protected override int RunLoop() { //start assert Platform.AssertAutoMode(this); Platform.LocateInPos("Wait"); Project.AssertNoNull(this); //show barcode read form; var barcode = RunBarcodeScanner(); if (CfgSettings.QuitOnProductError && string.IsNullOrEmpty(barcode)) { return(0); } //Wait start button DualStartButton.WaitStart(this, CfgSettings.AutoDryRun); //check position sensor ok if (CfgSettings.SensorEnable && !MultiSensorCheck.Check(this)) { return(0); } //create product Product = new Thermo2ProductB() { Barcode = barcode, ProductType = Project.ThermoProductType.ToString(), Description = string.Join("-", new[] { Project.ProductName, CfgSettings.Version }), SPCItems = Project.SPCItems, }; Product.ClearSpc(); MeasureTask.Product = Product; //start measure MultiClampCylinders.Clamp(this, 300); TestProcessControl.OnTestStartEvent(Product); VioMeasureStart.SetVio(this, true); { TestProcessControl.OnTestingEvent(Product); } VioMeasureFinish.WaitVioAndClear(this); Platform.MoveAbs("SafeOrigin"); Platform.MoveAbs("Wait"); MultiClampCylinders.Reset(this); //save product data Product.MachineName = CfgSettings.Uploader.AVC_Machine_ID; SaveProductData(); if (CfgSettings.Uploader.Enable) { Product.ToSQL().Save(Project.PartID); } return(0); }
protected override int RunLoop() { //start assert Platform.AssertAutoMode(this); Platform.LocateInPos("Wait"); Project.AssertNoNull(this); //wait start button DualStartButton.WaitStart(this, CfgSettings.AutoDryRun); //check locate sensor ok if (CfgSettings.SensorEnable) { if (!CarrierLoader.CheckProductSensor()) { return(0); } } //check fin sensor ok if (CfgSettings.FinSensorEnable) { //select sensor pattern by product var vcSensorPattern = new[] { true, true, false }; var moduleSensorPattern = new[] { true, true, true }; bool[] sensor; if (Project.ThermoProductType == ThermoProductType.VaporChamber) { sensor = vcSensorPattern; } else { sensor = moduleSensorPattern; } if (!FinSensorCheck.CheckByPattern(this, sensor)) { return(0); } } //create new product, pass to measure task Product = new Thermo2ProductA { ProductType = Project.ThermoProductType.ToString(), Description = string.Join("-", new[] { Project.ProductName, CfgSettings.Version }), SPCItems = Project.SPCItems }; Product.ClearSpc(); MeasureTask.Product = Product; Log("TransStart:" + Product, LogLevel.Info); TestProcessControl.OnTestStartEvent(Product); SetCarrier(); { Platform.MoveAbs("Work"); VioMeasureStart.SetVio(this); { TestProcessControl.OnTestingEvent(Product); } VioMeasureFinish.WaitVioAndClear(this); Platform.MoveAbs("Wait"); } ResetCarrier(); SaveProductData(); return(0); }
protected override int RunLoop() { //in case of manual operations Platform.AssertAutoMode(this); //wait start while ((!DIStart1.GetDiSts() || !DIStart2.GetDiSts())) { Thread.Sleep(100); JoinIfPause(); AbortIfCancel("cancel trans wait start"); if (Station.Id == 1 && Machine.Ins.Settings.Common.LeftAutoTryRun) { break; } if (Station.Id == 2 && Machine.Ins.Settings.Common.RightAutoTryRun) { break; } } Log(string.Empty, LogLevel.None); if ((Station.Id == 1 && Machine.Ins.Settings.Common.LeftSensorCheck) || (Station.Id == 2 && Machine.Ins.Settings.Common.RightSensorCheck)) { //检查定位传感器 if (!DISensorCheck1.GetDiSts() || !DISensorCheck2.GetDiSts()) { Station.Machine.Beep(); Log($"{Station.Name} - {Name} 定位传感器检测异常", LogLevel.Warning); return(0); } } if ((Station.Id == 1 && Machine.Ins.Settings.Common.LeftFinSensorCheck) || (Station.Id == 2 && Machine.Ins.Settings.Common.RightFinSensorCheck)) { //检查fin传感器 if (!CheckProductFin()) { //return to wait start return(0); } } //new product Product = new Thermo1Product() { ProductType = Project.ThermoProductType.ToString(), Description = Station.Name + "-" + Project.ProductName + "-" + CfgSettings.Version, SPCItems = Project.SPCItems, }; Product.ClearSpc(); //push data to measure tasks WaitTaskDown.Product = Product; WaitTaskUp.Product = Product; TestProcessControl.OnTestStartEvent(Product); TestProcessControl.OnTestingEvent(Product); DOBtnLight1.SetDo(); DOBtnLight2.SetDo(); //cy clamp if (Project.ProjectName.Contains("HeightCalib")) { DoClampCylinderY.SetDo(this, true, 100, ignoreOrWaringOrError: null); } else if (Project.ThermoProductType == ThermoProductType.FullModule) { Clamper.ClampModule(); } else if (Project.ThermoProductType == ThermoProductType.VaporChamber) { Clamper.ClampVC(); } else { Clamp(true); } //move work Platform.MoveAbs(0, "Work"); { VioTransInp.SetVio(this); //start waiting Log("Measure Start......\n-----------------------------------------------", LogLevel.Info); //set measure start VioTransFinishUp.SetVio(this); VioTransFinishDown.SetVio(this); { //wait barcode finish update barcode VioBarcodeFinish.WaitVioAndClear(this); TestProcessControl.OnTestingEvent(Product); } //wait measure finish VioMeasureFinishUp.WaitVioAndClear(this); VioMeasureFinishDown.WaitVioAndClear(this); Log("Measure Finish......\n-----------------------------------------------", LogLevel.Info); } //move wait pos Platform.MoveAbs(0, "Wait"); //update results //calc flatness if (Thermo1GeometryCalculator != null) { //transform raw data to same coord GTTransform.TransformRawData(Station.Name, CfgSettings.Calibration, Product); var data = Thermo1GeometryCalculator.Calculate(Product); Log($"Flatness Calc: {data.ToString()}"); } SaveProductData(); Clamper.Release(); DOBtnLight1.SetDo(false); DOBtnLight2.SetDo(false); return(0); }