| | |
| | | // } |
| | | // debuginfo( "。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。" ); |
| | | //} |
| | | |
| | | sourceChangeover := uptb.ChangeoverDuration(); |
| | | targetChangeover := Duration::Zero(); |
| | | |
| | | debuginfo( "需要圆整的时间(单位:小时)", timeDifference, " 考虑ChangeOver条件圆整使其达到整班" ); |
| | | nextUnitPeriodTimeBase := ifexpr( isnull( uptb.Next().astype( UnitPeriodTimeBase ) ), select( uptbs, Elements, tempUPTB, tempUPTB.Start() = uptb.End() ), uptb.Next().astype( UnitPeriodTimeBase ) ); |
| | | while ( timeDifference > 0 and not isnull( nextUnitPeriodTimeBase ) ) { |
| | | debuginfo( "开始向时间为:", nextUnitPeriodTimeBase.StartDate().Format( "Y-M2-D2" ), "的产能周期借" ); |
| | | traverse ( nextUnitPeriodTimeBase, PeriodTaskOperation, pto, guard( pto.Operation().RoutingStep().Routing().Start(), uptb.StartDate() ) <= uptb.StartDate() and |
| | | guard( pto.Operation().RoutingStep().Routing().End(), uptb.End().Date() ) >= uptb.End().Date() and |
| | | exists( uptb, PeriodTaskOperation.Operation, tempO, tempO = pto.Operation() ) and |
| | | timeDifference > 0 ) { |
| | | minimumCapacityThatCanBeBorrowed := pto.Quantity() / pto.Operation().Throughput(); |
| | | unifiedProcessingTimeOfRounding := minvalue( timeDifference, minimumCapacityThatCanBeBorrowed ); |
| | | debuginfo( "剩余圆整的产能:", timeDifference, " nextUnitPeriodTimeBase的当前周期任务供应数量:", pto.Quantity(), " 能借的产能:", minimumCapacityThatCanBeBorrowed, " 统一借的产能:", unifiedProcessingTimeOfRounding, " 借之前changeover时间:", uptb.ChangeoverDuration() ); |
| | | this.UnifiedProcessingOfRoundingLogic( unifiedProcessingTimeOfRounding, uptb, pto, macroPlan ); |
| | | targetChangeover := uptb.ChangeoverDuration(); |
| | | timeDifference := timeDifference - unifiedProcessingTimeOfRounding; |
| | | } |
| | | |
| | | if ( isnull( nextUnitPeriodTimeBase.Next() ) ) { |
| | | nextUnitPeriodTimeBase := select( uptbs, Elements, tempUPTB, tempUPTB.Start() = nextUnitPeriodTimeBase.End() ); |
| | | } else { |
| | | nextUnitPeriodTimeBase := nextUnitPeriodTimeBase.Next().astype( UnitPeriodTimeBase ); |
| | | } |
| | | } |
| | | |
| | | debuginfo( "不考虑任何条件圆整使其到达整班" ); |
| | | debuginfo( "需要圆整的时间(单位:小时)", timeDifference, " 不考虑任何条件圆整使其到达整班" ); |
| | | nextUnitPeriodTimeBase := ifexpr( isnull( uptb.Next().astype( UnitPeriodTimeBase ) ), select( uptbs, Elements, tempUPTB, tempUPTB.Start() = uptb.End() ), uptb.Next().astype( UnitPeriodTimeBase ) ); |
| | | while ( timeDifference > 0 and not isnull( nextUnitPeriodTimeBase ) ) { |
| | | debuginfo( "开始向时间为:", nextUnitPeriodTimeBase.StartDate().Format( "Y-M2-D2" ), "的产能周期借" ); |
| | |
| | | timeDifference > 0 ) { |
| | | minimumCapacityThatCanBeBorrowed := pto.Quantity() / pto.Operation().Throughput(); |
| | | unifiedProcessingTimeOfRounding := minvalue( timeDifference, minimumCapacityThatCanBeBorrowed ); |
| | | debuginfo( "剩余圆整的产能:", timeDifference, " nextUnitPeriodTimeBase的当前周期任务供应数量:", pto.Quantity(), " 能借的产能:", minimumCapacityThatCanBeBorrowed, " 统一借的产能:", unifiedProcessingTimeOfRounding ); |
| | | debuginfo( "剩余圆整的产能:", timeDifference, " nextUnitPeriodTimeBase的当前周期任务供应数量:", pto.Quantity(), " 能借的产能:", minimumCapacityThatCanBeBorrowed, " 统一借的产能:", unifiedProcessingTimeOfRounding, " 当前changeover时间:", uptb.ChangeoverDuration().HoursAsReal() ); |
| | | this.UnifiedProcessingOfRoundingLogic( unifiedProcessingTimeOfRounding, uptb, pto, macroPlan ); |
| | | timeDifference := timeDifference - unifiedProcessingTimeOfRounding; |
| | | } |
| | |
| | | nextUnitPeriodTimeBase := nextUnitPeriodTimeBase.Next().astype( UnitPeriodTimeBase ); |
| | | } |
| | | } |
| | | |
| | | if ( ( targetChangeover - sourceChangeover ).HoursAsReal() > 0.0 ) { |
| | | this.ZeroCapacityReplenishment( macroPlan, ( targetChangeover - sourceChangeover ).HoursAsReal(), uptb, uptbs ); |
| | | } |
| | | *] |
| | | } |
| | |
| | | { |
| | | TextBody: |
| | | [* |
| | | traverse ( uptbs, Elements, uptb, true/*uptb.StartDate() <= Date::Construct( 2024, 4, 23 )*/ ) { |
| | | traverse ( uptbs, Elements, uptb, |
| | | true |
| | | // uptb.StartDate() <= Date::Construct( 2024, 5, 8 ) |
| | | ) { |
| | | if ( ( uptb.End().Date() - uptb.StartDate() ) > 1 ) { |
| | | // debuginfo( "开始时间:", uptb.StartDate().Format( "Y-M2-D2" ), " 结束时间:", uptb.End().Date().Format( "Y-M2-D2" ), " 时间区间:", ( uptb.End().Date() - uptb.StartDate() ) ); |
| | | // this.ProcessingTimeIntervalIsGreaterThanOneDay( macroPlan, uptb, uptbs ); |
| | |
| | | [* |
| | | traverse ( unit, Lane.LaneLeg.Trip, t ) { |
| | | traverse ( t, ProductInTrip, pit, pit.Quantity() > 0.0 ) { |
| | | info( pit.Product_MP().ParentID() ); |
| | | // 获取产品lotsize倍数 |
| | | lotsize := 1; |
| | | if ( pit.Product_MP().ParentID().Regex( "缸体" ) ) { |
| | | if ( pit.Product_MP().ParentID().Regex( "ZKG" ) ) { |
| | | lotsize := macroPlan.CylinderBlock(); |
| | | } else if ( pit.Product_MP().ParentID().Regex( "缸盖" ) ) { |
| | | } else if ( pit.Product_MP().ParentID().Regex( "ZKM" ) ) { |
| | | lotsize := macroPlan.CylinderHead(); |
| | | } else if ( pit.Product_MP().ParentID().Regex( "连杆" ) ) { |
| | | } else if ( pit.Product_MP().ParentID().Regex( "PL" ) ) { |
| | | lotsize := macroPlan.ConnectingRod(); |
| | | } else if ( pit.Product_MP().ParentID().Regex( "曲轴" ) ) { |
| | | } else if ( pit.Product_MP().ParentID().Regex( "KW" ) ) { |
| | | lotsize := macroPlan.Crankshaft(); |
| | | } else if ( pit.Product_MP().ParentID().Regex( "曲轴" ) ) { |
| | | } else if ( pit.Product_MP().ParentID().Regex( "AGW" ) ) { |
| | | lotsize := macroPlan.BalanceAxis(); |
| | | } |
| | | |
| | |
| | | Description: '处理时间区间等于1天' |
| | | TextBody: |
| | | [* |
| | | if ( uptb.UsedCapacity() = uptb.TotalAvailableCapacity() or ( uptb.UtilizationPercentage() * uptb.MaximumLoadPercentage() / 100 ) = 100 or uptb.FreeCapacity().HoursAsReal() = 0 ) { |
| | | if ( uptb.UsedCapacity() = uptb.TotalAvailableCapacity() or [Number]( uptb.UtilizationPercentage() * uptb.MaximumLoadPercentage() / 100 ) = 100 or uptb.FreeCapacity().HoursAsReal() = 0 ) { |
| | | debuginfo( "天已经是整班,无需处理(使用产能等于可用产能)" ); |
| | | } else if ( uptb.UsedCapacity().HoursAsReal() = 0 ) { |
| | | debuginfo( "天已经是整班,无需处理(使用产能等于0)" ); |
| | |
| | | } |
| | | debuginfo( ".........." ); |
| | | } |
| | | // whetherToFillInZero := false; |
| | | whetherToFillInZero := false; |
| | | if ( whetherToFillInZero ) { |
| | | debuginfo( "执行补零" ); |
| | | debuginfo( "开始执行补零------------" ); |
| | | this.ZeroCapacityReplenishment( macroPlan, uptb.UsedCapacity().HoursAsReal(), uptb, uptbs ); |
| | | } else { |
| | | debuginfo( "执行圆整" ); |
| | | debuginfo( "开始执行圆整------------" ); |
| | | this.CapacityRounding( macroPlan, uptb.TotalAvailableCapacity().HoursAsReal() - ( uptb.UsedCapacity() + uptb.ChangeoverDuration() ).HoursAsReal(), uptb, uptbs ); |
| | | } |
| | | } else { |