Quintiq file version 2.0
#parent: MatrixEditorTimeCapacities
Response OnUpdateValue (
  structured[UnitPeriodTime] cell,
  Real value
) id:Response_MatrixEditorTimeCapacities_OnUpdateValue
{
  #keys: '[136682.1.1060442683]'
  CanBindMultiple: false
  DefinitionID: 'Responsedef_WebMatrixEditor_OnUpdateValue'
  QuillAction
  {
    Body:
    [*
      //Update Efficiency
      data := shadow( cell.Element( 0 ).UnitAvailability() );
      if( isnull( data ) )
      {
        data := cell.Element( 0 ).Unit().UnitAvailability( relshadow );
      }
      UnitAvailability::CreateOrUpdateForUnitPeriodTimes( cell,
                                                          false,
                                                          data.TimeUnit(),
                                                          data.Maintenance(),
                                                          ifexpr( focusedattribute = attribute( UnitPeriodTime, Efficiency).Name(), true, false ),
                                                          ifexpr( focusedattribute = attribute( UnitPeriodTime, Efficiency ).Name(), value, data.Efficiency() ),
                                                          false,
                                                          data.Allocation(),
                                                          false,
                                                          data.ShiftPattern(),
                                                          focusedattribute = attribute( UnitPeriodTime, MaximumLoadPercentage ).Name(),
                                                          ifexpr( focusedattribute = attribute( UnitPeriodTime, MaximumLoadPercentage ).Name(), value, data.MaximumLoadPercentage() ),
                                                          false,
                                                          data.NrOfUnitsOpen(),
                                                          false,
                                                          focusedattribute = attribute( UnitPeriodTime, MinimumLoadThreshold ).Name(),
                                                          ifexpr( focusedattribute = attribute( UnitPeriodTime, MinimumLoadThreshold ).Name(), value, data.MinimumLoadThreshold() )
                                                        );
    *]
    GroupServerCalls: false
  }
}
