private void btnReadMeterTime_Click(object sender, EventArgs e)
        {
            Protocol645 p645 = new Protocol645();

            p645.ReadParameter(txtMeterTime1, "04000101");
            txtMeterTime1.Text = txtMeterTime1.Text.Substring(0, 6);
            p645.ReadParameter(txtMeterTime2, "04000102");
        }
Exemplo n.º 2
0
        private void button22_Click(object sender, EventArgs e)//福建:读表时间
        {
            Protocol645 p645 = new Protocol645();

            p645.ReadParameter(textBox24, "04000101");
            textBox24.Text = textBox24.Text.Substring(0, 6);
            p645.ReadParameter(textBox23, "04000102");
        }
        private void btn读显示内容_Click(object sender, EventArgs e)
        {
            int         displayNum = 0;
            string      startId    = null;
            string      display    = null;
            Protocol645 p645       = new Protocol645();

            if (rbDisplayAuto.Checked)
            {
                if (!p645.ReadParameter(tbXunxianNum, "04000301"))
                {
                    return;
                }
                startId    = "040401";
                displayNum = Convert.ToInt16(tbXunxianNum.Text);
            }
            if (rbDisplayButton.Checked)
            {
                if (!p645.ReadParameter(tbJianxianNum, "04000305"))
                {
                    return;
                }
                startId    = "040402";
                displayNum = Convert.ToInt16(tbJianxianNum.Text);
            }

            dgvDisplay.Rows.Clear();
            dgvDisplay.Rows.Add(displayNum);
            //progressBar.Maximum = displayNum;
            //progressBar.Value = 0;
            for (int i = 0; i < displayNum; i++)
            {
                dgvDisplay.Rows[i].HeaderCell.Value = "第" + (i + 1).ToString() + "屏";
                if (p645.ReadData(startId + (i + 1).ToString("X2"), out display))
                {
                    dgvDisplay[0, i].Value = display.Substring(2);
                    dgvDisplay[1, i].Value = display.Substring(0, 2);
                    try
                    {
                        dgvDisplay[2, i].Value = Functions.DISPLAY[display];
                    }
                    catch { }
                    //progressBar.Value++;
                }
                else
                {
                    MessageBox.Show("读表出错!");
                    return;
                }
            }
        }
Exemplo n.º 4
0
        private void btnReadStatus7_Click(object sender, EventArgs e)//电表运行状态字7
        {
            tbRunStatus7.Text = null;
            Protocol645 p645 = new Protocol645();

            p645.ReadParameter(tbRunStatus7, "04000507");
            string str = tbRunStatus7.Text;

            if (str.Length == 4)
            {
                List <string> list = new List <string>();
                list.Add("电表运行状态字7:\r\n合相故障状态");
                list.Add("总功率因数\r\n超下限\r\n(0无故障,1故障)");
                list.Add("需量超限");
                list.Add("掉电");
                list.Add("辅助电源失电");
                list.Add("电流不平衡");
                list.Add("电压不平衡");
                list.Add("电流逆相序");
                list.Add("电压逆相序");
                list.Add("保留");
                list.Add("保留");
                list.Add("保留");
                list.Add("保留");
                list.Add("保留");
                list.Add("开端钮盖\r\n(0无故障,1故障)");
                list.Add("开表盖\r\n(0无故障,1故障)");
                list.Add("电流严重不平衡\r\n(0无故障,1故障)");
                DrawGrid(str, list);
            }
        }
Exemplo n.º 5
0
        private void btnReadStatus6_Click(object sender, EventArgs e)//电表运行状态字6
        {
            tbRunStatus6.Text = null;
            Protocol645 p645 = new Protocol645();

            p645.ReadParameter(tbRunStatus6, "04000506");
            string str = tbRunStatus6.Text;

            if (str.Length == 4)
            {
                List <string> list = new List <string>();
                list.Add("电表运行状态字6:\r\nC相故障状态");
                list.Add("断相");
                list.Add("潮流反向");
                list.Add("过载");
                list.Add("过流");
                list.Add("失流");
                list.Add("过压");
                list.Add("欠压");
                list.Add("失压");
                list.Add("保留");
                list.Add("保留");
                list.Add("保留");
                list.Add("保留");
                list.Add("保留");
                list.Add("保留");
                list.Add("保留");
                list.Add("断流");
                DrawGrid(str, list);
            }
        }
Exemplo n.º 6
0
        private void btnReadStatus1_Click(object sender, EventArgs e)//电表运行状态字1
        {
            tbRunStatus1.Text = null;
            Protocol645 p645 = new Protocol645();

            p645.ReadParameter(tbRunStatus1, "04000501");
            string str = tbRunStatus1.Text;

            if (str.Length == 4)
            {
                List <string> list = new List <string>();
                list.Add("电表运行状态字1:");
                list.Add("保留");
                list.Add("保留");
                list.Add("无功功率方向\r\n(0正向,1反向)");
                list.Add("有功功率方向\r\n(0正向,1反向)");
                list.Add("停电抄表电池\r\n(0正常,1欠压)");
                list.Add("时钟电池\r\n(0正常,1欠压)");
                list.Add("需量积算方式\r\n(0滑差,1区间)");
                list.Add("保留");
                list.Add("时钟故障");
                list.Add("透支状态");
                list.Add("存储器故障\r\n或损坏");
                list.Add("内部程序错误");
                list.Add("保留");
                list.Add("保留");
                list.Add("ESAM错误");
                list.Add("控制回路错误");
                DrawGrid(str, list);
            }
        }
 private void TextBoxInputEnterEvent(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         TextBox     tbVal = new TextBox();
         TextBox     tbId  = (TextBox)sender;
         Protocol645 p645  = new Protocol645();
         if (tbId == textBox13)
         {
             tbVal = textBox12;
         }
         else if (tbId == textBox16)
         {
             tbVal = textBox17;
         }
         else if (tbId == textBox14)
         {
             tbVal = textBox15;
         }
         else if (tbId == textBox18)
         {
             tbVal = textBox19;
         }
         else
         {
             return;
         }
         p645.ReadParameter(tbVal, tbId.Text);
     }
 }
Exemplo n.º 8
0
        private void btnReadStatus3_Click(object sender, EventArgs e)//电表运行状态字3
        {
            tbRunStatus3.Text = null;
            Protocol645 p645 = new Protocol645();

            p645.ReadParameter(tbRunStatus3, "04000503");
            string str = tbRunStatus3.Text;

            if (str.Length == 4)
            {
                List <string> list = new List <string>();
                list.Add("电表运行状态字3:");
                list.Add("预跳闸报警状态\r\n(0无,1有)");
                list.Add("继电器命令状态\r\n(0通,1断)");
                list.Add("当前运行时区\r\n(0第一套,1第二套");
                list.Add("继电器状态\r\n(0通,1断)");
                list.Add("红外认证/编程\r\n允许状态\r\n(0失效,1有效)");
                list.Add("供电方式");
                list.Add("(00主电源\r\n01辅助电源\r\n10电池供电)");
                list.Add("当前运行时段\r\n(0第一套,1第二套)");
                list.Add("远程开户\r\n(0开户,1未开户)");
                list.Add("本地开户\r\n(0开户,1未开户)");
                list.Add("身份认证状态\r\n(0失效,1有效)");
                list.Add("保电状态\r\n(0非保电,1保电)");
                list.Add("保留");
                list.Add("保留");
                list.Add("电能表类型");
                list.Add("(00非预付费\r\n01电量型预付费表\r\n10电费型预付费表)");
                DrawGrid(str, list);
            }
        }
        private void TongyongReadAndSet(object sender, EventArgs e)
        {
            Button      btn   = (Button)sender;
            TextBox     tbVal = new TextBox();
            TextBox     tbId  = new TextBox();
            Protocol645 p645  = new Protocol645();

            if (btn == button4 || btn == button9)
            {
                tbVal = textBox12; tbId = textBox13;
            }
            if (btn == button12 || btn == button13)
            {
                tbVal = textBox17; tbId = textBox16;
            }
            if (btn == button10 || btn == button11)
            {
                tbVal = textBox15; tbId = textBox14;
            }
            if (btn == button14 || btn == button15)
            {
                tbVal = textBox19; tbId = textBox18;
            }
            if (btn == button4 || btn == button12 || btn == button10 || btn == button14)
            {
                p645.ReadParameter(tbVal, tbId.Text);
            }
            else
            {
                p645.SetParameter(tbId.Text, tbVal.Text);
            }
        }
Exemplo n.º 10
0
        private void btn插卡状态字_Click(object sender, EventArgs e)
        {
            tbCkztz.Text = null;
            Protocol645 p645 = new Protocol645();

            p645.ReadParameter(tbCkztz, "04001502");
            string str = tbCkztz.Text;

            if (str.Length == 4)
            {
                List <string> list = new List <string>();
                list.Add("插卡状态字:");
                list.Add("保留");
                list.Add("保留");
                list.Add("保留");
                list.Add("保留");
                list.Add("保留");
                list.Add("保留");
                list.Add("保留");
                list.Add("插卡状态\r\n(00未知,01成功,10失败)");
                list.Add("保留");
                list.Add("保留");
                list.Add("保留");
                list.Add("保留");
                list.Add("保留");
                list.Add("保留");
                list.Add("保留");
                list.Add("保留");
                DrawGrid(str, list);
            }
        }
Exemplo n.º 11
0
        private void btnReadStatus2_Click(object sender, EventArgs e)//电表运行状态字2
        {
            tbRunStatus2.Text = null;
            Protocol645 p645 = new Protocol645();

            p645.ReadParameter(tbRunStatus2, "04000502");
            string str = tbRunStatus2.Text;

            if (str.Length == 4)
            {
                List <string> list = new List <string>();
                list.Add("电表运行状态字2:");
                list.Add("保留");
                list.Add("C相无功功率方向\r\n(0正向,1反向)");
                list.Add("B相无功功率方向\r\n(0正向,1反向)");
                list.Add("A相无功功率方向\r\n(0正向,1反向)");
                list.Add("保留");
                list.Add("C相有功功率方向\r\n(0正向,1反向)");
                list.Add("B相有功功率方向\r\n(0正向,1反向)");
                list.Add("A相有功功率方向\r\n(0正向,1反向)");
                list.Add("保留");
                list.Add("保留");
                list.Add("保留");
                list.Add("保留");
                list.Add("保留");
                list.Add("保留");
                list.Add("保留");
                list.Add("保留");
                DrawGrid(str, list);
            }
        }
Exemplo n.º 12
0
        private void btnReadAndSet(object sender, EventArgs e)//大读写按钮
        {
            Button btn = (Button)sender;

            foreach (Control ckb in this.splitContainer4.Panel2.Controls)
            {
                if (ckb is CheckBox)
                {
                    if (((CheckBox)ckb).Checked)
                    {
                        object      obj    = this.splitContainer4.Panel2.Controls.Find("tb" + ckb.Name.Substring(2, 8), true)[0];
                        string      dataId = ckb.Name.Substring(2, 8);
                        Protocol645 p645   = new Protocol645();
                        if (btn == btnR)
                        {
                            p645.ReadParameter(obj, dataId);
                        }
                        if (btn == btnS)
                        {
                            p645.SetParameter(obj, dataId);
                        }
                    }
                }
            }
        }
Exemplo n.º 13
0
        private void ButtonParameterRead(object sender, EventArgs e)
        {
            Button      btn    = (Button)sender;
            object      obj    = splitContainer4.Panel2.Controls.Find("tb" + btn.Name.Substring(4), true)[0];
            string      dataId = btn.Name.Substring(4);
            Protocol645 p645   = new Protocol645();

            p645.ReadParameter(obj, dataId);
        }
Exemplo n.º 14
0
        private void btnReadKMVer_Click(object sender, EventArgs e)//读科美内部版本号
        {
            Protocol645 p645 = new Protocol645();

            p645.ReadParameter(txtKMVer, "048000E1");
            string ss = null;

            for (int i = txtKMVer.Text.Length; i > 0; i--)
            {
                ss += txtKMVer.Text.Substring(i - 1, 1);
            }
            txtKMVer.Text = ss;
        }
Exemplo n.º 15
0
        //private void button18_Click(object sender, EventArgs e)//改超级密码
        //{
        //    _TextBoxPsw.Text = "47574B4D";
        //}

        private void button19_Click(object sender, EventArgs e)//040001E0读出厂状态
        {
            Protocol645 p645 = new Protocol645();

            p645.ReadParameter(textBox20, "040001E0");
            if (textBox20.Text == "AA55")
            {
                textBox20.Text = "未出厂";
            }
            else
            {
                textBox20.Text = "已出厂";
            }
        }
Exemplo n.º 16
0
        private void btn密钥状态字_Click(object sender, EventArgs e)
        {
            tbMyztz.Text = null;
            Protocol645 p645 = new Protocol645();

            p645.ReadParameter(tbMyztz, "04000508");
            string str = tbMyztz.Text;

            if (str.Length == 8)
            {
                List <string> list = new List <string>();
                list.Add("密钥状态字:");
                list.Add("密钥7状态\r\n(0测试状态,\r\n1正式状态)");
                list.Add("密钥6状态\r\n(0测试状态,\r\n1正式状态)");
                list.Add("密钥5状态\r\n(0测试状态,\r\n1正式状态)");
                list.Add("密钥4状态\r\n(0测试状态,\r\n1正式状态)");
                list.Add("密钥3状态\r\n(0测试状态,\r\n1正式状态)");
                list.Add("密钥2状态\r\n(0测试状态,\r\n1正式状态)");
                list.Add("密钥1状态\r\n(0测试状态,\r\n1正式状态)");
                list.Add("主控密钥状态\r\n(0测试状态,\r\n1正式状态)");
                list.Add("密钥15状态\r\n(0测试状态,\r\n1正式状态)");
                list.Add("密钥14状态\r\n(0测试状态,\r\n1正式状态)");
                list.Add("密钥13状态\r\n(0测试状态,\r\n1正式状态)");
                list.Add("密钥12状态\r\n(0测试状态,\r\n1正式状态)");
                list.Add("密钥11状态\r\n(0测试状态,\r\n1正式状态)");
                list.Add("密钥10状态\r\n(0测试状态,\r\n1正式状态)");
                list.Add("密钥9状态\r\n(0测试状态,\r\n1正式状态)");
                list.Add("密钥8状态\r\n(0测试状态,\r\n1正式状态)");
                list.Add("密钥23状态\r\n(0测试状态,\r\n1正式状态)");
                list.Add("密钥22状态\r\n(0测试状态,\r\n1正式状态)");
                list.Add("密钥21状态\r\n(0测试状态,\r\n1正式状态)");
                list.Add("密钥20状态\r\n(0测试状态,\r\n1正式状态)");
                list.Add("密钥19状态\r\n(0测试状态,\r\n1正式状态)");
                list.Add("密钥18状态\r\n(0测试状态,\r\n1正式状态)");
                list.Add("密钥17状态\r\n(0测试状态,\r\n1正式状态)");
                list.Add("密钥16状态\r\n(0测试状态,\r\n1正式状态)");
                list.Add("密钥31状态\r\n(0测试状态,\r\n1正式状态)");
                list.Add("密钥30状态\r\n(0测试状态,\r\n1正式状态)");
                list.Add("密钥29状态\r\n(0测试状态,\r\n1正式状态)");
                list.Add("密钥28状态\r\n(0测试状态,\r\n1正式状态)");
                list.Add("密钥27状态\r\n(0测试状态,\r\n1正式状态)");
                list.Add("密钥26状态\r\n(0测试状态,\r\n1正式状态)");
                list.Add("密钥25状态\r\n(0测试状态,\r\n1正式状态)");
                list.Add("密钥24状态\r\n(0测试状态,\r\n1正式状态)");
                DrawGrid(str, list);
            }
        }
Exemplo n.º 17
0
 private void TextBoxInputEnterEvent(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         TextBox tbVal = new TextBox();
         TextBox tbId  = (TextBox)sender;
         if (tbId == tbTongyongID)
         {
             tbVal = tbTongyong;
         }
         else
         {
             return;
         }
         Protocol645 p645 = new Protocol645();
         p645.ReadParameter(tbVal, tbId.Text);
     }
 }
Exemplo n.º 18
0
        private void TongyongReadAndSet(object sender, EventArgs e)
        {
            Button  btn   = (Button)sender;
            TextBox tbVal = new TextBox();
            TextBox tbId  = new TextBox();

            if (btn == btnTongyongR || btn == btnTongyongS)
            {
                tbVal = tbTongyong; tbId = tbTongyongID;
            }
            Protocol645 p645 = new Protocol645();

            if (btn == btnTongyongR)
            {
                p645.ReadParameter(tbVal, tbId.Text);
            }
            else
            {
                p645.SetParameter(tbId.Text, tbVal.Text);
            }
        }
Exemplo n.º 19
0
        private void btn有功方式特征字_Click(object sender, EventArgs e)
        {
            tbYgzhfstzz.Text = null;
            Protocol645 p645 = new Protocol645();

            p645.ReadParameter(tbYgzhfstzz, "04000601");
            string str = tbYgzhfstzz.Text;

            if (str.Length == 2)
            {
                List <string> list = new List <string>();
                list.Add("有功组合方式特征字:");
                list.Add("保留");
                list.Add("保留");
                list.Add("保留");
                list.Add("保留");
                list.Add("反向有功\r\n(0不减,1减)");
                list.Add("反向有功\r\n(0不加,1加)");
                list.Add("正向有功\r\n(0不减,1减)");
                list.Add("正向有功\r\n(0不加,1加)");
                DrawGrid(str, list);
            }
        }
Exemplo n.º 20
0
        private void btn负荷纪录模式字_Click(object sender, EventArgs e)
        {
            tbFhjlmsz.Text = null;
            Protocol645 p645 = new Protocol645();

            p645.ReadParameter(tbFhjlmsz, "04000901");
            string str = tbFhjlmsz.Text;

            if (str.Length == 2)
            {
                List <string> list = new List <string>();
                list.Add("负荷纪录模式字:");
                list.Add("保留");
                list.Add("保留");
                list.Add("当前需量");
                list.Add("四象限无功\r\n总电能");
                list.Add("有、无功\r\n总电能");
                list.Add("功率因数");
                list.Add("有、无功\r\n功率");
                list.Add("电压、电流、\r\n频率");
                DrawGrid(str, list);
            }
        }
Exemplo n.º 21
0
        private void btn无功组合方式2特征字_Click(object sender, EventArgs e)
        {
            tbWgzhfstzz2.Text = null;
            Protocol645 p645 = new Protocol645();

            p645.ReadParameter(tbWgzhfstzz2, "04000603");
            string str = tbWgzhfstzz2.Text;

            if (str.Length == 2)
            {
                List <string> list = new List <string>();
                list.Add("无功组合方式2特征字:");
                list.Add("IV象限\r\n(0不减,1减)");
                list.Add("IV象限\r\n(0不加,1加)");
                list.Add("III象限\r\n(0不减,1减)");
                list.Add("III象限\r\n(0不加,1加)");
                list.Add("II象限\r\n(0不减,1减)");
                list.Add("II象限\r\n(0不加,1加)");
                list.Add("I象限\r\n(0不减,1减)");
                list.Add("I象限\r\n(0不加,1加)");
                DrawGrid(str, list);
            }
        }
Exemplo n.º 22
0
        private void btn电表运行特征字1_Click(object sender, EventArgs e)
        {
            tbDbyxtzz1.Text = null;
            Protocol645 p645 = new Protocol645();

            p645.ReadParameter(tbDbyxtzz1, "04001101");
            string str = tbDbyxtzz1.Text;

            if (str.Length == 2)
            {
                List <string> list = new List <string>();
                list.Add("电表运行特征字1:");
                list.Add("保留");
                list.Add("保留");
                list.Add("保留");
                list.Add("保留");
                list.Add("保留");
                list.Add("主动上报模式\r\n(0不启用后续标志,\r\n1启用后续标志)");
                list.Add("液晶①②字样意义\r\n(0显示1,2套时段,\r\n1显示1,2套费率)");
                list.Add("外置开关控制方式\r\n(0电平,1脉冲)");
                DrawGrid(str, list);
            }
        }
Exemplo n.º 23
0
        private void btn冻结数据模式字_Click(object sender, EventArgs e)
        {
            tbDjsjmsz.Text = null;
            Protocol645 p645 = new Protocol645();

            p645.ReadParameter(tbDjsjmsz, "04000902");
            string str = tbDjsjmsz.Text;

            if (str.Length == 2)
            {
                List <string> list = new List <string>();
                list.Add("冻结数据模式字:");
                list.Add("变量");
                list.Add("反向有功最大\r\n需量及发生时间");
                list.Add("正向有功最大\r\n需量及发生时间");
                list.Add("四象限无功\r\n电能");
                list.Add("组合无功2\r\n电能");
                list.Add("组合无功1\r\n电能");
                list.Add("反向有功\r\n电能");
                list.Add("正向有功\r\n电能");
                DrawGrid(str, list);
            }
        }
Exemplo n.º 24
0
        private void btn周休日特征字_Click(object sender, EventArgs e)
        {
            tbZxrtzz.Text = null;
            Protocol645 p645 = new Protocol645();

            p645.ReadParameter(tbZxrtzz, "04000801");
            string str = tbZxrtzz.Text;

            if (str.Length == 2)
            {
                List <string> list = new List <string>();
                list.Add("周休日特征字:");
                list.Add("保留");
                list.Add("周六");
                list.Add("周五");
                list.Add("周四");
                list.Add("周三");
                list.Add("周二");
                list.Add("周一");
                list.Add("周日");
                DrawGrid(str, list);
            }
        }
Exemplo n.º 25
0
        private void btn二类数据读_Click(object sender, EventArgs e)
        {
            Protocol645 p645 = new Protocol645();

            p645.ReadParameter(tbErleishujv, tbErleishujvID.Text);
        }
Exemplo n.º 26
0
        private void btn阶梯切换时间读_Click(object sender, EventArgs e)
        {
            Protocol645 p645 = new Protocol645();

            p645.ReadParameter(tbStepChTime, "04000109");
        }
Exemplo n.º 27
0
        private void btn电压变比读_Click(object sender, EventArgs e)
        {
            Protocol645 p645 = new Protocol645();

            p645.ReadParameter(tbVolCh, "04000307");
        }
Exemplo n.º 28
0
        private void btn电流变比读_Click(object sender, EventArgs e)
        {
            Protocol645 p645 = new Protocol645();

            p645.ReadParameter(tbCurrentCh, "04000306");
        }
Exemplo n.º 29
0
        private void btn表号读_Click(object sender, EventArgs e)
        {
            Protocol645 p645 = new Protocol645();

            p645.ReadParameter(tbMeterNo, "04000402");
        }
Exemplo n.º 30
0
        private void btn读认证时效_Click(object sender, EventArgs e)
        {
            Protocol645 p645 = new Protocol645();

            p645.ReadParameter(tbRenzhengshixiao, "02800022");
        }