コード例 #1
0
        //试验动作线程
        //Thread th_temp=null;
        #endregion

        #region 构造函数
        public Main(Login wnd)
        {
            InitializeComponent();
            serialPort = new InstrumentSerialPort(this);//仪器串口
            //创建借还扳手窗口,并隐藏
            borrowForm = new BorrowToolWnd();
            borrowForm.Hide();
            serialScanPort = new ScanSerialPort(this, borrowForm);//扫码枪串口
            this.wnd       = wnd;
        }
コード例 #2
0
        public ScanSerialPort(Main wnd, BorrowToolWnd borrowToolWnd)
            : base(wnd)
        {
            //界面传输
            this.MainForm      = wnd;
            this.borrowToolWnd = borrowToolWnd;

            this.wnd      = wnd;
            port.PortName = ConfigurationManager.AppSettings["ScanSerialPortName"];
            port.BaudRate = Int32.Parse(ConfigurationManager.AppSettings["ScanSerialBaudRate"].ToString());
            port.StopBits = System.IO.Ports.StopBits.Two;
        }