| | |
| | | tscEditLocation.Visible = tsmiShowEditor.Checked; |
| | | tscEditLocation.BringToFront(); |
| | | } |
| | | |
| | | private void tsmiRefreshLabels_Click(object sender, EventArgs e) |
| | | { |
| | | cvImage.Elements.Clear(); |
| | | lvMeasures.Items.Clear(); |
| | | |
| | | Config.MeasurementUnitCollection.ForEach(u => |
| | | { |
| | | if (!u.IsEnabled) |
| | | return; |
| | | |
| | | var ele = new KeyIndicator(u.Id, u.DisplayLocation); |
| | | cvImage.Elements.Add(ele); |
| | | |
| | | ListViewItem item = new ListViewItem(u.GetDisplayText()); |
| | | item.Tag = u.Id; |
| | | lvMeasures.Items.Add(item); |
| | | }); |
| | | |
| | | this.Invalidate(); |
| | | } |
| | | #endregion |
| | | |
| | | #region 标签编辑区 |
| | |
| | | { |
| | | if (lblMachineState.IsHandleCreated) |
| | | { |
| | | lblMachineState.BeginInvoke(new Action(() => |
| | | lblMachineState.Invoke(new Action(() => |
| | | { |
| | | switch (state) |
| | | { |
| | |
| | | |
| | | btnStartMeasure.Text = "开始测量"; |
| | | btnStartMeasure.Enabled = false; |
| | | btnStartMeasure.BackColor = Color.Red; |
| | | break; |
| | | case MachineState.Pause: |
| | | btnStartMeasure.BackColor = lblMachineState.BackColor = Color.Yellow; |
| | |
| | | |
| | | btnStartMeasure.Text = "继续测量"; |
| | | btnStartMeasure.Enabled = true; |
| | | btnStartMeasure.BackColor = Color.Lime; |
| | | break; |
| | | case MachineState.Ready: |
| | | btnStartMeasure.BackColor = lblMachineState.BackColor = Color.Lime; |
| | | btnStartMeasure.ForeColor = lblMachineState.ForeColor = Color.White; |
| | | btnStartMeasure.ForeColor = lblMachineState.ForeColor = Color.Black; |
| | | lblMachineState.Text = "就绪"; |
| | | |
| | | btnStartMeasure.Text = "开始测量"; |
| | | btnStartMeasure.Enabled = true; |
| | | btnStartMeasure.BackColor = Color.Lime; |
| | | break; |
| | | case MachineState.Running: |
| | | btnStartMeasure.BackColor = lblMachineState.BackColor = Color.Lime; |
| | | btnStartMeasure.BackColor = lblMachineState.BackColor = Color.Transparent; |
| | | btnStartMeasure.ForeColor = lblMachineState.ForeColor = Color.DarkGreen; |
| | | lblMachineState.Text = "运行"; |
| | | |
| | | btnStartMeasure.Text = "暂停测量"; |
| | | btnStartMeasure.Enabled = true; |
| | | btnStartMeasure.BackColor = Color.Lime; |
| | | break; |
| | | case MachineState.Unknown: |
| | | btnStartMeasure.BackColor = lblMachineState.BackColor = SystemColors.Control; |
| | |
| | | lblMachineState.Text = "未知"; |
| | | |
| | | btnStartMeasure.Enabled = false; |
| | | btnStartMeasure.BackColor = Color.Red; |
| | | break; |
| | | } |
| | | })); |
| | |
| | | } |
| | | else if (btnStartMeasure.Text == "继续测量") |
| | | { |
| | | Process_M071.SwitchJobStatus(new OperationConfigBase() { InputPara = new List<int>() { 0 } }, null, null); |
| | | Process_M071.SwitchJobStatus(new OperationConfigBase() { InputPara = new List<int>() { 10 } }, null, null); |
| | | } |
| | | else |
| | | { |
| | | Process_M071.SwitchJobStatus(new OperationConfigBase() { InputPara = new List<int>() { 1 } }, null, null); |
| | | Process_M071.SwitchJobStatus(new OperationConfigBase() { InputPara = new List<int>() { 11 } }, null, null); |
| | | } |
| | | } |
| | | |
| | |
| | | Process_M071.ResetTimer.Change(-1, -1); |
| | | } |
| | | #endregion |
| | | |
| | | } |
| | | } |