示例#1
0
        public void UpdateWidth(float width)
        {
            PhotocellInfo.width = width;
            RemoveAssembly(photocellDisplay);  //Easier to recreate graphic as it is just a graphic
            photocellDisplay.deleteFromUser = false;
            photocellDisplay.Dispose();

            photocellDisplay = new PalletPhotocellDisplay(new PhotocellDisplayInfo {
                width = width
            });
            photocellDisplay.ListSolutionExplorer       = false;
            photocellDisplay.OnPhotocellDisplayDeleted += photocellDisplay_OnPhotocellDisplayDeleted;

            Add(photocellDisplay, new Vector3(0, 0, 0));
            DeviceDistance = PhotocellInfo.distance;
        }
示例#2
0
        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;
        }