| | |
| | | MachineState = MachineState.Running; |
| | | OnMeasureStart?.Invoke(); |
| | | |
| | | var measurements = Config.MeasurementUnitCollection.Where(u => u.IsEnabled).ToList().DeepSerializeClone(); |
| | | measurements.ForEach(m => |
| | | //var measurements = Config.MeasurementUnitCollection.Where(u => u.IsEnabled).ToList().DeepSerializeClone(); |
| | | //measurements.ForEach(m => |
| | | //{ |
| | | // m.InitialKeyUnitMeasureChanged(); |
| | | //}); |
| | | |
| | | List<MeasurementUnit> measurements = new List<MeasurementUnit>(); |
| | | Config.MeasurementUnitCollection.Where(u => u.IsEnabled).ToList().ForEach(u => |
| | | { |
| | | var m = u.Copy(); |
| | | m.InitialKeyUnitMeasureChanged(); |
| | | measurements.Add(m); |
| | | }); |
| | | |
| | | var pMeasure = new ProductionMeasurement() |
| | |
| | | Measurements = measurements, |
| | | StartTime = DateTime.Now, |
| | | }; |
| | | |
| | | BarCode = ""; |
| | | |
| | | var existedProduction = productionList.FirstOrDefault(u => u.Barcode == pMeasure.Barcode); |
| | | if (existedProduction != null) |
| | |
| | | RunImageHandle(s.CameraOp.OpConfig, set, s.Id, s.Name, pMeasure.Measurements); |
| | | }); |
| | | |
| | | BarCode = ""; |
| | | LogAsync(DateTime.Now, $"{pMeasure.Barcode}测量动作完成", ""); |
| | | |
| | | GC.Collect(0, GCCollectionMode.Optimized); |
| | | |
| | | return new ProcessResponse(true); |
| | | } |
| | |
| | | |
| | | productionList.RemoveAll(p => p.Barcode == pMeasure.Barcode); |
| | | pMeasure.Dispose(); |
| | | //LogAsync(DateTime.Now, $"{pMeasure.Barcode}产品信息释放完成", JsonConvert.SerializeObject(pMeasure)); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | #region RawData |
| | | { |
| | | //rawDataSheet = package.Workbook.Worksheets["RawData"]; |
| | | |
| | | int rowDataStartCol = rawDataSheet.Dimension.Columns; |
| | | var barcodeCell = rawDataSheet.Cells[1, rowDataStartCol + 1, 1, rowDataStartCol + 4]; |
| | | barcodeCell.Merge = true; |
| | |
| | | { |
| | | int slantStartCol = slantSheet.Dimension.Columns; |
| | | |
| | | //var barcodeCell = slantSheet.Cells[1, slantStartCol + 1, 1, slantStartCol + 2]; |
| | | //barcodeCell.Merge = true; |
| | | //barcodeCell.Value = exportData.ProductionMeasurementRecord.ProductionBarcode; |
| | | //SetTitleCell(barcodeCell); |
| | | |
| | | var barcodeCell = slantSheet.Cells[1, slantStartCol + 1]; |
| | | barcodeCell.Value = exportData.ProductionMeasurementRecord.ProductionBarcode; |
| | | SetTitleCell(barcodeCell); |
| | |
| | | var valueCell = slantSheet.Cells[2, slantStartCol + 1]; |
| | | valueCell.Value = "Value"; |
| | | SetTitleCell(valueCell); |
| | | |
| | | //var resultCell = slantSheet.Cells[2, slantStartCol + 2]; |
| | | //resultCell.Value = "Result"; |
| | | //SetTitleCell(resultCell); |
| | | |
| | | slantMeasures.ForEach(m => |
| | | { |
| | |
| | | #endregion |
| | | |
| | | package.Save(); |
| | | |
| | | rawDataSheet.Dispose(); |
| | | slantSheet.Dispose(); |
| | | alignmentSheet.Dispose(); |
| | | rowAlignmentSheet.Dispose(); |
| | | }; |
| | | } |
| | | }); |
| | |
| | | }); |
| | | |
| | | image.Dispose(); |
| | | image = null; |
| | | } |
| | | //); |
| | | |
| | | imgSet.HImage.Dispose(); |
| | | imgSet.HImage = null; |
| | | imgSet.Dispose(); |
| | | |
| | | images.Dispose(); |
| | | images = null; |
| | | |
| | | //if (count.I != 1) |
| | | //{ |
| | | // hImage?.Dispose(); |