Esempio n. 1
0
        public SerPortConf(SerPortConfig config)
        {
            int i;

            this.Build();
            this.config = config;
            for (i = 0; i < baudTable.Length; ++i)
            {
                baudRateComboBox.AppendText(baudTable[i].ToString());
            }
            for (i = 0; i < portNameTable.Length; ++i)
            {
                portNameComboBoxEntry.AppendText(portNameTable[i]);
            }
            foreach (String s in System.IO.Ports.SerialPort.GetPortNames())
            {
                i = Array.FindIndex(portNameTable, s.Equals);
                if (i == -1)
                {
                    Array.Resize(ref portNameTable, portNameTable.Length + 1);
                    portNameTable[portNameTable.Length - 1] = s;
                    portNameComboBoxEntry.AppendText(s);
                }
            }
            config.LoadConfig();
            SetGuiFromConfig();
            config.dataChanged += gconf_changed;
            System.Console.WriteLine("xwidth = " + baudRateComboBox.Allocation.X);
        }
Esempio n. 2
0
 public SerPort(string id)
 {
     config = new SerPortConfig(id);
 }