public StraightPhotocellConveyor(StraightPhotocellConveyorInfo info) : base(info) { try { straightInfo = info; releaseTimer.OnElapsed += ReleaseTimer_OnElapsed; constructDevice = new ConstructDevice(string.Empty); LineReleasePhotocellName = straightInfo.LineReleasePhotocellName; DeviceInfo deviceInfo = DeviceInfos.Find(i => i.name == LineReleasePhotocellName); if (deviceInfo == null) { CasePhotocellInfo photocellInfo = new CasePhotocellInfo(); photocellInfo.name = "LineRelease"; photocellInfo.distanceFrom = PositionPoint.End; photocellInfo.distance = 0.125f; photocellInfo.type = constructDevice.DeviceTypes["Add Photocell"].Item1; //Item1 is the device type ...obviously! DeviceInfos.Add(photocellInfo); } constructDevice.InsertDevices(this as IConstructDevice); SetLineReleasePhotocell(); LineReleaseEvents(true); } catch (Exception ex) { Core.Environment.Log.Write(ex.Message); } }
public PalletStraight(PalletStraightInfo info) : base(info) { try { palletStraightInfo = info; ReleaseTimer.OnElapsed += ReleaseTimer_OnElapsed; ConstructDevice = new ConstructDevice(string.Empty); LineReleasePhotocellName = palletStraightInfo.LineReleasePhotocellName; DeviceInfo deviceInfo = DeviceInfos.Find(i => i.name == LineReleasePhotocellName); if (deviceInfo == null) { PalletPhotocellInfo photocellInfo = new PalletPhotocellInfo(); photocellInfo.name = "LineRelease"; photocellInfo.distanceFrom = PositionPoint.End; photocellInfo.distance = 0.125f; photocellInfo.type = ConstructDevice.DeviceTypes["Add Photocell"].Item1; //Item1 is the device type ...obviously! DeviceInfos.Add(photocellInfo); } ConstructDevice.InsertDevices(this as IConstructDevice); SetLineReleasePhotocell(); LineReleaseEvents(true); if (ControlType == ControlTypes.Local) { OnLoadArrived += Photocell_OnLoadArrived; } } catch (Exception ex) { Core.Environment.Log.Write(ex.Message); } }
public override void Dispose() { Core.Environment.Scene.OnLoaded -= Scene_OnLoaded; constructDevice = null; if (Leaving != null) { Leaving.Dispose(); } if (Entering != null) { Entering.Dispose(); } arrow.Dispose(); if (Assemblies != null) { foreach (Assembly assembly in this.Assemblies) { assembly.Dispose(); } } base.Dispose(); }
public BeltControl(Assembly assembly) { conveyor = assembly as IBeltControl; ReleaseTimer.OnElapsed += ReleaseTimer_OnElapsed; LoadWaitingTimer.OnElapsed += LoadWaitingTimer_OnElapsed; if (!Core.Environment.Scene.Loading) { constructDevice = new ConstructDevice(string.Empty); DeviceInfo deviceInfo = conveyor.DeviceInfos.Find(i => i.name == conveyor.LineReleasePhotocellName); if (deviceInfo == null) { CasePhotocellInfo photocellInfo = new CasePhotocellInfo(); photocellInfo.name = conveyor.LineReleasePhotocellName; photocellInfo.distanceFrom = PositionPoint.End; photocellInfo.distance = 0.125f; photocellInfo.type = constructDevice.DeviceTypes["Add Photocell"].Item1; //Item1 is the device type ...obviously! conveyor.DeviceInfos.Add(photocellInfo); } constructDevice.InsertDevices(conveyor as IConstructDevice); SetLineReleasePhotocell(); LineReleaseEvents(true); } }
public override List <System.Windows.Forms.ToolStripItem> ShowContextMenu() { if (constructDevice == null) { constructDevice = new ConstructDevice(Name); } return(new List <ToolStripItem>(constructDevice.subMnu)); }
public override List <System.Windows.Forms.ToolStripItem> ShowContextMenu() { if (constructDevice == null) // The CommPointCreator type displays a context menu for adding Devices; { constructDevice = new ConstructDevice(Name); //Scene_OnLoaded(); } return(new List <ToolStripItem>(constructDevice.subMnu)); }
/// <summary> ///Conveyor needs to be created before the commpoint creator is made as it contains a reference to the conveyor. ///Also called from ShowContextMenu /// </summary> public virtual void Scene_OnLoaded() { if (TransportSection.Route.Arrow != null) { TransportSection.Route.Arrow.Visible = false; } try { constructDevice = new ConstructDevice(Name); constructDevice.InsertDevices(this); } catch (Exception ex) { Experior.Core.Environment.Log.Write(ex.Message); } if (OnDevicesCreated != null) { OnDevicesCreated(this, new EventArgs()); } }
public virtual void Scene_OnLoaded() { constructDevice = new ConstructDevice(Name); constructDevice.InsertDevices(this); Reset(); }
public void Scene_OnLoaded() { constructDevice = new ConstructDevice(string.Empty); SetLineReleasePhotocell(); }