void theMultishuttle_OnArrivedAtInfeedRackConvPosB(object sender, RackConveyorArrivalEventArgs e) { ShuttleTask st = new ShuttleTask(); DCICaseData caseData = e._caseLoad.Case_Data as DCICaseData; string destination = caseData.Destination; if (destination.LocationType() == LocationTypes.RackConvIn) { Case_Load atcLoad = e._caseLoad as Case_Load; caseData.Current = caseData.Destination; string sendTelegram = controller.CreateTelegramFromLoad(TelegramTypes.TUReport, atcLoad); controller.SendTelegram(sendTelegram); return; } if (destination.LocationType() == LocationTypes.DropStation) { //Need to create a RI to RO task to the shuttle int level; if (!int.TryParse(e._locationName.Substring(3, 2), out level)) { Log.Write(string.Format("Multishuttle Control {0} Error: Error arriving at infeed rack conveyor when trying to find level", ParentAssembly.Name)); return; //Error! } st.Destination = MHEController_Multishuttle.DCILocToMultiShuttleConvLoc(level, destination); st.Level = level; st.LoadID = e._caseLoad.Identification; st.Source = e._locationName; theMultishuttle.shuttlecars[level].ShuttleTasks.Add(st); } else if (destination.LocationType() != LocationTypes.BinLocation) { Log.Write("WARNING: Arrived at infeed rack and destination is NOT a binlocation.", Color.Red); return; } else { int level; st.Destination = controller.DCIbinLocToMultiShuttleLoc(destination, out level, theMultishuttle); st.Level = level; st.LoadID = e._caseLoad.Identification; st.Source = e._locationName; theMultishuttle.shuttlecars[level].ShuttleTasks.Add(st); } }
//private Func<ObservableCollection<ElevatorTask>, ElevatorTask, ElevatorTask> elevatorPriority; public MHEControl_MultiShuttle(MultiShuttleDCIInfo info, MultiShuttle multishuttle) { Info = info; // set this to save properties multiShuttleATCInfo = info; theMultishuttle = multishuttle; controller = ((MHEController_Multishuttle)theMultishuttle.Controller); multishuttle.AutoNewElevatorTask = false; // Let this controller decide when a new task is created call Elevator.GetNewElevatorTask to assign the next task if there is one //Shuttle theMultishuttle.OnArrivedAtShuttle += theMultishuttle_OnArrivedAtShuttle; //Bin Location theMultishuttle.OnArrivedAtRackLocation += theMultishuttle_OnArrivedAtRackLocation; //InfeedRack theMultishuttle.OnArrivedAtInfeedRackConvPosA += theMultishuttle_OnArrivedAtInfeedRackConvPosA; theMultishuttle.OnArrivedAtInfeedRackConvPosB += theMultishuttle_OnArrivedAtInfeedRackConvPosB; //OutfeedRack theMultishuttle.OnArrivedAtOutfeedRackConvPosA += theMultishuttle_OnArrivedAtOutfeedRackConvPosA; theMultishuttle.OnArrivedAtOutfeedRackConvPosB += theMultishuttle_OnArrivedAtOutfeedRackConvPosB; //Elevator Conv theMultishuttle.OnArrivedAtElevatorConvPosA += theMultishuttle_OnArrivedAtElevatorConvPosA; theMultishuttle.OnArrivedAtElevatorConvPosB += theMultishuttle_OnArrivedAtElevatorConvPosB; theMultishuttle.OnElevatorTasksStatusChanged += TheMultishuttle_OnElevatorTasksStatusChanged; //DropStation theMultishuttle.OnArrivedAtDropStationConvPosA += theMultishuttle_OnArrivedAtDropStationConvPosA; theMultishuttle.OnArrivedAtDropStationConvPosB += theMultishuttle_OnArrivedAtDropStationConvPosB; theMultishuttle.OnDropStationConvClear += TheMultishuttle_OnDropStationConvClear; //PickStation theMultishuttle.OnArrivedAtPickStationConvPosA += theMultishuttle_OnArrivedAtPickStationConvPosA; theMultishuttle.OnArrivedAtPickStationConvPosB += theMultishuttle_OnArrivedAtPickStationConvPosB; }