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
Quintiq file version 2.0
#parent: #root
Method ShowHideComponents () id:Method_DialogSelectOptimizer_ShowHideComponents
{
  #keys: '[124808.0.1212040581]'
  Body:
  [*
    // Show / hide components
    inbound := guard( not SelectionStrategy.Data().IsBounded(), false );
    invalidkpiweight := guard( not SelectionStrategy.Data().IsValidKPIWeight(), false );
    isvisible := inbound or invalidkpiweight;
    
    text :="";
    if ( inbound )
    {
      text := Translations::MP_Designer_InboundStrategy_Warning();
    }
    else if( invalidkpiweight )
    {
      invalidkpiweightname := guard( select( SelectionStrategy.Data(), InvalidKPIWeight, kpiweight, true ).KPIName(), "" )
      text := Translations::Strategy_CanCopy_IsKPIWeightOK( invalidkpiweightname );
    }
    
    ImageOptimizerUnbounded.SetProperty( "Tooltip",text)
    ImageOptimizerUnbounded.Visible( isvisible );
    
    coversplanninghorizon := MacroPlan.GlobalParameters_MP().GetHasSelectedFullPlanningHorizon( SelectionPeriodFrom.Data(), SelectionPeriodTo.Data() );
    
    if( coversplanninghorizon )
    {
      ButtonPlanWholeHorizon.SetProperty( "Image", "CHECK" );                      
      ButtonPlanWholeHorizon.SetProperty( "Tooltip", Translations::MP_Optimizer_AllPlanningHorizonSelected_Tooltip() );
    }
    else
    {
      ButtonPlanWholeHorizon.SetProperty( "Image", "LM_HOR_FIX_PLUS" );
      ButtonPlanWholeHorizon.SetProperty( "Tooltip", Translations::MP_Optimizer_SelectAllPlanningHorizon_Tooltip() );
    }
  *]
}