private void InitPealDevice() { List <string> pealNames = PedalDevice.GetComlist(false); foreach (string name in pealNames) { cbxPedal.Items.Add(name); } }
private void OpenPedal() { try { if (_pc == null) { _pc = PedalConfig.GetConfig(); } if (string.IsNullOrEmpty(_pc.PealDeviceName)) { _pc.CopyFrom(_defPedalPar); } if (string.IsNullOrEmpty(_pc.PealDeviceName)) { return; } if (_pedal == null) { _pedal = new PedalDevice(); this.Controls.Add(_pedal); _pedal.OnSerialSignal += SerialSignalProcess; } _pedal.Stop(); _pedal.InitDevice(_pc.PealDeviceName); _pedal.Start(); } catch (Exception ex) { MsgBox.ShowException(ex, this); } }