| | |
| | | using Bro.Common.Helper; |
| | | using Bro.Common.Interface; |
| | | using Bro.Common.Model; |
| | | using Bro.M071.Model; |
| | | using Bro.Process; |
| | | using HalconDotNet; |
| | | using System; |
| | |
| | | |
| | | base.Open(); |
| | | |
| | | SwitchBeep(false); |
| | | SwitchLightGreen(false); |
| | | SwitchLightRed(false); |
| | | SwitchLightYellow(false); |
| | | |
| | | Reset(null, null, null); |
| | | FullReset(null); |
| | | } |
| | | |
| | | private void InitialSetting() |
| | | { |
| | | //数据库迁移检查 |
| | | DatabaseInitialize.Initialize(); |
| | | |
| | | MotionCardSettingCheck(); |
| | | |
| | | Config.SnapshotPointCollection.ForEach(u => |
| | | { |
| | | u.GetHalconToolPathList().ForEach(path => |
| | |
| | | { |
| | | return; |
| | | } |
| | | |
| | | pMeasure.EndTime = DateTime.Now; |
| | | bool pResult = pMeasure.Measurements.All(u => u.Spec.MeasureResult == true); |
| | | OnUpdateResult?.Invoke(DateTime.Now, pResult ? 1 : 0); |
| | | OnUpdateCT?.Invoke((float)(pMeasure.EndTime.Value - pMeasure.StartTime.Value).TotalSeconds); |
| | | |
| | | LogAsync(DateTime.Now, $"{pMeasure.Barcode} 检测完成,结果 {(pResult ? "OK" : "NG")}", ""); |
| | | |
| | | if (MachineState == MachineState.Running) |
| | | MachineState = MachineState.Ready; |
| | | |
| | | //MES输出 todo |
| | | |
| | | //Excel报表输出 todo |
| | | |
| | | //数据库保存 todo |
| | | |
| | | SaveWholeImage(pMeasure); |
| | | |
| | | productionList.RemoveAll(p => p.Barcode == pMeasure.Barcode); |
| | | pMeasure.Dispose(); |
| | | } |
| | | |
| | | pMeasure.EndTime = DateTime.Now; |
| | | bool pResult = pMeasure.Measurements.All(u => u.Spec.MeasureResult == true); |
| | | OnUpdateResult?.Invoke(DateTime.Now, pResult ? 1 : 0); |
| | | OnUpdateCT?.Invoke((float)(pMeasure.EndTime.Value - pMeasure.StartTime.Value).TotalSeconds); |
| | | |
| | | LogAsync(DateTime.Now, $"{pMeasure.Barcode} 检测完成,结果 {(pResult ? "OK" : "NG")}", ""); |
| | | |
| | | if (MachineState == MachineState.Running) |
| | | MachineState = MachineState.Ready; |
| | | |
| | | //MES输出 todo |
| | | |
| | | //Excel报表输出 todo |
| | | |
| | | //数据库保存 todo |
| | | |
| | | SaveWholeImage(pMeasure); |
| | | |
| | | productionList.RemoveAll(p => p.Barcode == pMeasure.Barcode); |
| | | pMeasure.Dispose(); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | private void SaveKeyImages(string barCode, MeasurementUint measureUnit) |
| | | private void SaveKeyImages(string barCode, MeasurementUnit measureUnit) |
| | | { |
| | | string measureName = measureUnit.GetDisplayText(); |
| | | if (Config.ImageSaveOption.IsSaveOriginImage) |
| | |
| | | } |
| | | } |
| | | |
| | | private async void SaveKeyImages(MeasurementUint measureUnit, string measureName, string dir) |
| | | private async void SaveKeyImages(MeasurementUnit measureUnit, string measureName, string dir) |
| | | { |
| | | await Task.Run(() => |
| | | { |
| | |
| | | } |
| | | #endregion |
| | | |
| | | private async void RunImageHandle(CameraBase camera, IOperationConfig opConfig, HImage hImage, string snapshotId, string snapshotName, List<MeasurementUint> measureList) |
| | | private async void RunImageHandle(CameraBase camera, IOperationConfig opConfig, HImage hImage, string snapshotId, string snapshotName, List<MeasurementUnit> measureList) |
| | | { |
| | | await Task.Run(() => |
| | | { |