コード例 #1
0
 void routeStatus_OnRouteStatusChanged(object sender, RouteStatusChangedEventArgs e)
 {
     if (e._available == RouteStatuses.Available)
     {
         //Start the timers
         if (restartBlocked && BlockedTimeout != 0)
         {
             BlockedTimer.Start();
         }
         if (restartClear && ClearTimeout != 0)
         {
             ClearTimer.Start();
         }
         restartBlocked = false;
         restartClear   = false;
     }
     else
     {
         if (BlockedTimeout != 0 && BlockedTimer.Running)
         {
             BlockedTimer.Stop();
             restartBlocked = true;
         }
         if (ClearTimeout != 0 && ClearTimer.Running)
         {
             ClearTimer.Stop();
             restartClear = true;
         }
     }
 }
コード例 #2
0
        //Only the RHS has the attached conveyor
        void rhsConveyor_OnNextRouteStatusAvailableChanged(object sender, RouteStatusChangedEventArgs e)
        {
            if (e._available == RouteStatuses.Blocked)
            {
                ReleaseDelayTimer.Stop();

                if (lhsConveyor.RouteAvailable == RouteStatuses.Available)
                {
                    lhsTransfering = true;
                }

                if (rhsConveyor.RouteAvailable == RouteStatuses.Available)
                {
                    rhsTransfering = true;
                }

                lhsConveyor.RouteAvailable = RouteStatuses.Blocked;
                rhsConveyor.RouteAvailable = RouteStatuses.Blocked;
                lhsConveyor.TransportSection.Route.Motor.Stop();
                rhsConveyor.TransportSection.Route.Motor.Stop();
            }
            else if (e._available == RouteStatuses.Available)
            {
                ReleaseDelayTimer.Start();
                if (rhsTransfering)
                {
                    rhsConveyor.RouteAvailable = RouteStatuses.Available;
                }
                else
                {
                    rhsConveyor.RouteAvailable = RouteStatuses.Request;
                }

                if (lhsTransfering)
                {
                    lhsConveyor.RouteAvailable = RouteStatuses.Available;
                }
                else
                {
                    lhsConveyor.RouteAvailable = RouteStatuses.Request;
                }

                lhsConveyor.TransportSection.Route.Motor.Start();
                rhsConveyor.TransportSection.Route.Motor.Start();
            }

            if (!ReleaseDelayTimer.Running)
            {
                Release();
            }
        }
コード例 #3
0
 private void EMUDAIConnectionConstructor()
 {
     //Data Check Ticker
     dataCheckTicker            = new Core.Timer(1);
     dataCheckTicker.OnElapsed += new Core.Timer.ElapsedEvent(dataCheckTicker_Elapsed);
     dataCheckTicker.AutoReset  = true;
     dataCheckTicker.Start();
 }
コード例 #4
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;
        }
コード例 #5
0
        /// <summary>
        /// Release the load from infeed point into the transfer
        /// </summary>
        /// <param name="fromSide">Side of the transfer to release</param>
        /// <param name="routeDirection">Route the load will take on the transfer</param>
        /// <param name="load">The load to be routed</param>
        public void RouteLoad(Side fromSide, Side routeDirection, Load load)
        {
            //TransferWaiting waitingConv = new TransferWaiting(conv, direction, load);
            //convsWithALoadToRelease.AddDHDMwaiting(waitingConv);
            //Release();

            StraightConveyor conv = lhsConveyor;

            if (fromSide == Side.Right)
            {
                conv = rhsConveyor;
            }

            //This now will actually just release the load into the divert most other control is from the controller
            load.UserData       = routeDirection;
            conv.RouteAvailable = RouteStatuses.Available;
            mergeQueue.Remove(fromSide);

            //When load has been released then depending on the release set the release timer
            //If load has diverted then use the divert timer

            if (ReleaseDelayTimer.Running)
            {
                Log.Write(string.Format("Trying to set the timer but it's running, name {0}, fromSide {1}, routeDirection {2}", Name, fromSide.ToString(), routeDirection.ToString()));
                Pause();
            }

            if ((fromSide == Side.Left && routeDirection == Side.Right) || (fromSide == Side.Right && routeDirection == Side.Left)) //Diverted
            {
                ReleaseDelayTimer.Timeout = ReleaseDelayTimeDivert;
            }
            else //Went straight
            {
                ReleaseDelayTimer.Timeout = ReleaseDelayTimeStraight;
            }
            ReleaseDelayTimer.Start();
            ReleaseDelayTimerRunning = true;
        }
コード例 #6
0
        protected void sensor_OnLeave(DematicSensor sender, Load load)
        {
            if (sender.PreviousActiveLoad == load)
            {
                BlockChargeCheck();
                return;
            }

            int result;

            if (int.TryParse(sender.Name, out result))
            {
                if (result == LineFullPosition - 1)
                {
                    sensors[result].cube.Color = Color.Blue;
                }
                else if (PickPosition != 0 && result == PickPosition - 1)
                {
                    sensors[result].cube.Color = Color.DarkGreen;
                }
                else if (result < (Positions - InfeedBlockChargePositions))
                {
                    sensors[result].cube.Color = Color.Yellow;
                }
                else
                {
                    sensors[result].cube.Color = Color.Orange;
                }

                if (InfeedBlockChargePositions == 0 || result < (Positions - InfeedBlockChargePositions)) //Normal position (not block charge)
                {
                    //If there is a sensor behind you and it has a load and this sensor has been cleared then release the one behind
                    if (sensors.Count > (result + 1) && sensors[result + 1].sensor.Active)
                    {
                        if ((result + 1) != (PickPosition - 1) || ReleasePickLoad) // Also check if the position has stopped due to picking operation
                        {
                            ((Case_Load)sensors[result + 1].sensor.ActiveLoad).ReleaseLoad();
                            if (ReleasePickLoad) //Added by BG but shouldn't make any difference but it might
                            {
                                ReleasePickLoad = false;
                            }
                        }
                    }
                }
                else //Block Charge Position
                {
                    //Check all the positions behind and release the load if active
                    for (int i = result + 1; i < Positions; i++)
                    {
                        if (i != (PickPosition - 1) || ReleasePickLoad) // Also check if the position has stopped due to picking operation
                        {
                            sensors[i].sensor.ReleaseActiveCaseLoads();
                        }
                    }
                }

                if (result == 0) //Load has cleared front photocell
                {
                    if (sensors[0].sensor.ActiveLoad != null)
                    {
                        SetLoadWaiting(false, sensors[0].sensor.ActiveLoad.StartDisposing, load);
                    }
                    else
                    {
                        SetLoadWaiting(false, false, load);
                    }
                }

                //Set the route available status or start the timer
                if (LineFullPosition != 0 && result == LineFullPosition - 1)
                {
                    if (BlockedTimer != null)
                    {
                        BlockedTimer.Stop();
                        BlockedTimer.Reset();
                    }
                    if (LineAvailableTimeout == 0)
                    {
                        RouteAvailable = RouteStatuses.Available;
                    }
                    else
                    {
                        ClearTimer.Start();
                    }
                }
            }
        }
コード例 #7
0
        public void sensor_OnEnter(DematicSensor sender, Load load)
        {
            if (sender.PreviousActive)
            {
                BlockChargeCheck();
                return;
            }

            int result;

            if (int.TryParse(sender.Name, out result))
            {
                sensors[result].cube.Color = Color.Red;

                //Check if the location is a picking position
                if (result == (PickPosition - 1))
                {
                    load.Stop();
                    if (OnArrivedAtPickingPosition != null)
                    {
                        OnArrivedAtPickingPosition(this, new ManualPickArrivalArgs(load));
                    }
                }

                if (result != 0) // photocells are named 0 to n with 0 being the front photocell
                {
                    //bool stopLoad = false;
                    if (InfeedBlockChargePositions == 0 || result < (Positions - InfeedBlockChargePositions + 1))
                    {
                        //Normal Position
                        if (sensors[result - 1].sensor.Active) //Active means that there is a load on the sensor
                        {
                            //stopLoad = true;
                            load.Stop();
                        }
                    }
                    if (result >= (Positions - InfeedBlockChargePositions))
                    {
                        //Block Position
                        BlockChargeCheck();
                    }
                }
                else //Load has arrived at front (zeroth) photocell
                {
                    SetLoadWaiting(true, false, load);
                    if (NextRouteStatus == null || NextRouteStatus.Available != RouteStatuses.Available)
                    {
                        ((Case_Load)load).StopLoad_PLCControl();
                        //load.Stop();
                    }
                }

                if (InfeedBlockChargePositions == 0 || result < (Positions - InfeedBlockChargePositions)) //Normal positions
                {
                    //Stops the load behind if it's active to create a gap
                    if (sensors.Count > (result + 1) && sensors[result + 1].sensor.Active)
                    {
                        sensors[result + 1].sensor.StopActiveLoads();
                    }
                }

                //Set the route available status or start the timer
                if (LineFullPosition != 0 && result == LineFullPosition - 1)
                {
                    if (ClearTimer != null)
                    {
                        ClearTimer.Stop();
                        ClearTimer.Reset();
                    }
                    if (BlockedTimeout == 0)
                    {
                        RouteAvailable = RouteStatuses.Blocked;
                    }
                    else
                    {
                        BlockedTimer.Start();
                    }
                }
            }
        }
コード例 #8
0
        public bool StartMiniloadHalfCycle(MiniloadHalfCycle HalfCycle)
        {
            if (CurrentHalfCycle != null) //reject if the miniload is running, there is a CurrentHalfCycle
            {
                return(false);
            }
            else
            {
                CurrentHalfCycle = HalfCycle;
                if (HalfCycle.Cycle == MiniloadCycle.PickPS)                                         //This will pick whatever is at the pick station
                {
                    if (liftcube.LocalPosition.Y == PdOffsetHeight && liftcube.LocalPosition.Z == 0) //Miniload is already at the P&D so doesn't need to move
                    {
                        Core.Timer pickdelay = new Core.Timer(0.5f);
                        pickdelay.OnElapsed += pickdelay_OnElapsed;
                        pickdelay.Start();
                        return(true);
                    }

                    Control.Goto(PdOffsetHeight, 0, "GotoPS");
                    Control.JobQueue[0].UserData = HalfCycle;
                    Control.StartCrane();
                    return(true);
                }
                else if (HalfCycle.Cycle == MiniloadCycle.DropDS)
                {
                    if (liftcube.LocalPosition.Y == PdOffsetHeight && liftcube.LocalPosition.Z == 0) //Miniload is already at the P&D so doesn't need to move
                    {
                        Core.Timer dropdelay = new Core.Timer(0.5f);
                        dropdelay.OnElapsed += dropdelay_OnElapsed;
                        dropdelay.UserData   = HalfCycle;
                        dropdelay.Start();
                        return(true);
                    }

                    Control.Goto(PdOffsetHeight, 0, "GotoDS");
                    Control.JobQueue[0].UserData = HalfCycle;
                    Control.StartCrane();
                    return(true);
                }
                else if (HalfCycle.Cycle == MiniloadCycle.DropRack)
                {
                    Control.Goto(HalfCycle.Height, HalfCycle.Length, "GotoRack");
                    Control.JobQueue[0].UserData = HalfCycle;
                    Control.DropLoad(DepthTime(HalfCycle.Depth), true, "DropRack", HalfCycle.LHD == 1 ? HBWMiniLoadJob.LHDs.LHD1 : HBWMiniLoadJob.LHDs.LHD2);
                    Control.JobQueue[1].UserData = HalfCycle;
                    Control.StartCrane();
                    return(true);
                }
                else if (HalfCycle.Cycle == MiniloadCycle.PickRack)
                {
                    float depth = (AisleWidth / 2) + ((RackWidth / (DepthsInRack + 1)) * HalfCycle.Depth);
                    holdingConveyor.LocalPosition = new Vector3(HalfCycle.Length - (LHDWidth / 2), HalfCycle.Height, HalfCycle.RackSide == Side.Left ? depth : -depth);

                    Control.Goto(HalfCycle.Height, HalfCycle.Length, "GotoRack");
                    Control.JobQueue[0].UserData = HalfCycle;

                    Case_Load caseLoad = CreateCaseLoad(HalfCycle.CaseData, HalfCycle.LHD);

                    Control.PickLoad(DepthTime(HalfCycle.Depth), new List <Load>()
                    {
                        caseLoad
                    }, true, "PickRack", HalfCycle.LHD == 1 ? HBWMiniLoadJob.LHDs.LHD1 : HBWMiniLoadJob.LHDs.LHD2);
                    Control.JobQueue[1].UserData = HalfCycle;
                    Control.StartCrane();
                    return(true);
                }
            }
            return(false);
        }