public void Work(DayTime dayTime) { if (!IsTimeToCommunicateWithPlants(dayTime)) { return; } _nextDump = NextDumpTime(dayTime); foreach (Workorder wo in NewToSend) { foreach (IPlant plant in Locations.Values) { int importantOp = 1; if (wo.CurrentOpIndex > importantOp) { importantOp = wo.CurrentOpIndex; } //TODO Maybe improve plant selection for ERP. Enterprise Scheduler?? if (plant.CanWorkOnType(wo.Operations[importantOp].Type)) { // Only adding to Plant. Will update back to ERP from // MES later. plant.Add(wo); break; } } } NewToSend.Clear(); }
public void CreateWorkorder(Workorder.PoType type, DayTime due, int initialOp = 0) { Workorder wo = new Workorder(GetNextWoId(), type, initialOp); AddWorkorder("none", wo); DueDates[wo.Id] = due; NewToSend.Add(wo); }