2using System.Collections.Generic;
3using System.ComponentModel;
8using System.Threading.Tasks;
9using System.Windows.Forms;
13 public partial class Light : Form
20 InitializeComponent();
21 lightBox.Items.Add(Microscope.TLHalogen);
22 lightBox.Items.Add(Microscope.RLHalogen);
23 lightBox.Items.Add(Microscope.HXP);
24 lightBox.SelectedIndex = 0;
30 int tl = Microscope.TLShutter.GetPosition();
31 int rl = Microscope.RLShutter.GetPosition();
32 int hxp = Microscope.HXPShutter.GetPosition();
34 tlShutterBox.Checked =
true;
36 tlShutterBox.Checked =
false;
38 rlShutterBox.Checked =
true;
40 rlShutterBox.Checked =
false;
42 hxpShutterBox.Checked =
true;
44 hxpShutterBox.Checked =
false;
45 percentLabel.Text = trackBar.Value +
"%";
53 private void trackBar_Scroll(
object sender, EventArgs e)
55 percentLabel.Text = trackBar.Value +
"%";
57 l.SetPosition(trackBar.Value);
65 private void tlShutterBox_CheckedChanged(
object sender, EventArgs e)
67 if(tlShutterBox.Checked)
68 Microscope.TLShutter.SetPosition(2);
70 Microscope.TLShutter.SetPosition(1);
78 private void rlShutterBox_CheckedChanged(
object sender, EventArgs e)
80 if (rlShutterBox.Checked)
81 Microscope.RLShutter.SetPosition(2);
83 Microscope.RLShutter.SetPosition(1);
91 private void hxpShutterBox_CheckedChanged(
object sender, EventArgs e)
93 if (hxpShutterBox.Checked)
94 Microscope.HXPShutter.SetPosition(2);
96 Microscope.HXPShutter.SetPosition(1);
104 private void lightBox_SelectedIndexChanged(
object sender, EventArgs e)
106 LightSource l = (LightSource)lightBox.SelectedItem;
109 int i = (int)l.GetPosition();
118 private void Light_Activated(
object sender, EventArgs e)
void UpdateGUI()
It updates the GUI to reflect the current state of the shutters.