Ejemplo n.º 1
0
        public static decimal GetVal(NumInputType t, decimal init, decimal max)
        {
            NumInputBox box = new NumInputBox(t, init, max);

            box.ShowDialog();

            return(box.Val);
        }
Ejemplo n.º 2
0
        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"));
        }
Ejemplo n.º 3
0
        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"));
        }