Exemplo n.º 1
0
        /// <summary>
        /// 保存参数
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnSaveMB_Click(object sender, EventArgs e)
        {
            try
            {
                SysIniFile ini = new SysIniFile(Application.StartupPath + @"\htcheckset.ini");

                ini.IniWriteValue("MB", "PORTNAME", drpPortName.Text);
                ini.IniWriteValue("MB", "BRATE", drpBaudrate.Text);

                ini.IniWriteValue("MB2", "PORTNAME", drpPortName2.Text);
                ini.IniWriteValue("MB2", "BRATE", drpBaudrate2.Text);

                this.ShowInfoMessage("参数设置成功,如需启作用,请关闭检验界面,重新打开");
            }
            catch (Exception E)
            {
                this.ShowMessage(E.Message);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 窗体加载
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void frmProductCheckSetting_Load(object sender, EventArgs e)
        {
            try
            {
                SysIniFile ini = new SysIniFile(Application.StartupPath + @"\htcheckset.ini");

                string pn = ini.IniReadValue("MB", "PORTNAME");
                if (pn != string.Empty)
                {
                    drpPortName.Text = pn;
                }

                string brate = ini.IniReadValue("MB", "BRATE");
                if (brate != string.Empty)
                {
                    drpBaudrate.Text = brate;
                }



                string pn2 = ini.IniReadValue("MB2", "PORTNAME");
                if (pn2 != string.Empty)
                {
                    drpPortName2.Text = pn2;
                }

                string brate2 = ini.IniReadValue("MB2", "BRATE");
                if (brate2 != string.Empty)
                {
                    drpBaudrate2.Text = brate2;
                }
            }
            catch (Exception E)
            {
                this.ShowMessage(E.Message);
            }
        }
Exemplo n.º 3
0
        private void Checking_Load(object sender, EventArgs e)
        {
            #region 初始化码表及模拟模式类
            htcpSerialPort = new HTCPSerialPort(this);//码表模式
            SysIniFile ini = new SysIniFile(Application.StartupPath + @"\htcheckset.ini");
            string     pn  = ini.IniReadValue("MB", "PORTNAME");
            if (pn != string.Empty)
            {
                htcpSerialPort.PortName = pn;
            }
            string brate = ini.IniReadValue("MB", "BRATE");
            if (SysConvert.ToInt32(brate) != 0)
            {
                htcpSerialPort.BroadRate = SysConvert.ToInt32(brate);
            }


            htcpVirtual = new HTCPVirtual(this); //模拟模式
            htcpInput   = new HTCPInput(this);   //录入模式
            #endregion

            //timerReadData.Enabled = false;
            //saveReadStartFlag = true;


            #region 扣分补码按钮相关
            btn1P.MouseUp       += new MouseEventHandler(btnKFBM_MouseUp);
            btn2P.MouseUp       += new MouseEventHandler(btnKFBM_MouseUp);
            btn3P.MouseUp       += new MouseEventHandler(btnKFBM_MouseUp);
            btn4P.MouseUp       += new MouseEventHandler(btnKFBM_MouseUp);
            btn0P.MouseUp       += new MouseEventHandler(btnKFBM_MouseUp);
            btn05M.MouseUp      += new MouseEventHandler(btnKFBM_MouseUp);
            btn1M.MouseUp       += new MouseEventHandler(btnKFBM_MouseUp);
            btn2M.MouseUp       += new MouseEventHandler(btnKFBM_MouseUp);
            btn3M.MouseUp       += new MouseEventHandler(btnKFBM_MouseUp);
            btnCDCancel.MouseUp += new MouseEventHandler(btnKFBM_MouseUp);

            btn1P.MouseDown       += new MouseEventHandler(btnKFBM_MouseDown);
            btn2P.MouseDown       += new MouseEventHandler(btnKFBM_MouseDown);
            btn3P.MouseDown       += new MouseEventHandler(btnKFBM_MouseDown);
            btn4P.MouseDown       += new MouseEventHandler(btnKFBM_MouseDown);
            btn0P.MouseDown       += new MouseEventHandler(btnKFBM_MouseDown);
            btn05M.MouseDown      += new MouseEventHandler(btnKFBM_MouseDown);
            btn1M.MouseDown       += new MouseEventHandler(btnKFBM_MouseDown);
            btn2M.MouseDown       += new MouseEventHandler(btnKFBM_MouseDown);
            btn3M.MouseDown       += new MouseEventHandler(btnKFBM_MouseDown);
            btnCDCancel.MouseDown += new MouseEventHandler(btnKFBM_MouseDown);

            btn1P.Click       += new EventHandler(btnKFBM_Click);
            btn2P.Click       += new EventHandler(btnKFBM_Click);
            btn3P.Click       += new EventHandler(btnKFBM_Click);
            btn4P.Click       += new EventHandler(btnKFBM_Click);
            btn0P.Click       += new EventHandler(btnKFBM_Click);
            btn05M.Click      += new EventHandler(btnKFBM_Click);
            btn1M.Click       += new EventHandler(btnKFBM_Click);
            btn2M.Click       += new EventHandler(btnKFBM_Click);
            btn3M.Click       += new EventHandler(btnKFBM_Click);
            btnCDCancel.Click += new EventHandler(btnCDCancel_Click);
            #endregion

            #region 弹出小键盘
            CheckKeyBoardCall(lblQty);
            CheckKeyBoardCall(lblQtyKG);
            CheckKeyBoardCall(lblJarNum);
            CheckKeyBoardCall(lblReelNo);
            CheckKeyBoardCall(lblKJQty);
            #endregion

            BindFastReportList(drpReportList, this.FormID);//待检清单

            //Common.BindReport(drpReportList, 1110,true);

            CreateCDList(pictureBox1);//绘制疵点项目

            CDInputSetCtlStatus(9);

            SetEntity(1);

            ReadStart();// = 0;//设置启动模式
        }