Esempio n. 1
0
        private void FillSerialPortList(StringBuilder builder)
        {
            this.serialPortList.Items.Add(string.Empty);

            this.serialPortList.Items.Add(SsmUtility.MockEcuDisplayName);

            if (SsmUtility.OpenPort20Exists())
            {
                this.serialPortList.Items.Add(SsmUtility.OpenPort20DisplayName);
            }

            foreach (string portName in System.IO.Ports.SerialPort.GetPortNames())
            {
                this.serialPortList.Items.Add(portName);
                builder.AppendLine("Added serial port " + portName);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Initialize the list of available serial ports.
        /// </summary>
        private void InitializeSerialPortList()
        {
            ignoreSerialPortChangeNotifications = true;

            if (SsmUtility.OpenPort20Exists())
            {
                Trace("Lumberjack.OpenPort20Exists: OpenPort 2.0 found.");
                this.ui.AddSsmSerialPort(SsmUtility.OpenPort20DisplayName);
            }
            else
            {
                Trace("Lumberjack.OpenPort20Exists: OpenPort 2.0 not found.");
            }

            this.ui.AddSsmSerialPort(MockEcuStream.PortName);
            this.ui.AddPlxSerialPort(ExternalSensors.NullSerialPortName);
            foreach (string name in System.IO.Ports.SerialPort.GetPortNames())
            {
                this.ui.AddSsmSerialPort(name);
                this.ui.AddPlxSerialPort(name);
            }

            ignoreSerialPortChangeNotifications = false;
        }