yanweiyuan3
2023-08-09 588bc7829387dfc761cc25f06f77d4c81818bd10
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
Quintiq file version 2.0
#parent: #root
StaticMethod ValidateBottlenecktInput (
  output String feedback_o,
  output String sanitycheckfeedback_o,
  MacroPlan macroplan,
  Real bottlenecktolerance,
  Duration bottleneckwindowstart,
  Duration bottleneckwindowend,
  Real capacitybelowthreshold,
  Real capacityabovethreshold,
  Real stockingpointbottleneckthreshold,
  Boolean isweb
) declarative remote as Boolean
{
  Description: 'Called by designer'
  TextBody:
  [*
    /*****
     PLEASE ENSURE THAT DATA ISSUE IS CHECKED BEFORE DATA WARNING
    **/
    
    if( feedback_o ='' )
    {
      // Bottleneck tolerance
      if ( bottlenecktolerance < 0 )
      {
       feedback_o := Translations::MP_GlobalParameters_MP_ValidateInput_IsNegativeBottleneckTolerance( bottlenecktolerance );
       sanitycheckfeedback_o := SanityCheckCategoryLevel::GetSanityCheckCategoryDataWarning();
      }
      // Bottleneck window start and end
      else if( bottleneckwindowstart > bottleneckwindowend )
      {
       feedback_o := Translations::MP_GlobalParameters_MP_ValidateInput_IsStartAfterEndOfBottlneckWindow( bottleneckwindowend, bottleneckwindowstart );
       sanitycheckfeedback_o := SanityCheckCategoryLevel::GetSanityCheckCategoryDataWarning();
      }
      // Capacity above threshold
      else if( capacityabovethreshold < 0 )
      {
       feedback_o := Translations::MP_GlobalParameters_MP_ValidateInput_IsNegativeCapacityAboveThreshold( capacityabovethreshold );
       sanitycheckfeedback_o := SanityCheckCategoryLevel::GetSanityCheckCategoryDataWarning();
      }
      // Capacity below threshold
      else if( capacitybelowthreshold < 0 )
      {
       feedback_o := Translations::MP_GlobalParameters_MP_ValidateInput_IsNegativeCapacityBelowThreshold( capacitybelowthreshold );
       sanitycheckfeedback_o := SanityCheckCategoryLevel::GetSanityCheckCategoryDataWarning();
      }
      // Capacity above and below threshold
      else if( capacityabovethreshold < capacitybelowthreshold )
      {
       feedback_o := Translations::MP_GlobalParameters_MP_ValidateInput_IsCapacityAboveThresholdLessThanCapacityBelowThreshold( capacityabovethreshold, capacitybelowthreshold );
       sanitycheckfeedback_o := SanityCheckCategoryLevel::GetSanityCheckCategoryDataWarning();
      }
       // Bottleneck tolerance
      else if ( stockingpointbottleneckthreshold < 0 )
      {
       feedback_o := Translations::MP_GlobalParameters_MP_ValidateInput_IsNegativeBottleneckThreshold( stockingpointbottleneckthreshold );
       sanitycheckfeedback_o := SanityCheckCategoryLevel::GetSanityCheckCategoryDataWarning();
      }
      
    }
    
    // Add instance text
    if ( isweb and  feedback_o <> '' )
    {
     feedback_o := SanityCheckMessage::GetFormattedMessage( Translations::MP_Bottleneck_Detection_Parameters_Instance(), feedback_o );
    }
    
    return feedback_o = '';
  *]
}