Exemplo n.º 1
0
 void theMultishuttle_OnArrivedAtInfeedRackConvPosA(object sender, RackConveyorArrivalEventArgs e)
 {
     if (e._elevator.ElevatorConveyor.Route.Loads.Count == 0)
     {
         e._elevator.SetNewElevatorTask();
     }
 }
Exemplo n.º 2
0
        void theMultishuttle_OnArrivedAtOutfeedRackConvPosB(object sender, RackConveyorArrivalEventArgs e)
        {
            DCICaseData caseData = e._caseLoad.Case_Data as DCICaseData;

            //If destination is a drop station ("D") there will be no new StartTransportTelegram so continue and create a elevator task
            if (BaseDCIController.GetLocFields(caseData.Destination, PSDSRackLocFields.ConvType) == "D")
            {
                if (e._elevator.CurrentTask == null || (e._elevator.CurrentTask != null && !e._elevator.CurrentTask.RelevantElevatorTask(e._caseLoad)))
                {
                    string level = BaseDCIController.GetPSDSLocFields(caseData.Destination, PSDSRackLocFields.Level);

                    // create an elevator task
                    string aisle = e._locationName.AisleNumber().ToString().PadLeft(2, '0');
                    char   side  = (char)ExtensionMethods.Side(e._locationName);

                    ElevatorTask et = new ElevatorTask(null, e._caseLoad.Identification)
                    {
                        SourceLoadB      = e._locationName,
                        DestinationLoadB = string.Format("{0}{1}{2}{3}A", aisle, side, level, (char)ConveyorTypes.Drop), // aasyyxz: a=aisle, s = side, yy = level, x = input or output, Z = loc A or B e.g. 01R05OA
                        DropIndexLoadB   = caseData.DropIndex,
                        LoadCycle        = Cycle.Single,
                        UnloadCycle      = Cycle.Single,
                        Flow             = TaskType.Outfeed
                    };

                    string elevatorName = string.Format("{0}{1}", side, aisle);
                    theMultishuttle.elevators.First(x => x.ElevatorName == elevatorName).ElevatorTasks.Add(et);
                }
            }
        }
Exemplo n.º 3
0
        void theMultishuttle_OnArrivedAtInfeedRackConvPosB(object sender, RackConveyorArrivalEventArgs e)
        {
            ShuttleTask st          = new ShuttleTask();
            string      destination = ((IATCCaseLoadType)e._caseLoad).Destination;

            if (destination.LocationType() == LocationTypes.RackConv)
            {
                //    IATCCaseLoadType atcLoad = e._caseLoad as IATCCaseLoadType;
                //    atcLoad.Location = atcLoad.Destination;
                //    string sendTelegram = mheController_Multishuttle.CreateTelegramFromLoad(TelegramTypes.MultishuttleTransportFinishedTelegram, atcLoad);
                //    mheController_Multishuttle.SendTelegram(sendTelegram, true);

                return;
            }

            if (destination.LocationType() == LocationTypes.DS)
            {
                //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 = mheController_Multishuttle.DCIbinLocToMultiShuttleLoc(destination, out level, theMultishuttle);
                //st.Level = level;
                //st.LoadID = e._caseLoad.Identification;
                //st.Source = e._locationName;

                //theMultishuttle.shuttlecars[level].ShuttleTasks.Add(st);


                //Task is set when load arrives at first position, it's possible that the shuttle is already waiting so need to be kicked again.
                int level;
                st.Destination = mheController_Multishuttle.DCIbinLocToMultiShuttleLoc(destination, out level, theMultishuttle);
                st.Level       = level;

                if (theMultishuttle.shuttlecars[level].waitingForLoadAtRI)
                {
                    theMultishuttle.shuttlecars[level].ShuttleOnArrived(null, null);
                }
            }
        }
Exemplo n.º 4
0
        void theMultishuttle_OnArrivedAtInfeedRackConvPosB(object sender, RackConveyorArrivalEventArgs e)
        {
            ShuttleTask sT = new ShuttleTask();

            sT.Barcode     = e._caseLoad.SSCCBarcode;
            sT.Source      = e._locationName;
            sT.Destination = GenerateBinLocation(e._locationName.Level().ToString());
            theMultishuttle.shuttlecars[sT.Source.Level()].ShuttleTasks.Add(sT);
        }
Exemplo n.º 5
0
        void theMultishuttle_OnArrivedAtOutfeedRackConvPosA(object sender, RackConveyorArrivalEventArgs e)
        {
            ((CaseData)e._caseLoad.Case_Data).CurrentPosition = string.Format("O{0}{1}{2}002{3}",
                                                                              e._locationName.AisleNumber().ToString().PadLeft(2, '0'),
                                                                              theMultishuttle.ElevatorGroup(e._locationName),
                                                                              (char)e._locationName.Side(),
                                                                              e._locationName.Level());

            string body = mheController_Multishuttle.CreateMissionDataSetBody((CaseData)e._caseLoad.Case_Data);

            mheController_Multishuttle.SendTelegram("02", body, 1);
        }
Exemplo n.º 6
0
        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);
            }
        }
Exemplo n.º 7
0
        private void DelayedShuttleTask(RackConveyorArrivalEventArgs e)
        {
            Core.Environment.Log.Write("task");

            ShuttleTask sT = new ShuttleTask();

            sT.Level = e._locationName.Level();
            //sT.LoadColor = Color.Peru;
            //sT.LoadHeight = 0.32f;
            //sT.LoadLength = 0.65f;
            //sT.LoadWidth = 0.32f;
            //sT.LoadWeight = 2.3f;
            sT.Destination = "01R06OB";
            sT.Source      = e._locationName;
            sT.Barcode     = FeedCase.GetSSCCBarcode();
            theMultishuttle.shuttlecars[sT.Level].ShuttleTasks.Add(sT);
        }
Exemplo n.º 8
0
        void theMultishuttle_OnArrivedAtOutfeedRackConvPosB(object sender, RackConveyorArrivalEventArgs e)
        {
            if (e._elevator.CurrentTask != null && e._elevator.CurrentTask.RelevantElevatorTask(e._caseLoad) && e._elevator.CurrentTask.LoadCycle == Cycle.Double)
            {
                //do nothing
            }
            else
            {
                ((CaseData)e._caseLoad.Case_Data).CurrentPosition = string.Format("O{0}{1}{2}001{3}",
                                                                                  e._locationName.AisleNumber().ToString().PadLeft(2, '0'),
                                                                                  theMultishuttle.ElevatorGroup(e._locationName),
                                                                                  (char)e._locationName.Side(),
                                                                                  e._locationName.Level());

                string body = mheController_Multishuttle.CreateMissionDataSetBody((CaseData)e._caseLoad.Case_Data);
                mheController_Multishuttle.SendTelegram("02", body, 1);
            }
        }
Exemplo n.º 9
0
        void theMultishuttle_OnArrivedAtInfeedRackConvPosA(object sender, RackConveyorArrivalEventArgs e)
        {
            ((CaseData)((Case_Load)e._caseLoad).Case_Data).CurrentPosition = string.Format("I{0}{1}{2}001{3}",
                                                                                           e._locationName.AisleNumber().ToString().PadLeft(2, '0'),
                                                                                           theMultishuttle.ElevatorGroup(e._locationName),
                                                                                           (char)e._locationName.Side(),
                                                                                           e._locationName.Level());
            string bodyB = string.Empty;

            bodyB = mheController_Multishuttle.CreateMissionDataSetBody((CaseData)e._caseLoad.Case_Data);

            //if(e._UnloadCycle != null && e._UnloadCycle == Cycle.Single)
            if (e._elevator.CurrentTask.UnloadCycle == Cycle.Single)
            {
                mheController_Multishuttle.SendTelegram("02", bodyB, 1);
                TryGetNewElevatorTask(e._elevator.CurrentTask, e._caseLoad);
            }
        }
Exemplo n.º 10
0
        void theMultishuttle_OnArrivedAtInfeedRackConvPosA(object sender, RackConveyorArrivalEventArgs e)
        {
            ShuttleTask st          = new ShuttleTask();
            string      destination = ((IATCCaseLoadType)e._caseLoad).Destination;

            if (destination.LocationType() == LocationTypes.RackConv)
            {
                IATCCaseLoadType atcLoad = e._caseLoad as IATCCaseLoadType;
                atcLoad.Location = atcLoad.Destination;
                string sendTelegram = mheController_Multishuttle.CreateTelegramFromLoad(TelegramTypes.MultishuttleTransportFinishedTelegram, atcLoad);
                mheController_Multishuttle.SendTelegram(sendTelegram, true);

                //return;
            }

            if (e._elevator.ElevatorConveyor.Route.Loads.Count == 0)
            {
                e._elevator.SetNewElevatorTask();
            }
        }
Exemplo n.º 11
0
        void theMultishuttle_OnArrivedAtInfeedRackConvPosB(object sender, RackConveyorArrivalEventArgs e)
        {
            if (e._rackConveyor.TransportSection.Route.Loads.Count == 1)
            {
                ((CaseData)((Case_Load)e._caseLoad).Case_Data).CurrentPosition = string.Format("I{0}{1}{2}002{3}",
                                                                                               e._locationName.AisleNumber().ToString().PadLeft(2, '0'),
                                                                                               theMultishuttle.ElevatorGroup(e._locationName),
                                                                                               (char)e._locationName.Side(),
                                                                                               e._locationName.Level());

                string body = mheController_Multishuttle.CreateMissionDataSetBody((CaseData)(((Case_Load)e._caseLoad).Case_Data));
                mheController_Multishuttle.SendTelegram("02", body, 1);
            }
            string bodyB = string.Empty;

            if (e._rackConveyor.TransportSection.Route.Loads.Count == 2)
            {
                ((CaseData)((Case_Load)e._caseLoad).Case_Data).CurrentPosition = string.Format("I{0}{1}{2}002{3}",
                                                                                               e._locationName.AisleNumber().ToString().PadLeft(2, '0'),
                                                                                               theMultishuttle.ElevatorGroup(e._locationName),
                                                                                               (char)e._locationName.Side(),
                                                                                               e._locationName.Level());

                bodyB = mheController_Multishuttle.CreateMissionDataSetBody((CaseData)e._caseLoad.Case_Data);



                var loadA = e._rackConveyor.TransportSection.Route.Loads.ToList().Find(x => ((Case_Load)x).SSCCBarcode != e._caseLoad.SSCCBarcode);

                ((CaseData)((Case_Load)loadA).Case_Data).CurrentPosition = string.Format("I{0}{1}{2}001{3}",
                                                                                         e._locationName.AisleNumber().ToString().PadLeft(2, '0'),
                                                                                         elevatorGroup,
                                                                                         (char)e._locationName.Side(),
                                                                                         e._locationName.Level());

                string bodyA = mheController_Multishuttle.CreateMissionDataSetBody(((CaseData)((Case_Load)loadA).Case_Data));
                mheController_Multishuttle.SendTelegram("02", bodyA + "," + bodyB, 2);
                TryGetNewElevatorTask(e._elevator.CurrentTask, e._caseLoad, (Case_Load)loadA);
            }
        }
Exemplo n.º 12
0
        void theMultishuttle_OnArrivedAtOutfeedRackConvPosA(object sender, RackConveyorArrivalEventArgs e)
        {
            DCICaseData caseData = e._caseLoad.Case_Data as DCICaseData;

            caseData.Current = FormatRackConvLocation(e._locationName, ConveyorTypes.OutfeedRack); //Update the location

            if (BaseDCIController.GetLocFields(caseData.Destination, PSDSRackLocFields.ConvType) == "D")
            {
                string sendMessage = controller.CreateTelegramFromLoad(TelegramTypes.TUNotification, e._caseLoad);
                controller.SendTelegram(sendMessage); //Always Send a notification at location A

                //Combine a task with an existing task but only if the final destination is a drop station because if destination is the rack conveyor then we need to wait for another message from the WMS
                if (e._elevator.CurrentTask != null && e._rackConveyor.LocationB.Active && !e._elevator.CurrentTask.RelevantElevatorTask(e._rackConveyor.LocationB.ActiveLoad))
                {
                    string aisle     = e._elevator.AisleNumber.ToString().PadLeft(2, '0');
                    string level     = BaseDCIController.GetLocFields(caseData.Destination, PSDSRackLocFields.Level);
                    string destLoadA = string.Format("{0}{1}{2}{3}A", aisle, (char)ExtensionMethods.Side(e._locationName), level, (char)ConveyorTypes.Drop);

                    //Create the task but do not add it to elevator tasks list
                    ElevatorTask et = new ElevatorTask(e._caseLoad.Identification, null)
                    {
                        SourceLoadA          = e._locationName,
                        DestinationLoadA     = destLoadA,
                        SourceLoadAConv      = theMultishuttle.GetConveyorFromLocName(e._locationName),
                        DestinationLoadAConv = theMultishuttle.GetConveyorFromLocName(destLoadA),
                        Elevator             = e._elevator
                    };

                    //This task should just be added and not combined as the combining is now done later
                    //TODO: Make it so that direct outfeed loads still work
                    et.CreateNewDoubleLoadCycleTask(et, e._rackConveyor.LocationB.ActiveLoad.Identification);
                }
            }
            else
            {
                string sendMessage = controller.CreateTelegramFromLoad(TelegramTypes.TUReport, e._caseLoad);
                controller.SendTelegram(sendMessage); //Always Send a notification at location A
            }
        }
Exemplo n.º 13
0
 void theMultishuttle_OnArrivedAtRackLocation(object sender, RackConveyorArrivalEventArgs e)
 {
     //   Timer timer = new Timer(obj => { DelayedShuttleTask(e); }, null, 10000, Timeout.Infinite);
 }