Exemplo n.º 1
0
 public CarrierSafeCheck(PlatformEx up, PlatformEx down, ICylinderEx downGT, SafeCheckType target)
 {
     Target = target;
     Up     = up;
     Down   = down;
     DownGT = downGT;
 }
Exemplo n.º 2
0
        public override bool Check(PlatformEx up, int i)
        {
            switch (Target)
            {
            case SafeCheckType.ManualHome:
            case SafeCheckType.Manual:
                if (i < 2)
                {
                    if (Carrier.LocateInPos("Wait"))
                    {
                        return(true);
                    }
                    else if (Carrier.LocateInPos("Work"))
                    {
                        return(true);
                    }
                    else
                    {
                        if (!up.LocateInPos("Wait", 2))
                        {
                            Error = $"UpSafeCheck {up.Name} Z 不在等待位";
                            return(false);
                        }
                        return(true);
                    }
                }
                return(true);

            default:
                return(true);
            }
        }
Exemplo n.º 3
0
        public TransTask(int id, string name, Station station) : base(id, name, station)
        {
            DualStartButton = new DualStartButton()
            {
                DiStart1 = station.Machine.Find <IDiEx>("DiStart1"),
                DiStart2 = station.Machine.Find <IDiEx>("DiStart2"),
            };

            MultiSensorCheck = new MultiDiSensorCheck()
            {
                DISensors = new List <IDiEx>()
                {
                    station.Machine.Find <IDiEx>("DiSensor1"),
                    station.Machine.Find <IDiEx>("DiSensor2"),
                }
            };

            MultiClampCylinders = new MultiClampCylinders()
            {
                Clamps = new List <ICylinderEx>()
                {
                    station.Machine.Find <ICylinderEx>("FBCY"),
                    station.Machine.Find <ICylinderEx>("LRCY"),
                }
            };


            Platform = station.Machine.Find <PlatformEx>("TransPlatform");

            VioMeasureStart  = station.Machine.Find <IVioEx>("VioMeasureStart");
            VioMeasureFinish = station.Machine.Find <IVioEx>("VioMeasureFinish");
        }
Exemplo n.º 4
0
        public TransTask(int id, string name, Station station) : base(id, name, station)
        {
            DualStartButton = new DualStartButton
            {
                DiStart1 = station.Machine.Find <IDiEx>("DiStart1"),
                DiStart2 = station.Machine.Find <IDiEx>("DiStart2")
            };

            FinSensorCheck = new MultiDiSensorCheck
            {
                DISensors = new List <IDiEx>()
                {
                    station.Machine.Find <IDiEx>("DiSensor2"),
                    station.Machine.Find <IDiEx>("DiSensor3"),
                    station.Machine.Find <IDiEx>("DiSensor1"),
                }
            };


            CarrierLoader = new CarrierLoader()
            {
                Task    = this,
                CyLeft  = station.Machine.Find <ICylinderEx>("LCY"),
                CyBack  = station.Machine.Find <ICylinderEx>("BCY"),
                CyFront = station.Machine.Find <ICylinderEx>("FCY"),
                CyRight = station.Machine.Find <ICylinderEx>("RCY"),


                Vaccum1 = station.Machine.Find <IDoEx>("DOVaccum1"),
                Vaccum2 = station.Machine.Find <IDoEx>("DOVaccum2"),

                VaccumSensor1 = station.Machine.Find <IDiEx>("DiVaccum1"),
                VaccumSensor2 = station.Machine.Find <IDiEx>("DiVaccum2"),

                CarrierSensor1 = station.Machine.Find <IDiEx>("DiSensor2"),
                CarrierSensor2 = station.Machine.Find <IDiEx>("DiSensor3"),
            };


            VioMeasureStart  = station.Machine.Find <IVioEx>("VioMeasureStart");
            VioMeasureFinish = station.Machine.Find <IVioEx>("VioMeasureFinish");


            Platform = station.Machine.Find <PlatformEx>("TransPlatform");
        }
Exemplo n.º 5
0
        public MeasureTask(int id, string name, Station station) : base(id, name, station)
        {
            VioMeasureStart  = station.Machine.Find <IVioEx>("VioMeasureStart");
            VioMeasureFinish = station.Machine.Find <IVioEx>("VioMeasureFinish");


            Camera = new ThermoCameraA();


            Platform = station.Machine.Find <PlatformEx>("MeasurePlatform");

            var toFilePos = new Func <double[], double[]>(d => (new PosXYZ(d) - new PosXYZ(Platform["Origin"]?.Data())).Data());
            var toMovePos = new Func <double[], double[]>(d => (new PosXYZ(d) + new PosXYZ(Platform["Origin"]?.Data())).Data());

            Platform.PosConvertFuncs.Clear();
            Platform.PosConvertFuncs.Add("FILE", toFilePos);
            Platform.PosConvertFuncs.Add("MOVE", toMovePos);
        }
Exemplo n.º 6
0
        public override bool Check(PlatformEx platform, int i)
        {
            switch (Target)
            {
            case SafeCheckType.AutoHome:
            case SafeCheckType.Auto:
                if (!Up.LocateInPos("Wait", 2))
                {
                    Error = $"CarrierSafeCheck {Up.Name} 不在等待位置";
                    return(false);
                }
                else if (!Down.LocateInPos("Wait", 2))
                {
                    Error = $"CarrierSafeCheck {Down.Name} 不在等待位置";
                    return(false);
                }

                return(true);

            case SafeCheckType.ManualHome:
            case SafeCheckType.Manual:
                if (!Up.LocateInPos("Wait", 2))
                {
                    Error = $"CarrierSafeCheck {Up.Name} Z 不在等待位置";
                    return(false);
                }
                else if (!Down.LocateInPos("Wait", 2))
                {
                    Error = $"CarrierSafeCheck {Down.Name} 不在等待位置";
                    return(false);
                }

                return(true);

            default:
                return(true);
            }
        }
Exemplo n.º 7
0
 public UpSafeCheck(PlatformEx carrier, SafeCheckType target)
 {
     Target  = target;
     Carrier = carrier;
 }
Exemplo n.º 8
0
 public DownSafeCheck(PlatformEx carrier, ICylinderEx downGt, SafeCheckType target)
 {
     Carrier = carrier;
     DownGt  = downGt;
     Target  = target;
 }
Exemplo n.º 9
0
        public void ParseContent(StateMachine machine, string line)
        {
            if (Section != "PLATFORM")
            {
                if (line.Length == 0)
                {
                    //read next line
                    return;
                }
            }


            switch (Section)
            {
            case "MOTION":
                new MotionCardWrapper().Import(line, machine);
                break;

            case "DI":
                new DiEx().Import(line, machine);
                break;

            case "ESTOP":
            case "START":
            case "STOP":
            case "RESET":
                DiEx.Import(Section, line, machine);
                break;

            case "DO":
                new DoEx().Import(line, machine);
                break;

            case "LIGHTGREEN":
            case "LIGHTYELLOW":
            case "LIGHTRED":
            case "BUZZER":
                DoEx.Import(Section, line, machine);
                break;

            case "CY":
                new CylinderEx().Import(line, machine);
                break;

            case "VIO":
                new VioEx().Import(line, machine);
                break;

            case "AXIS":
                new AxisEx().Import(line, machine);
                break;

            case "PLATFORM":
                if (string.IsNullOrEmpty(IndentSection))
                {
                    IndentSection = line.Split(' ')[1];
                    PlatformEx.Import(line, machine);
                    _indentIndex = 0;
                }
                else
                {
                    if (line.StartsWith("NULL") || line.StartsWith("null") || line.StartsWith("Null"))
                    {
                        var platform = machine.Platforms.Values.FirstOrDefault(p => p.Name == IndentSection);
                        if (platform != null)
                        {
                            platform.Axis[_indentIndex] = null;
                        }

                        _indentIndex++;
                    }
                    else
                    {
                        IAxisEx axis = new AxisEx();
                        axis.Import(line, machine);
                        axis = machine.Find <IAxisEx>(axis.Name);

                        var platform = machine.Platforms.Values.FirstOrDefault(p => p.Name == IndentSection);
                        if (platform != null)
                        {
                            platform.Axis[_indentIndex] = axis;
                        }

                        _indentIndex++;
                    }
                }

                break;

            case "STATION":
                if (string.IsNullOrEmpty(IndentSection))
                {
                    IndentSection = line.Split(' ')[1];
                    Station.Import("STATION", line, machine);
                }
                else
                {
                    var data = line.Split(' ');
                    if (data.Length == 6)
                    {
                        //import task
                        Station.Import("STATIONTASK", line, machine.Find <Station>(IndentSection));
                    }
                    else if (data.Length == 7)
                    {
                        //import pause signal
                        Station.Import("PAUSESIGNAL", line, machine.Find <Station>(IndentSection));
                    }
                    else
                    {
                        throw new Exception($"{Section} {line} FORMAT ERROR");
                    }
                }

                break;

            default:
                throw new Exception($"Not Support Section - {Section}");
            }
        }
 public abstract bool Check(PlatformEx platform, int i);