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 PalletPhotocell(PalletPhotocellInfo info, BaseTrack conv) : base(info, conv) { PhotocellInfo = info; AssemblyInfo ai = new AssemblyInfo(); conveyor = conv; photocellDisplay = new PalletPhotocellDisplay(new PhotocellDisplayInfo { width = info.width }); photocellDisplay.ListSolutionExplorer = false; photocellDisplay.OnPhotocellDisplayDeleted += photocellDisplay_OnPhotocellDisplayDeleted; Add(photocellDisplay, new Vector3(info.length / 2, 0, 0)); sensor.OnEnter += sensor_OnEnter; sensor.OnLeave += sensor_OnLeave; sensor.Color = Color.Green; sensor.Visible = false; conv.TransportSection.Route.InsertActionPoint(sensor); OnNameChanged += PalletPhotocell_OnNameChanged; }