| | |
| | | using System.Drawing.Imaging; |
| | | using System.IO; |
| | | using System.Linq; |
| | | using System.Runtime.CompilerServices; |
| | | using System.Text; |
| | | using System.Threading; |
| | | using System.Threading.Tasks; |
| | |
| | | public event Action<IShapeElement> OnElementUpdated; |
| | | public event Action<MachineState> OnMachineStateChanged; |
| | | public event Action OnFullResetDone; |
| | | public event Action OnResetDone; |
| | | #endregion |
| | | |
| | | string _precision = "f3"; |
| | |
| | | object productionLock = new object(); |
| | | List<ProductionMeasurement> productionList = new List<ProductionMeasurement>(); |
| | | |
| | | bool _isdoing = false; |
| | | |
| | | [ProcessMethod("", "StartJob", "开始扫描", InvokeType.TestInvoke)] |
| | | [MethodImpl(MethodImplOptions.Synchronized)] |
| | | public ProcessResponse StartJob(IOperationConfig opConfig, IDevice invokeDevice, IDevice sourceDevice) |
| | | { |
| | | if (!IsAllowedWork) |
| | |
| | | } |
| | | |
| | | string hint = ""; |
| | | |
| | | //if (MachineState != MachineState.Ready) |
| | | //{ |
| | | // hint = "机台未就绪,请勿开始测量"; |
| | |
| | | OnCheckHintUpload?.Invoke(hint, true); |
| | | throw new ProcessException(hint); |
| | | } |
| | | |
| | | _isdoing = true; |
| | | |
| | | MachineState = MachineState.Running; |
| | | |
| | |
| | | }); |
| | | |
| | | LogAsync(DateTime.Now, $"{pMeasure.Barcode}测量动作完成", ""); |
| | | _isdoing = false; |
| | | |
| | | GC.Collect(0, GCCollectionMode.Optimized); |
| | | |
| | |
| | | get => isLeftStart; |
| | | set |
| | | { |
| | | isLeftStart = value; |
| | | StartCheck(); |
| | | if (IsLeftStart != value) |
| | | { |
| | | isLeftStart = value; |
| | | StartCheck(); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | get => isRightStart; |
| | | set |
| | | { |
| | | isRightStart = value; |
| | | StartCheck(); |
| | | if (isRightStart != value) |
| | | { |
| | | isRightStart = value; |
| | | StartCheck(); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | if (isRightStart && isLeftStart) |
| | | { |
| | | if (_isdoing) |
| | | { |
| | | OnCheckHintUpload?.Invoke("设备运行中", false); |
| | | return; |
| | | } |
| | | StartJob(null, null, null); |
| | | } |
| | | } |