Quintiq file version 2.0 
 | 
#parent: #root 
 | 
Method GetHasValidThroughputRange ( 
 | 
  output Strings feedback_o, 
 | 
  output Strings sanitycheckfeedback_o 
 | 
) declarative remote as Boolean 
 | 
{ 
 | 
  Description: 'Checks if the difference factor of the operation throughput in this unit is within specified limits.' 
 | 
  TextBody: 
 | 
  [* 
 | 
    // MKO2 Apr-6-2016 (created) 
 | 
     
 | 
    isvalid := true; 
 | 
    factorlimit := this.MacroPlan().GlobalParameters_MP().DifferenceFactor1e3(); 
 | 
    maxthroughput := this.MaxThroughput(); 
 | 
    minthroughput := this.MinThroughput(); 
 | 
     
 | 
    if( minthroughput.IsFinite() and maxthroughput.IsFinite() ) 
 | 
    { 
 | 
      differencefactor := guard( maxthroughput / minthroughput, maxthroughput ); 
 | 
      isvalid := differencefactor < factorlimit; 
 | 
    } 
 | 
     
 | 
    if( not isnull( feedback_o ) and not isvalid ) 
 | 
    { 
 | 
      formatfactorlimit := factorlimit.Format( "N(Dec(0), Thousands)" ); 
 | 
      formatmaxthroughput := maxthroughput.Format( "N(Dec(0), Thousands)" ); 
 | 
      formatminthroughput := minthroughput.Format( "N(Dec(0), Thousands)" ); 
 | 
      unitname := MacroPlan::GetSubstituteName( this.Name() ); 
 | 
      feedback_o.Add( SanityCheckMessage::GetFormattedMessage( Translations::MP_Unit_Instance( unitname ), 
 | 
                                                               Translations::MP_Unit_ValidateInput_HasExtremeThroughputRange( formatmaxthroughput, formatminthroughput, formatfactorlimit  ) ) ); 
 | 
      sanitycheckfeedback_o.Add( SanityCheckCategoryLevel::GetSanityCheckCategoryDataWarning() ); 
 | 
    } 
 | 
     
 | 
    return isvalid; 
 | 
  *] 
 | 
} 
 |