Пример #1
0
        public TrackRail(TrackRailInfo info) : base(Color.Gray, info.parentMultiShuttle.Raillength, 0.05f)
        {
            trackRailInfo        = info;
            parentMultishuttle   = info.parentMultiShuttle;
            ListSolutionExplorer = true;
            level = info.level;
            Name  = "S" + level.ToString().PadLeft(2, '0');

            //TrackVehicleInfo trackVehicleInfo = new TrackVehicleInfo() { trackRail = this, moveToDistance = parentMultishuttle.InfeedRackShuttleLocation };
            //trackVehicle = new TrackVehicle(trackVehicleInfo);
            //Load.Items.Add(trackVehicle);

            route.Motor.Speed = info.shuttlecarSpeed;
            route.Motor.Stop();

            // info.controlAssembly.Add((Core.Parts.RigidPart)this);
            Visible = true;

            if (!ParentMultishuttle.ShowBoxGraphic)
            {
                Visible = true;
            }

            Core.Environment.Scene.OnLoaded += Scene_OnLoaded;
        }
Пример #2
0
        public DropStationPoint(Types type, MultiShuttle parent, Elevator elevator) : base(type, parent)
        {
            Multishuttle = parent;
            Elevator     = elevator;

            Core.Communication.Internal.AddListener(this, new Core.Communication.Internal.RecieveMessage(listen));
        }
Пример #3
0
        private float GetXDistance(int xCoord, MultiShuttle multishuttle)
        {
            if (xCoord < 1)
            {
                Log.Write("Error: X coordinate less then 1: " + xCoord, Color.Red);
                Core.Environment.Scene.Pause();
                xCoord = 1;
            }

            //if (multishuttle.MultiShuttleDriveThrough)
            //{
            //    //assuming equal number on both sides!
            //    int midpoint = multishuttle.RackBays / 2;
            //    if (xCoord <= midpoint)
            //        return (xCoord - 0.5f) * multishuttle.BayLength;

            //    return (xCoord - 0.5f) * multishuttle.BayLength + multishuttle.RackConveyorLength * 2 + multishuttle.ElevatorConveyorLength;
            //}

            if (multishuttle.FrontLeftElevator || multishuttle.FrontRightElevator)
            {
                return((xCoord - 0.5f) * multishuttle.LocationLength + multishuttle.RackConveyorLength);
            }

            return((xCoord - 0.5f) * multishuttle.LocationLength);
        }
Пример #4
0
        public Shuttle(ShuttleInfo info) : base(info)
        {
            shuttleInfo = info;
            //trackRail = new TrackRail(info.multiShuttleinfo, info.level, info.parent)
            trackRail = new TrackRail(new TrackRailInfo()
            {
                level = info.level, parentMultiShuttle = info.parentMultishuttle, shuttlecarSpeed = info.parentMultishuttle.ShuttleCarSpeed
            })
            {
                Name        = "S" + info.level.ToString().PadLeft(2, '0'),
                ThisShuttle = this
            };

            ParentMultiShuttle = info.parentMultishuttle;
            Add((Core.Parts.RigidPart)trackRail);

            shuttleConveyor = new StraightTransportSection(Core.Environment.Scene.DefaultColor, 0.1f, 0.1f)
            {
                Height = 0.05f
            };
            Add(shuttleConveyor, new Vector3(trackRail.Length / 2, 0, 0));
            //shuttleConveyor.LocalYaw = (float)Math.PI / 2;

            shuttleAP          = shuttleConveyor.Route.InsertActionPoint(shuttleConveyor.Length / 2);
            shuttleAP.OnEnter += shuttleAP_OnEnter;
            shuttleAP2         = shuttleConveyor.Route.InsertActionPoint(shuttleConveyor.Length / 2);
            shuttleAP_Zpos     = (info.multiShuttleinfo.RackConveyorWidth / 2) + (info.multiShuttleinfo.carwidth / 2);
            trackRail.Car.OnPositionChanged += Car_OnPositionChanged;
            ShuttleTasks.CollectionChanged  += ShuttleTasks_CollectionChanged;

            ShuttleTasks.Clear();
            shuttleConveyor.Route.Motor.Stop();
        }
Пример #5
0
        private void SingleLoadAtPS(string telegramFields, Case_Load caseLoad)
        {
            // Rack Location for an ElevatorTask takes the form:  aasyyxz: aa=aisle, s = side, yy = level, x = conv type see enum ConveyorTypes , Z = loc A or B e.g. 01R05OA e.g. 01R05OA
            // Source location for a shuttleTask takes the form: sxxxyydd: Side, xxx location, yy = level, dd = depth
            // Elevator Format saa s = Side ( L or R), aa = aisle

            string currentLoc  = telegramFields.GetFieldValue(this, TelegramFields.Current);
            string destLoc     = telegramFields.GetFieldValue(this, TelegramFields.Destination);
            string aisle       = GetPSDSLocFields(currentLoc, PSDSRackLocFields.Aisle);
            string side        = GetPSDSLocFields(currentLoc, PSDSRackLocFields.Side);
            string dest        = null;
            string sourceLoadB = string.Format("{0}{1}{2}{3}B", aisle,    //Single load will always be at B
                                               side,
                                               GetPSDSLocFields(currentLoc, PSDSRackLocFields.Level),
                                               GetPSDSLocFields(currentLoc, PSDSRackLocFields.ConvType));

            MultiShuttle ms = GetMultishuttleFromAisleNum(sourceLoadB);

            if (telegramFields.GetFieldValue(this, TelegramFields.Destination).LocationType() == LocationTypes.DropStation)
            {
                //First check if the destination is to a drop station... check if the drop station is on this elevator
                if (GetPSDSLocFields(destLoc, PSDSRackLocFields.Side) != side)
                {
                    //If not choose a destination to level 1 and remember the load route
                    dest = string.Format("{0}{1}{2}{3}A", aisle, side, FindLevelForReject(ms), "I");
                }
                else
                {
                    dest = string.Format("{0}{1}{2}{3}A",
                                         aisle,
                                         side,
                                         GetPSDSLocFields(destLoc, PSDSRackLocFields.Level),
                                         GetPSDSLocFields(destLoc, PSDSRackLocFields.ConvType));
                }
            }
            else if (telegramFields.GetFieldValue(this, TelegramFields.Destination).LocationType() == LocationTypes.RackConvIn)
            {
                dest = string.Format("{0}{1}{2}{3}B", aisle,
                                     side,
                                     GetLocFields(destLoc, PSDSRackLocFields.Level),
                                     GetLocFields(destLoc, PSDSRackLocFields.ConvType));
            }
            else
            {
                dest = GetRackDestinationFromDCIBinLocation(string.Join(",", telegramFields), 0);
            }


            ElevatorTask et = new ElevatorTask(null, caseLoad.Identification)
            {
                SourceLoadB      = sourceLoadB,
                DestinationLoadB = dest,
                LoadCycle        = Cycle.Single,
                UnloadCycle      = Cycle.Single,
                Flow             = TaskType.Infeed
            };

            ms.elevators.First(x => x.ElevatorName == side + aisle).ElevatorTasks.Add(et);
            //ms.elevators[side+aisle].ElevatorTasks.Add(et);
        }
Пример #6
0
        public Elevator(MultiShuttleElevatorInfo info) : base(info)
        {
            multishuttleElevatorInfo = info;
            Embedded           = true;
            ParentMultiShuttle = info.Multishuttle;
            Side        = info.Side;
            AisleNumber = ParentMultiShuttle.AisleNumber;

            ElevatorConveyor = new ElevatorConveyor(new ElevatorConveyorInfo
            {
                length    = info.multishuttleinfo.ElevatorConveyorLength,
                width     = info.multishuttleinfo.ElevatorConveyorWidth,
                thickness = 0.05f,
                color     = Core.Environment.Scene.DefaultColor,
                Elevator  = this
            }
                                                    );

            AddAssembly(ElevatorConveyor);
            ElevatorConveyor.Route.Motor.Speed = info.multishuttleinfo.ConveyorSpeed;
            ElevatorConveyor.LocalYaw          = -(float)Math.PI;

            lift = new TrackRail(info.multishuttleinfo, 1, info.Multishuttle, this);// UserData = this };
            lift.Car.OnPositionChanged += Car_PositionChanged;
            AddPart(lift);
            lift.LocalRoll         = -(float)Math.PI / 2;
            lift.Route.Motor.Speed = multishuttleElevatorInfo.multishuttleinfo.elevatorSpeed;
            lift.Car.Visible       = false;
            ElevatorTasks.Clear();
            ElevatorTasks.CollectionChanged += ElevatorTasks_CollectionChanged;
        }
Пример #7
0
        /// <summary>
        /// Takes a dci bin location in the form MS011005080152 and converts it to a shuttletask location (sxxxyydd: Side, xxx location, yy = level, dd = depth)
        ///
        /// </summary>
        public string DCIbinLocToMultiShuttleLoc(string dciLoc, out int _level, MultiShuttle ms)
        {
            string side = GetBinLocField(dciLoc, BinLocFields.Side);

            if (side == "1")
            {
                side = "L";
            }
            else if (side == "2")
            {
                side = "R";
            }

            string yLoc = GetBinLocField(dciLoc, BinLocFields.YLoc);

            int.TryParse(yLoc, out _level); //assign out parameter

            string xLoc = ((MHEControl_MultiShuttle)ms.ControllerProperties).XLocConverter(GetBinLocField(dciLoc, BinLocFields.XLoc), GetBinLocField(dciLoc, BinLocFields.RasterPos));

            // takes the form  sxxxyydd: Side, xxx location, yy = level, dd = depth
            return(string.Format("{0}{1}{2}{3}", side,
                                 xLoc,                  //Need control object here to get properties of raster position and type
                                 yLoc,
                                 GetBinLocField(dciLoc, BinLocFields.Depth)));
        }
Пример #8
0
        /// <summary>
        /// Shuffle Move
        /// </summary>
        /// <param name="telegram"></param>
        private void CreateShuttleTask(string telegram) //TODO should this go into the control object?
        {
            int    level;
            string destination = string.Empty;
            string current     = telegram.GetFieldValue(this, TelegramFields.Current); //GetFieldValue by string not enum (faster)

            MultiShuttle ms = GetMultishuttleFromAisleNum(GetBinLocField(current, BinLocFields.Aisle));
            ShuttleTask  st = new ShuttleTask();

            st.Source = DCIbinLocToMultiShuttleLoc(current, out level, ms);
            string tlgDest = telegram.GetFieldValue(this, TelegramFields.Destination);

            if (tlgDest.LocationType() == LocationTypes.BinLocation)//A shuffle move
            {
                destination = DCIbinLocToMultiShuttleLoc(tlgDest, out level, ms);
            }
            else if (tlgDest.LocationType() == LocationTypes.DropStation)//A move to a drop station
            {
                // takes the form aasyyxz: aa=aisle, s = side, yy = level, x = conv type see enum ConveyorTypes , Z = loc A or B e.g. 01R05OA
                destination = string.Format("{0}{1}{2}OA", GetPSDSLocFields(tlgDest, PSDSRackLocFields.Aisle),
                                            GetPSDSLocFields(tlgDest, PSDSRackLocFields.Side),
                                            level.ToString().PadLeft(2, '0'));
            }
            else if (tlgDest.LocationType() == LocationTypes.RackConvOut)
            {
                destination = DCIrackLocToMultiShuttleRackLoc(level, tlgDest);//Create the rack location destination for the shuttle task
            }

            st.Destination = destination;
            st.Level       = level;
            st.LoadID      = telegram.GetFieldValue(this, TelegramFields.TUIdent);
            st.caseData    = CreateDCICaseData(telegram);
            ms.shuttlecars[level].ShuttleTasks.Add(st);
        }
Пример #9
0
        public TrackCar(MultiShuttleInfo shuttleinfo, int level, MultiShuttle parent) : base(Color.Gray, shuttleinfo.raillength, 0.05f)
        {
            multishuttle         = parent;
            ListSolutionExplorer = true;
            this.level           = level;
            this.shuttleinfo     = shuttleinfo;//TODO shuttleinfo is of type multishuttleinfo -- this is confusing

            LoadInfo shuttlecarinfo = new LoadInfo();

            shuttlecarinfo.length = carlength;
            shuttlecarinfo.height = carheight;
            shuttlecarinfo.width  = carwidth;
            shuttlecarinfo.color  = Color.Yellow;
            shuttlecar            = new ShuttleCar(shuttlecarinfo);

            Load.Items.Add(shuttlecar);
            route.Add(shuttlecar);

            shuttlecar.Deletable     = false;
            shuttlecar.UserDeletable = false;
            shuttlecar.Embedded      = true;
            route.Motor.Speed        = shuttleinfo.shuttlecarSpeed;
            shuttlecar.Stop();
            route.Motor.Stop();

            Destination = route.InsertActionPoint(0);
            // Destination.Visible          = true;
            Destination.OnEnter += destination_Enter;

            shuttlecar.OnPositionChanged += Car_PositionChanged;

            //timer             = new Core.Timer(shuttleinfo.ShuttlePositioningTime);
            //nextJobDelayTimer = new Core.Timer(0.1f);
        }
Пример #10
0
        public Elevator(ElevatorInfo info) : base(info)
        {
            multishuttleElevatorInfo = info;
            Embedded           = true;
            ParentMultiShuttle = info.Multishuttle;
            Side        = info.Side;
            AisleNumber = ParentMultiShuttle.AisleNumber;
            GroupName   = info.groupName;

            ElevatorConveyor = new ElevatorConveyor(new ElevatorConveyorInfo
            {
                length    = info.multishuttleinfo.ElevatorConveyorLength,
                width     = info.multishuttleinfo.ElevatorConveyorWidth,
                thickness = 0.05f,
                color     = Core.Environment.Scene.DefaultColor,
                Elevator  = this
            }
                                                    );

            Add(ElevatorConveyor);
            ElevatorConveyor.Visible           = false;
            ElevatorConveyor.Route.Motor.Speed = info.multishuttleinfo.ConveyorSpeed;
            ElevatorConveyor.LocalYaw          = -(float)Math.PI;

            Lift = new TrackRail(new TrackRailInfo()
            {
                parentMultiShuttle = ParentMultiShuttle, level = 0, shuttlecarSpeed = ParentMultiShuttle.ShuttleCarSpeed, controlAssembly = this
            });
            Vehicle = new TrackVehicle(new TrackVehicleInfo()
            {
                trackRail = Lift, moveToDistance = 0, controlAssembly = this
            });

            Vehicle.Length = info.multishuttleinfo.ElevatorConveyorLength;
            Vehicle.Width  = info.multishuttleinfo.ElevatorConveyorWidth;
            Vehicle.Color  = Color.Silver;

            Vehicle.OnVehicleArrived  += ElevatorOnArrived;
            Vehicle.OnPositionChanged += Car_PositionChanged;
            Add((Core.Parts.RigidPart)Lift, new Vector3(-0.025f, 0, 0));
            Lift.LocalRoll         = -(float)Math.PI / 2;
            Lift.Route.Motor.Speed = multishuttleElevatorInfo.multishuttleinfo.elevatorSpeed;
            Lift.Route.Motor.Stop();
            Vehicle.Roll    = (float)Math.PI / 2;
            Vehicle.Movable = false;
            ElevatorTasks.Clear();
            ElevatorTasks.CollectionChanged += ElevatorTasks_CollectionChanged;

            taskMonitor            = new Timer(5);
            taskMonitor.AutoReset  = true;
            taskMonitor.OnElapsed += TaskMonitor_OnElapsed;
            taskMonitor.Start();
            Core.Environment.Scene.OnResetCompleted += Scene_OnResetCompleted;
        }
Пример #11
0
        private string FindLevelForReject(MultiShuttle ms)
        {
            string destLevel = "01";

            foreach (RackConveyor rackConveyor in ms.RackConveyors.Reverse <RackConveyor>())
            {
                if (rackConveyor.RackConveyorType == MultiShuttleDirections.Infeed)
                {
                    if (rackConveyor.TransportSection.Route.Loads.Count < 2)
                    {
                        destLevel = rackConveyor.Level.ToString("00");
                    }
                }
            }
            return(destLevel);
        }
Пример #12
0
        public TrackRail(MultiShuttleInfo trackInfo, int level, MultiShuttle parent, Elevator elevator = null) : base(Color.Gray, trackInfo.raillength, 0.05f)
        {
            multishuttle         = parent;
            ListSolutionExplorer = true;
            this.level           = level;
            this.shuttleinfo     = trackInfo;//TODO shuttleinfo is of type multishuttleinfo -- this is confusing
            ThisElevator         = elevator;

            LoadInfo shuttlecarinfo = new LoadInfo()
            {
                length = carlength,
                height = carheight,
                width  = carwidth,
                color  = Color.Yellow
            };

            shuttlecar               = new TrackVehicle(shuttlecarinfo);
            shuttlecar.Deletable     = false;
            shuttlecar.UserDeletable = false;
            shuttlecar.Embedded      = true;

            //if (elevator == null)
            //{
            //    shuttlecar.OnPositionChanged += Car_PositionChanged;
            //}

            Load.Items.Add(shuttlecar);

            if (ThisElevator != null)
            {
                route.Add(shuttlecar);
                Destination = route.InsertActionPoint(0);
            }
            else
            {
                route.Add(shuttlecar, multishuttle.workarround);
                Destination = route.InsertActionPoint(multishuttle.workarround);
            }

            Destination.Visible  = true;
            Destination.OnEnter += destination_Enter;
            route.Motor.Speed    = trackInfo.shuttlecarSpeed;
            shuttlecar.Stop();
            route.Motor.Stop();

            Visible = false;
        }
Пример #13
0
        public Shuttle(ShuttleInfo info) : base(info)
        {
            shuttleInfo = info;
            trackRail   = new TrackRail(info.multiShuttleinfo, info.level, info.parent)
            {
                Name        = "S" + info.level.ToString().PadLeft(2, '0'),
                ThisShuttle = this
            };

            ParentMultiShuttle = info.parent;
            AddPart(trackRail);

            shuttleConveyor = new StraightTransportSection(Core.Environment.Scene.DefaultColor, ParentMultiShuttle.DepthDistPos2 * 2, 0.5f)
            {
                Height = 0.05f
            };
            Add(shuttleConveyor, new Vector3(trackRail.Length / 2, 0, 0));
            shuttleConveyor.LocalYaw = (float)Math.PI / 2;

            transferIn          = shuttleConveyor.Route.InsertActionPoint(ParentMultiShuttle.DepthDistPos2 - ((info.multiShuttleinfo.RackConveyorWidth / 2) + (info.multiShuttleinfo.carwidth / 2)));
            transferIn.OnEnter += transferIn_OnEnter;

            transferOut          = shuttleConveyor.Route.InsertActionPoint(ParentMultiShuttle.DepthDistPos2 + ((info.multiShuttleinfo.RackConveyorWidth / 2) + (info.multiShuttleinfo.carwidth / 2)));
            transferOut.OnEnter += transferOut_OnEnter;

            shuttleAP          = shuttleConveyor.Route.InsertActionPoint(shuttleConveyor.Length / 2);
            shuttleAP.OnEnter += shuttleAP_OnEnter;

            enterPointDepth1          = shuttleConveyor.Route.InsertActionPoint(ParentMultiShuttle.DepthDistPos2 - ParentMultiShuttle.DepthDistPos1);
            enterPointDepth1.OnEnter += enterPointDepth1_OnEnter;

            enterPointDepth2 = shuttleConveyor.Route.InsertActionPoint(0);

            exitPointDepth1          = shuttleConveyor.Route.InsertActionPoint(ParentMultiShuttle.DepthDistPos2 + ParentMultiShuttle.DepthDistPos1);
            exitPointDepth1.OnEnter += exitPointDepth1_OnEnter;

            exitPointDepth2          = shuttleConveyor.Route.InsertActionPoint(shuttleConveyor.Length);
            exitPointDepth2.OnEnter += exitPointDepth2_OnEnter;

            trackRail.Car.OnPositionChanged += Car_OnPositionChanged;

            ShuttleTasks.Clear();
            ShuttleTasks.CollectionChanged += ShuttleTasks_CollectionChanged;

            // MoveShuttle(ParentMultiShuttle.workarround);
        }
Пример #14
0
        void hideShow_Click(object sender, EventArgs e)
        {
            for (int i = 1; i < 9; i++)
            {
                string       name = string.Format("Multi-Shuttle {0}", i.ToString());
                MultiShuttle dms  = Core.Assemblies.Assembly.Items[name] as MultiShuttle;

                if (dms.Visible)
                {
                    dms.Visible = false;
                }
                else
                {
                    dms.Visible = true;
                }
            }
        }
Пример #15
0
        private const float Tolerance = 0.01f; //1 cm

        public MSlevel(MSlevelInfo info) : base(info)
        {
            msLevelInfo = info;
            ParentMS    = info.parentMultishuttle;

            Track = new TrackRail(new TrackRailInfo()
            {
                level = info.level, parentMultiShuttle = ParentMS, shuttlecarSpeed = ParentMS.ShuttleCarSpeed, controlAssembly = this
            });
            Vehicle = new TrackVehicle(new TrackVehicleInfo()
            {
                trackRail = Track, moveToDistance = InfeedRackShuttleLocation, controlAssembly = this
            });
            Add((Core.Parts.RigidPart)Track, new Vector3(0, -0.025f, 0));

            Vehicle.OnLoadArrived          += Vehicle_OnLoadArrived;
            Vehicle.Length                  = ParentMS.ShuttleCarLength;
            Vehicle.Width                   = ParentMS.ShuttleCarWidth;
            shuttleAP_Zpos                  = (info.multiShuttleinfo.RackConveyorWidth / 2) + (info.multiShuttleinfo.carwidth / 2);
            ShuttleTasks.CollectionChanged += ShuttleTasks_CollectionChanged;
            Vehicle.OnVehicleArrived       += ShuttleOnArrived;
            ShuttleTasks.Clear();
        }
Пример #16
0
        public MHEControl_MultiShuttle(MultiShuttleDatcomInfo info, MultiShuttle multishuttle)
        {
            Info                             = info; // set this to save properties
            theMultishuttle                  = multishuttle;
            mheController_Multishuttle       = ((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



            //theMultishuttle.OnLoadTransferingToPickStation += theMultishuttle_OnLoadTransferingToPickStation;

            //Shuttle
            theMultishuttle.OnArrivedAtShuttle += theMultishuttle_OnArrivedAtShuttle;

            //Bin Location
            theMultishuttle.OnArrivedAtRackLocation += theMultishuttle_OnArrivedAtRackLocation;

            //OutfeedRack
            theMultishuttle.OnArrivedAtOutfeedRackConvPosA += theMultishuttle_OnArrivedAtOutfeedRackConvPosA;
            theMultishuttle.OnArrivedAtOutfeedRackConvPosB += theMultishuttle_OnArrivedAtOutfeedRackConvPosB;

            //Elevator Conv
            theMultishuttle.OnArrivedAtElevatorConvPosA += theMultishuttle_OnArrivedAtElevatorConvPosA;
            theMultishuttle.OnArrivedAtElevatorConvPosB += theMultishuttle_OnArrivedAtElevatorConvPosB;

            //DropStation
            theMultishuttle.OnArrivedAtDropStationConvPosA += theMultishuttle_OnArrivedAtDropStationConvPosA;
            theMultishuttle.OnArrivedAtDropStationConvPosB += theMultishuttle_OnArrivedAtDropStationConvPosB;

            //PickStation
            theMultishuttle.OnArrivedAtPickStationConvPosA += theMultishuttle_OnArrivedAtPickStationConvPosA;
            theMultishuttle.OnArrivedAtPickStationConvPosB += theMultishuttle_OnArrivedAtPickStationConvPosB;

            //InfeedRack
            theMultishuttle.OnArrivedAtInfeedRackConvPosA += theMultishuttle_OnArrivedAtInfeedRackConvPosA;
            theMultishuttle.OnArrivedAtInfeedRackConvPosB += theMultishuttle_OnArrivedAtInfeedRackConvPosB;
        }
Пример #17
0
        //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;
        }
Пример #18
0
        /// <summary>
        /// Tasks are split into elevator task and shuttle task this method gives you the corrent rack location (i.e. the destination for an infeed elevator task)
        /// </summary>
        /// <param name="messageA">Can be either a full message or just the destination</param>
        /// <param name="multipal">We need to know if it is multipal as we need to know if we need to extract destinations or destination</param>
        /// <returns>A rack destination that the assembly will understand</returns>
        private string GetRackDestinationFromDCIBinLocation(string telegram, int blockPosition)
        {
            string dest = null, current = null;

            current = telegram.GetFieldValue(this, TelegramFields.Current, blockPosition);
            dest    = telegram.GetFieldValue(this, TelegramFields.Destination, blockPosition);

            //Need to make the intermediate position to the rack conveyor
            //takes the form aasyyxz: aa=aisle, s = side, yy = level, x = conv type see enum ConveyorTypes , Z = loc A or B e.g. 01R05OA
            //The actual final destination from the message is stored on a load parameter and this will be used when creating the shuttle task

            MultiShuttle ms             = GetMultishuttleFromAisleNum(GetPSDSLocFields(current, PSDSRackLocFields.Aisle));
            string       destinationLoc = string.Format("{0}{1}{2}IA", GetPSDSLocFields(current, PSDSRackLocFields.Aisle), GetPSDSLocFields(current, PSDSRackLocFields.Side), GetBinLocField(dest, BinLocFields.YLoc));

            DematicActionPoint ap = ms.ConveyorLocations.Find(x => x.LocName == destinationLoc);

            if (ap == null)
            {
                Log.Write("Can't find location in MHEController_Multishuttle.GetRackDestinationFromDCIBinLocation.", Color.Red);
                return(null);
            }

            return(destinationLoc);
        }
Пример #19
0
        /// <summary>
        /// Rack Location for an ElevatorTask takes the form: aasyyxz: a=aisle, s = side, y = level, x = input or output, Z = loc A or B e.g. 01R05OA
        /// Elevator Source location for a shuttleTask takes the form: sxxxyydd: Side, xxx location, yy = level, dd = depth
        /// </summary>
        /// <param name="info"></param>
        /// <param name="cPoint"></param>
        public MHEControl_MultiShuttleSimulation(MultiShuttleSimInfo info, MultiShuttle cPoint)
        {
            theMultishuttle     = cPoint;
            multiShuttleSimInfo = info;  // set this to save properties

            theMultishuttle.OnArrivedAtPickStationConvPosB += multiShuttle_OnArrivedAtPickStationConvPosB;
            theMultishuttle.OnArrivedAtPickStationConvPosA += multiShuttle_OnArrivedAtPickStationConvPosA;
            theMultishuttle.OnArrivedAtInfeedRackConvPosB  += theMultishuttle_OnArrivedAtInfeedRackConvPosB;
            theMultishuttle.OnArrivedAtOutfeedRackConvPosA += theMultishuttle_OnArrivedAtOutfeedRackConvPosA;
            theMultishuttle.OnArrivedAtOutfeedRackConvPosB += theMultishuttle_OnArrivedAtOutfeedRackConvPosB;
            theMultishuttle.OnLoadTransferingToPickStation += theMultishuttle_OnLoadTransferingToPickStation;
            theMultishuttle.OnArrivedAtRackLocation        += theMultishuttle_OnArrivedAtRackLocation;

            //List<string> setShuttleTasks = new List<string>() { "L0270902", "R0150202", "L0340102", "R0280302", "L0090701", "R0400802", "L0370802", "R0140102", "L0390402", "R0180602" };

            //foreach (string item in setShuttleTasks)
            //{
            //    ShuttleTask sT = new ShuttleTask();
            //    sT.LoadColor = Color.Peru;
            //    sT.LoadHeight = 0.32f;
            //    sT.LoadLength = 0.65f;
            //    sT.LoadWidth = 0.32f;
            //    sT.LoadWeight = 2.3f;
            //    sT.Source = item;
            //    sT.Level = sT.Source.Level();
            //    sT.Destination = string.Format("01R{0}OB", sT.Level.ToString().PadLeft(2, '0'));
            //    sT.Barcode = FeedCase.GetSSCCBarcode();
            //    theMultishuttle.shuttlecars[sT.Level].ShuttleTasks.Add(sT);

            //}

            ShuttleTask sT = new ShuttleTask();

            try
            {
                //sT.LoadColor = Color.Peru;
                //sT.LoadHeight = 0.32f;
                //sT.LoadLength = 0.65f;
                //sT.LoadWidth = 0.32f;
                //sT.LoadWeight = 2.3f;
                sT.Source      = "R0011001";//"L0011001"
                sT.Level       = sT.Source.Level();
                sT.Destination = string.Format("01{0}{1}OA", (char)(sT.Source.Side()), sT.Level.ToString().PadLeft(2, '0'));
                sT.Barcode     = FeedCase.GetSSCCBarcode();
                theMultishuttle.shuttlecars[sT.Level].ShuttleTasks.Add(sT);

                sT = new ShuttleTask();
                //sT.LoadColor = Color.Peru;
                //sT.LoadHeight = 0.32f;
                //sT.LoadLength = 0.65f;
                //sT.LoadWidth = 0.32f;
                //sT.LoadWeight = 2.3f;
                sT.Source      = "R0110801";
                sT.Level       = sT.Source.Level();
                sT.Destination = string.Format("01{0}{1}OA", (char)sT.Source.Side(), sT.Level.ToString().PadLeft(2, '0'));
                sT.Barcode     = FeedCase.GetSSCCBarcode();
                theMultishuttle.shuttlecars[sT.Level].ShuttleTasks.Add(sT);
            }
            catch (Exception ex)
            {
                Log.Write("Error in simulation: " + ex.Message, Color.Red);
            }

            //for (int i = 0; i < 30; i++)
            //{
            //    ShuttleTask task = GenerateBinLocRetrival(1);
            //    if (task != null)
            //    {
            //        theMultishuttle.shuttlecars[task.Source.Level()].ShuttleTasks.Add(task);
            //        task = null;
            //    }
            //}


            //List<RackConveyor> infeedRackConvTemp = new List<RackConveyor>();

            //foreach (DematicActionPoint dAP in theMultishuttle.ConveyorLocations)
            //{
            //    if (dAP.LocName.ConvType() == ConveyorTypes.InfeedRack)
            //    {
            //        infeedRackConvTemp.Add((dAP.Parent.Parent.Parent) as RackConveyor);
            //    }
            //}

            //var hash = new HashSet<RackConveyor>(infeedRackConvTemp);
            //List<RackConveyor> infeedRackConv = hash.ToList();
        }
Пример #20
0
        private void LoadAtRackConv(string telegram, Case_Load caseLoad)
        {
            if (telegram.GetFieldValue(this, TelegramFields.Destination).LocationType() == LocationTypes.DropStation)
            {
                DCICaseData caseData = caseLoad.Case_Data as DCICaseData;

                string currentLevel = GetRackLocFields(caseData.Current, PSDSRackLocFields.Level);
                string destLevel    = GetPSDSLocFields(caseData.Destination, PSDSRackLocFields.Level);
                string aisle        = GetRackLocFields(caseData.Current, PSDSRackLocFields.Aisle);
                string side         = GetRackLocFields(caseData.Current, PSDSRackLocFields.Side);

                //Set somedata on the load
                caseData.Current     = telegram.GetFieldValue(this, TelegramFields.Current);
                caseData.Destination = telegram.GetFieldValue(this, TelegramFields.Destination);

                int dropIndex = 0;
                if (int.TryParse(telegram.GetFieldValue(this, TelegramFields.DropIndex), out dropIndex))
                {
                    caseData.DropIndex = dropIndex;
                }

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

                string       elevatorName = string.Format("{0}{1}", side, aisle);
                MultiShuttle ms           = GetMultishuttleFromAisleNum(aisle);
                Elevator     elevator     = ms.elevators.First(x => x.ElevatorName == elevatorName);
                elevator.ElevatorTasks.Add(et);
            }
            else if (telegram.GetFieldValue(this, TelegramFields.Destination).LocationType() == LocationTypes.RackConvIn) //This will only work for drive through!
            {
                DCICaseData caseData = caseLoad.Case_Data as DCICaseData;

                string currentLevel = GetRackLocFields(caseData.Current, PSDSRackLocFields.Level);
                string destLevel    = GetRackLocFields(caseData.Destination, PSDSRackLocFields.Level);
                string aisle        = GetRackLocFields(caseData.Current, PSDSRackLocFields.Aisle);
                string side         = GetRackLocFields(caseData.Current, PSDSRackLocFields.Side);

                //Set somedata on the load
                caseData.Current     = telegram.GetFieldValue(this, TelegramFields.Current);
                caseData.Destination = telegram.GetFieldValue(this, TelegramFields.Destination);

                int dropIndex = 0;
                if (int.TryParse(telegram.GetFieldValue(this, TelegramFields.DropIndex), out dropIndex))
                {
                    caseData.DropIndex = dropIndex;
                }

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

                string       elevatorName = string.Format("{0}{1}", side, aisle);
                MultiShuttle ms           = GetMultishuttleFromAisleNum(aisle);
                Elevator     elevator     = ms.elevators.First(x => x.ElevatorName == elevatorName);
                elevator.ElevatorTasks.Add(et);
            }
        }
Пример #21
0
        private void TUMissionMultiBlock(string telegram)
        {
            string             currentLoc = string.Empty;
            DematicActionPoint locA = null, locB = null;
            MultiShuttle       ms = null;

            TelegramTypes type = telegram.GetTelegramType(this);


            //List<string> indexTags;
            //List<string> messageBodies = Telegrams.DeMultaplise(telegram, telegram.GetTelegramType(), out indexTags);
            //string[] messageBodySplit  = messageBodies.First().Split(',');//don't care which message is used as both on the same conveyor
            string current = telegram.GetFieldValue(this, TelegramFields.Current);
            string destLoc0 = telegram.GetFieldValue(this, TelegramFields.Destination, 0);
            string destLoc1 = telegram.GetFieldValue(this, TelegramFields.Destination, 1);
            string tuIdent0 = telegram.GetFieldValue(this, TelegramFields.TUIdent, 0);
            string tuIdent1 = telegram.GetFieldValue(this, TelegramFields.TUIdent, 1);
            string aisle = GetPSDSLocFields(current, PSDSRackLocFields.Aisle);
            string side = GetPSDSLocFields(current, PSDSRackLocFields.Side);
            string destA = null, destB = null;

            // takes the form aasyyxz: aa=aisle, s = side, yy = level, x = conv type see enum ConveyorTypes , Z = loc A or B e.g. 01R05OA
            string loc = string.Format("{0}{1}{2}P", aisle, side, GetPSDSLocFields(current, PSDSRackLocFields.Level));

            ms   = GetMultishuttleFromAisleNum(loc + "A");
            locA = ms.ConveyorLocations.Find(x => x.LocName == loc + "A");
            locB = ms.ConveyorLocations.Find(x => x.LocName == loc + "B");

            if ((locA != null && locA.Active) && (locB != null && locB.Active))
            {
                string messageA = telegram.Split(',').ToList().Find(x => x.Contains(locA.ActiveLoad.Identification));
                string messageB = telegram.Split(',').ToList().Find(x => x.Contains(locB.ActiveLoad.Identification));

                if (destLoc0 == null || destLoc1 == null)
                {
                    Log.Write(string.Format("{0}: Invalid destinations sent in TUMission - Logically Grouped", Name), Color.Red);
                    return;
                }

                if (telegram.GetFieldValue(this, TelegramFields.Destination, 0).LocationType() == LocationTypes.DropStation)  //Assume that both going to DS
                {
                    destA = string.Format("{0}{1}{2}{3}A", aisle,
                                          side,
                                          GetPSDSLocFields(destLoc0, PSDSRackLocFields.Level),
                                          GetPSDSLocFields(destLoc0, PSDSRackLocFields.ConvType));
                    destB = destA;
                }
                else if (telegram.GetFieldValue(this, TelegramFields.Destination).LocationType() == LocationTypes.RackConvIn)
                {
                    //need to calculate which way around the loads are on the PS and ensure that the elevator task is correct
                    if (locA.ActiveLoad.Identification == tuIdent0)
                    {
                        destA = string.Format("{0}{1}{2}{3}B", aisle, side, GetLocFields(destLoc0, PSDSRackLocFields.Level), GetLocFields(destLoc0, PSDSRackLocFields.ConvType));
                    }
                    else if (locA.ActiveLoad.Identification == tuIdent1)
                    {
                        destA = string.Format("{0}{1}{2}{3}B", aisle, side, GetLocFields(destLoc1, PSDSRackLocFields.Level), GetLocFields(destLoc1, PSDSRackLocFields.ConvType));
                    }
                    else
                    {
                        Log.Write(string.Format("Error {0}: The tuIdent at the PS does not match the tuIdent in the TU Mission - Logically Grouped (Position A"), Color.Orange);
                        return;
                    }

                    if (locB.ActiveLoad.Identification == tuIdent0)
                    {
                        destB = string.Format("{0}{1}{2}{3}B", aisle, side, GetLocFields(destLoc0, PSDSRackLocFields.Level), GetLocFields(destLoc0, PSDSRackLocFields.ConvType));
                    }
                    else if (locB.ActiveLoad.Identification == tuIdent1)
                    {
                        destB = string.Format("{0}{1}{2}{3}B", aisle, side, GetLocFields(destLoc1, PSDSRackLocFields.Level), GetLocFields(destLoc1, PSDSRackLocFields.ConvType));
                    }
                    else
                    {
                        Log.Write(string.Format("Error {0}: The tuIdent at the PS does not match the tuIdent in the TU Mission - Logically Grouped (Position A"), Color.Orange);
                        return;
                    }
                }
                else
                {
                    destA = GetRackDestinationFromDCIBinLocation(telegram, 0);
                    destB = GetRackDestinationFromDCIBinLocation(telegram, 1);
                }

                if (messageA != null && messageB != null)
                {
                    ElevatorTask et = new ElevatorTask(locA.ActiveLoad.Identification, locB.ActiveLoad.Identification)
                    {
                        LoadCycle        = Cycle.Double,
                        Flow             = TaskType.Infeed,
                        SourceLoadA      = locA.LocName,
                        SourceLoadB      = locB.LocName,
                        DestinationLoadA = destA,
                        DestinationLoadB = destB,
                        UnloadCycle      = Cycle.Single
                    };
                    if (et.DestinationLoadA == et.DestinationLoadB)
                    {
                        et.UnloadCycle = Cycle.Double;
                    }

                    UpDateLoadParameters(telegram, (Case_Load)locA.ActiveLoad, 1);
                    UpDateLoadParameters(telegram, (Case_Load)locB.ActiveLoad, 0);

                    ms.elevators.First(x => x.ElevatorName == side + aisle).ElevatorTasks.Add(et);
                    //ms.elevators[side+aisle].ElevatorTasks.Add(et);
                }
                else
                {
                    Log.Write("ERROR: Load ids from telegram do not match active load ids in TU Mission - Logically Grouped", Color.Red);
                    return;
                }
            }
            else
            {
                Log.Write("ERROR: Can't find locations or can't find loads on the locations named in TU Mission - Logically Grouped", Color.Red);
            }
        }
Пример #22
0
        private void TUMissionSingleBlock(string telegram)
        {
            try
            {
                if (Core.Environment.InvokeRequired)
                {
                    Core.Environment.Invoke(() => TUMissionSingleBlock(telegram));
                    return;
                }

                //Look for the load somewhere in the model, if the load is found then change it's status, if not create it at the current location
                Case_Load caseLoad = Case_Load.GetCaseFromIdentification(telegram.GetFieldValue(this, TelegramFields.TUIdent));

                if (caseLoad != null)
                {
                    DCICaseData caseData = caseLoad.Case_Data as DCICaseData;
                    UpDateLoadParameters(telegram, caseLoad);

                    if (telegram.GetFieldValue(this, TelegramFields.Current).LocationType() == LocationTypes.PickStation)
                    {
                        //Check how many loads are at the pickstation, first i need to find the pick station

                        string currentLoc = telegram.GetFieldValue(this, TelegramFields.Current);
                        string destLoc    = telegram.GetFieldValue(this, TelegramFields.Destination);
                        string aisle      = GetPSDSLocFields(currentLoc, PSDSRackLocFields.Aisle);
                        string side       = GetPSDSLocFields(currentLoc, PSDSRackLocFields.Side);
                        string psLevel    = GetPSDSLocFields(currentLoc, PSDSRackLocFields.Level);

                        string psA = string.Format("{0}{1}{2}{3}A", aisle, side, psLevel, GetPSDSLocFields(currentLoc, PSDSRackLocFields.ConvType));
                        string psB = string.Format("{0}{1}{2}{3}B", aisle, side, psLevel, GetPSDSLocFields(currentLoc, PSDSRackLocFields.ConvType));

                        MultiShuttle        ms     = GetMultishuttleFromAisleNum(psA);
                        PickStationConveyor psConv = ms.PickStationConveyors.Find(x => x.Name == string.Format("{0}{1}PS{2}", aisle, side, psLevel));

                        //Check how many loads are on the pickstation if there is only 1 then send a single mission
                        if (psConv.LocationA.Active && psConv.LocationB.Active)
                        {
                            Case_Load caseA = psConv.LocationA.ActiveLoad as Case_Load;
                            Case_Load caseB = psConv.LocationB.ActiveLoad as Case_Load;

                            DCICaseData caseDataA = caseA.Case_Data as DCICaseData;
                            DCICaseData caseDataB = caseB.Case_Data as DCICaseData;

                            //This is a double move to the elevator so don't send a single
                            if (caseB.Identification == telegram.GetFieldValue(this, TelegramFields.TUIdent)) //LocationB just set the destination
                            {
                                UpDateLoadParameters(telegram, caseB);
                                return;
                            }
                            else if (caseA.Identification == telegram.GetFieldValue(this, TelegramFields.TUIdent)) //LocationA Should be the second message so create the elevator task
                            {
                                UpDateLoadParameters(telegram, caseA);

                                string DestLoadA, DestLoadB;

                                if (caseDataA.Destination.LocationType() == LocationTypes.DropStation && GetPSDSLocFields(caseDataA.Destination, PSDSRackLocFields.Side) != side)
                                {
                                    //First check if the destination is to a drop station... check if the drop station is on this elevator
                                    //If not choose a destination to level 1 and remember the load route
                                    DestLoadA = string.Format("{0}{1}{2}{3}B",
                                                              GetPSDSLocFields(caseDataA.Current, PSDSRackLocFields.Aisle),
                                                              GetPSDSLocFields(caseDataA.Current, PSDSRackLocFields.Side),
                                                              FindLevelForReject(ms),
                                                              "I");
                                }
                                else
                                {
                                    DestLoadA = string.Format("{0}{1}{2}{3}B",
                                                              aisle,
                                                              side,
                                                              //GetLocFields(caseDataA.Destination, PSDSRackLocFields.Level),
                                                              //GetLocFields(caseDataA.Destination, PSDSRackLocFields.ConvType));
                                                              GetLocFields(caseDataA.Destination, PSDSRackLocFields.Level) != "" ? GetLocFields(caseDataA.Destination, PSDSRackLocFields.Level) : GetBinLocField(caseDataA.Destination, BinLocFields.YLoc),
                                                              GetLocFields(caseDataA.Destination, PSDSRackLocFields.ConvType) != "" ? GetLocFields(caseDataA.Destination, PSDSRackLocFields.ConvType) : "I");
                                }

                                if (caseDataB.Destination.LocationType() == LocationTypes.DropStation && GetPSDSLocFields(caseDataB.Destination, PSDSRackLocFields.Side) != side)
                                {
                                    //First check if the destination is to a drop station... check if the drop station is on this elevator
                                    //If not choose a destination to level 1 and remember the load route
                                    DestLoadB = string.Format("{0}{1}{2}{3}B",
                                                              GetPSDSLocFields(caseDataB.Current, PSDSRackLocFields.Aisle),
                                                              GetPSDSLocFields(caseDataB.Current, PSDSRackLocFields.Side),
                                                              FindLevelForReject(ms),
                                                              "I");
                                }
                                else
                                {
                                    DestLoadB = string.Format("{0}{1}{2}{3}B",
                                                              aisle,
                                                              side,
                                                              GetLocFields(caseDataB.Destination, PSDSRackLocFields.Level) != "" ? GetLocFields(caseDataB.Destination, PSDSRackLocFields.Level) : GetBinLocField(caseDataB.Destination, BinLocFields.YLoc),
                                                              GetLocFields(caseDataB.Destination, PSDSRackLocFields.ConvType) != "" ? GetLocFields(caseDataB.Destination, PSDSRackLocFields.ConvType) : "I");
                                }

                                ElevatorTask et = new ElevatorTask(caseA.Identification, caseB.Identification)
                                {
                                    LoadCycle        = Cycle.Double,
                                    Flow             = TaskType.Infeed,
                                    SourceLoadA      = psA,
                                    SourceLoadB      = psB,
                                    DestinationLoadA = DestLoadA,
                                    DestinationLoadB = DestLoadB,
                                    UnloadCycle      = Cycle.Single
                                };
                                if (et.DestinationLoadA == et.DestinationLoadB)
                                {
                                    et.UnloadCycle = Cycle.Double;
                                }

                                ms.elevators.First(x => x.ElevatorName == side + aisle).ElevatorTasks.Add(et);
                            }
                            else
                            {
                                Log.Write(string.Format("Error {0}: None of the tuIdents match any of the loads at the PS on StartTransportTelegram"), Color.Orange);
                            }
                        }
                        else
                        {
                            SingleLoadAtPS(telegram, caseLoad);
                        }
                    }
                    else if (telegram.GetFieldValue(this, TelegramFields.Current).LocationType() == LocationTypes.RackConvOut)
                    {
                        LoadAtRackConv(telegram, caseLoad);
                    }
                    else if (telegram.GetFieldValue(this, TelegramFields.Current).LocationType() == LocationTypes.RackConvIn &&
                             caseData.Current == telegram.GetFieldValue(this, TelegramFields.Current)) //Mission for load at Infeed Rack conveyor
                    {
                        ShuttleTask st          = new ShuttleTask();
                        string      destination = caseData.Destination;


                        if (destination.LocationType() != LocationTypes.BinLocation)
                        {
                            Log.Write("WARNING: Arrived at infeed rack and destination is NOT a binlocation.", Color.Red);
                            return;
                        }

                        string current  = telegram.GetFieldValue(this, TelegramFields.Current);
                        string aisle    = GetRackLocFields(current, PSDSRackLocFields.Aisle);
                        string side     = GetRackLocFields(current, PSDSRackLocFields.Side);
                        string location = string.Format("{0}{1}{2}IB", aisle, side, GetRackLocFields(current, PSDSRackLocFields.Level));

                        MultiShuttle ms = GetMultishuttleFromAisleNum(location);

                        int level;
                        st.Destination = DCIbinLocToMultiShuttleLoc(destination, out level, ms);
                        st.Level       = level;
                        st.LoadID      = caseLoad.Identification;
                        st.Source      = location;

                        ms.shuttlecars[level].ShuttleTasks.Add(st);
                    }
                    else
                    {
                        Log.Write(string.Format("{0}: MultishuttleStartTransportTelegram received but the load was found elsewhere in the model ({1}) message ignored", Name, caseData.Current), Color.Red);
                    }
                }
                //Anything FROM a binloc will not have a load until the shuttle gets to the bin location at this point it will be created.
                else if (telegram.GetFieldValue(this, TelegramFields.Current).LocationType() == LocationTypes.BinLocation)
                {
                    CreateShuttleTask(telegram);
                }
                else if (telegram.GetFieldValue(this, TelegramFields.Current).LocationType() == LocationTypes.BinLocation &&
                         telegram.GetFieldValue(this, TelegramFields.Destination).LocationType() == LocationTypes.DropStation) //It's a shuffle move
                {
                    SingleLoadOut(telegram);
                }
                else
                {
                    Log.Write("Error: Load not found in StartTransportTelegramReceived", Color.Red);
                }
            }
            catch (Exception ex)
            {
                Log.Write(ex.ToString());
                if (ex.InnerException != null)
                {
                    Log.Write(ex.InnerException.ToString());
                }
            }
        }
Пример #23
0
        private void Telegram01Recieved(string[] splittelegram, int datasets)
        {
            MultiShuttle ms = GetMultishuttleFromAisleNum(splittelegram);

            #region Case on Pos2 is the first in dataset, Case on Pos1 is the second in dataset

            CaseData cData = new CaseData();
            cData.UserData = string.Empty;

            if ((splittelegram[7].Length > 0 && splittelegram[7].Substring(0, 1) == "R") && (splittelegram[8].Length > 0 && splittelegram[8].Substring(0, 1) == "O"))
            {
                //From rack to outfeed rack conveyor
                cData = SetUpCaseMissionDataSet(splittelegram, 1);
                ((MHEControl_MultiShuttle)ms.ControllerProperties).CreateShuttleTask(splittelegram[7], splittelegram[8], cData, ShuttleTaskTypes.RackToConv);

                return;
            }
            else if ((splittelegram[7].Length > 0 && splittelegram[7].Substring(0, 1) == "R") && (splittelegram[8].Length > 0 && splittelegram[8].Substring(0, 1) == "R"))
            {
                //Shuffle move from rack loc to rack loc
                cData = SetUpCaseMissionDataSet(splittelegram, 1);
                ((MHEControl_MultiShuttle)ms.ControllerProperties).CreateShuttleTask(splittelegram[7], splittelegram[8], cData, ShuttleTaskTypes.Shuffle);
                return;
            }
            else if ((splittelegram[7].Length > 0 && splittelegram[7].Substring(0, 1) == "O") && (splittelegram[8].Length > 0 && splittelegram[8].Substring(0, 1) == "D") && datasets == 1)
            {
                //Outfeed rack to Drop Station single load
                cData = SetUpCaseMissionDataSet(splittelegram, 1);
                ((MHEControl_MultiShuttle)ms.ControllerProperties).CreateElevatorTask(null, null, null, splittelegram[7], splittelegram[8], cData, Cycle.Single, Cycle.Single, TaskType.Outfeed);
                return;
            }
            else if ((splittelegram[7].Length > 0 && splittelegram[7].Substring(0, 1) == "O") && (splittelegram[8].Length > 0 && splittelegram[8].Substring(0, 1) == "D") && datasets == 2)
            {
                //Outfeed rack to Drop Station double load
                CaseData cDataA = SetUpCaseMissionDataSet(splittelegram, 2);
                CaseData cDataB = SetUpCaseMissionDataSet(splittelegram, 1);

                cDataA.UserData = cDataA.ULID + "," + cDataB.ULID; //Tag double loads for the correct 02 at the dropstation
                cDataB.UserData = cDataA.UserData;

                Cycle unloadcycle = Cycle.Double;
                if (splittelegram[8].Datcom_Y_Vertical() != splittelegram[15 + datcomVersionIndexOffset].Datcom_Y_Vertical())
                {
                    unloadcycle = Cycle.Single;
                }

                Cycle loadcycle = Cycle.Double;
                if (splittelegram[6].Datcom_Y_Vertical() != splittelegram[13 + datcomVersionIndexOffset].Datcom_Y_Vertical())
                {
                    loadcycle = Cycle.Single;
                }

                if (unloadcycle == Cycle.Single && loadcycle == Cycle.Single)
                {
                }

                ((MHEControl_MultiShuttle)ms.ControllerProperties).CreateElevatorTask(splittelegram[14 + datcomVersionIndexOffset], splittelegram[15 + datcomVersionIndexOffset], cDataA, splittelegram[7], splittelegram[8], cDataB, loadcycle, unloadcycle, TaskType.Outfeed);
                return;
            }
            else if ((splittelegram[7].Length > 0 && splittelegram[7].Substring(0, 1) == "P") && ((splittelegram[7].Length > 0 && splittelegram[8].Substring(0, 1) == "D")))
            {
                //Pick Station to drop station
                if (datasets == 1)
                {
                    cData = SetUpCaseMissionDataSet(splittelegram, 1);
                    ((MHEControl_MultiShuttle)ms.ControllerProperties).CreateElevatorTask(null, null, null, splittelegram[7], splittelegram[8], cData, Cycle.Single, Cycle.Single);
                }
                else if (datasets == 2)
                {
                    cData = SetUpCaseMissionDataSet(splittelegram, 1);
                    CaseData cDataA = SetUpCaseMissionDataSet(splittelegram, 2);

                    cDataA.UserData = cDataA.ULID + "," + cData.ULID; //Tag double loads for the correct 02 at the dropstation
                    cData.UserData  = cDataA.UserData;

                    ((MHEControl_MultiShuttle)ms.ControllerProperties).CreateElevatorTask(splittelegram[18], splittelegram[19], cDataA, splittelegram[7], splittelegram[8], cData, Cycle.Double, Cycle.Double);
                }
            }
            else if (splittelegram[7].Length > 0 && splittelegram[7].Substring(0, 1) == "P" && datasets == 1)
            {
                cData = SetUpCaseMissionDataSet(splittelegram, 1);
                ((MHEControl_MultiShuttle)ms.ControllerProperties).CreateElevatorTask(null, null, null, splittelegram[7], splittelegram[8], cData, Cycle.Single, Cycle.Single, TaskType.Infeed);
            }
            else if ((splittelegram[7].Length > 0 && splittelegram[7].Substring(0, 1) == "I") && (splittelegram[8].Length > 0 && splittelegram[8].Substring(0, 1) == "R"))
            {
                //From infeed conveyor to rack location
                cData = SetUpCaseMissionDataSet(splittelegram, 1);
                ((MHEControl_MultiShuttle)ms.ControllerProperties).CreateShuttleTask(splittelegram[7], splittelegram[8], cData, ShuttleTaskTypes.ConvToRack);
                return;
            }
            else if ((splittelegram[7].Length > 0 && splittelegram[7].Substring(0, 1) == "P") && (splittelegram[8].Length > 0 && splittelegram[8].Substring(0, 1) == "I") && datasets == 2 &&
                     splittelegram[8].Length > 0 && splittelegram[8].Datcom_Y_Vertical() == splittelegram[15 + datcomVersionIndexOffset].Datcom_Y_Vertical())
            {
                CaseData cDataA;
                CaseData cDataB;
                SetCaseData(splittelegram, out cDataA, out cDataB);

                // CaseData cDataA = SetUpCaseMissionDataSet(splittelegram, 2);
                // CaseData cDataB = SetUpCaseMissionDataSet(splittelegram, 1);

                // cDataA.UserData = cDataA.ULID + "," + cDataB.ULID; //Tag double loads for the correct 02 at the dropstation
                // cDataB.UserData = cDataA.UserData;

                ((MHEControl_MultiShuttle)ms.ControllerProperties).CreateElevatorTask(splittelegram[14 + datcomVersionIndexOffset], splittelegram[15 + datcomVersionIndexOffset], cDataA, splittelegram[7], splittelegram[8], cDataB, Cycle.Double, Cycle.Double, TaskType.Infeed);
                return;
            }
            else if ((splittelegram[7].Length > 0 && splittelegram[7].Substring(0, 1) == "P") && (splittelegram[8].Length > 0 && splittelegram[8].Substring(0, 1) == "I") && datasets == 2 &&
                     splittelegram[8].Length > 0 && splittelegram[8].Datcom_Y_Vertical() != splittelegram[15 + datcomVersionIndexOffset].Datcom_Y_Vertical())
            {
                CaseData cDataA;
                CaseData cDataB;
                SetCaseData(splittelegram, out cDataA, out cDataB);

                ((MHEControl_MultiShuttle)ms.ControllerProperties).CreateElevatorTask(splittelegram[14 + datcomVersionIndexOffset], splittelegram[15 + datcomVersionIndexOffset], cDataA, splittelegram[7], splittelegram[8], cDataB, Cycle.Double, Cycle.Single, TaskType.Infeed);
                return;
            }
            else
            {
                Log.Write(string.Join(",", splittelegram));
                Log.Write("ERROR: 01 not handled by Experior.Catalog.Dematic.DatcomUK.Assemblies.MHEController_Multishuttle.Telegram01Recieved", Color.Red);
            }

            //Doesn't seem to do anything
            //if (datasets == 2 && splittelegram[7].Length > 0 && splittelegram[7].Substring(0, 1) != "R" && splittelegram[14 + datcomVersionIndexOffset].Length > 0 && splittelegram[14 + datcomVersionIndexOffset].Substring(0, 1) != "R")
            //{
            //    //switch D, E, I, O pos2 & pos1
            //    if (splittelegram[7].Contains("001") && splittelegram[14 + datcomVersionIndexOffset].Contains("002"))
            //    {
            //        //switch around!
            //        string temp17 = splittelegram[13 + datcomVersionIndexOffset];
            //        string temp18 = splittelegram[14 + datcomVersionIndexOffset];
            //        string temp19 = splittelegram[15 + datcomVersionIndexOffset];
            //        string temp20 = splittelegram[26 + datcomVersionIndexOffset];
            //        string temp21 = splittelegram[27 + datcomVersionIndexOffset];

            //        splittelegram[13 + datcomVersionIndexOffset] = splittelegram[6];
            //        splittelegram[14 + datcomVersionIndexOffset] = splittelegram[7];
            //        splittelegram[15 + datcomVersionIndexOffset] = splittelegram[8];
            //        splittelegram[16 + datcomVersionIndexOffset] = splittelegram[9];
            //        splittelegram[17 + datcomVersionIndexOffset] = splittelegram[10];

            //        splittelegram[6] = temp17;
            //        splittelegram[7] = temp18;
            //        splittelegram[8] = temp19;
            //        splittelegram[9] = temp20;
            //        splittelegram[10] = temp21;
            //    }
            //}
            #endregion


            //string originalPosition2;
            //string currentPosition2;
            //string destinationPosition2;
            //string missionStatus2;
            //string ULID2;
            //string originalPosition1;
            //string currentPosition1;
            //string destinationPosition1;
            //string missionStatus1;
            //string ULID1;
            //MultiShuttle multishuttle;
            //Case_Load caseload1, caseload2;

            //if (!VerifyReceivedMission(splittelegram, datasets, out originalPosition2, out currentPosition2, out destinationPosition2, out missionStatus2, out ULID2,
            //    out originalPosition1, out currentPosition1, out destinationPosition1, out missionStatus1, out ULID1, out multishuttle, out caseload1, out caseload2))
            //{
            //    return; //Reason is written to log in VerifyReceivedMission method
            //}
        }
Пример #24
0
        public void ConfigureRackConveyor(Elevator elevator, float zCoord, int level, float xoffset)
        {
            Elevator = elevator;
            MultiShuttle ParentMultiShuttle = Elevator.ParentMultiShuttle;

            if (ParentMultiShuttle.MultiShuttleinfo.MultiShuttleDriveThrough)
            {
                LocalPosition = ParentMultiShuttle.shuttlecars[level].LocalPosition + new Vector3(-Length + ParentMultiShuttle.DriveThroughElevatorOffset + xoffset, 0, zCoord);
            }
            else  //outfeed wll always travel in the same direction so point the conveyor in the correct direction and not reverse the conveyor
            {
                Height        = ParentMultiShuttle.shuttlecars[level].LocalPosition.Y;
                LocalPosition = ParentMultiShuttle.shuttlecars[level].LocalPosition + new Vector3(ParentMultiShuttle.MultiShuttleinfo.raillength / 2 - Length / 2 + xoffset, /*0.025f*/ 0, zCoord);
            }

            if (RackConveyorType == MultiShuttleDirections.Outfeed)
            {
                LocalYaw = (float)Math.PI;
            }
            //    TransportSection.Route.InsertActionPoint(LocationA, Length/ 2 + Length / 4);
            //    TransportSection.Route.InsertActionPoint(LocationB, Length/ 2 - Length / 4);
            //}
            //else if (RackConveyorType == MultiShuttleDirections.Infeed)
            //{
            TransportSection.Route.InsertActionPoint(LocationA, Length / 2 - Length / 4);
            TransportSection.Route.InsertActionPoint(LocationB, Length / 2 + Length / 4);
            // }
            //LocationA.Visible = true;
            //LocationB.Visible = true;
            LocationA.LocName = string.Format("{0}{1}{2}{3}{4}", Elevator.AisleNumber.ToString().PadLeft(2, '0'), (char)Elevator.Side, level.ToString().PadLeft(2, '0'), (char)RackConveyorType, "A");
            LocationB.LocName = string.Format("{0}{1}{2}{3}{4}", Elevator.AisleNumber.ToString().PadLeft(2, '0'), (char)Elevator.Side, level.ToString().PadLeft(2, '0'), (char)RackConveyorType, "B");

            ParentMultiShuttle.ConveyorLocations.Add(LocationA);
            ParentMultiShuttle.ConveyorLocations.Add(LocationB);

            Level    = level;
            Elevator = elevator;
            // RackName = rackname;
            // ms.RackConveyors.Add(rackname, this);
            ParentMultiShuttle.RackConveyors.Add(this);
            LocationA.OnEnter += rackConvLocA_Enter;
            LocationB.OnEnter += rackConvLocB_Enter;
            //Location1.UserData = elevator;
            //Location2.UserData = elevator;

            //if (ms.MultiShuttleDriveThrough)
            //{
            //    RackConveyorInfo rackConvInfo = new RackConveyorInfo();

            //    //rackConvInfo.length = RackConveyorLength;
            //    //rackConvInfo.width = RackConveyorWidth;
            //   // conv = new RackConveyor(rackConvInfo);
            //    //ElevatorConveyor = new RackConveyor(Color.Gray, RackConveyorLength, RackConveyorWidth);
            //    //AddPart(ElevatorConveyor);
            //    AddAssembly(this);
            //    ConvRoute.Motor.Speed = ms.ConveyorSpeed;
            //    LocalPosition = ms.shuttlecars[level].LocalPosition + new Vector3(Length + ms.DriveThroughElevatorOffset + xoffset, 0, zCoord);
            //    LocalYaw = (float)Math.PI;
            //    _level = level.ToString();
            //    _level = _level.PadLeft(2, '0');

            //    if (rackConveyorType == MultiShuttleDirections.Infeed)
            //    {
            //        if (mSside == "L")
            //        {
            //            name1 = ms.FrontLeftOutfeedRackGroupName + mSside + ms.POS1OUTFEED + _level; // Front, Left, pos 001, level level
            //            name2 = ms.FrontLeftOutfeedRackGroupName + mSside + ms.POS2OUTFEED + _level; // Front, Left, pos 001, level level
            //            rackname = ms.FrontLeftOutfeedRackGroupName + mSside + _level;
            //        }
            //        else
            //        {
            //            name1 = ms.FrontRightOutfeedRackGroupName + mSside + ms.POS1OUTFEED + _level; // Front, Left, pos 001, level level
            //            name2 = ms.FrontRightOutfeedRackGroupName + mSside + ms.POS2OUTFEED + _level; // Front, Left, pos 001, level level
            //            rackname = ms.FrontRightOutfeedRackGroupName + mSside + _level;
            //        }
            //    }
            //    else
            //    {
            //        if (mSside == "L")
            //        {
            //            name1 = ms.FrontLeftInfeedRackGroupName + mSside + ms.POS1 + _level; // Front, Left, pos 001, level level
            //            name2 = ms.FrontLeftInfeedRackGroupName + mSside + ms.POS2 + _level; // Front, Left, pos 001, level level'
            //            rackname = ms.FrontLeftInfeedRackGroupName + mSside + _level;
            //        }
            //        else
            //        {
            //            name1 = ms.FrontRightInfeedRackGroupName + mSside + ms.POS1 + _level; // Front, Left, pos 001, level level
            //            name2 = ms.FrontRightInfeedRackGroupName + mSside + ms.POS2 + _level; // Front, Left, pos 001, level level
            //            rackname = ms.FrontRightInfeedRackGroupName + mSside + _level;
            //        }
            //    }

            //    if (rackConveyorType == MultiShuttleDirections.Infeed)
            //    {
            //        ConvRoute.Motor.Backward();
            //        //ElevatorConveyor.Exit = ElevatorConveyor.Route.InsertActionPoint(0);
            //        //ElevatorConveyor.Exit.OnEnter += new ActionPoint.EnterEvent(Exit_Enter);
            //        //ElevatorConveyor.RackConveyorType = RackConveyor.RackConveyorTypes.Outfeed;
            //    }
            //    Location1 = ConvRoute.InsertActionPoint(Length / 2 + Length / 4 + 0.01f);
            //    Location1.Name = name1;
            //    Location2 = ConvRoute.InsertActionPoint(Length / 2 - Length / 4);
            //    Location2.Name = name2;
            //    ms.conveyorlocations.Add(Location1.Name, Location1);
            //    ms.conveyorlocations.Add(Location2.Name, Location2);
            //    Level = _level;
            //    Elevator = elevator;
            //    RackName = rackname;
            //    ms.RackConveyors.Add(rackname, this);
            //    ms.RackConveyorsList.Add(this);
            //    Location1.OnEnter += rackConvLoc1_Enter;
            //    Location2.OnEnter += rackConvLoc2_Enter;
            //    Location1.UserData = elevator;
            //    Location2.UserData = elevator;

            //}
        }