| | |
| | | } |
| | | } |
| | | |
| | | List<ProductionMeasurement> productionList = new List<ProductionMeasurement>(); |
| | | |
| | | [ProcessMethod("", "StartJob", "开始扫描", InvokeType.TestInvoke)] |
| | | public ProcessResponse StartJob(IOperationConfig opConfig, IDevice invokeDevice, IDevice sourceDevice) |
| | | { |
| | |
| | | { |
| | | throw new ProcessException("未输入产品条码,请勿开始测量"); |
| | | } |
| | | |
| | | //检查产品放置OK |
| | | |
| | | //气缸推动压板移动到产品上方 |
| | | |
| | | //压板压紧产品 |
| | | |
| | | OnMeasureStart?.BeginInvoke(null, null); |
| | | |
| | |
| | | Barcode = BarCode, |
| | | Measurements = measurements, |
| | | }; |
| | | |
| | | var existedProduction = productionList.FirstOrDefault(u => u.Barcode == pMeasure.Barcode); |
| | | if (existedProduction != null) |
| | | { |
| | | productionList.Remove(existedProduction); |
| | | existedProduction.Dispose(); |
| | | existedProduction = null; |
| | | } |
| | | |
| | | productionList.Add(pMeasure); |
| | | |
| | | pMeasure.InitialMeasurementsPropertyChanged(); |
| | | pMeasure.PropertyChanged += MeasureProduction_PropertyChanged; |
| | |
| | | if (camera == null) |
| | | return; |
| | | |
| | | //IImageSet imgSet = camera.Snapshot(s.CameraOp.OpConfig); |
| | | //if (imgSet == null) |
| | | // return; |
| | | |
| | | HImage hImage = CollectHImage(camera, s.CameraOp.OpConfig, out string imgSetId); |
| | | if (string.IsNullOrWhiteSpace(imgSetId)) |
| | | { |
| | |
| | | }); |
| | | |
| | | BarCode = ""; |
| | | |
| | | |
| | | |
| | | return new ProcessResponse(true); |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | LogAsync(DateTime.Now, $"{m.GetDisplayText()}检测结果", $"{((m.Spec.MeasureResult ?? false) ? "OK" : "NG")}"); |
| | | |
| | | IShapeElement indicator = null; |
| | | pMeasure.ElementList.Add(indicator); |
| | | //输出图形基元到界面 todo |
| | | OnElementUpdated?.BeginInvoke(null, null, null); |
| | | OnElementUpdated?.BeginInvoke(indicator, null, null); |
| | | |
| | | SaveKeyImages(pMeasure.Barcode, m); |
| | | |
| | |
| | | return; |
| | | } |
| | | |
| | | |
| | | |
| | | //MES输出 todo |
| | | |
| | | //Excel报表输出 todo |
| | |
| | | //数据库保存 todo |
| | | |
| | | SaveWholeImage(pMeasure); |
| | | |
| | | productionList.RemoveAll(p => p.Barcode == pMeasure.Barcode); |
| | | pMeasure.Dispose(); |
| | | } |
| | | } |