7 partial class ConfigurationControl
13 private void InitLaserValues()
15 this.textBoxLaserX.Text = this.configuration.Laser.WorldCoordinates.X.ToString(CultureInfo.InvariantCulture);
16 this.textBoxLaserX.TextChanged += this.TextBoxLaserXOnTextChanged;
18 this.textBoxLaserY.Text = this.configuration.Laser.WorldCoordinates.Y.ToString(CultureInfo.InvariantCulture);
19 this.textBoxLaserY.TextChanged += this.TextBoxLaserYOnTextChanged;
21 this.textBoxLaserZ.Text = this.configuration.Laser.WorldCoordinates.Z.ToString(CultureInfo.InvariantCulture);
22 this.textBoxLaserZ.TextChanged += this.TextBoxLaserZOnTextChanged;
24 this.numericUpperRange.Value = (int) this.configuration.Laser.UpperRange;
25 this.numericUpperRange.ValueChanged +=
this.NumericUpperRangeOnValueChanged;
27 this.numericLowerRange.Value = (
int) this.configuration.Laser.LowerRange;
28 this.numericLowerRange.ValueChanged += this.NumericLowerRangeOnValueChanged;
30 this.numericOffset.Value = this.configuration.Laser.Offset;
31 this.numericOffset.ValueChanged += this.NumericOffsetOnValueChanged;
33 this.checkBoxMotorEnabled.Checked = this.configuration.Laser.MotorEnabled;
34 this.checkBoxMotorEnabled.CheckStateChanged += this.CheckBoxMotorEnabledOnCheckStateChanged;
36 this.numericSwipeMin.Value = (int)this.configuration.Laser.SwipeMin;
37 this.numericSwipeMin.ValueChanged +=
this.NumericSwipeMinOnValueChanged;
39 this.numericSwipeMax.Value = (
int) this.configuration.Laser.SwipeMax;
40 this.numericSwipeMax.ValueChanged += this.NumericSwipeMaxOnValueChanged;
50 private void TextBoxLaserXOnTextChanged(
object sender, EventArgs eventArgs)
52 this.configuration.Laser.WorldCoordinates.X =
float.Parse(this.textBoxLaserX.Text);
62 private void TextBoxLaserYOnTextChanged(
object sender, EventArgs eventArgs)
64 this.configuration.Laser.WorldCoordinates.Y =
float.Parse(this.textBoxLaserY.Text);
74 private void TextBoxLaserZOnTextChanged(
object sender, EventArgs eventArgs)
76 this.configuration.Laser.WorldCoordinates.Z =
float.Parse(this.textBoxLaserZ.Text);
86 private void NumericUpperRangeOnValueChanged(
object sender, EventArgs eventArgs)
88 this.configuration.Laser.UpperRange = (float)this.numericUpperRange.Value;
98 private void NumericLowerRangeOnValueChanged(
object sender, EventArgs eventArgs)
100 this.configuration.Laser.LowerRange = (float)this.numericLowerRange.Value;
110 private void NumericOffsetOnValueChanged(
object sender, EventArgs eventArgs)
112 this.configuration.Laser.Offset = (int)this.numericOffset.Value;
122 private void CheckBoxMotorEnabledOnCheckStateChanged(
object sender, EventArgs eventArgs)
124 this.configuration.Laser.MotorEnabled = this.checkBoxMotorEnabled.Checked;
134 private void NumericSwipeMinOnValueChanged(
object sender, EventArgs eventArgs)
136 this.configuration.Laser.SwipeMin = (float)this.numericSwipeMin.Value;
147 private void NumericSwipeMaxOnValueChanged(
object sender, EventArgs eventArgs)
149 this.configuration.Laser.SwipeMax = (float)this.numericSwipeMax.Value;
154 private void buttonLoadLaserDefaults_Click(
object sender, EventArgs e)
156 this.DetachLaserEvents();
158 this.InitLaserValues();
161 private void DetachLaserEvents()
163 this.textBoxLaserX.TextChanged -= this.TextBoxLaserXOnTextChanged;
164 this.textBoxLaserY.TextChanged -= this.TextBoxLaserYOnTextChanged;
165 this.textBoxLaserZ.TextChanged -= this.TextBoxLaserZOnTextChanged;
166 this.numericUpperRange.ValueChanged -= this.NumericUpperRangeOnValueChanged;
167 this.numericLowerRange.ValueChanged -= this.NumericLowerRangeOnValueChanged;
168 this.numericOffset.ValueChanged -= this.NumericOffsetOnValueChanged;
169 this.checkBoxMotorEnabled.CheckStateChanged -= this.CheckBoxMotorEnabledOnCheckStateChanged;
170 this.numericSwipeMin.ValueChanged -= this.NumericSwipeMinOnValueChanged;
171 this.numericSwipeMax.ValueChanged -= this.NumericSwipeMaxOnValueChanged;
static Laser CreateDefaultLaser()
Creates the default laser.
Class for accessing the configuration.