public static decimal GetVal(NumInputType t, decimal init, decimal max) { NumInputBox box = new NumInputBox(t, init, max); box.ShowDialog(); return(box.Val); }
private void SetCurrent(object sender, EventArgs e) { string resp = SendCommand("GETS00"); if (resp == null) { return; } var c = ExtractC(resp); resp = SendCommand("GMAX00"); var m = ExtractC(resp); c = NumInputBox.GetVal(NumInputBox.NumInputType.CURR, c, m); if (c == 0) { return; } SetCurrentText(c); c *= 100; SendSimpleCommand("CURR00" + c.ToString("000")); }
private void SetVoltage(object sender, EventArgs e) { string resp = SendCommand("GETS00"); if (resp == null) { return; } var v = ExtractV(resp); resp = SendCommand("GMAX00"); var m = ExtractV(resp); v = NumInputBox.GetVal(NumInputBox.NumInputType.VOLT, v, m); if (v == 0) { return; } SetVoltageText(v); v *= 10; SendSimpleCommand("VOLT00" + v.ToString("000")); }