示例#1
0
        public SerialDatTest()
        {
            InitializeComponent();

            this.SerialData     = new SerialData.SerialData(this.SerialDataHandler);
            this.SerialDataForm = new SerialDataForm.SerialDataForm(this.SerialData);
            this.SerialDataForm.Show();
        }
示例#2
0
        //public SerialDataForm()
        //{
        //    Console.WriteLine("SerialDataForm class requires
        //    Environment.Exit(-1);
        //}

        public SerialDataForm(SerialData.SerialData serialData)
        {
            InitializeComponent();
            this.SerialData = serialData;

            //Set COM Ports dropdown list
            this.UpdateCOMPortDropdown();

            //Set baud rate dropdown list
            foreach (string baudRate in BaudRates)
            {
                this.BaudRateSelection.Items.Add(baudRate);
            }
            this.BaudRateSelection.SelectedIndex = BaudRates.Length - 3;

            //Set connected state text box
            SerialConnectionStateText.TextAlign = HorizontalAlignment.Center;
            SerialConnectionStateText.BackColor = Color.Red;
            SerialConnectionStateText.Text      = "Disconnected";
        }