Ejemplo n.º 1
0
        private static DataTable QueryTestHisDetail(string testSerial)
        {
            #region init table
            DataTable dataSource = new DataTable();
            dataSource.Columns.Add("序号");
            dataSource.Columns.Add("起点接口");
            dataSource.Columns.Add("起点接点");
            dataSource.Columns.Add("终点接口");
            dataSource.Columns.Add("终点接点");
            dataSource.Columns.Add("导通电阻(Ω)");
            dataSource.Columns.Add("导通测试结果");
            dataSource.Columns.Add("短路测试(Ω)");
            dataSource.Columns.Add("短路测试结果");
            dataSource.Columns.Add("绝缘电阻(MΩ)");
            dataSource.Columns.Add("绝缘测试结果");
            //dataSource.Columns.Add("耐压电流(Ω)");
            //dataSource.Columns.Add("耐压测试结果");
            #endregion

            THistoryDataDetailManager detailManage = new THistoryDataDetailManager();
            var data = detailManage.GetDataSetByWhere($"where TestSerialNumber = '{testSerial}'").Tables[0];
            if (data.Rows.Count <= 0)
            {
                return(dataSource);
            }
            int iRow = 1;
            foreach (DataRow dataRow in data.Rows)
            {
                DataRow dr = dataSource.NewRow();
                dr["序号"]      = iRow;
                dr["起点接口"]    = dataRow["StartInterface"].ToString();
                dr["起点接点"]    = dataRow["StartContactPoint"].ToString();
                dr["终点接口"]    = dataRow["EndInterface"].ToString();
                dr["终点接点"]    = dataRow["EndContactPoint"].ToString();
                dr["导通电阻(Ω)"] = dataRow["ConductValue"].ToString();
                dr["导通测试结果"]  = dataRow["ConductTestResult"].ToString();
                dr["短路测试(Ω)"] = dataRow["ShortCircuitValue"].ToString();
                dr["短路测试结果"]  = dataRow["ShortCircuitTestResult"].ToString();
                double insulateVal;
                if (double.TryParse(dataRow["InsulateValue"].ToString(), out insulateVal))
                {
                    dr["绝缘电阻(MΩ)"] = (insulateVal / 1000000).ToString("f1");
                }
                else
                {
                    dr["绝缘电阻(MΩ)"] = "--";
                }
                dr["绝缘测试结果"] = dataRow["InsulateTestResult"].ToString();
                dataSource.Rows.Add(dr);
                iRow++;
            }
            return(dataSource);
        }
        public static long InsertHistoryDetailPID()
        {
            int id = -1;
            THistoryDataDetailManager objManager = new THistoryDataDetailManager();
            var dt = objManager.GetDataSetByWhere("order by ID DESC limit 1").Tables[0];

            if (dt.Rows.Count < 1)
            {
                return(0);
            }
            if (int.TryParse(dt.Rows[0]["ID"].ToString(), out id))
            {
                return(id + 1);
            }
            else
            {
                LogHelper.Log.Error("Option His Detail PID FAILT..." + id);
            }
            return(id);
        }
Ejemplo n.º 3
0
        private void QueryHistoryBasicInfo(bool IsLike)
        {
            RadGridViewProperties.ClearGridView(this.radGridView1, null);
            var hisBasicInfo = TestHisBasicInfo.QueryProTestHisBasicInfo(this.testNumber);

            this.lbx_TestResult.Text             = hisBasicInfo.FinalTestResult;
            this.lbx_bcCableName.Text            = hisBasicInfo.TestCableName;
            this.lbx_testDate.Text               = hisBasicInfo.TestStartDate;
            this.lbx_TestNumber.Text             = hisBasicInfo.TestSerialNumber;
            this.lbx_OperatorName.Text           = hisBasicInfo.TestOperator;
            this.lbx_EnvironmentTemperature.Text = hisBasicInfo.EnvironmentTemperature;
            this.lbx_AmbientHumidity.Text        = hisBasicInfo.EnvironmentAmbientHumidity;
            this.lbx_conductResult.Text          = hisBasicInfo.ConductTestResult;
            this.lbx_circuitResult.Text          = hisBasicInfo.ShortCircuitTestResult;
            this.lbx_insulateResult.Text         = hisBasicInfo.InsulateTestResult;
            if (hisBasicInfo.ProjectName != "")
            {
                this.Text += "(" + hisBasicInfo.ProjectName + ")";
            }

            //更新测试参数
            this.lbx_conductThreshold.Text      = "≤" + hisBasicInfo.ConductThreshold + "Ω";
            this.lbx_shortCircuitThreshold.Text = "≥" + hisBasicInfo.ShortCircuitThreshold + "Ω";
            this.lbx_insulateThreshold.Text     = "≥" + hisBasicInfo.InsulateThreshold + "Ω";
            this.lbx_insulateVoltage.Text       = hisBasicInfo.InsulateVoltage + "V";
            this.lbx_insulateTime.Text          = hisBasicInfo.InsulateHoldTime + "s";
            //this.lbx_pressureProofThreshold.Text = "≤" + dr["VoltageWithStandardThreshold"].ToString() + "mA";
            //this.lbx_pressureProofTime.Text = dr["VoltageWithStandardHoldTime"].ToString() + "s";
            //this.lbx_pressureProofVoltage.Text = dr["VoltageWithStandardVoltage"].ToString() + "VAC";

            //更新测试数据详情
            if (this.testNumber == "")
            {
                return;
            }
            var dt = historyDataDetailManager.GetDataSetByWhere($"where TestSerialNumber = '{this.testNumber}'").Tables[0];

            if (dt.Rows.Count < 1)
            {
                return;
            }
            foreach (DataRow dr in dt.Rows)
            {
                var sInter                 = dr["StartInterface"].ToString();
                var sPoint                 = dr["StartContactPoint"].ToString();
                var eInter                 = dr["EndInterface"].ToString();
                var ePoint                 = dr["EndContactPoint"].ToString();
                var conductValue           = dr["ConductValue"].ToString();
                var conductResult          = dr["ConductTestResult"].ToString();
                var shortCircuitValue      = dr["ShortCircuitValue"].ToString();
                var shortCircuitTestResult = dr["ShortCircuitTestResult"].ToString();
                var insulateValue          = dr["InsulateValue"].ToString();
                var insulateResult         = dr["InsulateTestResult"].ToString();
                if (IsExistTestInfo(sInter, sPoint, eInter, ePoint))
                {
                    continue;
                }
                this.radGridView1.Rows.AddNew();
                var rCount = this.radGridView1.RowCount;
                this.radGridView1.Rows[rCount - 1].Cells[0].Value  = rCount;
                this.radGridView1.Rows[rCount - 1].Cells[1].Value  = sInter;
                this.radGridView1.Rows[rCount - 1].Cells[2].Value  = sPoint;
                this.radGridView1.Rows[rCount - 1].Cells[3].Value  = eInter;
                this.radGridView1.Rows[rCount - 1].Cells[4].Value  = ePoint;
                this.radGridView1.Rows[rCount - 1].Cells[5].Value  = conductValue;
                this.radGridView1.Rows[rCount - 1].Cells[6].Value  = conductResult;
                this.radGridView1.Rows[rCount - 1].Cells[7].Value  = shortCircuitValue;
                this.radGridView1.Rows[rCount - 1].Cells[8].Value  = shortCircuitTestResult;
                this.radGridView1.Rows[rCount - 1].Cells[9].Value  = insulateValue;
                this.radGridView1.Rows[rCount - 1].Cells[10].Value = insulateResult;
            }
        }