public void Connected(HMP4040 hmp) { try { if (m_hmp != null && hmp == null) { m_hmp.SetOutputEnable(m_outputChannel, false); tsOutputEnable.Checked = false; } if (hmp != null) { hmp.GetOutputEnable(m_outputChannel, out bool enable); tsOutputEnable.Checked = enable; lbOnOff.On = enable; double value; hmp.GetOutputVoltageLevel(m_outputChannel, out value); txtOutputVoltageLevel.Text = value.ToString(); ssVoltage.Text = value.ToString(); hmp.GetOverVoltageProtectionLevel(m_outputChannel, out value); txtOverProtectionLevel.Text = value.ToString(); hmp.GetOutputCurrentLevel(m_outputChannel, out value); txtOutputCurrentLevel.Text = value.ToString(); } m_hmp = hmp; } catch (Exception err) { MessageBox.Show(err.Message); } }
private void tsOutputEnable_CheckedChanged(object sender, EventArgs e) { m_hmp.SetOutputEnable(m_outputChannel, tsOutputEnable.Checked); m_hmp.GetOutputEnable(m_outputChannel, out bool enable); lbOnOff.On = enable; }