| | |
| | | cvImage.SetScreenSize(); |
| | | cvImage.OnElementChangedHandle -= CvImage_OnElementChangedHandle; |
| | | cvImage.OnElementChangedHandle += CvImage_OnElementChangedHandle; |
| | | |
| | | timer1.Enabled = true; |
| | | |
| | | btnReset.Text = $"复位(长按{Config.FullResetRequiredDuration}秒大复位)"; |
| | | }; |
| | | } |
| | | |
| | |
| | | #region 标签结果显示 |
| | | private async void Process_M071_OnElementUpdated(Common.Interface.IShapeElement obj) |
| | | { |
| | | //this.Invoke(new Action(() => |
| | | //{ |
| | | // if (obj is KeyIndicator keyIndicator) |
| | | // { |
| | | // var ele = cvImage.Elements.FirstOrDefault(u => u.ID == keyIndicator.ID); |
| | | |
| | | // //(ele as KeyIndicator).Text = keyIndicator.Text; |
| | | // //(ele as KeyIndicator).ResultState = keyIndicator.ResultState; |
| | | // if (ele != null) |
| | | // { |
| | | // ele = keyIndicator; |
| | | // } |
| | | |
| | | // this.Invalidate(); |
| | | // } |
| | | //})); |
| | | |
| | | if (obj is KeyIndicator keyIndicator) |
| | | { |
| | | this.Invoke(new Action(() => |
| | |
| | | if (keyStr.Length == 1) |
| | | { |
| | | _barcode += keyStr.ToUpper(); |
| | | } |
| | | else if (keyStr.Length == 2 && keyStr.StartsWith("D")) |
| | | { |
| | | _barcode += keyStr.Substring(1).ToUpper(); |
| | | } |
| | | |
| | | if (e.KeyValue == 13) |
| | |
| | | { |
| | | if (lblMachineState.IsHandleCreated) |
| | | { |
| | | lblMachineState.BeginInvoke(new Action(() => |
| | | lblMachineState.Invoke(new Action(() => |
| | | { |
| | | switch (state) |
| | | { |
| | |
| | | btnStartMeasure.BackColor = lblMachineState.BackColor = Color.Lime; |
| | | btnStartMeasure.ForeColor = lblMachineState.ForeColor = Color.Black; |
| | | lblMachineState.Text = "就绪"; |
| | | |
| | | |
| | | btnStartMeasure.Text = "开始测量"; |
| | | btnStartMeasure.Enabled = true; |
| | | break; |
| | |
| | | Process_M071.Reset(null, null, null); |
| | | } |
| | | |
| | | Process_M071.ResetTimer.Change(1000 * 5, -1); |
| | | Process_M071.ResetTimer.Change(1000 * Config.FullResetRequiredDuration, -1); |
| | | } |
| | | |
| | | private void btnReset_MouseUp(object sender, MouseEventArgs e) |
| | |
| | | } |
| | | #endregion |
| | | |
| | | private void timer1_Tick(object sender, EventArgs e) |
| | | { |
| | | cvImage.Refresh(); |
| | | } |
| | | } |
| | | } |