Example #1
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 #2
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 #3
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 #4
0
        /// <summary>
        /// 加载配置
        /// </summary>
        void LoadAppConfig()
        {
            txtAppIdentifier.Text = commonAppConfig.AppIdentifier;
            txtSelfConnStr.Text   = commonAppConfig.SelfConnStr;
            chbStartup.Checked    = (commonDAO.GetAppletConfigString("开机启动") == "1");

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

            // 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(cmbRwer1Com, commonDAO.GetAppletConfigInt32("读卡器1_串口").ToString());
            txtRwerTagStartWith.Text = commonDAO.GetAppletConfigString("读卡器_标签过滤");

            // LED显示屏
            iptxtLED1IP.Value = commonDAO.GetAppletConfigString("LED显示屏1_IP地址");
        }
Example #5
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 #6
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 #7
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 #8
0
        /// <summary>
        /// 加载配置
        /// </summary>
        void LoadAppConfig()
        {
            txtAppIdentifier.Text = commonAppConfig.AppIdentifier;
            txtSelfConnStr.Text   = commonAppConfig.SelfConnStr;
            chbStartup.Checked    = (commonDAO.GetAppletConfigString("开机启动") == "1");

            txtJxSamplerMachineCode.Text = commonDAO.GetAppletConfigString("采样机设备编码");
        }
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
        /// <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());
            chbUseGate1.Checked = (commonDAO.GetAppletConfigString("启用道闸1") == "1");
            chbUseGate2.Checked = (commonDAO.GetAppletConfigString("启用道闸2") == "1");

            // 读卡器
            iptxtRwer1.Value      = commonDAO.GetAppletConfigString("车号识别1_IP地址");
            iptxtRwer2.Value      = commonDAO.GetAppletConfigString("车号识别2_IP地址");
            chbUseCamera1.Checked = (commonDAO.GetAppletConfigString("启用车号识别1") == "1");
            chbUseCamera2.Checked = (commonDAO.GetAppletConfigString("启用车号识别2") == "1");

            // LED显示屏
            iptxtLED1IP.Value = commonDAO.GetAppletConfigString("LED显示屏1_IP地址");
            iptxtLED2IP.Value = commonDAO.GetAppletConfigString("LED显示屏2_IP地址");
        }
Example #11
0
        /// <summary>
        /// 窗体初始化
        /// </summary>
        private void InitForm()
        {
            FrmDebugConsole.GetInstance();

            // 采样机设备编码
            this.SamplerMachineCode = commonDAO.GetAppletConfigString("采样机设备编码");
            this.SamplerMachineName = commonDAO.GetMachineNameByCode(this.SamplerMachineCode);

            // 默认自动
            sbtnChangeAutoHandMode.Value = true;
        }
Example #12
0
        void ReadConfig()
        {
            List <HtmlDataItem> datas     = new List <HtmlDataItem>();
            CommonDAO           commonDAO = CommonDAO.GetInstance();

            datas.Add(new HtmlDataItem("ckbfc1", commonDAO.GetAppletConfigString(GlobalVars.CommonAppletConfigName, "#1翻车机对应皮带采样机"), "Set"));
            datas.Add(new HtmlDataItem("ckbfc2", commonDAO.GetAppletConfigString(GlobalVars.CommonAppletConfigName, "#2翻车机对应皮带采样机"), "Set"));
            datas.Add(new HtmlDataItem("ckbjy1", commonDAO.GetAppletConfigString(GlobalVars.CommonAppletConfigName, "#1皮带采样机集样方式"), "Set"));
            datas.Add(new HtmlDataItem("ckbjy2", commonDAO.GetAppletConfigString(GlobalVars.CommonAppletConfigName, "#2皮带采样机集样方式"), "Set"));
            // 发送到页面
            cefWebBrowser.Browser.GetMainFrame().ExecuteJavaScript("requestData(" + Newtonsoft.Json.JsonConvert.SerializeObject(datas) + ");", "", 0);
        }
Example #13
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(cmbInfraredSensor1Port, commonDAO.GetAppletConfigInt32("IO控制器_对射1端口").ToString());
            SelectedComboBoxItem(cmbInfraredSensor2Port, commonDAO.GetAppletConfigInt32("IO控制器_对射2端口").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());

            // 读卡器
            ip_Rwer1.Value = commonDAO.GetAppletConfigString("读卡器1_IP地址");
            SelectedComboBoxItem(cmbip_Rwer1Port, commonDAO.GetAppletConfigInt32("读卡器1_功率").ToString());
            txtRwerTagStartWith.Text = commonDAO.GetAppletConfigString("读卡器_标签过滤");

            // 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 #14
0
        private DcDbers()
        {
            BeltSampler_Dber       = new SqlServerDapperDber(commonDAO.GetCommonAppletConfigString("皮带采样机接口连接字符串"));
            AutoCupboard_Dber      = new SqlServerDapperDber(commonDAO.GetCommonAppletConfigString("智能存样柜接口连接字符串"));
            PneumaticTransfer_Dber = new SqlServerDapperDber(commonDAO.GetCommonAppletConfigString("气动传输接口连接字符串"));

            WeightBridger_Dber = new SqlServerDapperDber(commonDAO.GetCommonAppletConfigString("轨道衡数据库连接字符串"));
            CarJXSampler_Dber1 = new SqlServerDapperDber(commonDAO.GetCommonAppletConfigString("#1汽车机械采样机接口连接字符串"));
            CarJXSampler_Dber2 = new SqlServerDapperDber(commonDAO.GetCommonAppletConfigString("#2汽车机械采样机接口连接字符串"));

            WeightBridger_Dber1 = new AccessDapperDber(string.Format(commonDAO.GetAppletConfigString("轨道衡数据库连接字符串1"), DateTime.Now.Year));
            TruckWeight_Dber    = new OracleDapperDber(commonDAO.GetAppletConfigString("汽车衡数据库连接字符串"));
        }
Example #15
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 #16
0
        /// <summary>
        /// 初始化外接设备
        /// </summary>
        private void InitHardware()
        {
            try
            {
                bool success = false;
                ReadRwer.OnStatusChange += new HFReaderRwer.StatusChangeHandler(Rwer_OnStatusChange);
                Rwer_OnStatusChange(ReadRwer.Status);

                // 初始化-读卡器
                success = ReadRwer.OpenNetPort(commonDAO.GetAppletConfigString("读卡器网口"), 6000);
                //success = ReadRwer.OpenNetPort("192.168.70.30",6000);


                // 初始化-电子秤
                if (IsUseWeight)
                {
                    this.WbMinWeight = commonDAO.GetAppletConfigDouble("电子秤最小重量");

                    // 电子秤仪表1
                    wber.OnStatusChange += new WB.TOLEDO.IND231.TOLEDO_IND231Wber.StatusChangeHandler(Wber_OnStatusChange);
                    wber.OnSteadyChange += new WB.TOLEDO.IND231.TOLEDO_IND231Wber.SteadyChangeEventHandler(Wber_OnSteadyChange);
                    success              = wber.OpenCom(commonDAO.GetAppletConfigInt32("电子秤串口"), commonDAO.GetAppletConfigInt32("电子秤波特率"), commonDAO.GetAppletConfigInt32("电子秤数据位"), commonDAO.GetAppletConfigInt32("电子秤停止位"));
                }

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

                // 初始化-读卡器
                rwer.OnStatusChange += new HFReaderRwer.StatusChangeHandler(Rwer_OnStatusChange);
                success              = rwer.OpenNetPort(commonDAO.GetAppletConfigString("读卡器IP"), commonDAO.GetAppletConfigInt32("读卡器端口"));
                if (success)
                {
                    Rwer_OnStatusChange(true);
                }
                else
                {
                    Rwer_OnStatusChange(false);
                }

                // 初始化-电子秤
                if (IsUseWeight)
                {
                    this.WbMinWeight = commonDAO.GetAppletConfigDouble("电子秤最小重量");

                    wber.OnStatusChange += new WB.TOLEDO.IND231.TOLEDO_IND231Wber.StatusChangeHandler(Wber_OnStatusChange);
                    wber.OnSteadyChange += new WB.TOLEDO.IND231.TOLEDO_IND231Wber.SteadyChangeEventHandler(Wber_OnSteadyChange);
                    success              = wber.OpenCom(commonDAO.GetAppletConfigInt32("电子秤串口"), commonDAO.GetAppletConfigInt32("电子秤波特率"), commonDAO.GetAppletConfigInt32("电子秤数据位"), commonDAO.GetAppletConfigInt32("电子秤停止位"));
                }
            }
            catch (Exception ex)
            {
                Log4Neter.Error("设备初始化", ex);
            }
        }
Example #18
0
        /// <summary>
        /// 初始化外接设备
        /// </summary>
        private void InitHardware()
        {
            try
            {
                bool success = false;
                Hardwarer.ReadRwer.OnStatusChange += new HFReaderRwer.StatusChangeHandler(Rwer_OnStatusChange);
                Rwer_OnStatusChange(Hardwarer.ReadRwer.Status);
                if (!SelfVars.RfReadOpen)
                {
                    // 初始化-读卡器
                    success             = Hardwarer.ReadRwer.OpenNetPort(commonDAO.GetAppletConfigString("读卡器IP"), commonDAO.GetAppletConfigInt32("读卡器端口"));
                    SelfVars.RfReadOpen = success;
                }
                // 初始化-电子天平
                if (IsUseWeight)
                {
                    this.WbMinWeight = commonDAO.GetAppletConfigDecimal("电子天平最小重量");

                    Hardwarer.Wber_min.OnStatusChange += new WB.XiangPing.Balance.XiangPing_Balance.StatusChangeHandler(Wber_OnStatusChange);
                    Hardwarer.Wber_min.OnSteadyChange += new WB.XiangPing.Balance.XiangPing_Balance.SteadyChangeEventHandler(Wber_OnSteadyChange);
                    Hardwarer.Wber_min.OnWeightChange += new WB.XiangPing.Balance.XiangPing_Balance.WeightChangeEventHandler(wber_OnWeightChange);

                    if (!SelfVars.WeightMinOpen)
                    {
                        success = Hardwarer.Wber_min.OpenCom(commonDAO.GetAppletConfigInt32("电子天平串口"), commonDAO.GetAppletConfigInt32("电子天平波特率"), commonDAO.GetAppletConfigInt32("电子天平数据位"), commonDAO.GetAppletConfigInt32("电子天平停止位"));
                        SelfVars.WeightMinOpen = success;
                    }
                }
            }
            catch (Exception ex)
            {
                Log4Neter.Error("设备初始化", ex);
            }
        }
Example #19
0
        /// <summary>
        /// 窗体初始化
        /// </summary>
        private void InitForm()
        {
            FrmDebugConsole.GetInstance();

            // 采样机设备编码
            this.SamplerMachineCode = commonDAO.GetAppletConfigString("采样机设备编码");
            this.SamplerMachineName = commonDAO.GetMachineNameByCode(this.SamplerMachineCode);

            // 默认自动
            sbtnChangeAutoHandMode.Value = true;

            // 重置程序远程控制命令
            commonDAO.ResetAppRemoteControlCmd(CommonAppConfig.GetInstance().AppIdentifier);

            btnRefresh_Click(null, null);
        }
Example #20
0
 private void FrmSetting_Load(object sender, EventArgs e)
 {
     try
     {
         txtSampleCode.Text    = commonDAO.GetAppletConfigString("采样机设备编码");
         txtRCMakeCode.Text    = commonDAO.GetAppletConfigString("入厂制样机设备编码");
         txtCCMakeCode.Text    = commonDAO.GetAppletConfigString("出厂制样机设备编码");
         txtAppIdentifier.Text = CommonAppConfig.GetInstance().AppIdentifier;
         txtSelfConnStr.Text   = CommonAppConfig.GetInstance().SelfConnStr;
         // 全局参数
         Old_Param = txtSampleCode.Text;
     }
     catch (Exception ex)
     {
         MessageBoxEx.Show("参数初始化失败" + ex.Message, "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
     }
 }
        /// <summary>
        /// 窗体初始化
        /// </summary>
        private void FormInit()
        {
            rTxtOutputer = new RTxtOutputer(rTxTMessageInfo);

            // 采样机设备编码,跟卸样程序一一对应
            samplerMachineCodes = commonDAO.GetAppletConfigString("采样机设备编码").Split('|');
            makerMachineCode    = commonDAO.GetAppletConfigString("制样机设备编码");

            CreateSamplerButton();
            CreateEquStatus();

            // 触发选择第一台采样机
            if (flpanSamplerButton.Controls.Count > 0)
            {
                (flpanSamplerButton.Controls[0] as RadioButton).Checked = true;
            }
        }
Example #22
0
        /// <summary>
        /// 道闸1升杆
        /// </summary>
        public void Gate1Up()
        {
#if DEBUG
            FrmDebugConsole.GetInstance().Output("道闸1升杆");
#endif
            if (commonDAO.GetAppletConfigString("启用道闸1") != "1")
            {
                return;
            }
            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, "道闸1升杆", "1");
        }
Example #23
0
        public void InitFrom()
        {
            this.IsUseWeight = Convert.ToBoolean(commonDAO.GetAppletConfigInt32("启用称重"));

            this._CodePrinter = new CodePrinter(printDocument1);

            // 获取全自动制样机
            this.AutoMaker = commonDAO.GetCMEquipmentByMachineCode(commonDAO.GetAppletConfigString("全自动制样机编码"));
        }
Example #24
0
        private void FrmSetting_Load(object sender, EventArgs e)
        {
            try
            {
                labelX10.ForeColor = Color.Red;

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

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

                //制样机设备编码
                txtMakerMachineCode.Text = commonDAO.GetAppletConfigString("制样机设备编码");
            }
            catch (Exception ex)
            {
                MessageBoxEx.Show("参数初始化失败" + ex.Message, "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
            }
        }
Example #25
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 #26
0
        /// <summary>
        /// 获取智能物流始发表数据
        /// </summary>
        /// <param name="output"></param>
        /// <returns></returns>
        public void GetData(Action <string, eOutputType> output)
        {
            if (mysqlDber == null)
            {
                output("未在【小程序参数配置】模块中添加配置,唯一标识:数据同步智能物流接口,配置名称:接口地址", eOutputType.Error);
                return;
            }

            int    intervalValue = 7;
            string configValue   = commonDAO.GetAppletConfigString("数据同步智能物流接口", "获取智能物流数据时间间隔(天)");

            if (!string.IsNullOrWhiteSpace(configValue))
            {
                Int32.TryParse(configValue, out intervalValue);
            }
            DateTime startTime = DateTime.Now.AddDays(-intervalValue);

            List <WL_CarSendInfo> sendEntities = mysqlDber.Entities <WL_CarSendInfo>(string.Format(" where (同步完成=0 or 同步完成 is NULL) and 创建时间>='{0}'", startTime));

            SaveCarSendData(sendEntities, output);
        }
Example #27
0
        /// <summary>
        /// 加载配置
        /// </summary>
        void LoadAppConfig()
        {
            txtAppIdentifier.Text = commonAppConfig.AppIdentifier;
            txtSelfConnStr.Text   = commonAppConfig.SelfConnStr;
            chbStartup.Checked    = (commonDAO.GetAppletConfigString("开机启动") == "1");
            chbBothWay.Checked    = (commonDAO.GetAppletConfigString("双向磅") == "1");
            cmbInFactoryType.Text = commonDAO.GetAppletConfigString("过磅类型");
            // 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(cmbInfraredSensor1Port, commonDAO.GetAppletConfigInt32("IO控制器_对射1端口").ToString());
            SelectedComboBoxItem(cmbInfraredSensor2Port, commonDAO.GetAppletConfigInt32("IO控制器_对射2端口").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(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("地磅仪表_最小称重");
            dbtxtSteady.Value        = commonDAO.GetAppletConfigDouble("地磅仪表_稳定时间");
            dbtxtGrossLossTare.Value = Convert.ToDouble(commonDAO.GetAppletConfigString(GlobalVars.CommonAppletConfigName, "地磅仪表_毛皮差"));
            // 读卡器
            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(cmbLEDType, commonDAO.GetAppletConfigString("LED显示屏类型").ToString());
        }
Example #28
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 #29
0
        private void FrmSetting_Load(object sender, EventArgs e)
        {
            try
            {
                labelX1.ForeColor  = Color.Red;
                labelX10.ForeColor = Color.Red;
                labelX4.ForeColor  = Color.Red;

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

                //翻车机编码
                txtTipperMachineCodes.Text = commonDAO.GetAppletConfigString("翻车机编码");

                //翻车机车号识别编码
                txtCarriageRecognitionerMachineCodes.Text = commonDAO.GetAppletConfigString("翻车机车号识别编码");

                //翻车机对应皮带采样机
                txtCarriageRecognitionerTrainBeltSamplerCodes.Text = commonDAO.GetAppletConfigString("翻车机对应皮带采样机编码");
            }
            catch (Exception ex)
            {
                MessageBoxEx.Show("参数初始化失败" + ex.Message, "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
            }
        }
Example #30
0
        /// <summary>
        /// 获取设置的翻车机
        /// </summary>
        /// <returns></returns>
        public List <CmcsCMEquipment> GetTrainTippers()
        {
            List <CmcsCMEquipment> res = new List <CmcsCMEquipment>();

            string machineCodes = commonDAO.GetAppletConfigString("翻车机编码");

            if (!string.IsNullOrEmpty(machineCodes))
            {
                foreach (string machineCode in machineCodes.Split('|'))
                {
                    CmcsCMEquipment eMEquipment = Dbers.GetInstance().SelfDber.Entity <CmcsCMEquipment>("where EquipmentCode=:EquipmentCode", new { EquipmentCode = machineCode });
                    if (eMEquipment != null)
                    {
                        res.Add(eMEquipment);
                    }
                }
            }

            return(res);
        }