예제 #1
0
        private void InitPealDevice()
        {
            List <string> pealNames = PedalDevice.GetComlist(false);

            foreach (string name in pealNames)
            {
                cbxPedal.Items.Add(name);
            }
        }
예제 #2
0
        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);
            }
        }