public CarrierSafeCheck(PlatformEx up, PlatformEx down, ICylinderEx downGT, SafeCheckType target) { Target = target; Up = up; Down = down; DownGT = downGT; }
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); } }
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"); }
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"); }
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); }
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); } }
public UpSafeCheck(PlatformEx carrier, SafeCheckType target) { Target = target; Carrier = carrier; }
public DownSafeCheck(PlatformEx carrier, ICylinderEx downGt, SafeCheckType target) { Carrier = carrier; DownGt = downGt; Target = target; }
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);