Exemplo n.º 1
0
 public SetDisplay(ProgramEditor programEditor)
 {
     this.programEditor = programEditor;
     this.comms = new Comms();
     InitializeComponent();
     this.Icon = Properties.Resources.rgb;
 }
Exemplo n.º 2
0
        public ConnectionSetup()
        {
            InitializeComponent();

            this.ports = new List<string>();
            this.timer = new System.Windows.Forms.Timer();
            this.timer.Tick += new EventHandler(TimerTick);
            this.timer.Interval = 100;
            this.timer.Enabled = true;
            this.timer.Start();
            RefreshPorts();
            if (this.ports.Count != 0)
            {
                this.serialPortList.SelectedIndex = this.ports.Count - 1;
            }
            this.connectionInfo.ReadOnly = true;
            this.connectionInfo.Clear();
            this.AppendText("Light Program - for Jilly!\n");
            this.simulator = new Simulator(this);
            this.lightChooser = new LightChooser(this);
            this.comms = new Comms();
            this.lightChooser.SetComms(this.comms);

            this.Icon = Properties.Resources.rgb;
        }
Exemplo n.º 3
0
 public Wait(ProgramEditor programEditor)
 {
     this.programEditor = programEditor;
     this.comms = new Comms();
     InitializeComponent();
     this.timeBar.Minimum = 0;
     this.timeBar.Maximum = 255;
     this.Icon = Properties.Resources.rgb;
 }
Exemplo n.º 4
0
 public void Disconnect(object sender = null, FormClosedEventArgs e = null)
 {
     this.lightChooser.Hide();
     this.connectButton.Enabled = true;
     this.simulator.Hide();
     this.comms.Disconnect();
     this.comms = new Comms();
     this.lightChooser.SetComms(this.comms);
 }
Exemplo n.º 5
0
 public LightChooser(ConnectionSetup connectionSetup)
 {
     this.connectionSetup = connectionSetup;
     this.comms = new Comms();
     this.programs = new Dictionary<int, ProgramListItem> ();
     this.programEditor = new ProgramEditor(this);
     InitializeComponent();
     this.programList.FormattingEnabled = false;
     this.Icon = Properties.Resources.rgb;
 }
Exemplo n.º 6
0
 public ProgramEditor(LightChooser lightChooser)
 {
     this.comms = new Comms();
     this.lightChooser = lightChooser;
     InitializeComponent();
     this.transition = new Transition(this);
     this.set_display = new SetDisplay(this);
     this.wait = new Wait(this);
     this.Icon = Properties.Resources.rgb;
 }
Exemplo n.º 7
0
 public void SetComms(Comms comms)
 {
     this.comms = comms;
 }
Exemplo n.º 8
0
 public void SetComms(Comms comms)
 {
     this.comms = comms;
     this.programEditor.SetComms(comms);
 }
Exemplo n.º 9
0
        private void ConnectClick(object sender, EventArgs e)
        {
            Disconnect();
            int index = this.serialPortList.SelectedIndex;
            if ((index < 0) || (index >= this.ports.Count))
            {
                this.AppendText("No port selected");
                return;
            }
            string port = this.ports[index];
            this.AppendText("Connecting to " + port + "...");
            this.connectButton.Enabled = false;

            if (port == simulation)
            {
                this.comms = new SimulatorComms();
                this.simulator.Show();
            }
            else
            {
                this.comms = new SerialComms();
            }
            this.comms.Connect(port);
            this.lightChooser.SetComms(this.comms);
        }
Exemplo n.º 10
0
 public void SetComms(Comms comms)
 {
     this.comms = comms;
     this.transition.SetComms(comms);
     this.set_display.SetComms(comms);
     this.wait.SetComms(comms);
 }