public SerialControllerPanel(SerialPortCtrl serialPort)
        {
            InitializeComponent();
            _serialPort = serialPort;

            BtnRefreshPortsClick(this, null);
        }
 void BtnRefreshPortsClick(object sender, EventArgs e)
 {
     comboPorts.Items.Clear();
     comboPorts.Items.AddRange(SerialPortCtrl.GetAllPorts());
     if (comboPorts.Items.Count > 0)
     {
         comboPorts.SelectedIndex = 0;
     }
 }
示例#3
0
        public void Initialize(ISharpControl control)
        {
            _control    = control;
            _serialPort = new SerialPortCtrl();
            _serialPort.OnFrequencyChange += UpdateFrequency;

            _controlPanel = new SerialControllerPanel(_serialPort);
            _controlPanel.readSettings();
        }
 public void Initialize(ISharpControl control)
 {
     _control = control;
     _control.PropertyChanged += PropertyChangedHandler;
     _LastRadioFrequency       = _control.Frequency;
     _LastRadioMode            = _control.DetectorType;
     _Protocol     = new Protocol_TS50(this);
     _serialPort   = new SerialPortCtrl(_Protocol);
     _controlPanel = new SerialControllerPanel(_serialPort);
     _controlPanel.readSettings();
 }