Exemplo n.º 1
0
        private void btnSdSet_Click(object sender, EventArgs e)
        {
            string      sData = null;
            Protocol645 p645  = new Protocol645();

            for (int i = 14; i > 0; i--)
            {
                TextBox tmpTextBox = this.gBSd.Controls.Find("txtSd" + i.ToString(), true)[0] as TextBox;
                sData += tmpTextBox.Text.Trim();
            }
            if (rBtnSd1.Checked)
            {
                for (int i = 1; i < 9; i++)
                {
                    if ((this.gBSd.Controls.Find("rBtnSd_" + i.ToString(), true)[0] as RadioButton).Checked)
                    {
                        p645.SetParameter("0401000" + i.ToString(), sData);
                    }
                }
            }
            if (rBtnSd2.Checked)
            {
                for (int i = 1; i < 9; i++)
                {
                    if ((this.gBSd.Controls.Find("rBtnSd_" + i.ToString(), true)[0] as RadioButton).Checked)
                    {
                        p645.SetParameter("0402000" + i.ToString(), sData);
                    }
                }
            }
        }
        private void btn设显示内容_Click(object sender, EventArgs e)
        {
            Protocol645 p645 = new Protocol645();

            if (rbDisplayAuto.Checked)
            {
                int displayautoNum = Convert.ToInt16(tbXunxianNum.Text);
                if (dgvDisplay.Rows.Count == displayautoNum)
                {
                    //progressBar.Maximum = displayautoNum;
                    //progressBar.Value = 0;
                    for (int i = 0; i < displayautoNum; i++)
                    {
                        if (dgvDisplay[0, i].Value.ToString().Length == 8 && dgvDisplay[1, i].Value.ToString().Length == 2)
                        {
                            p645.SetParameter("040401" + (i + 1).ToString("X2"), dgvDisplay[1, i].Value.ToString() + dgvDisplay[0, i].Value.ToString());
                            //progressBar.Value++;
                        }
                        else
                        {
                            MessageBox.Show("输入数据长度错误,请检查!");
                            return;
                        }
                    }
                    MessageBox.Show("设表完毕!");
                }
                else
                {
                    MessageBox.Show("表格内容与要设置的屏数不相符");
                }
            }
            if (rbDisplayButton.Checked)
            {
                int displaybuttonNum = Convert.ToInt16(tbJianxianNum.Text);
                if (dgvDisplay.Rows.Count == displaybuttonNum)
                {
                    //progressBar.Maximum = displaybuttonNum;
                    //progressBar.Value = 0;
                    for (int i = 0; i < displaybuttonNum; i++)
                    {
                        if (dgvDisplay[0, i].Value.ToString().Length == 8 && dgvDisplay[1, i].Value.ToString().Length == 2)
                        {
                            p645.SetParameter("040402" + (i + 1).ToString("X2"), dgvDisplay[1, i].Value.ToString() + dgvDisplay[0, i].Value.ToString());
                            //progressBar.Value++;
                        }
                        else
                        {
                            MessageBox.Show("输入数据长度错误,请检查!");
                            return;
                        }
                    }
                    MessageBox.Show("设表完毕!");
                }
                else
                {
                    MessageBox.Show("表格内容与要设置的屏数不相符");
                }
            }
        }
Exemplo n.º 3
0
        private void button23_Click(object sender, EventArgs e)//福建:设表时间
        {
            Protocol645 p645 = new Protocol645();

            p645.SetParameter(textBox24, "04000101");
            Functions.Delay(10);
            p645.SetParameter(textBox23, "04000102");
        }
        private void btnSetMeterTime_Click(object sender, EventArgs e)
        {
            Protocol645 p645 = new Protocol645();

            p645.SetParameter(txtMeterTime1, "04000101");
            Functions.Delay(10);
            p645.SetParameter(txtMeterTime2, "04000102");
        }
Exemplo n.º 5
0
        private void btnSetPcDataTime_Click(object sender, EventArgs e)//设当前电脑日期时间
        {
            Protocol645 p645     = new Protocol645();
            string      dataDate = DateTime.Now.ToString("yyMMdd");

            dataDate = Functions.JustWeek(dataDate);
            p645.SetParameter("04000101", dataDate);
            p645.SetParameter("04000102", DateTime.Now.ToString("HHmmss"));
        }
Exemplo n.º 6
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);
                        }
                    }
                }
            }
        }
        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.º 8
0
        private void ButtonParameterSet(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.SetParameter(obj, dataId);
        }
Exemplo n.º 9
0
        private void btnSqSet_Click(object sender, EventArgs e)
        {
            string sData = null;

            for (int i = 14; i > 0; i--)
            {
                TextBox tmpTextBox = this.gBSq.Controls.Find("txtSq" + i.ToString(), true)[0] as TextBox;
                sData += tmpTextBox.Text.Trim();
            }
            Protocol645 p645 = new Protocol645();

            if (rBtnSq1.Checked)
            {
                p645.SetParameter("04010000", sData);
            }
            if (rBtnSq2.Checked)
            {
                p645.SetParameter("04020000", sData);
            }
        }
Exemplo n.º 10
0
 private void btnSetJvQuanFacMod_Click(object sender, EventArgs e)//设钜泉出厂模式
 {
     if (tBSetJvQuanFacMod.Text == "FF" || tBSetJvQuanFacMod.Text == "00")
     {
         Protocol645 p645 = new Protocol645();
         p645.SetParameter(tBSetJvQuanFacMod, "04CC0001");
     }
     else
     {
         MessageBox.Show("请填00或FF!");
     }
 }
Exemplo n.º 11
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.º 12
0
        private void btnSetRidongjieTime_Click(object sender, EventArgs e)
        {
            Protocol645 p645 = new Protocol645();

            p645.SetParameter(tBRidongjieTime, "04001203");
        }
Exemplo n.º 13
0
        private void btnJvQuanInit_Click(object sender, EventArgs e)//钜泉初始化
        {
            Protocol645 p645 = new Protocol645();

            p645.SetParameter("04CC00FF", "");
        }
Exemplo n.º 14
0
        private void button17_Click_1(object sender, EventArgs e)//04091120清出厂
        {
            Protocol645 p645 = new Protocol645();

            p645.SetParameter("04091120", "AA55");
        }
        private void btnSet1stJsr_Click(object sender, EventArgs e)
        {
            Protocol645 p645 = new Protocol645();

            p645.SetParameter(txt1stJsr, "04000B01");
        }
        private void btn设键显屏数_Click(object sender, EventArgs e)
        {
            Protocol645 p645 = new Protocol645();

            p645.SetParameter(tbJianxianNum, "04000305");
        }
Exemplo n.º 17
0
        }//设两套时区切换时间

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

            p645.SetParameter(txt2SdChange, "04000107");
        }//设两套时段切换时间
Exemplo n.º 18
0
        private void btn设主动上报模式字_Click(object sender, EventArgs e)
        {
            Protocol645 p645 = new Protocol645();

            p645.SetParameter(tbZdsbmsz, "04001104");
        }
Exemplo n.º 19
0
        private void btn复位主动上报状态字_Click(object sender, EventArgs e)
        {
            Protocol645 p645 = new Protocol645();

            p645.SetParameter(tbFwzdsbztz, "04001503");
        }