private void radioButtonHuanj_CheckedChanged(object sender, EventArgs e) { switch (UseFqy) { case "fla_502": if (fla_502 != null) { fla_502.setAirAsTl(); } break; } }
private void fqtl() { try { toolStripButtonTl.Enabled = false; toolStripButtonXljc.Enabled = false; toolStripButtonBd.Enabled = false; toolStripButtonPumpOn.Enabled = false; toolStripButtonPumpOff.Enabled = false; toolStripButtonSelfDetect.Enabled = false; switch (UseFqy) { case "FLA_502": if (fla_502 != null) { if (radioButtonLingQ.Checked == true) { fla_502.setZeroAsTl(); } else { fla_502.setAirAsTl(); } fla_502.Zeroing(); for (int i = 30; i > 0; i--) { Msg_label(label_msg, panel_msg, "仪器调零 " + i.ToString("0")); Thread.Sleep(1000); } while (true) { int i = 100; if (i <= 1) { Msg_label(label_msg, panel_msg, "调零失败,请手动操作"); break; } if (fla_502.Get_Struct().IndexOf("准备好") > -1) { break; } else { i--; } Thread.Sleep(10); } Msg_label(label_msg, panel_msg, "调零成功"); toolStripButtonTl.Enabled = true; toolStripButtonXljc.Enabled = true; toolStripButtonBd.Enabled = true; toolStripButtonPumpOn.Enabled = true; toolStripButtonPumpOff.Enabled = true; toolStripButtonSelfDetect.Enabled = true; } else { Msg_label(label_msg, panel_msg, "调零失败,检查仪器状态"); toolStripButtonTl.Enabled = true; toolStripButtonXljc.Enabled = true; toolStripButtonBd.Enabled = true; toolStripButtonPumpOn.Enabled = true; toolStripButtonPumpOff.Enabled = true; toolStripButtonSelfDetect.Enabled = true; } break; case "FLA_501": if (fla_501 != null) { fla_501.SetZero(); for (int i = 30; i > 0; i--) { Msg_label(label_msg, panel_msg, "仪器调零 " + i); Thread.Sleep(1000); } Msg_label(label_msg, panel_msg, "调零成功"); toolStripButtonTl.Enabled = true; toolStripButtonXljc.Enabled = true; toolStripButtonBd.Enabled = true; toolStripButtonPumpOn.Enabled = true; toolStripButtonPumpOff.Enabled = true; toolStripButtonSelfDetect.Enabled = true; } else { Msg_label(label_msg, panel_msg, "调零失败,检查仪器状态"); toolStripButtonTl.Enabled = true; toolStripButtonXljc.Enabled = true; toolStripButtonBd.Enabled = true; toolStripButtonPumpOn.Enabled = true; toolStripButtonPumpOff.Enabled = true; toolStripButtonSelfDetect.Enabled = true; } break; } } catch (Exception) { Msg_label(label_msg, panel_msg, "调零失败,检查仪器状态"); toolStripButtonTl.Enabled = true; toolStripButtonXljc.Enabled = true; toolStripButtonBd.Enabled = true; toolStripButtonPumpOn.Enabled = true; toolStripButtonPumpOff.Enabled = true; toolStripButtonSelfDetect.Enabled = true; } }