Пример #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);
            }
        }
Пример #3
0
        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);
            }
        }
Пример #4
0
        /// <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());
            }
        }
Пример #5
0
 public virtual void Scene_OnLoaded()
 {
     constructDevice = new ConstructDevice(Name);
     constructDevice.InsertDevices(this);
     Reset();
 }