rislai
2024-06-17 3f1616593f199f969223abbd64e3f8cf9a85cc3b
_Main/BL/Type_Routing/StaticMethod_ThermalTrialRatio.qbl
@@ -2,6 +2,7 @@
#parent: #root
StaticMethod ThermalTrialRatio (
  Routing routing,
  Unit unit,
  Number capacity,
  Date start,
  Date end,
@@ -12,16 +13,15 @@
  TextBody:
  [*
    // Adhi Feb-10-2016 (created)
    thermaltrial := '热式';
    thermaltrial := Unit::GetThermalTrial();
    newroutings := construct( Routings );
    unit := selectobject( routing.MacroPlan(), Unit, unit, unit.ID() = thermaltrial and unit.HasCapacityTypeQuantity() );
    
    for( starttime := start; starttime <= end; starttime := starttime + 1 ){
      uc := selectobject( unit, UnitCapacity, uc, uc.Start().Date() = starttime );
      if( isnull( uc ) ){
        uc := UnitCapacity::Create( unit, starttime.DateTime(), 'Day', 0.0, [Real]capacity, 100.0, 1, false );
      }
      uc.MaxCapacity( [Real]capacity );
      uc.MaxCapacity( [Real]capacity * ratio );
    }
    
    newrouting := routing.Copy();