/// <summary> /// Поиск подключенных устройств /// </summary> private void searchConnectedDevices() { string[] ports = isTestApp ? DemoTera.FakePortNumbers() : System.IO.Ports.SerialPort.GetPortNames(); if (ports.Length > 0) { foreach (string pName in ports) { try { TeraDevice t; t = new TeraDevice(pName); if (t.IsExists) { ConnectedDevices.Add(t); }// MessageBox.Show(t.NameWithSerial() + " порт " + pName); else { t.Dispose(); } } catch { continue; } } } else { MessageBox.Show("Нет портов"); } }
public TeraCoeffsForm(TeraResultsForm resultForm, TeraDevice device) { InitializeComponent(); this.resultForm = resultForm; this.teraDevice = device; this.Text = String.Format("Коэффициенты коррекции тераомметра {0}", this.teraDevice.SerialNumber); coeffs = getCoeffs(); FillCoeffs(); //drawFields(); }