Quintiq file version 2.0
#parent: ToolbarMain/ValueHolderSanityCheckHighestSeverity
Response OnValueChanged () id:Response_ToolbarMain_ValueHolderSanityCheckHighestSeverity_OnValueChanged
{
  #keys: '[112884.1.706808273]'
  Body:
  [*
    // Update the summary status image
    
    image := 'SMILEY';
    tooltips := Translations::MP_SanityCheck_Passed();
    
    if( guard( [Number]this.Data(), -1 ) <> 0 )
    {
      //different color for different most severe violation level
      if( this.Data() = SanityCheckCategoryLevel::GetSanityCheckCategoryDataIssue() )
      {
        image := 'SAD-SMILEY';
      }
      else if( this.Data() = SanityCheckCategoryLevel::GetSanityCheckCategoryDataWarning() )
      {
        image := 'SAD-SMILEY-PURPLE';
      }
      else if( this.Data() = SanityCheckCategoryLevel::GetSanityCheckCategoryPlanningIssue() )
      {
        image := 'SAD-SMILEY-ORANGE';
      }
      else if( this.Data() = SanityCheckCategoryLevel::GetSanityCheckCategoryPlanningWarning() )
      {
        image := 'SAD-SMILEY-YELLOW';
      }
      else if( this.Data() = SanityCheckCategoryLevel::GetSanityCheckCategoryUnclassifiedError() )
      {
        image := 'SAD-SMILEY-CYAN';
      }
      tooltips := Translations::MP_SanityCheck_Failed( MacroPlan.MostSevereSanityCheckCategoryLevel() );
    }
    
    ButtonDoSanityCheck.SetProperty( 'Image', image );
    ButtonDoSanityCheck.SetProperty( 'Tooltip', tooltips );
    
    ApplicationLibMacroPlanner.UpdateOptimizerRunButton();
  *]
  CanBindMultiple: false
  DefinitionID: 'Responsedef_ValueHolder_OnValueChanged'
  Precondition:
  [*
    return MacroPlan::HasMacroPlan( MacroPlan, feedback );
  *]
}
