public override void SetData(CLDC_DataCore.Model.DnbModel.DnbGroupInfo MeterGroup, bool allowedit) { try { if (MeterGroup.MeterGroup.Count == 0) { return; } Conn_Data.Rows.Clear(); DataTable dtKeys = new DataTable(); dtKeys.Columns.Add("Keys", typeof(string)); dtKeys.Columns.Add("PrjId", typeof(string)); foreach (string Key in MeterGroup.MeterGroup[MeterGroup.GetFirstYaoJianMeterBwh()].MeterResults.Keys) { if (Key.IndexOf(((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.通讯协议检查试验).ToString("D3")) != -1) { CLDC_DataCore.Model.DnbModel.DnbInfo.MeterResult meterResult = MeterGroup.MeterGroup[MeterGroup.GetFirstYaoJianMeterBwh()].MeterResults[Key]; if (meterResult.Mr_chrRstId != null && meterResult.Mr_chrRstName != null) { dtKeys.Rows.Add(Key, meterResult.Mr_chrRstId); } } } //只计算基本误差的数据 DataRow[] Rows = dtKeys.Select("Keys <> '' and PrjId Like '" + ((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.通讯协议检查试验).ToString("D3") + "%' ", "PrjId asc"); for (int i = 0; i < MeterGroup._Bws; i++) { if (!MeterGroup.MeterGroup[i].YaoJianYn) { continue; } for (int j = 0; j < Rows.Length; j++) { string Key = Rows[j][0].ToString(); if (!MeterGroup.MeterGroup[i].MeterResults.ContainsKey(Key)) { continue; } CLDC_DataCore.Model.DnbModel.DnbInfo.MeterResult meterResult = MeterGroup.MeterGroup[i].MeterResults[Key]; if (meterResult.Mr_chrRstId != null) { int rowIndex = Conn_Data.Rows.Add(); Conn_Data["表位", rowIndex].Value = MeterGroup.MeterGroup[i].ToString(); Conn_Data["项目名称", rowIndex].Value = meterResult.Mr_chrRstName; Conn_Data["项目数据", rowIndex].Value = meterResult.Mr_chrRstValue; } } } } catch (Exception ex) { MessageBox.Show(ex.StackTrace); } }
private void thShowData(object obj) { CheckPlan = CLDC_DataCore.Const.GlobalUnit.g_CUS.DnbData.CheckPlan; CLDC_DataCore.Model.DnbModel.DnbInfo.MeterBasicInfo curMeter = null; if (CLDC_DataCore.Const.GlobalUnit.g_CUS == null) { return; } lock (objShowDataLock) { bool isRead = false; string strKey = string.Empty; for (int bw = 0; bw < BwCount; bw++) { //if (bw > BwCount) break; string strMessageValue = string.Empty; curMeter = CLDC_DataCore.Const.GlobalUnit.Meter(bw); /*表格显示中的表位序号是从1开始*/ ClientTable.SetCheckBoxValue(bw + 1, curMeter.YaoJianYn); if (!curMeter.YaoJianYn) { continue; } if (CLDC_DataCore.Const.GlobalUnit.g_CUS.DnbData.ActiveItemID < 0 || CLDC_DataCore.Const.GlobalUnit.g_CUS.DnbData.CheckState == CLDC_Comm.Enum.Cus_CheckStaute.停止检定) { //参数录入状态下刷新时显示条形码 strMessageValue = curMeter.Mb_ChrTxm; } else { //数据验证 //if (curMeter.MeterPlan == null || curMeter.MeterPlan.CheckPlan == null) continue; //if (CheckPlan.Count <= CLDC_DataCore.Const.GlobalUnit.g_CUS.DnbData.ActiveItemID) return; strKey = ""; object curPlan = CheckPlan[CLDC_DataCore.Const.GlobalUnit.g_CUS.DnbData.ActiveItemID]; if (curPlan is CLDC_DataCore.Struct.StPlan_ZouZi) { strKey = ((CLDC_DataCore.Struct.StPlan_ZouZi)curPlan).PrjID; } CLDC_DataCore.Model.DnbModel.DnbInfo.MeterResult curResult = null; #region 预热数据显示 if (curPlan is StPlan_YuRe) { strMessageValue = "预热中"; } #endregion #region 起动/启动数据 else if (curPlan is StPlan_QiDong) { strKey = ((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.起动试验).ToString("D3"); strKey += ((int)((StPlan_QiDong)curPlan).PowerFangXiang).ToString(); if (curMeter.MeterResults.ContainsKey(strKey)) { curResult = curMeter.MeterResults[strKey]; strMessageValue = curResult.Mr_chrRstValue; isRead = curResult.Mr_chrRstValue == CLDC_DataCore.Const.Variable.CTG_BuHeGe; } else { strMessageValue = "准备检定"; } } #endregion #region 潜动试验显示 else if (curPlan is StPlan_QianDong) { strKey = ((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.潜动试验).ToString("000"); strKey += ((int)((StPlan_QianDong)curPlan).PowerFangXiang).ToString(); if (curMeter.MeterResults.ContainsKey(strKey)) { curResult = curMeter.MeterResults[strKey]; strMessageValue = curResult.Mr_chrRstValue; isRead = curResult.Mr_chrRstValue == CLDC_DataCore.Const.Variable.CTG_BuHeGe; } else { strMessageValue = "准备检定"; } } #endregion #region 基本误差/标准偏差 else if (curPlan is StPlan_WcPoint) { //strKey = "P_" + CLDC_DataCore.Const.GlobalUnit.g_CUS.DnbData.ActiveItemID; StPlan_WcPoint _curPoint = (StPlan_WcPoint)curPlan; CLDC_DataCore.Model.DnbModel.DnbInfo.MeterError curErroWc = null; strKey = _curPoint.PrjID; if (curMeter.MeterErrors.ContainsKey(strKey)) { curErroWc = curMeter.MeterErrors[strKey]; string[] strErrorValue = curErroWc.Me_chrWcMore.Split('|'); if (strErrorValue.Length > 0) { strMessageValue = strErrorValue[0]; } if (curErroWc.Me_chrWcJl == CLDC_DataCore.Const.Variable.CTG_BuHeGe) { isRead = true; } } } #endregion #region ----------特殊检定----------- else if (curPlan is StPlan_SpecalCheck) { //Comm.Struct.CheckPoint _curPoint = (Comm.Struct.CheckPoint)curPlan; strKey = "P_" + CLDC_DataCore.Const.GlobalUnit.g_CUS.DnbData.ActiveItemID; CLDC_DataCore.Model.DnbModel.DnbInfo.MeterSpecialErr curErroWc = null; //strKey = _curPoint.PrjID; if (curMeter.MeterSpecialErrs.ContainsKey(strKey)) { curErroWc = curMeter.MeterSpecialErrs[strKey]; string[] strErrorValue = curErroWc.Mse_Wc.Split('|'); if (strErrorValue.Length > 0) { strMessageValue = strErrorValue[0]; } if (curErroWc.Mse_Result == CLDC_DataCore.Const.Variable.CTG_BuHeGe) { isRead = true; } } } #endregion #region 走字数据 else if (curPlan is StPlan_ZouZi) { CLDC_DataCore.Model.DnbModel.DnbInfo.MeterZZError curZZerror = null; if (curMeter.MeterZZErrors.ContainsKey(strKey)) { curZZerror = curMeter.MeterZZErrors[strKey]; if (m_VerifyStep == CLDC_Comm.Enum.Cus_stVerifyStep.走字试验录起码 || m_VerifyStep == CLDC_Comm.Enum.Cus_stVerifyStep.走字试验录止码) { strMessageValue = ""; } else if (m_VerifyStep == CLDC_Comm.Enum.Cus_stVerifyStep.走字试验录止码完毕) { //止码 strMessageValue = curZZerror.Mz_chrZiMa.ToString(); } else if (m_VerifyStep == CLDC_Comm.Enum.Cus_stVerifyStep.走字试验录起码完毕) { //起码 strMessageValue = curZZerror.Mz_chrQiMa.ToString(); } else if (m_VerifyStep == CLDC_Comm.Enum.Cus_stVerifyStep.计算误差完毕) { //起码 strMessageValue = curZZerror.Mz_chrWc.ToString(); } else { //中途进入 if (curZZerror.Mz_chrZiMa != -1) { strMessageValue = curZZerror.Mz_chrZiMa.ToString(); } else if (curZZerror.Mz_chrQiMa != -1) { strMessageValue = curZZerror.Mz_chrQiMa.ToString(); } else { strMessageValue = ""; } } if (curZZerror.Mz_chrJL == CLDC_DataCore.Const.Variable.CTG_BuHeGe) { isRead = true; } } } #endregion #region 多功能数据 else if (curPlan is CLDC_DataCore.Struct.StPlan_Dgn) { strMessageValue = "检定中"; CLDC_DataCore.Struct.StPlan_Dgn DgnPlan = (CLDC_DataCore.Struct.StPlan_Dgn)curPlan; } #endregion #region 载波数据 else if (curPlan is StPlan_Carrier) { strMessageValue = "检定中"; StPlan_Carrier CarrierPlan = (StPlan_Carrier)curPlan; } #endregion else { //MUSTDO:走字,多功能检定客户端显示还没有做 } } //更新到UI ClientTable.SetTextValue(bw + 1, strMessageValue); ClientTable.SetTextBackColorValue(bw + 1, isRead); } } }
/// <summary> /// 数据刷新 /// </summary> /// <param name="MeterGroup">电能表数据集合</param> /// <param name="CheckOrderID">当前检定点</param> private void RefreshGrid(CLDC_DataCore.Model.DnbModel.DnbGroupInfo MeterGroup, int CheckOrderID) { string strKey = ((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.外观检查试验).ToString(); CLDC_DataCore.Struct.StPlan_WGJC _Item; if (MeterGroup.CheckPlan[CheckOrderID] is CLDC_DataCore.Struct.StPlan_WGJC) { _Item = (CLDC_DataCore.Struct.StPlan_WGJC)MeterGroup.CheckPlan[CheckOrderID]; } else { return; } for (int i = 0; i < MeterGroup.MeterGroup.Count; i++) { CLDC_DataCore.Model.DnbModel.DnbInfo.MeterBasicInfo _MeterInfo = MeterGroup.MeterGroup[i]; DataGridViewRow _Row = Data_WGJC.Rows[i]; //表位号 _Row.Cells[1].Value = _MeterInfo.ToString(); //插入表位号 if (!_MeterInfo.YaoJianYn) //如果不检 { _Row.Cells[0].Value = false; if (_MeterInfo.Mb_chrBcs == String.Empty || _MeterInfo.Mb_chrBdj == String.Empty) //如果不检,并且常数或者等级都为空,则将勾选单元格设置为只读 { _Row.Cells[0].ReadOnly = true; } for (int j = 2; j < _Row.Cells.Count; j++) { _Row.Cells[j].Value = string.Empty; } continue; } _Row.Cells[0].Value = true; _Row.Cells[2].Value = _Item.ToString(); if (!_MeterInfo.MeterResults.ContainsKey(strKey)) //检查是否存在外观检查试验 { CLDC_DataCore.Model.DnbModel.DnbInfo.MeterResult _TmpMeterResult = new CLDC_DataCore.Model.DnbModel.DnbInfo.MeterResult(); _TmpMeterResult.Mr_chrRstValue = CLDC_DataCore.Const.Variable.CTG_HeGe; _TmpMeterResult._intMyId = MeterGroup.MeterGroup[i]._intMyId; _TmpMeterResult.Mr_chrRstId = strKey; _TmpMeterResult.Mr_chrRstName = Cus_MeterResultPrjID.外观检查试验.ToString(); _MeterInfo.MeterResults.Add(strKey, _TmpMeterResult); } if (_MeterInfo.MeterResults.ContainsKey(strKey)) //如果数据中存在值那么久需要插入数据,这个地方插的值都是合格或者不合格,因为取的都是大编号,不是带具体值的小编号 { _Row.Cells[4].Value = _MeterInfo.MeterResults[strKey].Mr_chrRstValue; if ((MeterGroup.CheckState & CLDC_Comm.Enum.Cus_CheckStaute.检定) == CLDC_Comm.Enum.Cus_CheckStaute.检定 || (MeterGroup.CheckState & CLDC_Comm.Enum.Cus_CheckStaute.单步检定) == CLDC_Comm.Enum.Cus_CheckStaute.单步检定) { _Row.Cells[3].Value = ""; } } else { //_Row.DefaultCellStyle.ForeColor = Color.Black; _Row.Cells[4].Value = ""; } if (_MeterInfo.Mb_Result == CLDC_DataCore.Const.Variable.CTG_BuHeGe) { _Row.DefaultCellStyle.ForeColor = Color.Red; } else { _Row.DefaultCellStyle.ForeColor = Color.Black; } } CLDC_DataCore.Const.GlobalUnit.g_RealTimeDataControl.OutUpdateRealTimeData("100", CLDC_Comm.Enum.Cus_MeterDataType.检定结论); }
private void Data_WGJC_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { string strKey = ((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.外观检查试验).ToString(); if (e.ColumnIndex != 4 || e.RowIndex == -1) { if (e.RowIndex >= 0 && e.ColumnIndex >= 0) { try { this.GridSelectRowIndexChanged(e.RowIndex); } catch { } } return; //如果不是第一列,则退出 } CLDC_DataCore.Model.DnbModel.DnbInfo.MeterBasicInfo _MeterInfo = CLDC_DataCore.Const.GlobalUnit.g_CUS.DnbData.MeterGroup[e.RowIndex]; DataGridViewRow _Row = Data_WGJC.Rows[e.RowIndex]; //表位号 _Row.Cells[1].Value = _MeterInfo.ToString(); //插入表位号 if (!_MeterInfo.YaoJianYn) //如果不检 { return; } _Row.Cells[0].Value = true; if (!_MeterInfo.MeterResults.ContainsKey(((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.外观检查试验).ToString())) //检查是否存在外观检查试验 { CLDC_DataCore.Model.DnbModel.DnbInfo.MeterResult _TmpMeterResult = new CLDC_DataCore.Model.DnbModel.DnbInfo.MeterResult(); _TmpMeterResult.Mr_chrRstValue = CLDC_DataCore.Const.Variable.CTG_HeGe; _TmpMeterResult._intMyId = CLDC_DataCore.Const.GlobalUnit.g_CUS.DnbData.MeterGroup[e.RowIndex]._intMyId; _TmpMeterResult.Mr_chrRstId = ((int)Cus_MeterResultPrjID.外观检查试验).ToString(); _TmpMeterResult.Mr_chrRstName = Cus_MeterResultPrjID.外观检查试验.ToString(); _MeterInfo.MeterResults.Add(((int)Cus_MeterResultPrjID.外观检查试验).ToString(), _TmpMeterResult); } if (_MeterInfo.MeterResults.ContainsKey(strKey)) //如果数据中存在值那么久需要插入数据,这个地方插的值都是合格或者不合格,因为取的都是大编号,不是带具体值的小编号 { if (_MeterInfo.MeterResults[strKey].Mr_chrRstValue == Variable.CTG_HeGe) { _MeterInfo.MeterResults[strKey].Mr_chrRstValue = Variable.CTG_BuHeGe; } else { _MeterInfo.MeterResults[strKey].Mr_chrRstValue = Variable.CTG_HeGe; } _Row.Cells[4].Value = _MeterInfo.MeterResults[strKey].Mr_chrRstValue; CLDC_DataCore.Const.GlobalUnit.g_CUS.DnbData.MeterGroup[e.RowIndex].MeterResults[strKey].Mr_chrRstValue = _MeterInfo.MeterResults[strKey].Mr_chrRstValue; if (_MeterInfo.Mb_Result == Variable.CTG_BuHeGe) { _Row.DefaultCellStyle.ForeColor = Color.Red; } else { _Row.DefaultCellStyle.ForeColor = Color.Black; } this.GridSelectRowIndexChanged(e.RowIndex); this.BeginInvoke(new Action <string>(A => { RefreshRightGridView(CLDC_DataCore.Const.GlobalUnit.g_CUS.DnbData.ActiveItemID); }), ""); } }
private void LoadData() { int ColIndex = 0; //清除所有表格内容 Dgv_Result.Columns.Clear(); Dgv_Result.Rows.Clear(); if (MeterGroup.MeterGroup.Count == 0) { return; } int FirstYJMeter = Main.GetFirstYaoJianMeterIndex(MeterGroup); #region -----------------这个地方补充结论数据----------------- for (int i = 0; i < MeterGroup.MeterGroup.Count; i++) { CLDC_DataCore.Model.DnbModel.DnbInfo.MeterBasicInfo _MeterInfo = MeterGroup.MeterGroup[i]; if (!_MeterInfo.YaoJianYn) { continue; } #region -------------------增加结论项目---------------------- if (!_MeterInfo.MeterResults.ContainsKey(((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.通电检查).ToString())) //检查是否存在通电检查 { CLDC_DataCore.Model.DnbModel.DnbInfo.MeterResult _TmpMeterResult = new CLDC_DataCore.Model.DnbModel.DnbInfo.MeterResult(); _TmpMeterResult.Mr_chrRstValue = CLDC_DataCore.Const.Variable.CTG_HeGe; _TmpMeterResult._intMyId = MeterGroup.MeterGroup[i]._intMyId; _TmpMeterResult.Mr_chrRstId = ((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.通电检查).ToString(); _TmpMeterResult.Mr_chrRstName = CLDC_Comm.Enum.Cus_MeterResultPrjID.通电检查.ToString(); _MeterInfo.MeterResults.Add(((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.通电检查).ToString(), _TmpMeterResult); } if (!_MeterInfo.MeterResults.ContainsKey(((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.外观检查试验).ToString())) //检查是否存在外观检查试验 { CLDC_DataCore.Model.DnbModel.DnbInfo.MeterResult _TmpMeterResult = new CLDC_DataCore.Model.DnbModel.DnbInfo.MeterResult(); _TmpMeterResult.Mr_chrRstValue = CLDC_DataCore.Const.Variable.CTG_HeGe; _TmpMeterResult._intMyId = MeterGroup.MeterGroup[i]._intMyId; _TmpMeterResult.Mr_chrRstId = ((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.外观检查试验).ToString(); _TmpMeterResult.Mr_chrRstName = CLDC_Comm.Enum.Cus_MeterResultPrjID.外观检查试验.ToString(); _MeterInfo.MeterResults.Add(((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.外观检查试验).ToString(), _TmpMeterResult); } if (!_MeterInfo.MeterResults.ContainsKey(((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.工频耐压试验).ToString())) //检查是否存在工频耐压试验 { CLDC_DataCore.Model.DnbModel.DnbInfo.MeterResult _TmpMeterResult = new CLDC_DataCore.Model.DnbModel.DnbInfo.MeterResult(); _TmpMeterResult.Mr_chrRstValue = CLDC_DataCore.Const.Variable.CTG_HeGe; _TmpMeterResult._intMyId = MeterGroup.MeterGroup[i]._intMyId; _TmpMeterResult.Mr_chrRstId = ((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.工频耐压试验).ToString(); _TmpMeterResult.Mr_chrRstName = CLDC_Comm.Enum.Cus_MeterResultPrjID.工频耐压试验.ToString(); _MeterInfo.MeterResults.Add(((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.工频耐压试验).ToString(), _TmpMeterResult); } #endregion List <string> _CheckPrjYn = new List <string>(); string[] Arr_ID = new string[_MeterInfo.MeterResults.Keys.Count]; _MeterInfo.MeterResults.Keys.CopyTo(Arr_ID, 0); for (int j = 0; j < Arr_ID.Length; j++) { string _ID = Arr_ID[j]; if (_ID.Length == 3) //如果ID长度是3表示是大项目,则跳过 { continue; } #region -----------------------------在结论集合中加入起动试验总结论----------------------------------------- if (_ID.Substring(0, 3) == ((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.起动试验).ToString()) { if (_MeterInfo.MeterResults.ContainsKey(((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.起动试验).ToString())) //如果存在大ID,并默认合格 { if (!_CheckPrjYn.Contains(((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.起动试验).ToString())) //如果在验证列表里面没有起动试验这个ID才进行结论初始化,否则跳过 { _MeterInfo.MeterResults[((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.起动试验).ToString()].Mr_chrRstValue = CLDC_DataCore.Const.Variable.CTG_HeGe; _CheckPrjYn.Add(((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.起动试验).ToString()); //在验证列表中加入该ID } } else //如果不存在,则模拟一个大ID { CLDC_DataCore.Model.DnbModel.DnbInfo.MeterResult _TmpResult = new CLDC_DataCore.Model.DnbModel.DnbInfo.MeterResult(); _TmpResult._intMyId = _MeterInfo.MeterResults[_ID]._intMyId; _TmpResult.Mr_chrRstId = ((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.起动试验).ToString(); _TmpResult.Mr_chrRstName = CLDC_Comm.Enum.Cus_MeterResultPrjID.起动试验.ToString(); _TmpResult.Mr_chrRstValue = _MeterInfo.MeterResults[_ID].Mr_chrRstValue; _MeterInfo.MeterResults.Add(((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.起动试验).ToString(), _TmpResult); _CheckPrjYn.Add(((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.起动试验).ToString()); } if (_MeterInfo.MeterResults[_ID].Mr_chrRstValue == CLDC_DataCore.Const.Variable.CTG_BuHeGe) //如果不合格 { _MeterInfo.MeterResults[((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.起动试验).ToString()].Mr_chrRstValue = CLDC_DataCore.Const.Variable.CTG_BuHeGe; } } #endregion #region -----------------------------在结论集合中加入潜动总结论----------------------------------------- if (_ID.Substring(0, 3) == ((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.潜动试验).ToString()) { if (_MeterInfo.MeterResults.ContainsKey(((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.潜动试验).ToString())) { if (!_CheckPrjYn.Contains(((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.潜动试验).ToString())) //如果在验证列表里面没有起动试验这个ID才进行结论初始化,否则跳过 { _MeterInfo.MeterResults[((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.潜动试验).ToString()].Mr_chrRstValue = CLDC_DataCore.Const.Variable.CTG_HeGe; _CheckPrjYn.Add(((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.潜动试验).ToString()); //在验证列表中加入该ID } } else //如果不存在,则模拟一个大ID { CLDC_DataCore.Model.DnbModel.DnbInfo.MeterResult _TmpResult = new CLDC_DataCore.Model.DnbModel.DnbInfo.MeterResult(); _TmpResult._intMyId = _MeterInfo.MeterResults[_ID]._intMyId; _TmpResult.Mr_chrRstId = ((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.潜动试验).ToString(); _TmpResult.Mr_chrRstName = CLDC_Comm.Enum.Cus_MeterResultPrjID.潜动试验.ToString(); _TmpResult.Mr_chrRstValue = _MeterInfo.MeterResults[_ID].Mr_chrRstValue; _MeterInfo.MeterResults.Add(((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.潜动试验).ToString(), _TmpResult); _CheckPrjYn.Add(((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.潜动试验).ToString()); //在验证列表中加入该ID } if (_MeterInfo.MeterResults[_ID].Mr_chrRstValue == CLDC_DataCore.Const.Variable.CTG_BuHeGe) //如果不合格 { _MeterInfo.MeterResults[((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.潜动试验).ToString()].Mr_chrRstValue = CLDC_DataCore.Const.Variable.CTG_BuHeGe; } } #endregion #region -----------------------------在结论集合中加入基本误差总结论----------------------------------------- if (_ID.Substring(0, 3) == ((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.基本误差试验).ToString()) { if (_MeterInfo.MeterResults.ContainsKey(((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.基本误差试验).ToString())) { if (!_CheckPrjYn.Contains(((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.基本误差试验).ToString())) //如果在验证列表里面没有起动试验这个ID才进行结论初始化,否则跳过 { _MeterInfo.MeterResults[((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.基本误差试验).ToString()].Mr_chrRstValue = CLDC_DataCore.Const.Variable.CTG_HeGe; _CheckPrjYn.Add(((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.基本误差试验).ToString()); //在验证列表中加入该ID } } else //如果不存在,则模拟一个大ID { CLDC_DataCore.Model.DnbModel.DnbInfo.MeterResult _TmpResult = new CLDC_DataCore.Model.DnbModel.DnbInfo.MeterResult(); _TmpResult._intMyId = _MeterInfo.MeterResults[_ID]._intMyId; _TmpResult.Mr_chrRstId = ((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.基本误差试验).ToString(); _TmpResult.Mr_chrRstName = CLDC_Comm.Enum.Cus_MeterResultPrjID.基本误差试验.ToString(); _TmpResult.Mr_chrRstValue = _MeterInfo.MeterResults[_ID].Mr_chrRstValue; _MeterInfo.MeterResults.Add(((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.基本误差试验).ToString(), _TmpResult); _CheckPrjYn.Add(((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.基本误差试验).ToString()); //在验证列表中加入该ID } if (_MeterInfo.MeterResults[_ID].Mr_chrRstValue == CLDC_DataCore.Const.Variable.CTG_BuHeGe) //如果不合格 { _MeterInfo.MeterResults[((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.基本误差试验).ToString()].Mr_chrRstValue = CLDC_DataCore.Const.Variable.CTG_BuHeGe; } } #endregion #region -----------------------------在结论集合中加入标准偏差总结论----------------------------------------- if (_ID.Substring(0, 3) == ((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.标准偏差).ToString()) { if (_MeterInfo.MeterResults.ContainsKey(((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.标准偏差).ToString())) { if (!_CheckPrjYn.Contains(((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.标准偏差).ToString())) //如果在验证列表里面没有起动试验这个ID才进行结论初始化,否则跳过 { _MeterInfo.MeterResults[((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.标准偏差).ToString()].Mr_chrRstValue = CLDC_DataCore.Const.Variable.CTG_HeGe; _CheckPrjYn.Add(((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.标准偏差).ToString()); //在验证列表中加入该ID } } else //如果不存在,则模拟一个大ID { CLDC_DataCore.Model.DnbModel.DnbInfo.MeterResult _TmpResult = new CLDC_DataCore.Model.DnbModel.DnbInfo.MeterResult(); _TmpResult._intMyId = _MeterInfo.MeterResults[_ID]._intMyId; _TmpResult.Mr_chrRstId = ((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.标准偏差).ToString(); _TmpResult.Mr_chrRstName = CLDC_Comm.Enum.Cus_MeterResultPrjID.标准偏差.ToString(); _TmpResult.Mr_chrRstValue = _MeterInfo.MeterResults[_ID].Mr_chrRstValue; _MeterInfo.MeterResults.Add(((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.标准偏差).ToString(), _TmpResult); _CheckPrjYn.Add(((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.标准偏差).ToString()); //在验证列表中加入该ID } if (_MeterInfo.MeterResults[_ID].Mr_chrRstValue == CLDC_DataCore.Const.Variable.CTG_BuHeGe) //如果不合格 { _MeterInfo.MeterResults[((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.标准偏差).ToString()].Mr_chrRstValue = CLDC_DataCore.Const.Variable.CTG_BuHeGe; } } #endregion #region -----------------------------在结论集合中加入最大偏差值----------------------------------------- if (_ID.Substring(0, 3) == ((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.最大偏差).ToString()) { if (_MeterInfo.MeterResults.ContainsKey(((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.最大偏差).ToString())) { if (!_CheckPrjYn.Contains(((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.最大偏差).ToString())) //如果在验证列表里面没有起动试验这个ID才进行结论初始化,否则跳过 { _MeterInfo.MeterResults[((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.最大偏差).ToString()].Mr_chrRstValue = CLDC_DataCore.Const.Variable.CTG_HeGe; _CheckPrjYn.Add(((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.最大偏差).ToString()); //在验证列表中加入该ID } } else //如果不存在,则模拟一个大ID { CLDC_DataCore.Model.DnbModel.DnbInfo.MeterResult _TmpResult = new CLDC_DataCore.Model.DnbModel.DnbInfo.MeterResult(); _TmpResult._intMyId = _MeterInfo.MeterResults[_ID]._intMyId; _TmpResult.Mr_chrRstId = ((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.最大偏差).ToString(); _TmpResult.Mr_chrRstName = CLDC_Comm.Enum.Cus_MeterResultPrjID.最大偏差.ToString(); _TmpResult.Mr_chrRstValue = _MeterInfo.MeterResults[_ID].Mr_chrRstValue; _MeterInfo.MeterResults.Add(((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.最大偏差).ToString(), _TmpResult); _CheckPrjYn.Add(((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.最大偏差).ToString()); //在验证列表中加入该ID } if (_MeterInfo.MeterResults[_ID].Mr_chrRstValue == CLDC_DataCore.Const.Variable.CTG_BuHeGe) //如果不合格 { _MeterInfo.MeterResults[((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.最大偏差).ToString()].Mr_chrRstValue = CLDC_DataCore.Const.Variable.CTG_BuHeGe; } } #endregion #region -----------------------------在结论集合中加入走字试验总结论----------------------------------------- if (_ID.Substring(0, 3) == ((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.走字试验).ToString()) { if (_MeterInfo.MeterResults.ContainsKey(((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.走字试验).ToString())) { if (!_CheckPrjYn.Contains(((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.走字试验).ToString())) //如果在验证列表里面没有起动试验这个ID才进行结论初始化,否则跳过 { _MeterInfo.MeterResults[((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.走字试验).ToString()].Mr_chrRstValue = CLDC_DataCore.Const.Variable.CTG_HeGe; _CheckPrjYn.Add(((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.走字试验).ToString()); //在验证列表中加入该ID } } else //如果不存在,则模拟一个大ID { CLDC_DataCore.Model.DnbModel.DnbInfo.MeterResult _TmpResult = new CLDC_DataCore.Model.DnbModel.DnbInfo.MeterResult(); _TmpResult._intMyId = _MeterInfo.MeterResults[_ID]._intMyId; _TmpResult.Mr_chrRstId = ((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.走字试验).ToString(); _TmpResult.Mr_chrRstName = CLDC_Comm.Enum.Cus_MeterResultPrjID.走字试验.ToString(); _TmpResult.Mr_chrRstValue = _MeterInfo.MeterResults[_ID].Mr_chrRstValue; _MeterInfo.MeterResults.Add(((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.走字试验).ToString(), _TmpResult); _CheckPrjYn.Add(((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.走字试验).ToString()); //在验证列表中加入该ID } if (_MeterInfo.MeterResults[_ID].Mr_chrRstValue == CLDC_DataCore.Const.Variable.CTG_BuHeGe) //如果不合格 { _MeterInfo.MeterResults[((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.走字试验).ToString()].Mr_chrRstValue = CLDC_DataCore.Const.Variable.CTG_BuHeGe; } } #endregion #region -----------------------------在结论集合中加入走字组合误差总结论----------------------------------------- if (_ID.Substring(0, 3) == ((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.走字组合误差试验).ToString()) { if (_MeterInfo.MeterResults.ContainsKey(((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.走字组合误差试验).ToString())) { if (!_CheckPrjYn.Contains(((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.走字组合误差试验).ToString())) //如果在验证列表里没有组合误差这个ID菜进行结论初始化,否则跳过 { _MeterInfo.MeterResults[((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.走字组合误差试验).ToString()].Mr_chrRstValue = CLDC_DataCore.Const.Variable.CTG_HeGe; _CheckPrjYn.Add(((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.走字组合误差试验).ToString()); //在验证列表中加入该ID } } else { CLDC_DataCore.Model.DnbModel.DnbInfo.MeterResult _TmpResult = new CLDC_DataCore.Model.DnbModel.DnbInfo.MeterResult(); _TmpResult._intMyId = _MeterInfo.MeterResults[_ID]._intMyId; _TmpResult.Mr_chrRstId = ((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.走字组合误差试验).ToString(); _TmpResult.Mr_chrRstName = CLDC_Comm.Enum.Cus_MeterResultPrjID.走字组合误差试验.ToString(); _TmpResult.Mr_chrRstValue = _MeterInfo.MeterResults[_ID].Mr_chrRstValue; _MeterInfo.MeterResults.Add(((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.走字组合误差试验).ToString(), _TmpResult); } if (_MeterInfo.MeterResults[_ID].Mr_chrRstValue == CLDC_DataCore.Const.Variable.CTG_BuHeGe) //如果不合格,则改写总结论 { _MeterInfo.MeterResults[((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.走字组合误差试验).ToString()].Mr_chrRstValue = CLDC_DataCore.Const.Variable.CTG_BuHeGe; } } #endregion #region -----------------------------在结论集合中加入走字组合误差总误差值(最大误差值)----------------------------------------- if (_ID.Substring(0, 3) == ((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.走字组合误差值).ToString()) { if (_MeterInfo.MeterResults.ContainsKey(((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.走字组合误差值).ToString())) { if (!_CheckPrjYn.Contains(((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.走字组合误差值).ToString())) //如果在验证列表里没有组合误差这个ID菜进行结论初始化,否则跳过 { _MeterInfo.MeterResults[((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.走字组合误差值).ToString()].Mr_chrRstValue = CLDC_DataCore.Const.Variable.CTG_HeGe; _CheckPrjYn.Add(((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.走字组合误差值).ToString()); //在验证列表中加入该ID } } else { CLDC_DataCore.Model.DnbModel.DnbInfo.MeterResult _TmpResult = new CLDC_DataCore.Model.DnbModel.DnbInfo.MeterResult(); _TmpResult._intMyId = _MeterInfo.MeterResults[_ID]._intMyId; _TmpResult.Mr_chrRstId = ((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.走字组合误差值).ToString(); _TmpResult.Mr_chrRstName = CLDC_Comm.Enum.Cus_MeterResultPrjID.走字组合误差值.ToString(); _TmpResult.Mr_chrRstValue = _MeterInfo.MeterResults[_ID].Mr_chrRstValue; _MeterInfo.MeterResults.Add(((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.走字组合误差值).ToString(), _TmpResult); } if (_MeterInfo.MeterResults[_ID].Mr_chrRstValue == CLDC_DataCore.Const.Variable.CTG_BuHeGe) //如果不合格,则改写总结论 { _MeterInfo.MeterResults[((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.走字组合误差值).ToString()].Mr_chrRstValue = CLDC_DataCore.Const.Variable.CTG_BuHeGe; } } #endregion } #region ---------------------挂多功能总结论------------------- string strDgnKey = ((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.多功能试验).ToString("000"); if (_MeterInfo.MeterDgns.Count == 0) { if (_MeterInfo.MeterResults.ContainsKey(strDgnKey)) { _MeterInfo.MeterResults.Remove(strDgnKey); } } else { //查看所有多功能项目 bool Result = true; foreach (string strKey in _MeterInfo.MeterDgns.Keys) { if (_MeterInfo.MeterDgns[strKey].Md_chrValue == CLDC_DataCore.Const.Variable.CTG_BuHeGe) { Result = false; break; } } //增加总结论 CLDC_DataCore.Model.DnbModel.DnbInfo.MeterResult dgnResult = null; if (_MeterInfo.MeterResults.ContainsKey(strDgnKey)) { dgnResult = _MeterInfo.MeterResults[strDgnKey]; } else { dgnResult = new CLDC_DataCore.Model.DnbModel.DnbInfo.MeterResult(); _MeterInfo.MeterResults.Add(strDgnKey, dgnResult); dgnResult.Mr_chrRstId = strDgnKey; dgnResult.Mr_chrRstName = "多功能试验"; } dgnResult.Mr_chrRstValue = CLDC_DataCore.Function.Common.ConverResult(Result); } #endregion _CheckPrjYn = null; } #endregion bool _ChangeData = (CLDC_DataCore.Const.GlobalUnit.g_SystemConfig.SystemMode.getItem(CLDC_DataCore.Const.Variable.CTC_CHANGEDATA).Value == "是" ? false : true); //是否允许修改检定数据 foreach (string _ResultID in MeterGroup.MeterGroup[FirstYJMeter].MeterResults.Keys) //遍历结论ID { if (_ResultID.Length == 3) //如果ID长度=3则表示是需要显示的大项目结论 { ColIndex = Dgv_Result.Columns.Add("Key_" + _ResultID, ((CLDC_Comm.Enum.Cus_MeterResultPrjID) int.Parse(_ResultID)).ToString()); Dgv_Result.Columns[ColIndex].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; Dgv_Result.Columns[ColIndex].SortMode = DataGridViewColumnSortMode.NotSortable; Dgv_Result.Columns[ColIndex].ReadOnly = _ChangeData; Dgv_Result.Columns[ColIndex].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; Dgv_Result.Columns[ColIndex].Tag = _ResultID; //将检定ID保存到TAG中 } } //total rst ColIndex = Dgv_Result.Columns.Add("Key_total", "总结论"); Dgv_Result.Columns[ColIndex].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; Dgv_Result.Columns[ColIndex].SortMode = DataGridViewColumnSortMode.NotSortable; Dgv_Result.Columns[ColIndex].ReadOnly = _ChangeData; Dgv_Result.Columns[ColIndex].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; Dgv_Result.Columns[ColIndex].Tag = "Key_total"; if (Dgv_Result.Columns.Count == 0) { return; } for (int i = 0; i < MeterGroup.MeterGroup.Count; i++) { if (!MeterGroup.MeterGroup[i].YaoJianYn) { continue; } int RowIndex = Dgv_Result.Rows.Add(); Dgv_Result.Rows[RowIndex].Tag = i; //保存表位号 if ((RowIndex + 1) % 2 == 0) { Dgv_Result.Rows[RowIndex].DefaultCellStyle.BackColor = CLDC_DataCore.Const.Variable.Color_Grid_Alter; } else { Dgv_Result.Rows[RowIndex].DefaultCellStyle.BackColor = CLDC_DataCore.Const.Variable.Color_Grid_Normal; } Dgv_Result.Rows[RowIndex].HeaderCell.Value = MeterGroup.MeterGroup[i].ToString(); //表位号 for (int j = 0; j < Dgv_Result.Columns.Count; j++) { string Key = Dgv_Result.Columns[j].Tag.ToString(); //取出检定ID if (MeterGroup.MeterGroup[i].MeterResults.ContainsKey(Key)) { Dgv_Result.Rows[RowIndex].Cells[j].Value = MeterGroup.MeterGroup[i].MeterResults[Key].Mr_chrRstValue; //如果存在则填写结论 if (MeterGroup.MeterGroup[i].MeterResults[Key].Mr_chrRstValue == CLDC_DataCore.Const.Variable.CTG_BuHeGe) { Dgv_Result.Rows[RowIndex].Cells[j].Style.ForeColor = CLDC_DataCore.Const.Variable.Color_Grid_BuHeGe; } else { Dgv_Result.Rows[RowIndex].Cells[j].Style.ForeColor = Color.Black; } } } Dgv_Result.Rows[RowIndex].Cells[Dgv_Result.Columns.Count - 1].Value = MeterGroup.MeterGroup[i].Mb_chrResult; if (MeterGroup.MeterGroup[i].Mb_chrResult == CLDC_DataCore.Const.Variable.CTG_BuHeGe) { Dgv_Result.Rows[RowIndex].Cells[Dgv_Result.Columns.Count - 1].Style.ForeColor = CLDC_DataCore.Const.Variable.Color_Grid_BuHeGe; } else { Dgv_Result.Rows[RowIndex].Cells[Dgv_Result.Columns.Count - 1].Style.ForeColor = Color.Black; } } this.InvokeRefreshTab(); }