public void doublebtn_Click(object sender, EventArgs e) { @double doublewindow = new @double(); Thickness thick = new Thickness(10, 10, 10, 10); doublewindow.Margin = thick; this.replace.Children.Clear(); this.replace.Children.Add(doublewindow); }
private void SetEditStates(int idx) { switch (idx) { case (int)Datum.DatumTypes.BINARY: DatumType = new binary(); break; case (int)Datum.DatumTypes.BOOL: DatumType = new boolean(); break; case (int)Datum.DatumTypes.COMPLEX: DatumType = new complex(); break; case (int)Datum.DatumTypes.DATETIME: DatumType = new dateTime(); break; case (int)Datum.DatumTypes.DOUBLE: DatumType = new @double(); break; case (int)Datum.DatumTypes.HEX: DatumType = new hexadecimal(); break; case (int)Datum.DatumTypes.INT: DatumType = new integer(); break; case (int)Datum.DatumTypes.LONG: DatumType = new @long(); break; case (int)Datum.DatumTypes.OCT: DatumType = new octal(); break; case (int)Datum.DatumTypes.STRING: DatumType = new @string(); break; case (int)Datum.DatumTypes.UINT: DatumType = new unsignedInteger(); break; case (int)Datum.DatumTypes.ULONG: DatumType = new unsignedLong(); break; } }
private void btnDatum_Click(object sender, EventArgs e) { DatumForm form = new DatumForm(); ControlsToData(); form.Datum = _doubleValue; if (DialogResult.OK == form.ShowDialog()) { _doubleValue = form.Datum as @double; DataToControls(); } }
private void ControlsToData() { if (!edtDoubleValue.HasValue()) { _doubleValue = null; } else { if (_doubleValue == null) { _doubleValue = new @double(); } _doubleValue.value = edtDoubleValue.GetValue <double>(); _doubleValue.standardUnit = standardUnitControl.StandardUnit; } }
private void btnSubmit_Click(object sender, EventArgs e) { string input1 = edtQuickEntry.Text; string input2 = null; int idx = input1.IndexOf(" to ", System.StringComparison.Ordinal); if (idx != -1) { input2 = input1.Substring(idx + " to ".Length); input1 = input1.Substring(0, idx); } bool useLimitPair = false; List <Value> values1 = ElectricalUtils.ParseExpression(input1); List <Value> values2 = null; if (input2 != null) { values2 = ElectricalUtils.ParseExpression(input2); useLimitPair = true; } if (values1.Count > 0) { Value value1 = values1[0]; ErrorLimit errorLimit1 = value1.errorLimit; Value resolution1 = value1.resoluion; string unit1 = value1.unit; string val1 = value1.value; @double datum1 = value1.@double; _limit = new Limit(); if (!useLimitPair) { cmbLimitType.SelectedIndex = LIMIT_EXPECTED; var le = new LimitExpected { Item = datum1 }; _limit.Item = le; //20msV errlmt 0.01% res 1mV range 50mV to 10V range 100mV to 20V } else { cmbLimitType.SelectedIndex = LIMIT_PAIR; SingleLimit limit1 = new SingleLimit(); SingleLimit limit2 = new SingleLimit(); limit1.comparator = ComparisonOperator.GE; limit2.comparator = ComparisonOperator.LE; var lp = new LimitPair { Limit = new List <SingleLimit> { limit1, limit2 } }; limit1.Item = datum1; if (values2.Count > 0) { Value value2 = values2[0]; ErrorLimit errorLimit2 = value2.errorLimit; Value resolution2 = value2.resoluion; string unit2 = value2.unit; string val2 = value2.value; @double datum2 = value2.@double; limit2.Item = datum2; //20mV errlmt 0.01% res 1mV range 50mV to 10V range 100mV to 20V } _limit.Item = lp; } DataToControls(); } }