| | |
| | | localCells := construct( LocalCell_ScheduleSummarys ); |
| | | localCellIndexTree := NamedValueTree::Create(); |
| | | |
| | | units := selectset( owner,Unit,unit,unit.HasCapacityTypeTime() and not unit.HasChild()); |
| | | unitIndexTree := NamedValueTree::Create(); |
| | | for( i := 0 ; i< units.Size() ; i++ ){ |
| | | unit := units.Element( i ); |
| | | unitHandle := unitIndexTree.GetHandle( unit.ID() ); |
| | | unitIndexTree.Root().AddChild( unitHandle,i ); |
| | | } |
| | | |
| | | |
| | | //shiftPatternCount := NamedValueTree::Create(); |
| | | traverse( tables,Elements.MP_Row,row ){ |
| | | rowMacroPlan := row.MP_Table().MacroPlan(); |
| | |
| | | cell.MP_Column().CustomDate() >= localColumn.CustomDate() and |
| | | cell.MP_Column().CustomDate() < localColumn.CustomDate().StartOfNextMonth() ); |
| | | |
| | | output := 0.0; |
| | | isFuture := owner.StartOfPlanning().Date() >= localColumn.CustomDate(); |
| | | |
| | | scheduleSummaryOutputDataKey := row.Name() + localColumn.CustomDate().AsQUILL(); |
| | | scheduleSummaryOutputDataHandle := scheduleSummaryOutputDataIndexTree.GetHandle( scheduleSummaryOutputDataKey ); |
| | | scheduleSummaryOutputDataIndex := guard( scheduleSummaryOutputDataIndexTree.Root().Child( scheduleSummaryOutputDataHandle ),null( NamedValue )); |
| | | if( not isnull( scheduleSummaryOutputDataIndex )){ |
| | | scheduleSummaryOutputData := scheduleSummaryOutputDatas.Element( scheduleSummaryOutputDataIndex.GetValueAsNumber() ); |
| | | output := scheduleSummaryOutputData.Output(); |
| | | output := 0.0; |
| | | if( isFuture ){ |
| | | unitHandle := unitIndexTree.GetHandle( row.Name() ); |
| | | unitIndex := guard( unitIndexTree.Root().Child( unitHandle ),null( NamedValue )); |
| | | if( not isnull( unitIndex )){ |
| | | unit := units.Element( unitIndex.GetValueAsNumber() ); |
| | | output := sum( unit,UnitPeriod.PeriodTask_MP.NewSupply,np, |
| | | np.PeriodTask_MP().UnitPeriod().StartDate() >= localColumn.CustomDate() and |
| | | np.PeriodTask_MP().UnitPeriod().StartDate() < localColumn.CustomDate(), |
| | | np.Quantity() ); |
| | | } |
| | | }else{ |
| | | scheduleSummaryOutputDataKey := row.Name() + localColumn.CustomDate().AsQUILL(); |
| | | scheduleSummaryOutputDataHandle := scheduleSummaryOutputDataIndexTree.GetHandle( scheduleSummaryOutputDataKey ); |
| | | scheduleSummaryOutputDataIndex := guard( scheduleSummaryOutputDataIndexTree.Root().Child( scheduleSummaryOutputDataHandle ),null( NamedValue )); |
| | | if( not isnull( scheduleSummaryOutputDataIndex )){ |
| | | scheduleSummaryOutputData := scheduleSummaryOutputDatas.Element( scheduleSummaryOutputDataIndex.GetValueAsNumber() ); |
| | | output := scheduleSummaryOutputData.Output(); |
| | | } |
| | | } |
| | | |
| | | maxShiftPattern := ""; |
| | |
| | | } |
| | | } |
| | | |
| | | localCell.ShiftPattern( maxShiftPattern ); |
| | | if( not maxShiftPattern = "" ){ |
| | | localCell.ShiftPattern( maxShiftPattern ); |
| | | } |
| | | localCell.WorkingDay( localCell.WorkingDay() + workingDay ); |
| | | localCell.Capacity( localCell.Capacity() + capacity ); |
| | | localCell.Output( localCell.Output() + output ); |