// Daily 17 fails public bool NextStepTimeShiftBreak() { var breakTimeIndex = GetBreakTimeIndex(Controller.RealTime); if (breakTimeIndex >= 0 && Controller.IsReadyForBreak) { if (WarehouseReorganizer != null) { WarehouseReorganizationProgressUpdated?.Invoke(this, new ProgressEventArgs() { State = ProgressState.Start, CurrentValue = WarehouseReorganizer.MaxDepth }); } var breakPair = productionDayBreaks[breakTimeIndex]; var breakDuration = (breakPair.Item2 - (Controller.RealTime % secondsInProductionDay)) % secondsInProductionDay; var timeUsedInBreak = Controller.RealTime % secondsInProductionDay - breakPair.Item1; //var breakDuration = breakPair.Item2 - breakPair.Item1; Controller.StepLog.Add(new BaseStepModel() { Message = $"Break time (duration {breakDuration})" }); WarehouseReorganizer?.ReorganizeWarehouse(Controller.ProductionState, Controller.StepLog, breakDuration); Controller.RealTime += breakDuration + timeUsedInBreak; var timeShift = (breakDuration + timeUsedInBreak) % tactTime; if (Controller.RealTime > 0) { Controller.IncreaseTimebaseShift(timeShift); } Controller.BreakTime += breakDuration + timeUsedInBreak; if (WarehouseReorganizer != null) { WarehouseReorganizationProgressUpdated?.Invoke(this, new ProgressEventArgs() { State = ProgressState.End, CurrentValue = WarehouseReorganizer.MaxDepth }); } } else { Controller.NextStep(); } return(true); }
private void WarehouseReorganizer_ProgressTriggered(object sender, ProgressEventArgs e) { WarehouseReorganizationProgressUpdated?.Invoke(this, e); }