public BeltSorterMerge(BeltSorterMergeInfo info) : base(info) { beltSorterMergeInfo = info; if (info.type == MergeType.PopUp) { arrow.Dispose(); } StraightConveyorInfo divertSectionInfo = new StraightConveyorInfo() { Length = info.mergeConveyorLength, thickness = info.thickness, Width = info.width, Speed = info.Speed, color = info.color }; mergeSection = new StraightConveyor(divertSectionInfo); mergeSection.endLine.Visible = false; mergeSection.EndFixPoint.Enabled = false; mergeSection.EndFixPoint.Visible = false; Add(mergeSection); TransportSection.Route.InsertActionPoint(apStraight); mergeSection.TransportSection.Route.InsertActionPoint(apMerge, info.mergeConveyorLength); apMerge.OnEnter += apMerge_OnEnter; apStraight.OnEnter += apStraight_OnEnter; mergeSection.StartFixPoint.OnSnapped += MergeSectionStartFixPoint_OnSnapped; mergeSection.StartFixPoint.OnUnSnapped += MergeSectionStartFixPoint_OnUnSnapped; ControlType = info.ControlType; if (beltControl.LineReleasePhotocell != null) { beltControl.LineReleasePhotocell.Dispose(); } //if (mergeSection.beltControl.LineReleasePhotocell != null) //{ // mergeSection.beltControl.LineReleasePhotocell.Dispose(); //} MergeAngle = info.mergeAngle; Length = info.length; MergeConveyorOffset = info.mergeConveyorOffset; OffSetTimer.OnElapsed += OffSetTimer_OnElapsed; OffSetTimer.Timeout = OffSetInductTime; UpdateConveyor(); }
public override void EndFixPoint_OnSnapped(Core.Parts.FixPoint stranger, Core.Parts.FixPoint.SnapEventArgs e) { Speed = ((BaseTrack)stranger.Parent).Speed; StraightConveyor nextConveyor = stranger.Parent as StraightConveyor; //This is a bit dodgy how do we know the next conveyor is going to be straight (TODO) if (nextConveyor != null) { nextConveyor.OnSpeedUpdated += BeltSorterMerge_OnSpeedUpdated; } base.EndFixPoint_OnSnapped(stranger, e); }
public override void EndFixPoint_OnSnapped(FixPoint stranger, FixPoint.SnapEventArgs e) { Speed = ((BaseTrack)stranger.Parent).Speed; StraightConveyor nextConveyor = stranger.Parent as StraightConveyor; if (nextConveyor != null) { nextConveyor.OnSpeedUpdated += BeltSorterMerge_OnSpeedUpdated; } base.EndFixPoint_OnSnapped(stranger, e); }
public TwoToOneMerge(TwoToOneMergeInfo info) : base(info) { info.height = info.height * 2; // assembley is placed at height/2 so that it comes out at height ?!!?? twoToOneInfo = info; rhsConveyor = new StraightConveyor(NewStraightInfo()); Add(rhsConveyor); rhsEnd = rhsConveyor.TransportSection.Route.InsertActionPoint(3); lhsConveyor = new StraightConveyor(NewStraightInfo()); Add(lhsConveyor); lhsEnd = lhsConveyor.TransportSection.Route.InsertActionPoint(3); lhsConveyor.EndFixPoint.Enabled = false; //Disable one of the fixpoints so that there is only one that can be fixed to lhsConveyor.EndFixPoint.Visible = false; #region Make it look nice BasicInfo boxInfo = new BasicInfo { length = info.length, width = info.width, height = 0.05f, color = Core.Environment.Scene.DefaultColor }; box = new Cube(boxInfo); Add(box); #endregion lhsEnd.OnEnter += lhsEnd_OnEnter; TwoToOneWidth = info.width; TwoToOneLength = info.length; InternalConvWidth = info.internalConvWidth; UpdateMergeAngles(); lhsConveyor.RouteAvailable = RouteStatuses.Request; //We are setting this to request because the DHDM controls the release of loads from the previous conveyor onto it. rhsConveyor.RouteAvailable = RouteStatuses.Request; //same here ReleaseDelayTimer = new Core.Timer(ReleaseDelayTime); //loads will be only be released when the timer elapses the timer will start when a load transfers ReleaseDelayTimer.OnElapsed += ReleaseDelayTimer_OnElapsed; lhsConveyor.StartFixPoint.OnSnapped += LHSStartFixPoint_OnSnapped; lhsConveyor.StartFixPoint.OnUnSnapped += LHSStartFixPoint_OnUnSnapped; rhsConveyor.StartFixPoint.OnSnapped += RHSStartFixPoint_OnSnapped; rhsConveyor.StartFixPoint.OnUnSnapped += RHSStartFixPoint_OnUnSnapped; rhsConveyor.OnNextRouteStatusAvailableChanged += rhsConveyor_OnNextRouteStatusAvailableChanged; }
bool Release() { if (convsWithALoadToRelease.Count > 0 && rhsConveyor.NextRouteStatus.Available == RouteStatuses.Available) { StraightConveyor conv = convsWithALoadToRelease[0]; convsWithALoadToRelease.Remove(conv); if (rhsConveyor.NextRouteStatus.Available == RouteStatuses.Available) { ((StraightConveyor)conv.NextConveyor).RouteAvailable = RouteStatuses.Available; ReleaseDelayTimer.Start(); return(true); } } return(false); }
public AngledMerge(AngledMergeInfo info) : base(info) { angledMergeInfo = info; StraightConveyorInfo divertSectionInfo = new StraightConveyorInfo() { Length = info.mergeConveyorLength, thickness = info.thickness, Width = info.width, Speed = info.Speed, color = info.color }; mergeSection = new StraightConveyor(divertSectionInfo); mergeSection.endLine.Visible = false; mergeSection.EndFixPoint.Enabled = false; mergeSection.EndFixPoint.Visible = false; Add(mergeSection); TransportSection.Route.InsertActionPoint(apStraight); TransportSection.Route.InsertActionPoint(apEnd, Length); apEnd.Edge = ActionPoint.Edges.Trailing; mergeSection.TransportSection.Route.InsertActionPoint(apMerge, info.mergeConveyorLength); apMerge.OnEnter += apMerge_OnEnter; apStraight.OnEnter += apStraight_OnEnter; apEnd.OnEnter += apEnd_OnEnter; mergeSection.StartFixPoint.OnSnapped += MergeSectionStartFixPoint_OnSnapped; mergeSection.StartFixPoint.OnUnSnapped += MergeSectionStartFixPoint_OnUnSnapped; MergeAngle = info.mergeAngle; Length = info.length; MergeConveyorOffset = info.mergeConveyorOffset; MergeWidth = info.mergeWidth; //ReleaseTimer.OnElapsed += ReleaseTimer_OnElapsed; TransportSection.Route.OnLoadRemoved += Route_OnLoadRemoved; mergeSection.TransportSection.Route.OnLoadRemoved += Route_OnLoadRemoved; UpdateConveyor(); }
private void SetNextDivertRouteStatus(bool value) { if (value) { IRouteStatus afterNextConv = divertSection.NextConveyor; if (afterNextConv is StraightConveyor) { StraightConveyor straight = afterNextConv as StraightConveyor; NextDivertRouteStatus = straight.NextConveyor.GetRouteStatus(divertSection.EndFixPoint.Attached); } else if (afterNextConv is CurveConveyor) { CurveConveyor curve = afterNextConv as CurveConveyor; NextDivertRouteStatus = curve.NextConveyor.GetRouteStatus(divertSection.EndFixPoint.Attached); } } else { NextDivertRouteStatus = divertSection.NextConveyor.GetRouteStatus(divertSection.EndFixPoint.Attached); } }
DivertRoute SelectedRoute; //used to rember the last route that a load was sent to when using local control public AngledDivert(AngledDivertInfo info) : base(info) { angledDivertInfo = info; StraightConveyorInfo divertSectionInfo = new StraightConveyorInfo() { Length = info.DivertConveyorLength, thickness = info.thickness, Width = info.width, Speed = info.divertSpeed, color = info.color }; divertSection = new StraightConveyor(divertSectionInfo); divertSection.startLine.Visible = false; divertSection.StartFixPoint.Visible = false; divertSection.StartFixPoint.Enabled = false; divertSection.EndFixPoint.OnSnapped += DivertSectionEndFixPoint_OnSnapped; divertSection.EndFixPoint.OnUnSnapped += DivertSectionEndFixPoint_OnUnSnapped; Add(divertSection); DivertAngle = info.divertAngle; TransportSection.Route.InsertActionPoint(apStraight); divertSection.TransportSection.Route.InsertActionPoint(apDivert, 0); apStraight.OnEnter += apStraight_OnEnter; ReleaseDelayTimer.OnElapsed += ReleaseDelayTimer_OnElapsed; RouteAvailable = RouteStatuses.Request; DivertConveyorOffset = info.DivertConveyorOffset; if (beltControl.LineReleasePhotocell != null) { beltControl.LineReleasePhotocell.Dispose(); } UpdateConveyor(); }
public DivertTransferPlate(DivertTransferPlateInfo info) : base(info) { divertTransferPlateInfo = info; arrow.Visible = false; //Don't show the straight arrow EndFixPoint.Visible = false; //Loads can only transfer, they cannot go straight endLine.Visible = false; StraightConveyorInfo divertSectionInfo = new StraightConveyorInfo() { Length = Width / 2, thickness = info.thickness, Width = info.width, Speed = info.Speed }; divertSection = new StraightConveyor(divertSectionInfo); divertSection.startLine.Visible = false; divertSection.StartFixPoint.Visible = false; divertSection.StartFixPoint.Enabled = false; divertSection.Color = Core.Environment.Scene.DefaultColor; divertSection.EndFixPoint.Visible = false; divertSection.EndFixPoint.Enabled = false; DivertEndFixPoint = new FixPoint(FixPoint.Types.End, this); Add(DivertEndFixPoint); DivertEndFixPoint.Route = divertSection.TransportSection.Route; DivertEndFixPoint.OnSnapped += DivertSection_EndFixPoint_OnSnapped; DivertEndFixPoint.OnUnSnapped += DivertSection_EndFixPoint_OnUnSnapped; Add(divertSection); TransportSection.Route.InsertActionPoint(apStraight); divertSection.TransportSection.Route.InsertActionPoint(apDivert, 0); apStraight.OnEnter += apStraight_OnEnter; UpdateConveyor(); }
/// <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; }
public PickDoubleLift(PickDoubleLiftInfo info) : base(info) { pickDoubleLiftInfo = info; liftConveyor = new StraightConveyor(NewStraightInfo(info)); Add(liftConveyor); liftConveyor.ConveyorWidth = CaseConveyorWidth._500mm; liftConveyor.StartFixPoint.Visible = false; liftConveyor.EndFixPoint.Visible = false; liftConveyor.arrow.Visible = false; liftConveyor.LocalPosition = new Microsoft.DirectX.Vector3(liftConveyor.LocalPosition.X - 0.375f, liftConveyor.LocalPosition.Y + 0.5f, liftConveyor.LocalPosition.Z); liftConveyor.TransportSection.Route.Motor.Stop(); feed = TransportSection.Route.InsertActionPoint(0.375f); lower1 = TransportSection.Route.InsertActionPoint(1.125f); lower2 = TransportSection.Route.InsertActionPoint(1.875f); end = TransportSection.Route.InsertActionPoint(Length); upper1 = liftConveyor.TransportSection.Route.InsertActionPoint(0.375f); upper2 = liftConveyor.TransportSection.Route.InsertActionPoint(1.125f); feed.OnEnter += Feed_OnEnter; lower1.OnEnter += Lower1_OnEnter; lower2.OnEnter += Lower2_OnEnter; upper1.OnEnter += Upper1_OnEnter; upper2.OnEnter += Upper2_OnEnter; end.OnEnter += End_OnEnter; feed.Visible = true; lower1.Visible = true; lower2.Visible = true; upper1.Visible = true; upper2.Visible = true; OnNextRouteStatusAvailableChanged += PickDoubleLift_OnNextRouteStatusAvailableChanged; }
public MiniloadPickStation(MiniloadPickStationInfo info) : base(info) { miniloadPickStationInfo = info; StraightConveyorInfo feedSectionInfo = new StraightConveyorInfo() { Length = Width / 2, thickness = info.thickness, Width = info.width, Speed = info.Speed }; feedSection = new StraightConveyor(feedSectionInfo); feedSection.endLine.Visible = false; feedSection.EndFixPoint.Enabled = false; feedSection.EndFixPoint.Visible = false; feedSection.Color = this.Color; feedSection.TransportSection.Visible = false; StraightConveyorInfo reverseSectionInfo = new StraightConveyorInfo() { Length = Width / 2, thickness = info.thickness, Width = info.width, Speed = info.Speed }; reverseSection = new StraightConveyor(reverseSectionInfo); reverseSection.endLine.Visible = false; reverseSection.startLine.Visible = false; reverseSection.EndFixPoint.Enabled = false; reverseSection.EndFixPoint.Visible = false; reverseSection.StartFixPoint.Enabled = false; reverseSection.StartFixPoint.Visible = false; reverseSection.Color = this.Color; reverseSection.TransportSection.Visible = false; reverseSection.arrow.Visible = false; Add(feedSection); Add(reverseSection); TransportSection.Route.InsertActionPoint(apEnter); TransportSection.Route.InsertActionPoint(apHold, 0); feedSection.TransportSection.Route.InsertActionPoint(apFeed, feedSection.Length); reverseSection.TransportSection.Route.InsertActionPoint(apRevStart, 0); reverseSection.TransportSection.Route.InsertActionPoint(apRevEnd, reverseSection.Length); apFeed.OnEnter += apFeed_OnEnter; apEnter.OnEnter += apEnter_OnEnter; apHold.OnEnter += apHold_OnEnter; apRevEnd.OnEnter += apRevEnd_OnEnter; feedSection.StartFixPoint.OnSnapped += FeedSectionStartFixPoint_OnSnapped; feedSection.StartFixPoint.OnUnSnapped += FeedSectionStartFixPoint_OnUnSnapped; Length = info.length; feedSection.Width = (float)info.feedWidth / 1000; Speed = info.conveyorSpeed; reverseSection.Speed = info.conveyorSpeed; SingleTimer = new Timer(info.singleTimeout); SingleTimer.OnElapsed += SingleTimer_OnElapsed; UpdateConveyor(); }
public Transfer(TransferInfo info) : base(info) { transferInfo = info; info.height = info.height * 2; // assembley is placed at height/2 so that it comes out at height ?!!?? rightLeftCrossover = new StraightTransportSection(info.color, 1, convThickness, 0.25f); leftRightCrossover = new StraightTransportSection(info.color, 1, convThickness, 0.25f); rightLeftCrossover.Route.Arrow.Visible = false; leftRightCrossover.Route.Arrow.Visible = false; if (transferInfo.type == TransferType.TwoWay) { rightLeftCrossover.Route.Motor.Speed = DivertSpeed; leftRightCrossover.Route.Motor.Speed = DivertSpeed; } else if (transferInfo.type == TransferType.DHDM) { rightLeftCrossover.Route.Motor.Speed = DHDMSpeed; leftRightCrossover.Route.Motor.Speed = DHDMSpeed; } Add(rightLeftCrossover); Add(leftRightCrossover); rhsConveyor = new StraightConveyor(NewStraightInfo(info)); lhsConveyor = new StraightConveyor(NewStraightInfo(info)); rhsConveyor.Name = "rhs"; lhsConveyor.Name = "lhs"; if (transferInfo.type == TransferType.TwoWay) { crossoverOffset = info.length / 2; } Add(rhsConveyor); Add(lhsConveyor); lhsConveyor.StartFixPoint.OnSnapped += lhsStartFixPoint_OnSnapped; lhsConveyor.StartFixPoint.OnUnSnapped += lhsStartFixPoint_OnUnSnapped; lhsConveyor.OnNextRouteStatusAvailableChanged += lhsConveyor_OnNextRouteStatusAvailableChanged; lhsConveyor.EndFixPoint.OnSnapped += lhsEndFixPoint_OnSnapped; rhsConveyor.StartFixPoint.OnSnapped += rhsStartFixPoint_OnSnapped; rhsConveyor.StartFixPoint.OnUnSnapped += rhsStartFixPoint_OnUnSnapped; rhsConveyor.OnNextRouteStatusAvailableChanged += rhsConveyor_OnNextRouteStatusAvailableChanged; rhsConveyor.EndFixPoint.OnSnapped += rhsEndFixPoint_OnSnapped; lhsConveyor.RouteAvailable = RouteStatuses.Request; //We are setting this to request because the DHDM controls the release of loads from the previous conveyor onto it. rhsConveyor.RouteAvailable = RouteStatuses.Request; //same here rhsStartAP = rhsConveyor.TransportSection.Route.InsertActionPoint(crossoverOffset); lhsStartAP = lhsConveyor.TransportSection.Route.InsertActionPoint(crossoverOffset); rhsEndAP = rhsConveyor.TransportSection.Route.InsertActionPoint(DHDMLength - crossoverOffset); lhsEndAP = lhsConveyor.TransportSection.Route.InsertActionPoint(DHDMLength - crossoverOffset); rightToLeftStartAP = rightLeftCrossover.Route.InsertActionPoint(0); leftToRightStartAP = leftRightCrossover.Route.InsertActionPoint(0); rightToLeftEndAP = rightLeftCrossover.Route.InsertActionPoint(0); //Should be placed at the end this is done in UpdateCrossoverSectionAngles when we know the correct length of the crossover sections leftToRightEndAP = leftRightCrossover.Route.InsertActionPoint(0); //Should be placed at the end this is done in UpdateCrossoverSectionAngles when we know the correct length of the crossover sections rhsStartAP.OnEnter += rhsStartAP_OnEnter; lhsStartAP.OnEnter += lhsStartAP_OnEnter; rhsEndAP.OnEnter += rhsEndAP_OnEnter; lhsEndAP.OnEnter += lhsEndAP_OnEnter; rightToLeftEndAP.OnEnter += rightToLeftEndAP_OnEnter; leftToRightEndAP.OnEnter += leftToRightEndAP_OnEnter; DHDMWidth = info.width; //This will adjust the crossover conveyors so that the corossover angles are correct DHDMLength = info.length; InternalConvWidth = info.internalConvWidth; ReleaseDelayTimer = new Core.Timer(ReleaseDelayTimeStraight); //loads will be only be released when the timer elapses the timer will start when a load transfers ReleaseDelayTimer.OnElapsed += ReleaseDelayTimer_Elapsed; ReleaseDelayTimer.AutoReset = false; Core.Environment.Scene.OnLoaded += Scene_OnLoaded; ControllerProperties = StandardCase.SetMHEControl(info, this); }
private void PreviousLoadWaitingStatus_OnLoadWaitingChanged(object sender, LoadWaitingChangedEventArgs e, StraightConveyor conv, Side arrivalConveyor, Side defaultDirection) { if (e._loadWaiting) { if (!mergeQueue.Contains(arrivalConveyor)) { mergeQueue.Add(arrivalConveyor); } if (!ReleaseDelayTimer.Running) { TransferArrivalArgs transferArrivalArgs = new TransferArrivalArgs(arrivalConveyor, e._waitingLoad, defaultDirection); if (ControlType == ControlTypes.Controller && OnArrivedAtTransferController != null) { OnArrivedAtTransferController(this, transferArrivalArgs); } else if (ControlType == ControlTypes.Project_Script && OnArrivedAtTransferRoutingScript != null) { OnArrivedAtTransferRoutingScript(this, transferArrivalArgs); } else if (ControlType == ControlTypes.Local) { //RouteLoad(side, conv, e._waitingLoad); } } } else if (e._loadDeleted) { //var v = convsWithALoadToRelease.Find(x => x.ConvWithLoad.Name == conv.Name); //convsWithALoadToRelease.Remove(v); mergeQueue.Remove(defaultDirection); } if (!e._loadWaiting) { conv.RouteAvailable = RouteStatuses.Request; Case_Load cLoad = e._waitingLoad as Case_Load; } }
public MiniloadDropStation(MiniloadDropStationInfo info) : base(info) { miniloadDropStationInfo = info; StraightConveyorInfo receiveSectionInfo = new StraightConveyorInfo() { Length = Width / 2, thickness = info.thickness, Width = info.width, Speed = info.Speed }; releaseSection = new StraightConveyor(receiveSectionInfo); releaseSection.startLine.Visible = false; releaseSection.StartFixPoint.Enabled = false; releaseSection.StartFixPoint.Visible = false; releaseSection.Color = this.Color; releaseSection.TransportSection.Visible = false; StraightConveyorInfo reverseSectionInfo = new StraightConveyorInfo() { Length = Width / 2, thickness = info.thickness, Width = info.width, Speed = info.Speed }; reverseSection = new StraightConveyor(reverseSectionInfo); reverseSection.endLine.Visible = false; reverseSection.startLine.Visible = false; reverseSection.EndFixPoint.Enabled = false; reverseSection.EndFixPoint.Visible = false; reverseSection.StartFixPoint.Enabled = false; reverseSection.StartFixPoint.Visible = false; reverseSection.Color = this.Color; reverseSection.TransportSection.Visible = false; reverseSection.arrow.Visible = false; Add(releaseSection); Add(reverseSection); TransportSection.Route.InsertActionPoint(apEnter); TransportSection.Route.InsertActionPoint(apHold, 0); releaseSection.TransportSection.Route.InsertActionPoint(apRelStart, 0); releaseSection.TransportSection.Route.InsertActionPoint(apRelEnd, releaseSection.Length); reverseSection.TransportSection.Route.InsertActionPoint(apRevStart, 0); reverseSection.TransportSection.Route.InsertActionPoint(apRevEnd, reverseSection.Length); apRelEnd.Edge = ActionPoint.Edges.Trailing; apRelStart.OnEnter += apRelStart_OnEnter; apRelEnd.OnEnter += apRelEnd_OnEnter; apEnter.OnEnter += apEnter_OnEnter; apHold.OnEnter += apHold_OnEnter; apRevEnd.OnEnter += apRevEnd_OnEnter; releaseSection.EndFixPoint.OnSnapped += ReleaseSectionStartFixPoint_OnSnapped; releaseSection.EndFixPoint.OnUnSnapped += ReleaseSectionStartFixPoint_OnUnSnapped; Length = info.length; releaseSection.Width = (float)info.receiveWidth / 1000; Speed = info.conveyorSpeed; reverseSection.Speed = info.conveyorSpeed; UpdateConveyor(); }