예제 #1
0
        private void add_bAddSource_Click(object sender, EventArgs e)
        {
            //Save the new Device.
            add_bSaveNewDevice.PerformClick();

            //Create and display the DataBoard form.
            var window = new DataBoard(_communicator, _selectedDevice);
            window.GoToCommunicatorPage();
            window.ShowDialog();

            //Get the Comm object created.
            _communicator = window.GetCommunicator();

            //Update the labels.
            UpdateStartLabels();
        }
예제 #2
0
        private void modify_bComms_Click(object sender, EventArgs e)
        {
            try
            {
                //Loads the relevant communicators.
                var controller = new CommunicatorController();
                modcomms_lbComms.Items.Clear();
                modcomms_lbComms.Items.AddRange(
                    controller.GetAllCommunicators().Where(c => c.Device.Id == _selectedDevice.Id).ToArray());

                if (modcomms_lbComms.Items.Count > 0)
                {
                    //Select the first element
                    modcomms_lbComms.SelectedItem = modcomms_lbComms.Items[0];

                    //Shows the modify tab.
                    pTabPanel.SelectedTab = pModifyCommunicators;
                }
                else
                {
                    var msg =
                        System.Windows.Forms.MessageBox.Show(
                            "There are no Communicators for this Device.", "No Communicators Available",
                            MessageBoxButtons.OK, MessageBoxIcon.Hand);

                    // -------- Create new communicator ----------

                    //Create and display the DataBoard form.
                    var window = new DataBoard(null, _selectedDevice);
                    window.GoToCommunicatorPage();
                    window.ShowDialog();

                    //Get the Comm object created.
                    _communicator = window.GetCommunicator();
                }
            }
            catch (Exception ex)
            {
                DebugOutput.Print("Could not load/store/update information for selected Device", ex.Message);
            }
        }
예제 #3
0
        private void modcomms_bAddNewComm_Click(object sender, EventArgs e)
        {
            //Create and display the DataBoard form.
            var window = new DataBoard(_communicator, _selectedDevice);
            window.GoToCommunicatorPage();
            window.ShowDialog();

            //Get the Comm object created.
            _communicator = window.GetCommunicator();

            //Return to Device list
            modcomms_bBack.PerformClick();
        }