public void sensor_OnEnter1(DematicSensor sender, Load load) { SetDropStationOccupiedStatus(); Case_Load caseLoad = load as Case_Load; if (TransportSection.Route.Loads.Count == 2) { string id = TransportSection.Route.Loads.ToList()[0].Identification; if (id != load.Identification) { ((Case_Load)load).UserData = id + "," + load.Identification; } else { ((Case_Load)load).UserData = load.Identification + "," + id; } ParentMultishuttle.ArrivedAtDropStationConvPosB(new PickDropStationArrivalEventArgs(Location2.LocName, (Case_Load)load, Elevator, 2)); } else { ParentMultishuttle.ArrivedAtDropStationConvPosB(new PickDropStationArrivalEventArgs(Location1.LocName, (Case_Load)load, Elevator, 1)); } }
private void DeleteTelegramRecieved(string[] telegramFields, string subtype) { if (subtype == "W001" || subtype == "W002" || subtype == "W004") { //Delete tote message from wcs string location = telegramFields[2]; string totebarcode = telegramFields[1]; Case_Load caseload = Case_Load.GetCaseFromSSCCBarcode(totebarcode); if (caseload != null && caseload.Deletable && caseload.UserDeletable) { caseload.Dispose(); //Core.Environment.Log.Write("Case load deleted, Barcode: " + totebarcode); } else { Core.Environment.Log.Write("Could not delete case load barcode: " + totebarcode); if (caseload == null) { Core.Environment.Log.Write("Case load not found, barcode: " + totebarcode); } else { Core.Environment.Log.Write("Case load not ready to be deleted, barcode: " + totebarcode); } } } }
void divertConveyor_OnDivertPointDivertedControl(object sender, AngleDivertArgs e) { Case_Load caseLoad = e._load as Case_Load; if (e._direction != selectedRoute && !string.IsNullOrEmpty(FailedToDivertLocation)) { //Send failed to divert message if (FailedToDivertMessageType == FailedMessageType._02) { casePLC.SendDivertConfirmation(FailedToDivertLocation, caseLoad.SSCCBarcode); } else if (FailedToDivertMessageType == FailedMessageType._06) { string body = string.Format("{0},{1},{2}", caseLoad.SSCCBarcode, FailedToDivertLocation, FailedToDivertMessageReasonCode); casePLC.SendTelegram("06", body, 1, true); } } else if (e._direction == DivertRoute.Divert && !string.IsNullOrEmpty(DivertRoutingLocation)) { //Send Diverted message casePLC.SendDivertConfirmation(DivertRoutingLocation, caseLoad.SSCCBarcode); } else if (e._direction == DivertRoute.Straight && !string.IsNullOrEmpty(StraightRoutingLocation)) { //Send Diverted straight message casePLC.SendDivertConfirmation(StraightRoutingLocation, caseLoad.SSCCBarcode); } }
public StraightConveyor GetSourceConvOfLoad(Case_Load load, bool UseOtherLoad) { if (load == null || !RelevantElevatorTask(load)) { return(null); } if (!UseOtherLoad) { if (load.Identification == this.LoadA_ID) { return(SourceLoadAConv); } return(SourceLoadBConv); } else //get the conveyor of the other load to pick up { if (load.Identification == this.LoadA_ID) { return(SourceLoadBConv); } } return(SourceLoadAConv); }
public PickDropStationArrivalEventArgs(string locationName, Case_Load caseLoad, Elevator elevator, int NumberOfLoads) { _locationName = locationName; _caseLoad = caseLoad; _elevator = elevator; _numberOfLoads = NumberOfLoads; }
void theMultishuttle_OnArrivedAtDropStationConvPosB(object sender, PickDropStationArrivalEventArgs e) { if (e._numberOfLoads == 2 && e._elevator.ElevatorConveyor.Route.Loads.Count == 0) { string[] ulIDs = ((CaseData)e._caseLoad.Case_Data).UserData.Split(','); Case_Load loadA = Case_Load.GetCaseFromIdentification(ulIDs[0]); Case_Load loadB = Case_Load.GetCaseFromIdentification(ulIDs[1]); ((CaseData)loadA.Case_Data).CurrentPosition = string.Format("D{0}{1}{2}002{3}", e._locationName.AisleNumber().ToString().PadLeft(2, '0'), theMultishuttle.ElevatorGroup(e._locationName), (char)e._locationName.Side(), e._locationName.Level()); ((CaseData)loadB.Case_Data).CurrentPosition = string.Format("D{0}{1}{2}001{3}", e._locationName.AisleNumber().ToString().PadLeft(2, '0'), theMultishuttle.ElevatorGroup(e._locationName), (char)e._locationName.Side(), e._locationName.Level()); string bodyA = mheController_Multishuttle.CreateMissionDataSetBody((CaseData)loadA.Case_Data); string bodyB = mheController_Multishuttle.CreateMissionDataSetBody((CaseData)loadB.Case_Data); mheController_Multishuttle.SendTelegram("02", bodyB + "," + bodyA, 2); TryGetNewElevatorTask(e._elevator.CurrentTask, loadA, loadB); } }
public string CreatePickStationDataSetBody(Case_Load caseload2, Case_Load caseload1) { string body = ""; PickStationConveyor pSC = ((PickStationConveyor)caseload2.CurrentActionPoint.Parent.Parent.Parent); string PickStation = string.Format("P{0}{1}{2}002{3}", pSC.LocationA.LocName.AisleNumber().ToString().PadLeft(2, '0'), pSC.Elevator.GroupName, (char)pSC.LocationA.LocName.Side(), pSC.Name.Substring(4, 2)); if (caseload1 == null) { body = string.Format("{0},,{1},{2},,,", PickStation, caseload2.SSCCBarcode, "00"); //(caseload2.Height * 1000).ToString()); } else { body = string.Format("{0},,{1},{2},,{3},{4}", PickStation, caseload2.SSCCBarcode, //(caseload2.Height * 1000).ToString(), "00", caseload1.SSCCBarcode, // (caseload1.Height * 1000).ToString()); "00"); } return(body); }
public Case_Load CreateCaseLoad(BaseCaseData caseData) { MeshInfo boxInfo = new MeshInfo() { color = caseData.colour, filename = Case_Load.GraphicsMesh, length = caseData.Length, width = caseData.Width, height = caseData.Height }; Case_Load load = new Case_Load(boxInfo); CaseData DatComData = caseData as CaseData; if (DatComData == null) { Log.Write("ERROR: Bad cast to CaseData in CreateCaseLoad", Color.Red); return(null); } load.Weight = caseData.Weight; load.Identification = DatComData.ULID; load.Case_Data = DatComData; return(load); }
public virtual Case_Load CreateCaseLoad(BaseCaseData caseData) { MeshInfo boxInfo = new MeshInfo() { color = caseData.colour, filename = Case_Load.GraphicsMesh, length = caseData.Length, width = caseData.Width, height = caseData.Height }; Case_Load load = new Case_Load(boxInfo); DCICaseData caseDataDCi = caseData as DCICaseData; if (caseDataDCi == null) { Log.Write("ERROR: Bad cast to DCICaseData in CreateCaseLoad", Color.Red); return(null); } load.Weight = caseData.Weight; load.Identification = caseDataDCi.TUIdent; load.SSCCBarcode = caseDataDCi.TUIdent; load.Case_Data = caseData; return(load); }
/// <summary> /// Create transport telegrams only from load, do not use for any other type of telegram /// </summary> /// <param name="telegramType"></param> /// <param name="load"></param> /// <returns></returns> public string CreateTelegramFromLoad(TelegramTypes telegramType, Case_Load load) { string telegram = Template.CreateTelegram(this, telegramType); DCICaseData caseData = load.Case_Data as DCICaseData; //Populate the correct field values telegram = telegram.SetFieldValue(this, TelegramFields.Source, caseData.Source); telegram = telegram.SetFieldValue(this, TelegramFields.Current, caseData.Current); telegram = telegram.SetFieldValue(this, TelegramFields.Destination, caseData.Destination); telegram = telegram.SetFieldValue(this, TelegramFields.TUIdent, load.Identification); telegram = telegram.SetFieldValue(this, TelegramFields.TUType, caseData.TUType); telegram = telegram.SetFieldValue(this, TelegramFields.TULength, (caseData.Length * 1000).ToString("0000")); telegram = telegram.SetFieldValue(this, TelegramFields.TUWidth, (caseData.Width * 1000).ToString("0000")); telegram = telegram.SetFieldValue(this, TelegramFields.TUHeight, (caseData.Height * 1000).ToString("0000")); telegram = telegram.SetFieldValue(this, TelegramFields.TUWeight, (caseData.Weight * 1000).ToString("000000")); telegram = telegram.SetFieldValue(this, TelegramFields.EventCode, caseData.EventCode); telegram = telegram.SetFieldValue(this, TelegramFields.DropIndex, caseData.DropIndex.ToString()); telegram = telegram.SetFieldValue(this, TelegramFields.ShuttleDynamics, caseData.ShuttleDynamics); telegram = telegram.SetFieldValue(this, TelegramFields.LiftDynamics, caseData.LiftDynamics); telegram = telegram.SetFieldValue(this, TelegramFields.SourceShuttleExtension, caseData.SourceShuttleExtension); telegram = telegram.SetFieldValue(this, TelegramFields.DestinationShuttleExtension, caseData.DestinationShuttleExtension); if (DCIVersion == DCIVersions._1_60) { telegram = telegram.SetFieldValue(this, TelegramFields.CaseConveyorDynamics, caseData.CaseConveyorDynamics); } return(telegram); }
public void UpDateLoadParameters(string telegram, Case_Load load, int blockPosition = 0) { int dropIndex = 0; int.TryParse(telegram.GetFieldValue(this, TelegramFields.DropIndex, blockPosition), out dropIndex); DCICaseData caseData = load.Case_Data as DCICaseData; load.Identification = telegram.GetFieldValue(this, TelegramFields.TUIdent, blockPosition); caseData.TUIdent = telegram.GetFieldValue(this, TelegramFields.TUIdent, blockPosition); caseData.TUType = telegram.GetFieldValue(this, TelegramFields.TUType, blockPosition); caseData.Source = telegram.GetFieldValue(this, TelegramFields.Source, blockPosition); caseData.Current = telegram.GetFieldValue(this, TelegramFields.Current, blockPosition); caseData.Destination = telegram.GetFieldValue(this, TelegramFields.Destination, blockPosition); caseData.EventCode = telegram.GetFieldValue(this, TelegramFields.EventCode, blockPosition); caseData.DropIndex = dropIndex; caseData.ShuttleDynamics = telegram.GetFieldValue(this, TelegramFields.ShuttleDynamics, blockPosition); caseData.LiftDynamics = telegram.GetFieldValue(this, TelegramFields.LiftDynamics, blockPosition); caseData.SourceShuttleExtension = telegram.GetFieldValue(this, TelegramFields.SourceShuttleExtension, blockPosition); caseData.DestinationShuttleExtension = telegram.GetFieldValue(this, TelegramFields.DestinationShuttleExtension, blockPosition); caseData.CaseConveyorDynamics = telegram.GetFieldValue(this, TelegramFields.CaseConveyorDynamics, blockPosition); float weight; float.TryParse(telegram.GetFieldValue(this, TelegramFields.TUWeight), out weight); load.Weight = weight; }
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); }
void removeFromRoutingTable(Case_Load caseLoad) { if (RemoveFromRoutingTable && casePLC.RoutingTable.ContainsKey(caseLoad.SSCCBarcode.TrimStart('0'))) { casePLC.RoutingTable.Remove(caseLoad.SSCCBarcode.TrimStart('0')); } }
private void CreateTransferVector(Case_Load boxLoad, out float timeToTransfer, out Vector3 transferVector) { if ((CurrentTask.Source.Side() == RackSide.Right && !ParentMS.SwitchSides) || (CurrentTask.Source.Side() == RackSide.Left && ParentMS.SwitchSides)) { rackLoc = -shuttleAP_Zpos; } else { rackLoc = shuttleAP_Zpos; } int loadDepth = CurrentTask.Destination.LoadDepth(); //Get the depth in the rack timeToTransfer = ParentMS.TimeToPos1; if (loadDepth == -1) //-1 = IA = Inter Aisle Transfer { timeToTransfer = ParentMS.TimeToPos1 + ParentMS.TimeToPos2; rackLoc = rackLoc * 3; //dropoff into the other aisle } else if (loadDepth == 2) { rackLoc = rackLoc * 2; timeToTransfer = ParentMS.TimeToPos2; } Vector3 direction = Trigonometry.DirectionYaw(Trigonometry.Yaw(boxLoad.Route.Orientation)); transferVector = Trigonometry.CrossProduct(direction, new Vector3(0, rackLoc, 0)); }
public RackConveyorArrivalEventArgs(string locationName, Case_Load caseLoad, Elevator elevator, RackConveyor rackConveyor, Cycle?unloadcycle) { _locationName = locationName; _caseLoad = caseLoad; _elevator = elevator; _rackConveyor = rackConveyor; _UnloadCycle = unloadcycle; }
public ArrivedOnElevatorEventArgs(Task task, Case_Load loadA, Case_Load loadB, Elevator elevator, string locationName) { _task = task; _loadA = loadA; _loadB = loadB; _elevator = elevator; _locationName = locationName; }
void theTransfer_OnTransferStatusChangedController(object sender, EventArgs e) { //ReleaseDelayTimer on transfer has timed out, or one of the next conveyors routes has become available, //check if there are any loads that can be released if (theTransfer.mergeQueue.Count > 0) //There is something waiting to transfer in { List <Side> priorityQueue = new List <Side>(); if (theTransfer.mergeQueue.Count == 1 || LoadReleasePriority == ReleasePriority.FIFO) { priorityQueue = theTransfer.mergeQueue.ToList(); } else if (LoadReleasePriority == ReleasePriority.Left) { priorityQueue.Add(Side.Left); priorityQueue.Add(Side.Right); } else if (LoadReleasePriority == ReleasePriority.Right) { priorityQueue.Add(Side.Right); priorityQueue.Add(Side.Left); } foreach (Side side in priorityQueue) { Case_Load caseLoad = theTransfer.SideLoadWaitingStatus(side).WaitingLoad as Case_Load; if (caseLoad != null) { bool routeLoadLeft = casePLC.DivertSet(caseLoad.SSCCBarcode, LeftRoutes); bool routeLoadRight = casePLC.DivertSet(caseLoad.SSCCBarcode, RightRoutes); if (routeLoadLeft && theTransfer.RouteAvailable(Side.Left)) { //Load can travel left ReleaseLoad(side, Side.Left, caseLoad); return; } else if (routeLoadRight && theTransfer.RouteAvailable(Side.Right)) { //Load can travel right ReleaseLoad(side, Side.Right, caseLoad); return; } else if ((!routeLoadLeft && !routeLoadRight && ReleaseLoadDefault(side, caseLoad, false)) || ReleaseLoadDefault(side, caseLoad, true)) { return; } } else { Log.Write(string.Format("Error: {0} load null un expected! theTransfer_OnTransferStatusChangedController", side.ToString())); return; } } } }
public override void Reset() { base.Reset(); StartArrow.Color = Color.Green; lastLoad = null; feedTimer.Reset(); if (Enabled) { feedTimer.Start(); } }
private void SendTransportFinishedTelegram(Case_Load caseLoad, string Location, string status) { IATCCaseLoadType atcLoad = caseLoad as IATCCaseLoadType; atcLoad.Location = Location; if (status != null) { atcLoad.PresetStateCode = status; } casePLC.SendTransportFinishedTelegram(caseLoad as IATCCaseLoadType); }
bool releasedRight(Load load) { Case_Load caseLoad = load as Case_Load; if (!loadRoutedFailedToDivert(caseLoad) && !string.IsNullOrEmpty(RightRoutingLocation)) { SendConfirmationTelegram(caseLoad, RightRoutingLocation); } loadReleasedComplete(caseLoad); return(true); }
bool releasedRight(Load load) { Case_Load caseLoad = load as Case_Load; if (!loadRoutedFailedToDivert(caseLoad) && RightRoutingLocation != string.Empty) { casePLC.SendDivertConfirmation(RightRoutingLocation, caseLoad.SSCCBarcode); } loadReleasedComplete(caseLoad); return(true); }
bool loadDeleted(Load load) { Case_Load caseLoad = load as Case_Load; if (casePLC.RoutingTable.ContainsKey(caseLoad.SSCCBarcode.TrimStart('0'))) { casePLC.RoutingTable.Remove(caseLoad.SSCCBarcode.TrimStart('0')); } return(true); }
void theMultishuttle_OnArrivedAtRackLocation(object sender, TaskEventArgs e) { Case_Load caseLoad = (Case_Load)e._load; DCICaseData caseData = caseLoad.Case_Data as DCICaseData; string sendTelegram = controller.CreateTelegramFromLoad(TelegramTypes.TUReport, caseLoad); sendTelegram = sendTelegram.SetFieldValue(controller, TelegramFields.Current, caseData.Destination); sendTelegram = sendTelegram.SetFieldValue(controller, TelegramFields.EventCode, caseData.EventCode); controller.SendTelegram(sendTelegram); }
bool loadDeleted(Load load) //Not used no event at the moment (Don't think we care!!!) { Case_Load caseLoad = load as Case_Load; if (casePLC.RoutingTable.ContainsKey(caseLoad.SSCCBarcode.TrimStart('0'))) { casePLC.RoutingTable.Remove(caseLoad.SSCCBarcode.TrimStart('0')); } return(true); }
bool loadRoutedFailedToDivert(Case_Load caseLoad) { if (mergeDivertConveyor.failedToDivertLoad == caseLoad && FailedToDivertLocation != null) //Load has been routed to Default route so send failed to divert location { casePLC.SendDivertConfirmation(FailedToDivertLocation, caseLoad.SSCCBarcode); return(true); } else { return(false); } }
public virtual Case_Load CreateCaseLoad(TelegramTypes Type, string Telegram, int blockPosition = 0) { Case_Load newLoad = null; string length = Telegram.GetFieldValue(this, TelegramFields.TULength, blockPosition); string width = Telegram.GetFieldValue(this, TelegramFields.TUWidth); string height = Telegram.GetFieldValue(this, TelegramFields.TUHeight); string weight = Telegram.GetFieldValue(this, TelegramFields.TUWeight); //IEmulationController emulation = Core.Assemblies.Assembly.Items.Values.ToList().FirstOrDefault(x => x is IEmulationController) as IEmulationController; newLoad.Case_Data = CreateDCICaseData(Telegram, blockPosition); return(newLoad); }
/// <summary> /// Returns the Destination conveyor of load /// </summary> public StraightConveyor GetDestConvOfLoad(Case_Load load) { if (load == null || !RelevantElevatorTask(load)) { return(null); } if (load.Identification == LoadA_ID) { return(DestinationLoadAConv); } return(DestinationLoadBConv); }
private void ToteArrived(CommunicationPoint commPoint, Case_Load caseload) { if (AlwaysArrival) //Always send arrival message { casePLC.SendDivertConfirmation(location: commPoint.Name, SSCCBarcode: caseload.SSCCBarcode); } else if (!casePLC.RoutingTable.ContainsKey(caseload.SSCCBarcode.TrimStart('0'))) { //Only send arrival message if ULID not found in routing table casePLC.SendDivertConfirmation(location: commPoint.Name, SSCCBarcode: caseload.SSCCBarcode); return; } }
void feedTimer_OnElapsed(Timer sender) { if (lastLoad == null || lastLoad.Distance != DeviceDistance) { //lastLoad = FeedCase.FeedCaseLoad((ITransportSection)conveyor.TransportSection, DeviceDistance); lastLoad = FeedLoad.FeedCaseLoad((ITransportSection)conveyor.TransportSection, DeviceDistance, LoadLength, LoadWidth, LoadHeight, LoadWeight, LoadColour, LoadBarcodeLength, Case_Load.GetCaseControllerCaseData()); StartArrow.Color = Color.Green; } else { StartArrow.Color = Color.Red; } }
/// <summary> /// The first tote to arrive and wait for an elevator sets a timer this timer has either expired or a second tote has arrived /// and stopped the timer triggering this method to be called via the OnFinishedWaitingEvent. /// </summary> /// <param name="load"></param> void Tote_PickStation2TimeOut(Load load) { load.OnFinishedWaitingEvent -= Tote_PickStation2TimeOut; load.Stop(); //InfeedPickStationConveyor ElevatorConveyor = load.CurrentActionPoint.Parent.Parent.Parent as InfeedPickStationConveyor; Case_Load caseload1 = location1.ActiveLoad as Case_Load; Case_Load caseload2 = location2.ActiveLoad as Case_Load; if (caseload1 != null) { caseload1.CurrentPosition = infeedInfo.location1Name; } if (caseload2 != null) { caseload2.CurrentPosition = infeedInfo.location2Name; } if (caseload2.UserData is MultishuttleElevatorJobData) { Core.Environment.Log.Write("Error. caseload2 on pick station already has elevatorjob!", Color.Red); Core.Environment.Scene.Pause(); return; } if (caseload1 != null && caseload1.UserData is MultishuttleElevatorJobData) { Core.Environment.Log.Write("Error. caseload1 on pick station already has elevatorjob!", Color.Red); Core.Environment.Scene.Pause(); return; } if (caseload2.Case_Data.RoutingTableUpdateWait) { Core.Environment.Log.Write("Error. caseload2 on pick station already has WMSWait (25 arrival already sent)! Barcode: " + caseload2.SSCCBarcode, Color.Red); Core.Environment.Scene.Pause(); return; } if (caseload1 != null && caseload1.Case_Data.RoutingTableUpdateWait) { Core.Environment.Log.Write("Error. caseload1 on pick station already has WMSWait (25 arrival already sent)! Barcode: " + caseload1.SSCCBarcode, Color.Red); Core.Environment.Scene.Pause(); return; } //RouteAvailable = Case.AvailableStatus.Blocked; infeedRouteAvailableStatus.Available = AvailableStatus.Blocked; infeedInProgress = true; MultiShuttle.Control.InfeedTimeOut(caseload2, caseload1); }