chenqinghong
2024-05-07 3ec06a830367465068963156dcc1d8e522571c13
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
Quintiq file version 2.0
#parent: GanttChartCapacityPlanning
Response OnDrawNode (
  StockingPointInPeriod element
) id:Response_GanttChartCapacityPlanning_OnDrawNode_653
{
  #keys: '[139394.1.1196618415]'
  CanBindMultiple: false
  DefinitionID: 'Responsedef_WebGanttChart_OnDrawNode'
  QuillAction
  {
    Body:
    [*
      // Determine colors for gantt chart spip nodes
      textcolour := ColorScheme.CapacityGanttChart_TextGood();
      
      if( element.HasConstraintViolations() )
      {
        // Override the constraint red, to show a less fierce/strong color (blend in with other colors in GC)
        drawinfo.AddCompartment( ColorScheme.CapacityGanttChart_Error(), element.Duration() );
        textcolour := ColorScheme.CapacityGanttChart_WarningText();
      }
      else
      {
        duration := minvalue( element.Duration() * element.UtilizationPercentage() / 100, element.Duration() );
        color := ColorScheme.CapacityGanttChart_Good();
        
        if( element.UtilizationPercentage() > element.MaxCapacity() )
        {
          color := ColorScheme.CapacityGanttChart_WarningHigh();
          textcolour := ColorScheme.CapacityGanttChart_WarningText();
          
        }
        else if( element.UtilizationPercentage() > element.MacroPlan().GlobalParameters_MP().StockingPointBottleneckThreshold() and
                 element.Period_MP().IsWithinBottleneckWindow() )
        {
          color := ColorScheme.CapacityGanttChart_WarningMid();
          textcolour := ColorScheme.CapacityGanttChart_WarningText();
        }
        
        drawinfo.AddCompartment( color, duration );
        drawinfo.AddCompartment( ColorScheme.CapacityGanttChart_Free(), element.Duration() );
      }
      
      drawinfo.TextColor( textcolour );
    *]
    GroupServerCalls: false
  }
}