예제 #1
0
        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);
            }
        }
예제 #2
0
        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);
            }
        }