コード例 #1
0
 private void tim_PainPic_Tick(object sender, EventArgs e)
 {
     if (_tcpClient.IsTCPLink)
     {
         var c     = _tcpClient.GetCYXS(ref IsSeccess);
         int value = int.Parse(c.ToString());
         if (!IsSeccess)
         {
             MessageBox.Show("获取大气压力异常!", "警告!", MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1, MessageBoxOptions.ServiceNotification);
             return;
         }
         AnimateSeries(this.tChart_sm, value);
     }
 }
コード例 #2
0
        /// <summary>
        /// 差压读取
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void tim_qm_Tick(object sender, EventArgs e)
        {
            if (_tcpClient.IsTCPLink)
            {
                var value = int.Parse(_tcpClient.GetCYXS(ref IsSeccess).ToString());
                if (!IsSeccess)
                {
                    //todo
                    //MessageBox.Show("获取差压异常--气密!", "警告!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }
                //lbl_dqyl.Text = value.ToString();

                //读取设定值
                if (airtightPropertyTest == PublicEnum.AirtightPropertyTest.ZStart)
                {
                    double yl = _tcpClient.GetZYYBYLZ(ref IsSeccess, "ZYKS");
                    if (!IsSeccess)
                    {
                        //  MessageBox.Show("获取正压预备异常!", "警告!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        return;
                    }
                    lbl_setYL.Text = yl.ToString();
                }
                else if (airtightPropertyTest == PublicEnum.AirtightPropertyTest.FStart)
                {
                    double yl = _tcpClient.GetZYYBYLZ(ref IsSeccess, "FYKS");
                    if (!IsSeccess)
                    {
                        // MessageBox.Show("获取负压开始异常!", "警告!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        return;
                    }
                    lbl_setYL.Text = "-" + yl.ToString();
                }
                else if (airtightPropertyTest == PublicEnum.AirtightPropertyTest.Stop)
                {
                    lbl_setYL.Text = "0";
                }

                if (IsStart)
                {
                    if (this.tim_Top10.Enabled == false)
                    {
                        SetCurrType(value);
                    }
                }
            }
        }
コード例 #3
0
        /// <summary>
        /// 差压读取
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void tim_qm_Tick(object sender, EventArgs e)
        {
            if (_tcpClient.IsTCPLink)
            {
                var value = int.Parse(_tcpClient.GetCYXS(ref IsSeccess).ToString());
                if (!IsSeccess)
                {
                    return;
                }
                //  lbl_dqyl.Text = value.ToString();

                //读取设定值
                if (airtightPropertyTest == PublicEnum.AirtightPropertyTest.ZStart)
                {
                    double yl = _tcpClient.GetZYYBYLZ(ref IsSeccess, "ZYKS");
                    if (!IsSeccess)
                    {
                        return;
                    }
                    lbl_setYL.Text = yl.ToString();
                }
                else if (airtightPropertyTest == PublicEnum.AirtightPropertyTest.FStart)
                {
                    double yl = _tcpClient.GetZYYBYLZ(ref IsSeccess, "FYKS");
                    if (!IsSeccess)
                    {
                        return;
                    }
                    lbl_setYL.Text = "-" + yl.ToString();
                }
                else if (airtightPropertyTest == PublicEnum.AirtightPropertyTest.Stop)
                {
                    lbl_setYL.Text = "0";
                }

                if (IsStart)
                {
                    if (this.tim_Top10.Enabled == false)
                    {
                        SetCurrType(value);
                    }
                }
            }
        }
コード例 #4
0
        private void btn_collection_Click(object sender, EventArgs e)
        {
            var name = cbb_type.Text;

            if (string.IsNullOrWhiteSpace(cbb_type.Text))
            {
                MessageBox.Show("警告", "请选择传感器!", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1, MessageBoxOptions.ServiceNotification);
                return;
            }
            double       res       = 0;
            bool         IsSuccess = false;
            ListViewItem lvi       = new ListViewItem();

            if (name == "风速传感器      米/秒")
            {
                res = _tcpConnection.GetFSXS(ref IsSuccess);
            }
            if (name == "差压传感器      高 帕")
            {
                res = _tcpConnection.GetCYXS(ref IsSuccess);
            }
            if (name == "温度传感器      ℃")
            {
                res = _tcpConnection.GetWDXS(ref IsSuccess);
            }
            if (name == "大气压力传感器 KPa")
            {
                res = _tcpConnection.GetDQYLXS(ref IsSuccess);
            }
            if (name == "位移传感器1      mm")
            {
                res = _tcpConnection.GetDisplace1(ref IsSuccess);
            }
            if (name == "位移传感器2      mm")
            {
                res = _tcpConnection.GetDisplace2(ref IsSuccess);
            }
            if (name == "位移传感器3      mm")
            {
                res = _tcpConnection.GetDisplace3(ref IsSuccess);
            }

            lvi.Text = res.ToString();
            lvi.SubItems.Add(DateTime.Now.ToString("HH:mm:ss"));

            this.lv_cjz.Items.Add(lvi);
        }
コード例 #5
0
        private void DataInit()
        {
            //隐藏打开按钮
            // tsb_open.Visible = false;

            if (tcpClient.IsTCPLink)
            {
                #region 获取面板显示
                var IsSeccess = false;

                var temperature = _temperature = tcpClient.GetWDXS(ref IsSeccess);
                if (!IsSeccess)
                {
                    return;
                }

                var temppressure = _temppressure = tcpClient.GetDQYLXS(ref IsSeccess);
                if (!IsSeccess)
                {
                    return;
                }

                var windSpeed = tcpClient.GetFSXS(ref IsSeccess).ToString();
                if (!IsSeccess)
                {
                    return;
                }

                var diffPress = tcpClient.GetCYXS(ref IsSeccess).ToString();
                if (!IsSeccess)
                {
                    return;
                }

                lbl_wdcgq.Text   = temperature.ToString();
                lbl_dqylcgq.Text = temppressure.ToString();
                lbl_fscgq.Text   = windSpeed.ToString();
                lbl_cycgq.Text   = diffPress.ToString();

                #endregion

                #region 获取正负压阀状态
                GetPRVs();
                #endregion
            }
        }
コード例 #6
0
        private void DataInit()
        {
            //隐藏打开按钮
            tsb_open.Visible = false;

            if (tcpClient.IsTCPLink)
            {
                #region 获取面板显示
                var IsSeccess = false;
                //设置高压标零
                var pressureZero = tcpClient.SendGYBD(true);

                var temperature = _temperature = tcpClient.GetWDXS(ref IsSeccess);
                if (!IsSeccess)
                {
                    return;
                }

                var temppressure = _temppressure = tcpClient.GetDQYLXS(ref IsSeccess);
                if (!IsSeccess)
                {
                    return;
                }

                var windSpeed = tcpClient.GetFSXS(ref IsSeccess).ToString();
                if (!IsSeccess)
                {
                    return;
                }

                var diffPress = tcpClient.GetCYXS(ref IsSeccess).ToString();
                if (!IsSeccess)
                {
                    return;
                }

                lbl_wdcgq.Text   = temperature.ToString();
                lbl_dqylcgq.Text = temppressure.ToString();
                lbl_fscgq.Text   = windSpeed.ToString();
                lbl_cycgq.Text   = diffPress.ToString();


                //抗风压
                var displace1 = tcpClient.GetDisplace1(ref IsSeccess).ToString();
                if (!IsSeccess)
                {
                    return;
                }
                var displace2 = tcpClient.GetDisplace2(ref IsSeccess).ToString();
                if (!IsSeccess)
                {
                    return;
                }
                var displace3 = tcpClient.GetDisplace3(ref IsSeccess).ToString();
                if (!IsSeccess)
                {
                    return;
                }

                lbl_Displace1.Text = displace1.ToString();
                lbl_Displace2.Text = displace2.ToString();
                lbl_Displace3.Text = displace3.ToString();

                #endregion

                #region 获取正负压阀状态
                GetPRVs();
                #endregion
            }
        }