Example #1
0
        private void Form1_Shown(object sender, EventArgs e)
        {
            if (GlobalVars.LoginUser == null)
            {
                GlobalVars.LoginUser          = new Common.Entities.iEAA.CmcsUser();
                GlobalVars.LoginUser.UserName = GlobalVars.AdminAccount;
                GlobalVars.LoginUser.Name     = "系统管理员";
            }
            if (GlobalVars.LoginUser != null)
            {
                lblLoginUserName.Text = GlobalVars.LoginUser.UserName;
            }

            //CommonDAO.GetInstance().ResetAllSysMessageStatus();

            this.InductorCoil1Port = commonDAO.GetAppletConfigInt32("#1汽车机械采样机急停端口");
            this.InductorCoil2Port = commonDAO.GetAppletConfigInt32("#2汽车机械采样机急停端口");
            this.InductorCoil3Port = commonDAO.GetAppletConfigInt32("#1火车机械采样机急停端口");
            this.InductorCoil4Port = commonDAO.GetAppletConfigInt32("#2火车机械采样机急停端口");
            this.InductorCoil5Port = commonDAO.GetAppletConfigInt32("#3火车机械采样机急停端口");
            // IO控制器
            Hardwarer.Iocer.OnReceived     += new IOC.JMDM20DIOV2.JMDM20DIOV2Iocer.ReceivedEventHandler(Iocer_Received);
            Hardwarer.Iocer.OnStatusChange += new IOC.JMDM20DIOV2.JMDM20DIOV2Iocer.StatusChangeHandler(Iocer_StatusChange);
            bool success = Hardwarer.Iocer.OpenCom(1, 9600);

            commonDAO.SetSignalDataValue(CommonAppConfig.GetInstance().AppIdentifier, eSignalDataName.IO控制器_连接状态.ToString(), success ? "1" : "0");
            // 打开集中管控首页
            btnOpenHomePage_Click(null, null);

            InitEquipmentStatus();
        }
Example #2
0
        private void FrmSetting_Load(object sender, EventArgs e)
        {
            try
            {
                cmbLibra_COM.SelectedIndex      = 0;
                cmbLibra_Bandrate.SelectedIndex = 0;
                cmbDataBits.SelectedIndex       = 0;
                cmbParity.SelectedIndex         = 0;

                labelX1.ForeColor = Color.Red;
                labelX4.ForeColor = Color.Red;

                txtCommonAppConfig.Text = CommonAppConfig.GetInstance().AppIdentifier;

                //电子秤
                SelectedComboItem("COM" + commonDAO.GetAppletConfigInt32("电子秤串口"), cmbLibra_COM);
                SelectedComboItem(commonDAO.GetAppletConfigString("电子秤波特率"), cmbLibra_Bandrate);
                SelectedComboItem(commonDAO.GetAppletConfigString("电子秤数据位"), cmbDataBits);
                SelectedComboItem(commonDAO.GetAppletConfigString("电子秤停止位"), cmbParity);
                // 读卡器
                //SelectedComboItem("COM" + commonDAO.GetAppletConfigInt32("Read_Write_COM"), cmbRead_Write_COM);
                //SelectedComboItem(commonDAO.GetAppletConfigString("Read_Write_Bandrate"), cmbRead_Write_Bandrate);
                //电子秤最小重量
                dInputLibraWeight.Value = commonDAO.GetAppletConfigDouble("电子秤最小重量");
                //是否启用称重
                chkIsUseWeight.Checked = Convert.ToBoolean(commonDAO.GetAppletConfigInt32("启用称重"));
            }
            catch (Exception ex)
            {
                MessageBoxEx.Show("参数初始化失败" + ex.Message, "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
            }
        }
Example #3
0
        /// <summary>
        /// 加载配置
        /// </summary>
        void LoadAppConfig()
        {
            #region 绑定语音类型

            List <string> arrVoices = voiceSpeaker.GetVoices();
            for (int i = 0; i < arrVoices.Count; i++)
            {
                DataItem comboitem = new DataItem(arrVoices[i]);
                cmbVoiceName.Items.Add(comboitem);
            }
            cmbVoiceName.SelectedIndex = 0;

            #endregion

            txtAppIdentifier.Text = commonAppConfig.AppIdentifier;
            txtSelfConnStr.Text   = commonAppConfig.SelfConnStr;
            chbStartup.Checked    = (commonDAO.GetAppletConfigString("开机启动") == "1");

            txtJxSamplerMachineCode.Text = commonDAO.GetAppletConfigString("采样机设备编码");

            // 车号识别
            iptxtRwer1.Value = commonDAO.GetAppletConfigString("车号识别1_IP地址");

            // LED显示屏
            iptxtLED1IP.Value = commonDAO.GetAppletConfigString("LED显示屏1_IP地址");

            // 语音
            SelectedComboBoxItem(cmbVoiceName, commonDAO.GetAppletConfigString("语音包").ToString());
            sldVoiceRate.Value   = commonDAO.GetAppletConfigInt32("语速");
            sldVoiceVolume.Value = commonDAO.GetAppletConfigInt32("音量");
            lblVoiceRate.Text    = sldVoiceRate.Value.ToString();
            lblVoiceVolume.Text  = sldVoiceVolume.Value.ToString();
        }
Example #4
0
        private void FrmSetting_Load(object sender, EventArgs e)
        {
            try
            {
                cmbLibra_COM.SelectedIndex      = 0;
                cmbLibra_Bandrate.SelectedIndex = 0;
                cmbDataBits.SelectedIndex       = 0;
                cmbParity.SelectedIndex         = 0;

                labelX4.ForeColor = Color.Red;

                txtAppIdentifier.Text = CommonAppConfig.GetInstance().AppIdentifier;
                txtSelfConnStr.Text   = CommonAppConfig.GetInstance().SelfConnStr;
                //存样柜
                SelectedComboItem("COM" + commonDAO.GetAppletConfigInt32("存样柜串口"), cmbLibra_COM);
                SelectedComboItem(commonDAO.GetAppletConfigString("存样柜波特率"), cmbLibra_Bandrate);
                SelectedComboItem(commonDAO.GetAppletConfigString("存样柜数据位"), cmbDataBits);
                SelectedComboItem(commonDAO.GetAppletConfigString("存样柜停止位"), cmbParity);
                dbi_OverDay.Value = commonDAO.GetAppletConfigInt32("存样柜超期天数");
            }
            catch (Exception ex)
            {
                MessageBoxEx.Show("参数初始化失败" + ex.Message, "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
            }
        }
Example #5
0
        private void FrmSetting_Load(object sender, EventArgs e)
        {
            try
            {
                labelX3.ForeColor = Color.Red;
                labelX4.ForeColor = Color.Red;

                txtAppIdentifier.Text = CommonAppConfig.GetInstance().AppIdentifier;
                txtSelfConnStr.Text   = CommonAppConfig.GetInstance().SelfConnStr;

                //电子秤
                SelectedComboItem("COM" + commonDAO.GetAppletConfigInt32("电子秤串口"), cmbLibra_COM);
                SelectedComboItem(commonDAO.GetAppletConfigString("电子秤波特率"), cmbLibra_Bandrate);
                SelectedComboItem(commonDAO.GetAppletConfigString("电子秤数据位"), cmbDataBits);
                SelectedComboItem(commonDAO.GetAppletConfigString("电子秤停止位"), cmbParity);
                dInputLibraWeight.Value = commonDAO.GetAppletConfigDouble("电子秤最小重量") * 1000;
                chkIsUseWeight.Checked  = Convert.ToBoolean(commonDAO.GetAppletConfigInt32("启用称重"));

                dobBarrelWeight.Value = commonDAO.GetAppletConfigDouble("人工样桶重量") * 1000;
                // 全局参数
                Old_Param = (cmbLibra_COM.SelectedIndex + 1).ToString() + (cmbLibra_Bandrate.SelectedItem as ComboItem).Text
                            + (cmbDataBits.SelectedItem as ComboItem).Text + (cmbParity.SelectedItem as ComboItem).Text
                            + dInputLibraWeight.Value.ToString() + chkIsUseWeight.Checked.ToString();
            }
            catch (Exception ex)
            {
                MessageBoxEx.Show("参数初始化失败" + ex.Message, "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
            }
        }
Example #6
0
        /// <summary>
        /// 执行所有任务
        /// </summary>
        void ExecuteAllTask()
        {
            taskSimpleScheduler.StartNewTask("初始化甲路皮带秤", () =>
            {
                bber1.OnDataReceived += Bber1_OnDataReceived;
                bber1.OnReceiveError += Bber1_OnReceiveError;
                if (bber1.OpenCom(commonDAO.GetAppletConfigInt32("甲路皮带秤串口号"), commonDAO.GetAppletConfigInt32("甲路皮带秤波特率"), 8, System.IO.Ports.StopBits.One, System.IO.Ports.Parity.None))
                {
                    this.rTxtOutputer.Output("甲路皮带秤串口打开成功", eOutputType.Important);
                }
                else
                {
                    this.rTxtOutputer.Output("甲路皮带秤串口打开失败", eOutputType.Error);
                }
            });

            taskSimpleScheduler.StartNewTask("初始化乙路皮带秤", () =>
            {
                bber2.OnDataReceived += Bber2_OnDataReceived;
                bber2.OnReceiveError += Bber2_OnReceiveError;
                if (bber2.OpenCom(commonDAO.GetAppletConfigInt32("乙路皮带秤串口号"), commonDAO.GetAppletConfigInt32("乙路皮带秤波特率"), 8, System.IO.Ports.StopBits.One, System.IO.Ports.Parity.None))
                {
                    this.rTxtOutputer.Output("乙路皮带秤串口打开成功", eOutputType.Important);
                }
                else
                {
                    this.rTxtOutputer.Output("乙路皮带秤串口打开失败", eOutputType.Error);
                }
            });
        }
Example #7
0
        /// <summary>
        /// 加载配置
        /// </summary>
        void LoadAppConfig()
        {
            txtAppIdentifier.Text = commonAppConfig.AppIdentifier;
            txtSelfConnStr.Text   = commonAppConfig.SelfConnStr;
            chbStartup.Checked    = (commonDAO.GetAppletConfigString("开机启动") == "1");

            txtJxSamplerMachineCode.Text = commonDAO.GetAppletConfigString("采样机设备编码");
            if (txtJxSamplerMachineCode.Text.Contains("1"))
            {
                txtSqlConnStr.Text = commonDAO.GetCommonAppletConfigString("#1汽车机械采样机接口连接字符串");
            }
            else if (txtJxSamplerMachineCode.Text.Contains("2"))
            {
                txtSqlConnStr.Text = commonDAO.GetCommonAppletConfigString("#2汽车机械采样机接口连接字符串");
            }
            // IO控制器
            SelectedComboBoxItem(cmbIocerCom, commonDAO.GetAppletConfigInt32("IO控制器_串口").ToString());
            SelectedComboBoxItem(cmbIocerBandrate, commonDAO.GetAppletConfigInt32("IO控制器_波特率").ToString());
            SelectedComboBoxItem(cmbIocerDataBits, commonDAO.GetAppletConfigInt32("IO控制器_数据位").ToString());
            SelectedComboBoxItem(cmbIocerStopBits, commonDAO.GetAppletConfigInt32("IO控制器_停止位").ToString());
            SelectedComboBoxItem(cmbIocerParity, commonDAO.GetAppletConfigInt32("IO控制器_校验位").ToString());
            SelectedComboBoxItem(cmbInductorCoil1Port, commonDAO.GetAppletConfigInt32("IO控制器_地感1端口").ToString());
            SelectedComboBoxItem(cmbInductorCoil2Port, commonDAO.GetAppletConfigInt32("IO控制器_地感2端口").ToString());
            SelectedComboBoxItem(cmbGate1UpPort, commonDAO.GetAppletConfigInt32("IO控制器_道闸1升杆端口").ToString());
            SelectedComboBoxItem(cmbGate1DownPort, commonDAO.GetAppletConfigInt32("IO控制器_道闸1降杆端口").ToString());
            SelectedComboBoxItem(cmbAffirmPort, commonDAO.GetAppletConfigInt32("IO控制器_确认按钮端口").ToString());

            // 车号识别
            iptxtRwer1.Value = commonDAO.GetAppletConfigString("车号识别1_IP地址");

            // LED显示屏
            iptxtLED1IP.Value = commonDAO.GetAppletConfigString("LED显示屏1_IP地址");
        }
Example #8
0
        public void InitFrom()
        {
            this.IsUseWeight = Convert.ToBoolean(commonDAO.GetAppletConfigInt32("启用称重"));

            this._CodePrinter = new CodePrinter(printDocument1);

            // 获取全自动制样机
        }
Example #9
0
        private void FrmSetting_Load(object sender, EventArgs e)
        {
            try
            {
                labelX1.ForeColor  = Color.Red;
                labelX4.ForeColor  = Color.Red;
                labelX12.ForeColor = Color.Red;
                labelX11.ForeColor = Color.Red;
                labelX25.ForeColor = Color.Red;
                labelX30.ForeColor = Color.Red;

                txtAppIdentifier.Text = CommonAppConfig.GetInstance().AppIdentifier;
                txtSelfConnStr.Text   = CommonAppConfig.GetInstance().SelfConnStr;

                SelectedComboItem(commonDAO.GetCommonAppletConfigString(CommonAppConfig.GetInstance().AppIdentifier + "对应制样机"), cmbMake);

                //电子秤
                SelectedComboItem("COM" + commonDAO.GetAppletConfigInt32("电子秤串口"), cmbLibra_COM);
                SelectedComboItem(commonDAO.GetAppletConfigString("电子秤波特率"), cmbLibra_Bandrate);
                SelectedComboItem(commonDAO.GetAppletConfigString("电子秤数据位"), cmbDataBits);
                SelectedComboItem(commonDAO.GetAppletConfigString("电子秤停止位"), cmbParity);
                dInputLibraWeight.Value = commonDAO.GetAppletConfigDouble("电子秤最小重量");
                chkIsUseWeight.Checked  = Convert.ToBoolean(commonDAO.GetAppletConfigInt32("启用称重"));
                dobBarrelWeight.Value   = commonDAO.GetAppletConfigDouble("人工样桶重量");

                //电子天平
                SelectedComboItem("COM" + commonDAO.GetAppletConfigInt32("电子天平串口"), cmbLibramin_COM);
                SelectedComboItem(commonDAO.GetAppletConfigString("电子天平波特率"), cmbLibramin_Bandrate);
                SelectedComboItem(commonDAO.GetAppletConfigString("电子天平数据位"), cmbminDataBits);
                SelectedComboItem(commonDAO.GetAppletConfigString("电子天平停止位"), cmbminParity);
                dInputLibraminWeight.Value = commonDAO.GetAppletConfigDouble("电子天平最小重量");
                chkminIsUseWeight.Checked  = Convert.ToBoolean(commonDAO.GetAppletConfigInt32("电子天平启用称重"));

                // 读卡器
                iptxtIP.Value = commonDAO.GetAppletConfigString("读卡器IP");
                txtPort.Text  = commonDAO.GetAppletConfigString("读卡器端口");
                SelectedComboItem(commonDAO.GetAppletConfigString("读卡器扇区"), cmbSecNumber);
                SelectedComboItem(commonDAO.GetAppletConfigString("读卡器块区"), cmbBlockNumber);

                //样罐
                db2Weight.Value = commonDAO.GetCommonAppletConfigDouble("0.2mm样罐重");
                db3Weight.Value = commonDAO.GetCommonAppletConfigDouble("3mm样罐重");
                db6Weight.Value = commonDAO.GetCommonAppletConfigDouble("6mm样罐重");

                db2OverWeight.Value = commonDAO.GetCommonAppletConfigDouble("0.2mm超差重");
                db3OverWeight.Value = commonDAO.GetCommonAppletConfigDouble("3mm超差重");
                db6OverWeight.Value = commonDAO.GetCommonAppletConfigDouble("6mm超差重");

                // 全局参数
                Old_Param = (cmbLibra_COM.SelectedIndex + 1).ToString() + (cmbLibra_Bandrate.SelectedItem as ComboItem).Text
                            + (cmbDataBits.SelectedItem as ComboItem).Text + (cmbParity.SelectedItem as ComboItem).Text
                            + dInputLibraWeight.Value.ToString() + chkIsUseWeight.Checked.ToString();
            }
            catch (Exception ex)
            {
                MessageBoxEx.Show("参数初始化失败" + ex.Message, "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
            }
        }
Example #10
0
        public void InitFrom()
        {
            this.IsUseWeight = Convert.ToBoolean(commonDAO.GetAppletConfigInt32("启用称重"));

            this._CodePrinter = new CodePrinter(printDocument1);

            // 获取全自动制样机
            this.AutoMaker = commonDAO.GetCMEquipmentByMachineCode(commonDAO.GetAppletConfigString("全自动制样机编码"));
        }
        public void InitFrom()
        {
            this.IsUseWeight = Convert.ToBoolean(commonDAO.GetAppletConfigInt32("启用称重"));

            this._CodePrinter = new CodePrinter(printDocument1);

            // 获取全自动制样机
            this.AutoMaker = commonDAO.GetCMEquipmentByMachineCode(commonDAO.GetCommonAppletConfigString(CommonAppConfig.GetInstance().AppIdentifier + "对应制样机"));
        }
Example #12
0
        /// <summary>
        /// 写卡
        /// </summary>
        /// <returns></returns>
        private string WriteRf(string rf)
        {
            byte SecNumber   = Convert.ToByte(commonDAO.GetAppletConfigInt32("读卡器扇区"));
            byte BlockNumber = Convert.ToByte(commonDAO.GetAppletConfigInt32("读卡器块区"));

            if (!Hardwarer.ReadRwer.OpenRF())
            {
                ShowMessage("射频打开失败!", eOutputType.Error);
                return(string.Empty);
            }

            if (!Hardwarer.ReadRwer.ChangeToISO14443A())
            {
                ShowMessage("切换到1443模式失败!", eOutputType.Error);
                return(string.Empty);
            }

            if (!Hardwarer.ReadRwer.Request14443A())
            {
                ShowMessage("获取卡类型失败!", eOutputType.Error);
                return(string.Empty);
            }

            if (!Hardwarer.ReadRwer.Anticoll14443A())
            {
                ShowMessage("获取卡号失败!", eOutputType.Error);
                return(string.Empty);
            }

            if (!Hardwarer.ReadRwer.Select14443A())
            {
                ShowMessage("获取卡容量失败!", eOutputType.Error);
                return(string.Empty);
            }

            if (!Hardwarer.ReadRwer.AuthKey14443A(SecNumber, BlockNumber))
            {
                ShowMessage("标签密钥验证失败!", eOutputType.Error);
                return(string.Empty);
            }
            if (Hardwarer.ReadRwer.Write14443(rf, Convert.ToInt32(SecNumber), Convert.ToInt32(BlockNumber)))
            {
                ShowMessage("编码:" + rf + "写卡成功", eOutputType.Normal);
                string rf_new = Hardwarer.ReadRwer.Byte16ToString(Hardwarer.ReadRwer.RWRead14443A(SecNumber, BlockNumber));
                if (rf == rf_new)
                {
                    ShowMessage("编码:" + rf + "读卡验证成功", eOutputType.Normal);
                    return(rf_new);
                }
            }

            return(string.Empty);
        }
Example #13
0
        /// <summary>
        /// 加载配置
        /// </summary>
        void LoadAppConfig()
        {
            txtAppIdentifier.Text = commonAppConfig.AppIdentifier;
            txtSelfConnStr.Text   = commonAppConfig.SelfConnStr;
            chbStartup.Checked    = (commonDAO.GetAppletConfigString("开机启动") == "1");

            // 地磅仪表
            SelectedComboBoxItem(cmbWberCom, commonDAO.GetAppletConfigInt32("地磅仪表_串口").ToString());
            SelectedComboBoxItem(cmbWberBandrate, commonDAO.GetAppletConfigInt32("地磅仪表_波特率").ToString());
            SelectedComboBoxItem(cmbWberDataBits, commonDAO.GetAppletConfigInt32("地磅仪表_数据位").ToString());
            SelectedComboBoxItem(cmbWberStopBits, commonDAO.GetAppletConfigInt32("地磅仪表_停止位").ToString());
            SelectedComboBoxItem(cmbWberParity, commonDAO.GetAppletConfigInt32("地磅仪表_校验位").ToString());
            dbtxtMinWeight.Value = commonDAO.GetAppletConfigDouble("地磅仪表_最小称重");
        }
Example #14
0
        /// <summary>
        /// 初始化
        /// </summary>
        public void InitFrom()
        {
            this.IsUseWeight  = Convert.ToBoolean(commonDAO.GetAppletConfigInt32("启用称重"));
            this._CodePrinter = new CodePrinter(printDocument1);

            // 生成编码按钮
            GridButtonXEditControl btnNewCode = superGridControl1.PrimaryGrid.Columns["gclmNewCode"].EditControl as GridButtonXEditControl;

            btnNewCode.ColorTable = eButtonColor.BlueWithBackground;
            btnNewCode.Click     += new EventHandler(btnNewCode_Click);
            // 打印编码按钮
            GridButtonXEditControl btnPrintCode = superGridControl1.PrimaryGrid.Columns["gclmPrintCode"].EditControl as GridButtonXEditControl;

            btnNewCode.ColorTable = eButtonColor.BlueWithBackground;
            btnPrintCode.Click   += new EventHandler(btnPrintCode_Click);
        }
Example #15
0
        public void InitFrom()
        {
            // 生成取样按钮
            GridButtonXEditControl btnNewCode = superGridControl1.PrimaryGrid.Columns["gclmTakeSample"].EditControl as GridButtonXEditControl;

            btnNewCode.ColorTable = eButtonColor.BlueWithBackground;
            btnNewCode.Click     += new EventHandler(btnTakeCupBoard_Click);
            Over_Day = commonDAO.GetAppletConfigInt32("存样柜超期天数");
        }
Example #16
0
        private void FrmSetting_Load(object sender, EventArgs e)
        {
            try
            {
                labelX1.ForeColor  = Color.Red;
                labelX4.ForeColor  = Color.Red;
                labelX12.ForeColor = Color.Red;
                labelX17.ForeColor = Color.Red;
                labelX23.ForeColor = Color.Red;

                txtAppIdentifier.Text = CommonAppConfig.GetInstance().AppIdentifier;
                txtSelfConnStr.Text   = CommonAppConfig.GetInstance().SelfConnStr;

                //电子天平
                SelectedComboItem("COM" + commonDAO.GetAppletConfigInt32("天平1串口"), cmbLibra_COM);
                SelectedComboItem(commonDAO.GetAppletConfigString("天平1波特率"), cmbLibra_Bandrate);
                SelectedComboItem(commonDAO.GetAppletConfigString("天平1数据位"), cmbDataBits);
                SelectedComboItem(commonDAO.GetAppletConfigString("天平1停止位"), cmbParity);

                SelectedComboItem("COM" + commonDAO.GetAppletConfigInt32("天平2串口"), cmbLibra_COM2);
                SelectedComboItem(commonDAO.GetAppletConfigString("天平2波特率"), cmbLibra_Bandrate2);
                SelectedComboItem(commonDAO.GetAppletConfigString("天平2数据位"), cmbDataBits2);
                SelectedComboItem(commonDAO.GetAppletConfigString("天平2停止位"), cmbParity2);

                SelectedComboItem("COM" + commonDAO.GetAppletConfigInt32("天平3串口"), cmbLibra_COM3);
                SelectedComboItem(commonDAO.GetAppletConfigString("天平3波特率"), cmbLibra_Bandrate3);
                SelectedComboItem(commonDAO.GetAppletConfigString("天平3数据位"), cmbDataBits3);
                SelectedComboItem(commonDAO.GetAppletConfigString("天平3停止位"), cmbParity3);

                SelectedComboItem("COM" + commonDAO.GetAppletConfigInt32("天平4串口"), cmbLibra_COM4);
                SelectedComboItem(commonDAO.GetAppletConfigString("天平4波特率"), cmbLibra_Bandrate4);
                SelectedComboItem(commonDAO.GetAppletConfigString("天平4数据位"), cmbDataBits4);
                SelectedComboItem(commonDAO.GetAppletConfigString("天平4停止位"), cmbParity4);

                SelectedComboItem("COM" + commonDAO.GetAppletConfigInt32("天平5串口"), cmbLibra_COM5);
                SelectedComboItem(commonDAO.GetAppletConfigString("天平5波特率"), cmbLibra_Bandrate5);
                SelectedComboItem(commonDAO.GetAppletConfigString("天平5数据位"), cmbDataBits5);
                SelectedComboItem(commonDAO.GetAppletConfigString("天平5停止位"), cmbParity5);
            }
            catch (Exception ex)
            {
                MessageBoxEx.Show("参数初始化失败" + ex.Message, "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
            }
        }
Example #17
0
        private void FrmSetting_Load(object sender, EventArgs e)
        {
            try
            {
                labelX1.ForeColor  = Color.Red;
                labelX4.ForeColor  = Color.Red;
                labelX14.ForeColor = Color.Red;
                labelX10.ForeColor = Color.Red;

                txtAppIdentifier.Text = commonAppConfig.AppIdentifier;
                txtSelfConnStr.Text   = commonAppConfig.SelfConnStr;
                // 读卡器
                iptxtIP.Value = commonDAO.GetAppletConfigString("读卡器IP");
                txtPort.Text  = commonDAO.GetAppletConfigString("读卡器端口");
                SelectedComboItem(commonDAO.GetAppletConfigString("读卡器扇区"), cmbSecNumber);
                SelectedComboItem(commonDAO.GetAppletConfigString("读卡器块区"), cmbBlockNumber);

                //电子秤
                SelectedComboItem("COM" + commonDAO.GetAppletConfigInt32("电子秤串口"), cmbLibra_COM);
                SelectedComboItem(commonDAO.GetAppletConfigString("电子秤波特率"), cmbLibra_Bandrate);
                SelectedComboItem(commonDAO.GetAppletConfigString("电子秤数据位"), cmbDataBits);
                SelectedComboItem(commonDAO.GetAppletConfigString("电子秤停止位"), cmbParity);
                //电子秤最小重量
                dInputLibraWeight.Value = commonDAO.GetAppletConfigDouble("电子秤最小重量");
                //是否启用称重
                chkIsUseWeight.Checked = Convert.ToBoolean(commonDAO.GetAppletConfigInt32("启用称重"));

                //样罐
                db2Weight.Value = commonDAO.GetCommonAppletConfigDouble("0.2mm样罐重");
                db3Weight.Value = commonDAO.GetCommonAppletConfigDouble("3mm样罐重");
                db6Weight.Value = commonDAO.GetCommonAppletConfigDouble("6mm样罐重");

                db2OverWeight.Value = commonDAO.GetCommonAppletConfigDouble("0.2mm超差重");
                db3OverWeight.Value = commonDAO.GetCommonAppletConfigDouble("3mm超差重");
                db6OverWeight.Value = commonDAO.GetCommonAppletConfigDouble("6mm超差重");
            }
            catch (Exception ex)
            {
                MessageBoxEx.Show("参数初始化失败" + ex.Message, "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
            }
        }
Example #18
0
        /// <summary>
        /// 初始化
        /// </summary>
        public void InitFrom()
        {
            cmbAssayType.Items.Add("三级编码化验");
            cmbAssayType.Items.Add("抽查样化验");
            cmbAssayType.Items.Add("复查样化验");
            cmbAssayType.SelectedIndex = 0;

            this.IsUseWeight  = Convert.ToBoolean(commonDAO.GetAppletConfigInt32("电子天平启用称重"));
            this._CodePrinter = new CodePrinterMake(printDocument1);

            // 生成编码按钮
            GridButtonXEditControl btnNewCode = superGridControl1.PrimaryGrid.Columns["gclmNewCode"].EditControl as GridButtonXEditControl;

            btnNewCode.ColorTable = eButtonColor.BlueWithBackground;
            btnNewCode.Click     += new EventHandler(btnNewCode_Click);
            // 打印编码按钮
            GridButtonXEditControl btnPrintCode = superGridControl1.PrimaryGrid.Columns["gclmPrintCode"].EditControl as GridButtonXEditControl;

            btnPrintCode.ColorTable = eButtonColor.BlueWithBackground;
            btnPrintCode.Click     += new EventHandler(btnPrintCode_Click);
            // 写入编码按钮
            GridButtonXEditControl btnWriteCode = superGridControl1.PrimaryGrid.Columns["gclmWriteCode"].EditControl as GridButtonXEditControl;

            btnWriteCode.ColorTable = eButtonColor.BlueWithBackground;
            btnWriteCode.Click     += new EventHandler(btnWriteCode_Click);
        }
Example #19
0
        /// <summary>
        /// 道闸1升杆
        /// </summary>
        public void Gate1Up()
        {
#if DEBUG
            FrmDebugConsole.GetInstance().Output("道闸1升杆");
#endif
            int port = commonDAO.GetAppletConfigInt32("IO控制器_道闸1升杆端口");

            this.Iocer.Output(port, true);
            Thread.Sleep(100);
            this.Iocer.Output(port, false);
            Thread.Sleep(500);

            commonDAO.SetSignalDataValue(CommonAppConfig.GetInstance().AppIdentifier, eSignalDataName.道闸1升杆.ToString(), "1");
        }
Example #20
0
        /// <summary>
        /// 初始化外接设备
        /// </summary>
        private void InitHardware()
        {
            try
            {
                bool success = false;
                Hardwarer.Iocer.OnStatusChange += new CupCoard.DJ.CupCoard_DJ.StatusChangeHandler(OnReceiveStatus);

                success = Hardwarer.Iocer.OpenCom(commonDAO.GetAppletConfigInt32("存样柜串口"), commonDAO.GetAppletConfigInt32("存样柜波特率"));
            }
            catch (Exception ex)
            {
                Log4Neter.Error("设备初始化", ex);
            }
        }
Example #21
0
        /// <summary>
        /// 初始化外接设备
        /// </summary>
        private void InitHardware()
        {
            try
            {
                bool success = false;

                wber.OnStatusChange += new WB.Sartorius.Balance.Sartorius_Balance.StatusChangeHandler(wber_OnStatusChange);
                wber.OnWeightChange += new WB.Sartorius.Balance.Sartorius_Balance.WeightChangeEventHandler(wber_OnWeightChange);

                success = wber.OpenCom(commonDAO.GetAppletConfigInt32(string.Format("{0}串口", MachineCode)), commonDAO.GetAppletConfigInt32(string.Format("{0}波特率", MachineCode)), commonDAO.GetAppletConfigInt32(string.Format("{0}数据位", MachineCode)), commonDAO.GetAppletConfigInt32(string.Format("{0}校验位", MachineCode)));

                timer1.Enabled = true;
            }
            catch (Exception ex)
            {
                Log4Neter.Error("设备初始化", ex);
            }
        }
Example #22
0
        /// <summary>
        /// 初始化外接设备
        /// </summary>
        private void InitHardware()
        {
            try
            {
                bool success = false;

                this.InductorCoil1Port = commonDAO.GetAppletConfigInt32("IO控制器_地感1端口");
                this.InductorCoil2Port = commonDAO.GetAppletConfigInt32("IO控制器_地感2端口");
                this.InductorCoil3Port = commonDAO.GetAppletConfigInt32("IO控制器_地感3端口");
                this.InductorCoil4Port = commonDAO.GetAppletConfigInt32("IO控制器_地感4端口");
                this.InductorCoil3Port = commonDAO.GetAppletConfigInt32("IO控制器_地感3端口");

                // IO控制器
                Hardwarer.Iocer.OnReceived     += new IOC.JMDM20DIOV2.JMDM20DIOV2Iocer.ReceivedEventHandler(Iocer_Received);
                Hardwarer.Iocer.OnStatusChange += new IOC.JMDM20DIOV2.JMDM20DIOV2Iocer.StatusChangeHandler(Iocer_StatusChange);
                success = Hardwarer.Iocer.OpenCom(commonDAO.GetAppletConfigInt32("IO控制器_串口"), commonDAO.GetAppletConfigInt32("IO控制器_波特率"), commonDAO.GetAppletConfigInt32("IO控制器_数据位"), (StopBits)commonDAO.GetAppletConfigInt32("IO控制器_停止位"), (Parity)commonDAO.GetAppletConfigInt32("IO控制器_校验位"));
                if (!success)
                {
                    MessageBoxEx.Show("IO控制器连接失败!", "操作提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                this.iocControler = new IocControler(Hardwarer.Iocer);

                // 读卡器1
                Hardwarer.Rwer1.StartWith       = commonDAO.GetAppletConfigString("读卡器_标签过滤");
                Hardwarer.Rwer1.OnStatusChange += new RW.LZR12.Net.Lzr12Rwer.StatusChangeHandler(Rwer1_OnStatusChange);
                Hardwarer.Rwer1.OnScanError    += new RW.LZR12.Net.Lzr12Rwer.ScanErrorEventHandler(Rwer1_OnScanError);
                success = CommonUtil.PingReplyTest(commonDAO.GetAppletConfigString("读卡器1_IP地址")) && Hardwarer.Rwer1.OpenCom(commonDAO.GetAppletConfigString("读卡器1_IP地址"), 500, Convert.ToByte(commonDAO.GetAppletConfigInt32("读卡器1_功率")));
                if (!success)
                {
                    MessageBoxEx.Show("读卡器1连接失败!", "操作提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }

                //语音设置
                voiceSpeaker.SetVoice(commonDAO.GetAppletConfigInt32("语速"), commonDAO.GetAppletConfigInt32("音量"), commonDAO.GetAppletConfigString("语音包"));

                timer1.Enabled = true;
            }
            catch (Exception ex)
            {
                Log4Neter.Error("设备初始化", ex);
            }
        }
Example #23
0
        /// <summary>
        /// 初始化外接设备
        /// </summary>
        private void InitHardware()
        {
            try
            {
                bool success = false;

                this.WbMinWeight = commonDAO.GetAppletConfigDouble("地磅仪表_最小称重");

                // 地磅仪表
                Hardwarer.Wber.OnStatusChange += new WB.TOLEDO.YAOHUA.TOLEDO_YAOHUAWber.StatusChangeHandler(Wber_OnStatusChange);
                Hardwarer.Wber.OnSteadyChange += new WB.TOLEDO.YAOHUA.TOLEDO_YAOHUAWber.SteadyChangeEventHandler(Wber_OnSteadyChange);
                Hardwarer.Wber.OnWeightChange += new WB.TOLEDO.YAOHUA.TOLEDO_YAOHUAWber.WeightChangeEventHandler(Wber_OnWeightChange);
                success = Hardwarer.Wber.OpenCom(commonDAO.GetAppletConfigInt32("地磅仪表_串口"), commonDAO.GetAppletConfigInt32("地磅仪表_波特率"), commonDAO.GetAppletConfigInt32("地磅仪表_数据位"), commonDAO.GetAppletConfigInt32("地磅仪表_停止位"));

                timer1.Enabled = true;
            }
            catch (Exception ex)
            {
                Log4Neter.Error("设备初始化", ex);
            }
        }
Example #24
0
        /// <summary>
        /// 初始化外接设备
        /// </summary>
        private void InitHardware()
        {
            try
            {
                bool     success = false;
                string[] carriageRecognitionerMachineCodes = new string[] { "天平1", "天平2", "天平3", "天平4", "天平5", "天平6" };
                Hardwarer.Wber1.OnStatusChange += new WB.Sartorius.Balance.Sartorius_Balance.StatusChangeHandler(wber_OnStatusChange);
                Hardwarer.Wber1.OnWeightChange += new WB.Sartorius.Balance.Sartorius_Balance.WeightChangeEventHandler(wber_OnWeightChange);
                MachineCode = carriageRecognitionerMachineCodes[0];
                success     = Hardwarer.Wber1.OpenCom(commonDAO.GetAppletConfigInt32(string.Format("{0}串口", MachineCode)), commonDAO.GetAppletConfigInt32(string.Format("{0}波特率", MachineCode)), commonDAO.GetAppletConfigInt32(string.Format("{0}数据位", MachineCode)), commonDAO.GetAppletConfigInt32(string.Format("{0}校验位", MachineCode)), MachineCode);

                Hardwarer.Wber2.OnStatusChange += new WB.Sartorius.Balance.Sartorius_Balance.StatusChangeHandler(wber_OnStatusChange);
                Hardwarer.Wber2.OnWeightChange += new WB.Sartorius.Balance.Sartorius_Balance.WeightChangeEventHandler(wber_OnWeightChange);
                MachineCode = carriageRecognitionerMachineCodes[1];
                success     = Hardwarer.Wber2.OpenCom(commonDAO.GetAppletConfigInt32(string.Format("{0}串口", MachineCode)), commonDAO.GetAppletConfigInt32(string.Format("{0}波特率", MachineCode)), commonDAO.GetAppletConfigInt32(string.Format("{0}数据位", MachineCode)), commonDAO.GetAppletConfigInt32(string.Format("{0}校验位", MachineCode)), MachineCode);

                Hardwarer.Wber3.OnStatusChange += new WB.Sartorius.Balance.Sartorius_Balance.StatusChangeHandler(wber_OnStatusChange);
                Hardwarer.Wber3.OnWeightChange += new WB.Sartorius.Balance.Sartorius_Balance.WeightChangeEventHandler(wber_OnWeightChange);
                MachineCode = carriageRecognitionerMachineCodes[2];
                success     = Hardwarer.Wber3.OpenCom(commonDAO.GetAppletConfigInt32(string.Format("{0}串口", MachineCode)), commonDAO.GetAppletConfigInt32(string.Format("{0}波特率", MachineCode)), commonDAO.GetAppletConfigInt32(string.Format("{0}数据位", MachineCode)), commonDAO.GetAppletConfigInt32(string.Format("{0}校验位", MachineCode)), MachineCode);

                Hardwarer.Wber4.OnStatusChange += new WB.Sartorius.Balance.Sartorius_Balance.StatusChangeHandler(wber_OnStatusChange);
                Hardwarer.Wber4.OnWeightChange += new WB.Sartorius.Balance.Sartorius_Balance.WeightChangeEventHandler(wber_OnWeightChange);
                MachineCode = carriageRecognitionerMachineCodes[3];
                success     = Hardwarer.Wber4.OpenCom(commonDAO.GetAppletConfigInt32(string.Format("{0}串口", MachineCode)), commonDAO.GetAppletConfigInt32(string.Format("{0}波特率", MachineCode)), commonDAO.GetAppletConfigInt32(string.Format("{0}数据位", MachineCode)), commonDAO.GetAppletConfigInt32(string.Format("{0}校验位", MachineCode)), MachineCode);

                Hardwarer.Wber5.OnStatusChange += new WB.Sartorius.Balance.Sartorius_Balance.StatusChangeHandler(wber_OnStatusChange);
                Hardwarer.Wber5.OnWeightChange += new WB.Sartorius.Balance.Sartorius_Balance.WeightChangeEventHandler(wber_OnWeightChange);
                MachineCode = carriageRecognitionerMachineCodes[4];
                success     = Hardwarer.Wber5.OpenCom(commonDAO.GetAppletConfigInt32(string.Format("{0}串口", MachineCode)), commonDAO.GetAppletConfigInt32(string.Format("{0}波特率", MachineCode)), commonDAO.GetAppletConfigInt32(string.Format("{0}数据位", MachineCode)), commonDAO.GetAppletConfigInt32(string.Format("{0}校验位", MachineCode)), MachineCode);

                Hardwarer.Wber6.OnStatusChange += new WB.Sartorius.Balance.Sartorius_Balance.StatusChangeHandler(wber_OnStatusChange);
                Hardwarer.Wber6.OnWeightChange += new WB.Sartorius.Balance.Sartorius_Balance.WeightChangeEventHandler(wber_OnWeightChange);
                MachineCode = carriageRecognitionerMachineCodes[5];
                success     = Hardwarer.Wber6.OpenCom(commonDAO.GetAppletConfigInt32(string.Format("{0}串口", MachineCode)), commonDAO.GetAppletConfigInt32(string.Format("{0}波特率", MachineCode)), commonDAO.GetAppletConfigInt32(string.Format("{0}数据位", MachineCode)), commonDAO.GetAppletConfigInt32(string.Format("{0}校验位", MachineCode)), MachineCode);

                timer1.Enabled = true;
            }
            catch (Exception ex)
            {
                Log4Neter.Error("设备初始化", ex);
            }
        }
Example #25
0
        /// <summary>
        /// 加载配置
        /// </summary>
        void LoadAppConfig()
        {
            txtAppIdentifier.Text = commonAppConfig.AppIdentifier;
            txtSelfConnStr.Text   = commonAppConfig.SelfConnStr;
            chbStartup.Checked    = (commonDAO.GetAppletConfigString("开机启动") == "1");

            // IO控制器
            SelectedComboBoxItem(cmbIocerCom, commonDAO.GetAppletConfigInt32("IO控制器_串口").ToString());
            SelectedComboBoxItem(cmbIocerBandrate, commonDAO.GetAppletConfigInt32("IO控制器_波特率").ToString());
            SelectedComboBoxItem(cmbIocerDataBits, commonDAO.GetAppletConfigInt32("IO控制器_数据位").ToString());
            SelectedComboBoxItem(cmbIocerStopBits, commonDAO.GetAppletConfigInt32("IO控制器_停止位").ToString());
            SelectedComboBoxItem(cmbIocerParity, commonDAO.GetAppletConfigInt32("IO控制器_校验位").ToString());
            SelectedComboBoxItem(cmbInductorCoil1Port, commonDAO.GetAppletConfigInt32("IO控制器_地感1端口").ToString());
            SelectedComboBoxItem(cmbInductorCoil2Port, commonDAO.GetAppletConfigInt32("IO控制器_地感2端口").ToString());
            SelectedComboBoxItem(cmbInductorCoil3Port, commonDAO.GetAppletConfigInt32("IO控制器_地感3端口").ToString());
            SelectedComboBoxItem(cmbInductorCoil4Port, commonDAO.GetAppletConfigInt32("IO控制器_地感4端口").ToString());
            SelectedComboBoxItem(cmbGate1UpPort, commonDAO.GetAppletConfigInt32("IO控制器_道闸1升杆端口").ToString());
            SelectedComboBoxItem(cmbGate1DownPort, commonDAO.GetAppletConfigInt32("IO控制器_道闸1降杆端口").ToString());
            SelectedComboBoxItem(cmbGate2UpPort, commonDAO.GetAppletConfigInt32("IO控制器_道闸2升杆端口").ToString());
            SelectedComboBoxItem(cmbGate2DownPort, commonDAO.GetAppletConfigInt32("IO控制器_道闸2降杆端口").ToString());

            // 车号识别
            iptxtRwer1IP.Value = commonDAO.GetAppletConfigString("车号识别1_IP地址");
            iptxtRwer2IP.Value = commonDAO.GetAppletConfigString("车号识别2_IP地址");
        }
Example #26
0
        /// <summary>
        /// 加载配置
        /// </summary>
        void LoadAppConfig()
        {
            txtAppIdentifier.Text = commonAppConfig.AppIdentifier;
            txtSelfConnStr.Text   = commonAppConfig.SelfConnStr;
            chbStartup.Checked    = (commonDAO.GetAppletConfigString("开机启动") == "1");

            // IO控制器
            SelectedComboBoxItem(cmbIocerCom, commonDAO.GetAppletConfigInt32("IO控制器_串口").ToString());
            SelectedComboBoxItem(cmbIocerBandrate, commonDAO.GetAppletConfigInt32("IO控制器_波特率").ToString());
            SelectedComboBoxItem(cmbIocerDataBits, commonDAO.GetAppletConfigInt32("IO控制器_数据位").ToString());
            SelectedComboBoxItem(cmbIocerStopBits, commonDAO.GetAppletConfigInt32("IO控制器_停止位").ToString());
            SelectedComboBoxItem(cmbIocerParity, commonDAO.GetAppletConfigInt32("IO控制器_校验位").ToString());
            SelectedComboBoxItem(cmbInductorCoil1Port, commonDAO.GetAppletConfigInt32("IO控制器_地感1端口").ToString());
            SelectedComboBoxItem(cmbInductorCoil2Port, commonDAO.GetAppletConfigInt32("IO控制器_地感2端口").ToString());
            SelectedComboBoxItem(cmbInductorCoil3Port, commonDAO.GetAppletConfigInt32("IO控制器_地感3端口").ToString());
            SelectedComboBoxItem(cmbInductorCoil4Port, commonDAO.GetAppletConfigInt32("IO控制器_地感4端口").ToString());
            SelectedComboBoxItem(cmbInductorCoil5Port, commonDAO.GetAppletConfigInt32("IO控制器_地感5端口").ToString());
            SelectedComboBoxItem(cmbInductorCoil6Port, commonDAO.GetAppletConfigInt32("IO控制器_地感6端口").ToString());
            SelectedComboBoxItem(cmbInductorCoil7Port, commonDAO.GetAppletConfigInt32("IO控制器_地感7端口").ToString());
            SelectedComboBoxItem(cmbInductorCoil8Port, commonDAO.GetAppletConfigInt32("IO控制器_地感8端口").ToString());
            SelectedComboBoxItem(cmbGate1UpPort, commonDAO.GetAppletConfigInt32("IO控制器_道闸1升杆端口").ToString());
            SelectedComboBoxItem(cmbGate1DownPort, commonDAO.GetAppletConfigInt32("IO控制器_道闸1降杆端口").ToString());
            SelectedComboBoxItem(cmbGate2UpPort, commonDAO.GetAppletConfigInt32("IO控制器_道闸2升杆端口").ToString());
            SelectedComboBoxItem(cmbGate2DownPort, commonDAO.GetAppletConfigInt32("IO控制器_道闸2降杆端口").ToString());
            SelectedComboBoxItem(cmbSignalLight1Port, commonDAO.GetAppletConfigInt32("IO控制器_信号灯1端口").ToString());
            SelectedComboBoxItem(cmbSignalLight2Port, commonDAO.GetAppletConfigInt32("IO控制器_信号灯2端口").ToString());

            // 读卡器
            SelectedComboBoxItem(cmbRwer1Com, commonDAO.GetAppletConfigInt32("读卡器1_串口").ToString());
            SelectedComboBoxItem(cmbRwer2Com, commonDAO.GetAppletConfigInt32("读卡器2_串口").ToString());
            txtRwerTagStartWith.Text = commonDAO.GetAppletConfigString("读卡器_标签过滤");

            // LED显示屏
            iptxtLED1IP.Value = commonDAO.GetAppletConfigString("LED显示屏1_IP地址");
            iptxtLED2IP.Value = commonDAO.GetAppletConfigString("LED显示屏2_IP地址");
        }
Example #27
0
        /// <summary>
        /// 加载配置
        /// </summary>
        void LoadAppConfig()
        {
            #region 绑定语音类型

            List <string> arrVoices = voiceSpeaker.GetVoices();
            for (int i = 0; i < arrVoices.Count; i++)
            {
                DataItem comboitem = new DataItem(arrVoices[i]);
                cmbVoiceName.Items.Add(comboitem);
            }
            cmbVoiceName.SelectedIndex = 0;

            #endregion

            txtAppIdentifier.Text = commonAppConfig.AppIdentifier;
            txtSelfConnStr.Text   = commonAppConfig.SelfConnStr;
            chbStartup.Checked    = (commonDAO.GetAppletConfigString("开机启动") == "1");

            // IO控制器
            SelectedComboBoxItem(cmbIocerCom, commonDAO.GetAppletConfigInt32("IO控制器_串口").ToString());
            SelectedComboBoxItem(cmbIocerBandrate, commonDAO.GetAppletConfigInt32("IO控制器_波特率").ToString());
            SelectedComboBoxItem(cmbIocerDataBits, commonDAO.GetAppletConfigInt32("IO控制器_数据位").ToString());
            SelectedComboBoxItem(cmbIocerStopBits, commonDAO.GetAppletConfigInt32("IO控制器_停止位").ToString());
            SelectedComboBoxItem(cmbIocerParity, commonDAO.GetAppletConfigInt32("IO控制器_校验位").ToString());
            SelectedComboBoxItem(cmbInductorCoil1Port, commonDAO.GetAppletConfigInt32("IO控制器_地感1端口").ToString());
            SelectedComboBoxItem(cmbInductorCoil2Port, commonDAO.GetAppletConfigInt32("IO控制器_地感2端口").ToString());
            SelectedComboBoxItem(cmbInductorCoil3Port, commonDAO.GetAppletConfigInt32("IO控制器_地感3端口").ToString());
            SelectedComboBoxItem(cmbInductorCoil4Port, commonDAO.GetAppletConfigInt32("IO控制器_地感4端口").ToString());
            SelectedComboBoxItem(cmbGate1UpPort, commonDAO.GetAppletConfigInt32("IO控制器_道闸1升杆端口").ToString());
            SelectedComboBoxItem(cmbGate1DownPort, commonDAO.GetAppletConfigInt32("IO控制器_道闸1降杆端口").ToString());
            SelectedComboBoxItem(cmbGate2UpPort, commonDAO.GetAppletConfigInt32("IO控制器_道闸2升杆端口").ToString());
            SelectedComboBoxItem(cmbGate2DownPort, commonDAO.GetAppletConfigInt32("IO控制器_道闸2降杆端口").ToString());
            SelectedComboBoxItem(cmbSignalLight1Port, commonDAO.GetAppletConfigInt32("IO控制器_信号灯1端口").ToString());
            SelectedComboBoxItem(cmbSignalLight2Port, commonDAO.GetAppletConfigInt32("IO控制器_信号灯2端口").ToString());

            // 车号识别
            iptxtRwer1.Value = commonDAO.GetAppletConfigString("车号识别1_IP地址");
            iptxtRwer2.Value = commonDAO.GetAppletConfigString("车号识别2_IP地址");

            // LED显示屏
            iptxtLED1IP.Value = commonDAO.GetAppletConfigString("LED显示屏1_IP地址");
            iptxtLED2IP.Value = commonDAO.GetAppletConfigString("LED显示屏2_IP地址");

            // 语音
            SelectedComboBoxItem(cmbVoiceName, commonDAO.GetAppletConfigString("语音包").ToString());
            sldVoiceRate.Value   = commonDAO.GetAppletConfigInt32("语速");
            sldVoiceVolume.Value = commonDAO.GetAppletConfigInt32("音量");
            lblVoiceRate.Text    = sldVoiceRate.Value.ToString();
            lblVoiceVolume.Text  = sldVoiceVolume.Value.ToString();
        }
 /// <summary>
 /// 初始化
 /// </summary>
 public void InitFrom()
 {
     this.IsUseWeight = Convert.ToBoolean(commonDAO.GetAppletConfigInt32("启用称重"));
 }
Example #29
0
        /// <summary>
        /// ¼ÓÔØÅäÖÃ
        /// </summary>
        void LoadAppConfig()
        {
            #region °ó¶¨ÓïÒôÀàÐÍ

            List <string> arrVoices = voiceSpeaker.GetVoices();
            for (int i = 0; i < arrVoices.Count; i++)
            {
                DataItem comboitem = new DataItem(arrVoices[i]);
                cmbVoiceName.Items.Add(comboitem);
            }
            cmbVoiceName.SelectedIndex = 0;

            #endregion

            txtAppIdentifier.Text = commonAppConfig.AppIdentifier;
            txtSelfConnStr.Text   = commonAppConfig.SelfConnStr;
            chbStartup.Checked    = (commonDAO.GetAppletConfigString("¿ª»úÆô¶¯") == "1");

            // IO¿ØÖÆÆ÷
            SelectedComboBoxItem(cmbIocerCom, commonDAO.GetAppletConfigInt32("IO¿ØÖÆÆ÷_´®¿Ú").ToString());
            SelectedComboBoxItem(cmbIocerBandrate, commonDAO.GetAppletConfigInt32("IO¿ØÖÆÆ÷_²¨ÌØÂÊ").ToString());
            SelectedComboBoxItem(cmbIocerDataBits, commonDAO.GetAppletConfigInt32("IO¿ØÖÆÆ÷_Êý¾Ýλ").ToString());
            SelectedComboBoxItem(cmbIocerStopBits, commonDAO.GetAppletConfigInt32("IO¿ØÖÆÆ÷_ֹͣλ").ToString());
            SelectedComboBoxItem(cmbIocerParity, commonDAO.GetAppletConfigInt32("IO¿ØÖÆÆ÷_УÑéλ").ToString());
            SelectedComboBoxItem(cmbInductorCoil1Port, commonDAO.GetAppletConfigInt32("IO¿ØÖÆÆ÷_µØ¸Ð1¶Ë¿Ú").ToString());
            SelectedComboBoxItem(cmbInductorCoil2Port, commonDAO.GetAppletConfigInt32("IO¿ØÖÆÆ÷_µØ¸Ð2¶Ë¿Ú").ToString());
            SelectedComboBoxItem(cmbInductorCoil3Port, commonDAO.GetAppletConfigInt32("IO¿ØÖÆÆ÷_µØ¸Ð3¶Ë¿Ú").ToString());
            SelectedComboBoxItem(cmbInductorCoil4Port, commonDAO.GetAppletConfigInt32("IO¿ØÖÆÆ÷_µØ¸Ð4¶Ë¿Ú").ToString());
            SelectedComboBoxItem(cmbGate1UpPort, commonDAO.GetAppletConfigInt32("IO¿ØÖÆÆ÷_µÀÕ¢1Éý¸Ë¶Ë¿Ú").ToString());
            SelectedComboBoxItem(cmbGate1DownPort, commonDAO.GetAppletConfigInt32("IO¿ØÖÆÆ÷_µÀÕ¢1½µ¸Ë¶Ë¿Ú").ToString());
            SelectedComboBoxItem(cmbGate2UpPort, commonDAO.GetAppletConfigInt32("IO¿ØÖÆÆ÷_µÀÕ¢2Éý¸Ë¶Ë¿Ú").ToString());
            SelectedComboBoxItem(cmbGate2DownPort, commonDAO.GetAppletConfigInt32("IO¿ØÖÆÆ÷_µÀÕ¢2½µ¸Ë¶Ë¿Ú").ToString());
            SelectedComboBoxItem(cmbSignalLight1Port, commonDAO.GetAppletConfigInt32("IO¿ØÖÆÆ÷_ÐźŵÆ1¶Ë¿Ú").ToString());
            SelectedComboBoxItem(cmbSignalLight2Port, commonDAO.GetAppletConfigInt32("IO¿ØÖÆÆ÷_ÐźŵÆ2¶Ë¿Ú").ToString());

            // ¶Á¿¨Æ÷
            SelectedComboBoxItem(cmbRwer1Com, commonDAO.GetAppletConfigInt32("¶Á¿¨Æ÷1_´®¿Ú").ToString());
            SelectedComboBoxItem(cmbRwer2Com, commonDAO.GetAppletConfigInt32("¶Á¿¨Æ÷2_´®¿Ú").ToString());
            txtRwerTagStartWith.Text = commonDAO.GetAppletConfigString("¶Á¿¨Æ÷_±êÇ©¹ýÂË");

            // LEDÏÔʾÆÁ
            iptxtLED1IP.Value = commonDAO.GetAppletConfigString("LEDÏÔʾÆÁ1_IPµØÖ·");
            iptxtLED2IP.Value = commonDAO.GetAppletConfigString("LEDÏÔʾÆÁ2_IPµØÖ·");

            // ÓïÒô
            SelectedComboBoxItem(cmbVoiceName, commonDAO.GetAppletConfigString("ÓïÒô°ü").ToString());
            sldVoiceRate.Value   = commonDAO.GetAppletConfigInt32("ÓïËÙ");
            sldVoiceVolume.Value = commonDAO.GetAppletConfigInt32("ÒôÁ¿");
            lblVoiceRate.Text    = sldVoiceRate.Value.ToString();
            lblVoiceVolume.Text  = sldVoiceVolume.Value.ToString();
        }
Example #30
0
        /// <summary>
        /// ¼ÓÔØÅäÖÃ
        /// </summary>
        void LoadAppConfig()
        {
            txtAppIdentifier.Text = commonAppConfig.AppIdentifier;
            txtSelfConnStr.Text   = commonAppConfig.SelfConnStr;
            chbStartup.Checked    = (commonDAO.GetAppletConfigString("¿ª»úÆô¶¯") == "1");

            // IO¿ØÖÆÆ÷
            SelectedComboBoxItem(cmbIocerCom, commonDAO.GetAppletConfigInt32("IO¿ØÖÆÆ÷_´®¿Ú").ToString());
            SelectedComboBoxItem(cmbIocerBandrate, commonDAO.GetAppletConfigInt32("IO¿ØÖÆÆ÷_²¨ÌØÂÊ").ToString());
            SelectedComboBoxItem(cmbIocerDataBits, commonDAO.GetAppletConfigInt32("IO¿ØÖÆÆ÷_Êý¾Ýλ").ToString());
            SelectedComboBoxItem(cmbIocerStopBits, commonDAO.GetAppletConfigInt32("IO¿ØÖÆÆ÷_ֹͣλ").ToString());
            SelectedComboBoxItem(cmbIocerParity, commonDAO.GetAppletConfigInt32("IO¿ØÖÆÆ÷_УÑéλ").ToString());
            SelectedComboBoxItem(cmbInductorCoil1Port, commonDAO.GetAppletConfigInt32("IO¿ØÖÆÆ÷_µØ¸Ð1¶Ë¿Ú").ToString());
            SelectedComboBoxItem(cmbInductorCoil2Port, commonDAO.GetAppletConfigInt32("IO¿ØÖÆÆ÷_µØ¸Ð2¶Ë¿Ú").ToString());
            SelectedComboBoxItem(cmbInductorCoil3Port, commonDAO.GetAppletConfigInt32("IO¿ØÖÆÆ÷_µØ¸Ð3¶Ë¿Ú").ToString());
            SelectedComboBoxItem(cmbInductorCoil4Port, commonDAO.GetAppletConfigInt32("IO¿ØÖÆÆ÷_µØ¸Ð4¶Ë¿Ú").ToString());
            SelectedComboBoxItem(cmbGate1UpPort, commonDAO.GetAppletConfigInt32("IO¿ØÖÆÆ÷_µÀÕ¢1Éý¸Ë¶Ë¿Ú").ToString());
            SelectedComboBoxItem(cmbGate1DownPort, commonDAO.GetAppletConfigInt32("IO¿ØÖÆÆ÷_µÀÕ¢1½µ¸Ë¶Ë¿Ú").ToString());
            SelectedComboBoxItem(cmbGate2UpPort, commonDAO.GetAppletConfigInt32("IO¿ØÖÆÆ÷_µÀÕ¢2Éý¸Ë¶Ë¿Ú").ToString());
            SelectedComboBoxItem(cmbGate2DownPort, commonDAO.GetAppletConfigInt32("IO¿ØÖÆÆ÷_µÀÕ¢2½µ¸Ë¶Ë¿Ú").ToString());
            SelectedComboBoxItem(cmbSignalLight1Port, commonDAO.GetAppletConfigInt32("IO¿ØÖÆÆ÷_ÐźŵÆ1¶Ë¿Ú").ToString());
            SelectedComboBoxItem(cmbSignalLight2Port, commonDAO.GetAppletConfigInt32("IO¿ØÖÆÆ÷_ÐźŵÆ2¶Ë¿Ú").ToString());

            // ¶Á¿¨Æ÷
            SelectedComboBoxItem(cmbRwer1Com, commonDAO.GetAppletConfigInt32("¶Á¿¨Æ÷1_´®¿Ú").ToString());
            SelectedComboBoxItem(cmbRwer2Com, commonDAO.GetAppletConfigInt32("¶Á¿¨Æ÷2_´®¿Ú").ToString());
            txtRwerTagStartWith.Text = commonDAO.GetAppletConfigString("¶Á¿¨Æ÷_±êÇ©¹ýÂË");

            // LEDÏÔʾÆÁ
            iptxtLED1IP.Value = commonDAO.GetAppletConfigString("LEDÏÔʾÆÁ1_IPµØÖ·");
            iptxtLED2IP.Value = commonDAO.GetAppletConfigString("LEDÏÔʾÆÁ2_IPµØÖ·");


            // ¶Á¿¨Æ÷Íø¿Ú
            ipAddressInput1.Value = commonDAO.GetAppletConfigString("¶Á¿¨Æ÷1IPµØÖ·");
            ipAddressPort1.Text   = commonDAO.GetAppletConfigString("¶Á¿¨Æ÷1¶Ë¿Ú");
            ipAddressInput2.Value = commonDAO.GetAppletConfigString("¶Á¿¨Æ÷2IPµØÖ·");
            ipAddressPort2.Text   = commonDAO.GetAppletConfigString("¶Á¿¨Æ÷2¶Ë¿Ú");
        }