public void UpDateLoadParameters(string[] telegramFields, IATCLoadType load, string index = "") { load.TUType = telegramFields.GetFieldValue(TelegramFields.tuType, index); load.Source = telegramFields.GetFieldValue(TelegramFields.source, index); load.Destination = telegramFields.GetFieldValue(TelegramFields.destination, index); load.PresetStateCode = telegramFields.GetFieldValue(TelegramFields.presetStateCode, index); Color c = LoadColor(telegramFields.GetFieldValue(TelegramFields.color, index)); if (c != DefaultLoadColour) { if (load is IATCCaseLoadType) { load.Color = c; } else if (load is IATCPalletLoadType) { ATCEuroPallet palletLoad = load as ATCEuroPallet; palletLoad.LoadColor = c; } } float weight; float.TryParse(telegramFields.GetFieldValue(TelegramFields.weight), out weight); load.Weight = weight; }
private void PalletStraight_OnLoadArrived(object sender, LoadArrivedEventArgs e) { IATCLoadType palletLoad = e._Load as IATCLoadType; if (palletLoad == null) { return; } palletLoad.Location = palletStraight.Name; //Update the palletLoad location switch (PalletStraightType) { case PalletStraightATCInfo.PalletStraightATCTypes.None: break; case PalletStraightATCInfo.PalletStraightATCTypes.LocationArrived: LocationArrived(palletStraight, palletLoad); break; case PalletStraightATCInfo.PalletStraightATCTypes.LocationLeft: LocationLeft(palletStraight, palletLoad); break; case PalletStraightATCInfo.PalletStraightATCTypes.TransportRequest: TransportRequest(palletStraight, palletLoad); break; case PalletStraightATCInfo.PalletStraightATCTypes.TransportFinished: TransportFinished(palletStraight, palletLoad); break; case PalletStraightATCInfo.PalletStraightATCTypes.TransportRequestOrFinished: TransportRequestOrFinished(palletStraight, palletLoad); break; default: break; } palletStraight.ReleaseLoad(e._Load); }
private void SendLocationLeftTelegram(Experior.Dematic.Base.EuroPallet palletLoad, string Location) { IATCLoadType atcLoad = palletLoad as IATCLoadType; atcLoad.Location = Location; palletPLC.SendLocationLeftTelegram(palletLoad as IATCLoadType); }
private void LocationLeft(PalletStraight palletStraight, IATCLoadType palletLoad) { if (AlwaysArrival || palletLoad.Location == palletLoad.Destination) { palletLoad.Location = palletStraight.Name; palletPLC.SendLocationLeftTelegram(palletLoad); // Should we not use the base IATCLoadType for this? } }
public string CreateTelegramFromLoad(TelegramTypes telegramType, IATCLoadType load) { List <TelegramFields> fieldList = Telegrams.TelegramSignatures[telegramType]; string telegram = string.Empty.InsertType(telegramType); foreach (TelegramFields tf in fieldList) { telegram = telegram.AppendField(tf, load.GetPropertyValueFromEnum(tf)); } if (fieldList.Contains(TelegramFields.mts)) { telegram = telegram.SetFieldValue(TelegramFields.mts, this.Name); } if (fieldList.Contains(TelegramFields.stateCode)) { telegram = telegram.SetFieldValue(TelegramFields.stateCode, load.PresetStateCode); } //If the PLC has further additional telegram fields but they are not on the load yet they need to be added if (ProjectFields.Count > 0) { Dictionary <string, string> loadProjectFields = new Dictionary <string, string>(); foreach (string field in ProjectFields) { if (load.ProjectFields.Keys.Contains(field)) { //Field already exists copy into new version loadProjectFields.Add(field, load.ProjectFields[field]); } else { loadProjectFields.Add(field, ""); } } if (loadProjectFields.Count > 0) { load.ProjectFields = loadProjectFields; } } foreach (string field in load.ProjectFields.Keys) { if (telegram.Contains(string.Format(",{0}='", field))) { telegram = telegram.SetFieldValue(field, load.ProjectFields[field]); } else { telegram = telegram.AppendField(field, load.ProjectFields[field]); } } return(telegram + "#"); }
private int GetDepth(string[] telegramFields, IATCLoadType load) { string missionTuIdent = telegramFields.GetFieldValue(TelegramFields.tuIdent); if (missionTuIdent == load.TUIdent) { return(GetDepth(telegramFields.GetFieldValue(TelegramFields.destination))); } return(0); }
/// <summary> /// Returns the side that a load is to be dropped off at, can only be used with a multiple message as it is looking into the destination arrays /// </summary> /// <param name="telegramFields">MultipleStartTransportTelegram</param> /// <param name="load">The load to be checked</param> /// <returns>Side that the load is to be dropped off at</returns> private Side?GetSide(string[] telegramFields, IATCLoadType load) { string missionTuIdent = telegramFields.GetFieldValue(TelegramFields.tuIdent); if (missionTuIdent == load.TUIdent) { return(GetSide(telegramFields.GetFieldValue(TelegramFields.destination))); } return(null); }
private void LocationArrived(PalletStraight palletStraight, IATCLoadType palletLoad) { if (AlwaysArrival || palletLoad.Location == palletLoad.Destination) { palletLoad.Location = palletStraight.Name; palletPLC.SendLocationArrivedTelegram(palletLoad); if (LoadWait) { palletLoad.LoadWaitingForWCS = true; } } }
//TODO: For the loads that are stopping on the case conveyor at these communication points it //has to be placed in the correct position otherwise its can be an issue (I have found that placing //them in exactly the correct place compaired to a accumulation sensor is a good position as all atction point are triggered private void TransportRequest(PalletStraight palletStraight, IATCLoadType palletLoad) { if (AlwaysArrival || palletLoad.Location == palletLoad.Destination || string.IsNullOrEmpty(palletLoad.Destination)) { palletLoad.Location = palletStraight.Name; palletPLC.SendTransportRequestTelegram(palletLoad); if (LoadWait) { palletLoad.LoadWaitingForWCS = true; } } }
private void TransportRequestOrFinished(PalletStraight palletStraight, IATCLoadType palletLoad) { if (palletLoad.Location == palletLoad.Destination) { //Send TransportFinishedTelegram palletLoad.Location = palletStraight.Name; palletPLC.SendTransportFinishedTelegram(palletLoad); } else { //Send TransportRequestTelegram palletLoad.Location = palletStraight.Name; palletPLC.SendTransportRequestTelegram(palletLoad); } if (LoadWait) { palletLoad.LoadWaitingForWCS = true; } }
public void SendTransportRequestTelegram(IATCLoadType load) { string telegram = CreateTelegramFromLoad(TelegramTypes.TransportRequestTelegram, load); SendTelegram(telegram, true); }
public void SendLocationArrivedTelegram(IATCLoadType load) { string telegram = CreateTelegramFromLoad(TelegramTypes.LocationArrivedTelegram, load); SendTelegram(telegram, true); }