Пример #1
0
        /// <summary>
        /// 刷新单个电能表信息
        /// </summary>
        /// <param name="MeterInfo">电能表信息</param>
        /// <param name="allowedit"></param>
        public void SetData(CLDC_DataCore.Model.DnbModel.DnbInfo.MeterBasicInfo MeterInfo, bool allowedit)
        {
            Data_View.Rows.Clear();
            if (MeterInfo == null)
            {
                return;
            }
            if (MeterInfo.MeterFreezes.Count > 0)
            {
                int RowIndex = Data_View.Rows.Add();
                Data_View.Rows[RowIndex].Cells[0].Value             = string.Format("{0}表位", MeterInfo._intBno + 1);
                Data_View.Rows[RowIndex].DefaultCellStyle.BackColor = CLDC_DataCore.Const.Variable.Color_Grid_Normal;

                if ((MeterInfo.MeterFreezes.ContainsKey(Key) && !string.IsNullOrEmpty(MeterInfo.MeterFreezes[Key].Md_chrValue)))
                {
                    string[] _Values = MeterInfo.MeterFreezes[Key].Md_chrValue.Split('|');
                    if (_Values.Length != 3)
                    {
                        return;                                //如果数据长度不等于3,则表示数据有问题,跳过不处理
                    }
                    for (int j = 0; j < _Values.Length; j++)
                    {
                        Data_View.Rows[RowIndex].Cells[j + 1].Value = _Values[j];
                    }
                }
            }
        }
Пример #2
0
        private void CreateFaInfo()
        {
            int _FirstYaoJian = CLDC_MeterUI.UI_Detection_New.Main.GetFirstYaoJianMeterIndex(_DnbGroup);

            CLDC_DataCore.Model.DnbModel.DnbInfo.MeterBasicInfo _DnbInfo = _DnbGroup.MeterGroup[_FirstYaoJian];

            _Ub = float.Parse(_DnbInfo.Mb_chrUb);                 //电压

            _Ib = _DnbInfo.Mb_chrIb;                              //电流字符串

            _Dj = _DnbInfo.Mb_chrBdj;                             //等级 有功(无功)

            _GuiCheng = _DnbInfo.GuiChengName;                    //使用的规程名称

            _Const = _DnbInfo.Mb_chrBcs;                          //常数

            _Znq = _DnbInfo.Mb_BlnZnq;                            //止逆器

            _Hgq = _DnbInfo.Mb_BlnHgq;                            //互感器

            _Clfs = (CLDC_Comm.Enum.Cus_Clfs)_DnbInfo.Mb_intClfs; //测量方式

            for (int i = 0; i < _DnbGroup.CheckPlan.Count; i++)
            {
                if (!(_DnbGroup.CheckPlan[i] is StPlan_QianDong))
                {
                    continue;
                }

                StPlan_QianDong _Item = (StPlan_QianDong)_DnbGroup.CheckPlan[i];

                int _RowIndex = Dgv_QianDong.Rows.Add();

                Dgv_QianDong.Rows[_RowIndex].HeaderCell.Value = _Item.ToString();

                Dgv_QianDong.Rows[_RowIndex].Tag = i;

                Dgv_QianDong.Rows[_RowIndex].Cells[0].Value = _Item.PowerFangXiang.ToString();

                Dgv_QianDong.Rows[_RowIndex].Cells[1].Value = _Item.FloatxU * 100F;                      //电压倍数

                Dgv_QianDong.Rows[_RowIndex].Cells[1].Tag = Dgv_QianDong.Rows[_RowIndex].Cells[1].Value; //电压倍数副本

                Dgv_QianDong.Rows[_RowIndex].Cells[2].Value = _Item.FloatxIb;                            //潜动电流+多少倍起动电流

                Dgv_QianDong.Rows[_RowIndex].Cells[2].Tag = Dgv_QianDong.Rows[_RowIndex].Cells[2].Value;

                _Item.CheckTimeAndIb(_GuiCheng, _Clfs, _Ub, _Ib, _Dj, _Const, _Znq, _Hgq);               //计算潜动电流和潜动时间

                Dgv_QianDong.Rows[_RowIndex].Cells[3].Value = _Item.FloatIb;                             //潜动电流

                Dgv_QianDong.Rows[_RowIndex].Cells[4].Value = Math.Round(_Item.CheckTime, 1);            //潜动时间

                Dgv_QianDong.Rows[_RowIndex].Cells[4].Tag = Dgv_QianDong.Rows[_RowIndex].Cells[4].Value; //潜动时间副本

                Dgv_QianDong.Rows[_RowIndex].Cells[5].Value = _Item.DefaultValue == 1 ? true : false;    //是否默认合格

                Dgv_QianDong.Rows[_RowIndex].Cells[5].Tag = Dgv_QianDong.Rows[_RowIndex].Cells[5].Value; //是否默认合格副本
            }
        }
Пример #3
0
        public override void SetData(CLDC_DataCore.Model.DnbModel.DnbInfo.MeterBasicInfo MeterInfo, bool allowedit)
        {
            if (MeterInfo.MeterDgns.Count == 0)
            {
                return;
            }
            Dgw_Data.Rows.Clear();

            foreach (string _Key in MeterInfo.MeterDgns.Keys)
            {
                CLDC_DataCore.Model.DnbModel.DnbInfo.MeterDgn _Dgn = MeterInfo.MeterDgns[_Key];
                if (_Dgn.Md_PrjID.Trim().Length == 3)         //大ID
                {
                    int rowIndex = Dgw_Data.Rows.Add();
                    Dgw_Data["表位", rowIndex].Value = MeterInfo.ToString();
                    if (_Dgn.Md_PrjName.Length == 0)
                    {
                        Dgw_Data["项目名称", rowIndex].Value = (CLDC_Comm.Enum.Cus_DgnItem) int.Parse(_Dgn.Md_PrjID);
                    }
                    else
                    {
                        Dgw_Data["项目名称", rowIndex].Value = _Dgn.Md_PrjName;
                    }
                    Dgw_Data["项目结论", rowIndex].Value = "    " + _Dgn.Md_chrValue;
                }
            }

            base.SetData(MeterInfo, allowedit);
        }
Пример #4
0
        /// <summary>
        /// 刷新单个电能表信息
        /// </summary>
        /// <param name="MeterInfo">电能表信息</param>
        /// <param name="allowedit"></param>
        public void SetData(CLDC_DataCore.Model.DnbModel.DnbInfo.MeterBasicInfo MeterInfo, bool allowedit)
        {
            if (MeterInfo.MeterShows.Count == 0)
            {
                return;
            }
            Data_View.Rows.Clear();

            int RowIndex = Data_View.Rows.Add();

            if ((RowIndex + 1) % 2 == 0)
            {
                Data_View.Rows[RowIndex].DefaultCellStyle.BackColor = CLDC_DataCore.Const.Variable.Color_Grid_Alter;
            }
            else
            {
                Data_View.Rows[RowIndex].DefaultCellStyle.BackColor = CLDC_DataCore.Const.Variable.Color_Grid_Normal;
            }
            Data_View.Rows[RowIndex].Cells[0].Value = MeterInfo.ToString();
            string _Key = Key + "01";

            if (!MeterInfo.MeterShows.ContainsKey(_Key))
            {
                Data_View.Rows[RowIndex].Cells[0].Value = "";
                return;
            }
            if (MeterInfo.MeterShows[_Key].Msh_chrData == null || MeterInfo.MeterShows[_Key].Msh_chrData == string.Empty)
            {
                return;
            }

            Data_View.Rows[RowIndex].Cells[0].Value = MeterInfo.MeterShows[_Key].Msh_chrData;
        }
        /// <summary>
        /// 刷新表格数据
        /// </summary>
        public void Refresh(CLDC_DataCore.Model.DnbModel.DnbInfo.MeterBasicInfo MeterInfo)
        {
            if (MeterInfo == null)
            {
                return;
            }
            Dgv_PrjData.Rows.Clear();

            Dictionary <string, CLDC_DataCore.Model.DnbModel.DnbInfo.MeterQdQid> _QdQids = MeterInfo.MeterQdQids;

            foreach (string _Key in _QdQids.Keys)
            {
                if (_Key.Length > 3 && (_Key.Substring(0, 3) == ((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.起动试验).ToString()
                                        ||
                                        _Key.Substring(0, 3) == ((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.潜动试验).ToString()))        //只有大于3才可能是小项目,并且当中要包含启动ID和潜动ID
                {
                    int RowIndex = Dgv_PrjData.Rows.Add();
                    Dgv_PrjData.Rows[RowIndex].HeaderCell.Value = _QdQids[_Key].Mqd_chrProjectName; //项目名称
                    Dgv_PrjData.Rows[RowIndex].Tag            = _Key;                               //将ID保存到Tag
                    Dgv_PrjData.Rows[RowIndex].Cells[0].Value = MeterInfo.ToString();
                    Dgv_PrjData.Rows[RowIndex].Cells[1].Value = _QdQids[_Key].Mqd_chrDL;            //电流
                    Dgv_PrjData.Rows[RowIndex].Cells[2].Value = _QdQids[_Key].AVR_STANDARD_TIME;    //试验时间
                    Dgv_PrjData.Rows[RowIndex].Cells[3].Value = _QdQids[_Key].Mqd_chrTime;
                    Dgv_PrjData.Rows[RowIndex].Cells[4].Value = _QdQids[_Key].Mqd_chrJL;            //结论
                }
            }
        }
Пример #6
0
        public override void SetData(CLDC_DataCore.Model.DnbModel.DnbInfo.MeterBasicInfo MeterInfo, bool allowedit)
        {
            if (MeterInfo.MeterSpecialErrs.Count == 0)
            {
                return;
            }
            Dgw_Data.Rows.Clear();
            foreach (string _Key in MeterInfo.MeterSpecialErrs.Keys)
            {
                int rowIndex = Dgw_Data.Rows.Add();
                Dgw_Data["表位", rowIndex].Value   = MeterInfo.ToString();
                Dgw_Data["项目名称", rowIndex].Value = MeterInfo.MeterSpecialErrs[_Key].Mse_PrjName;
                Dgw_Data["项目结论", rowIndex].Value = "    " + MeterInfo.MeterSpecialErrs[_Key].Mse_Result;
                string[] Arr_Err = MeterInfo.MeterSpecialErrs[_Key].Mse_Wc.Split('|');
                if (Arr_Err.Length != 4)
                {
                    continue;
                }
                Dgw_Data[3, rowIndex].Value = Arr_Err[0];
                Dgw_Data[4, rowIndex].Value = Arr_Err[1];
                Dgw_Data[5, rowIndex].Value = Arr_Err[2];
                Dgw_Data[6, rowIndex].Value = Arr_Err[3];
            }

            base.SetData(MeterInfo, allowedit);
        }
Пример #7
0
        private List <object> CheckPlan = new List <object>();        //方案列表

        /// <summary>
        /// 显示方案信息
        /// </summary>
        private void showSchemeInfo()
        {
            int FirstYJIndex = CLDC_DataCore.Const.GlobalUnit.FirstYaoJianMeter;

            if (FirstYJIndex == -1)
            {
                ShowRunMessage(labAction, "没有要检定的电能表");
                FirstYJIndex = 0;
            }

            CLDC_DataCore.Model.DnbModel.DnbInfo.MeterBasicInfo
                firstMeter = CLDC_DataCore.Const.GlobalUnit.Meter(FirstYJIndex);

            string strFAName = string.Empty;                    //方案名称

            strFAName = CLDC_DataCore.Const.GlobalUnit.g_CUS.DnbData.FaName;
            CheckPlan = CLDC_DataCore.Const.GlobalUnit.g_CUS.DnbData.CheckPlan;

            if (firstMeter != null)
            {
                //显示方案名称
                ShowRunMessage(labSchemeName, strFAName);
                //显示检定项目名称
                if (CLDC_DataCore.Const.GlobalUnit.g_CUS.DnbData.ActiveItemID >= 0 &&
                    CLDC_DataCore.Const.GlobalUnit.g_CUS.DnbData.ActiveItemID < CheckPlan.Count)
                {
                    ShowRunMessage(labItem, CheckPlan[CLDC_DataCore.Const.GlobalUnit.g_CUS.DnbData.ActiveItemID].ToString());
                }
            }
        }
        /// <summary>
        /// 获取多功能数据字典
        /// </summary>
        /// <param name="Item"></param>
        /// <returns></returns>
        private Dictionary <string, string> DicDgnInfo(CLDC_DataCore.Model.DnbModel.DnbInfo.MeterBasicInfo Item)
        {
            Dictionary <string, string> DgnDic = new Dictionary <string, string>();

            foreach (string Key in Item.MeterDgns.Keys)
            {
                string sTrKey = clsMain.getIniString("V90Dgn", "D_" + Key, "", clsMain.getFilePath("ReportConfig.ini"));
                if (sTrKey == string.Empty)
                {
                    continue;
                }
                string[] Arr_Tmp   = sTrKey.Split(',');
                string[] Arr_Value = Item.MeterDgns[Key].Md_chrValue.Split('|');
                for (int i = 0; i < Arr_Tmp.Length; i++)
                {
                    try
                    {
                        DgnDic.Add(Arr_Tmp[i].ToLower(), Arr_Value[i]);
                    }
                    catch
                    { }
                }
            }
            return(DgnDic);
        }
Пример #9
0
 /// <summary>
 /// 刷新表单数据
 /// </summary>
 /// <param name="MeterGroup"></param>
 public void SetData(List <CLDC_DataCore.Model.DnbModel.DnbInfo.MeterBasicInfo> MeterGroup)
 {
     for (int i = 0; i < MeterGroup.Count; i++)
     {
         CLDC_DataCore.Model.DnbModel.DnbInfo.MeterBasicInfo meterTemp = MeterGroup[i];
         if (meterTemp.YaoJianYn)
         {
             if (meterTemp.MeterCostControls.ContainsKey(Key))
             {
                 CLDC_DataCore.Model.DnbModel.DnbInfo.MeterFK meterFk = meterTemp.MeterCostControls[Key];
                 string[] arrayResult = meterFk.Mfk_chrData.Split('|');
                 if (arrayResult.Length == 6)
                 {
                     //当前电价|开始剩余金额|开始总电量|结束剩余金额|结束总电量|误差
                     Data_View.Rows[i].Cells["当前电价"].Value   = arrayResult[0];
                     Data_View.Rows[i].Cells["开始剩余金额"].Value = arrayResult[1];
                     Data_View.Rows[i].Cells["开始总电量"].Value  = arrayResult[2];
                     Data_View.Rows[i].Cells["结束剩余金额"].Value = arrayResult[3];
                     Data_View.Rows[i].Cells["结束总电量"].Value  = arrayResult[4];
                     Data_View.Rows[i].Cells["误差"].Value     = arrayResult[5];
                 }
                 Data_View.Rows[i].Cells["结论"].Value    = meterFk.Mfk_chrJL;
                 Data_View.Rows[i].Cells["不合格原因"].Value = meterFk.AVR_DIS_REASON;
             }
         }
     }
 }
Пример #10
0
        /// <summary>
        /// 获取模板数组
        /// </summary>
        /// <param name="DxYn">是否是单相表</param>
        /// <param name="MeterInfo">表信息</param>
        /// <param name="ReportTao">模板套型</param>
        /// <param name="ReportType">模板类型(证书。原始记录。。。。)</param>
        /// <returns></returns>
        private string getReportTemplet(bool DxYn, CLDC_DataCore.Model.DnbModel.DnbInfo.MeterBasicInfo MeterInfo, int ReportTao, int ReportType)
        {
            int[] intType = new int[3];

            intType[2] = ReportType;

            bool blnPz = MeterInfo.MeterResults.ContainsKey(((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.基本误差试验).ToString() + ((int)CLDC_Comm.Enum.Cus_PowerFangXiang.正向有功).ToString());

            bool blnPf = MeterInfo.MeterResults.ContainsKey(((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.基本误差试验).ToString() + ((int)CLDC_Comm.Enum.Cus_PowerFangXiang.反向有功).ToString());

            bool blnQz = MeterInfo.MeterResults.ContainsKey(((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.基本误差试验).ToString() + ((int)CLDC_Comm.Enum.Cus_PowerFangXiang.正向无功).ToString());

            bool blnQf = MeterInfo.MeterResults.ContainsKey(((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.基本误差试验).ToString() + ((int)CLDC_Comm.Enum.Cus_PowerFangXiang.反向无功).ToString());


            if (DxYn)
            {
                intType[1] = 6;
            }
            else if ((blnPz && blnPf && blnQz && blnQf) || MeterInfo.Mb_chrBlx.IndexOf("多功能") >= 0)   //多功能
            {
                intType[1] = 5;
            }
            else if (blnPz && blnQz)        //二合一
            {
                intType[1] = 4;
            }
            else if (blnQz && blnQf)        //双向无功
            {
                intType[1] = 3;
            }
            else if (blnPz && blnPf)        //双向有功
            {
                intType[1] = 2;
            }
            else if (blnQz)         //普通有,无功
            {
                intType[1] = 1;     //无功
            }
            else
            {
                intType[1] = 0;     //有功
            }

            if (MeterInfo.Mb_chrBlx.IndexOf("机械") >= 0 || MeterInfo.Mb_chrBlx.IndexOf("机电") >= 0 || MeterInfo.Mb_chrBlx.IndexOf("感应") >= 0)
            {
                intType[0] = 1;
            }
            else
            {
                intType[0] = 0;
            }

            string sTrTemplet = clsMain.getIniString("PrintType_" + ReportTao.ToString(),
                                                     string.Format("{0}_{1}_{2}", intType[0], intType[1], intType[2]),
                                                     "",
                                                     iniPath);

            return(sTrTemplet);
        }
Пример #11
0
        public override void SetData(CLDC_DataCore.Model.DnbModel.DnbInfo.MeterBasicInfo MeterInfo, bool allowedit)
        {
            if (MeterInfo.MeterDgns.Count == 0)
            {
                return;
            }
            Dgw_Data.Rows.Clear();

            foreach (string _Key in MeterInfo.MeterCostControls.Keys)
            {
                CLDC_DataCore.Model.DnbModel.DnbInfo.MeterFK _Cost = MeterInfo.MeterCostControls[_Key];
                if (_Cost.Mcc_PrjName == null)
                {
                    continue;
                }
                if (_Cost.Mfk_chrItemType.Length == 3)         //大ID
                {
                    int rowIndex = Dgw_Data.Rows.Add();
                    Dgw_Data["表位", rowIndex].Value   = MeterInfo.ToString();
                    Dgw_Data["项目名称", rowIndex].Value = _Cost.Mcc_PrjName;
                    Dgw_Data["项目结论", rowIndex].Value = "    " + _Cost.Mfk_chrJL;
                }
            }

            base.SetData(MeterInfo, allowedit);
        }
        public override void SetData(CLDC_DataCore.Model.DnbModel.DnbInfo.MeterBasicInfo meterInfo, bool allowedit)
        {
            if (meterInfo.MeterCarrierDatas.Count == 0)
            {
                return;
            }

            foreach (string _Key in meterInfo.MeterInsulations.Keys)
            {
                CLDC_DataCore.Model.DnbModel.DnbInfo.MeterInsulation insulation = meterInfo.MeterInsulations[_Key];

                string checkName = string.Empty;

                if (insulation.InsulationType == ((int)CLDC_DataCore.Struct.StInsulationParam.EnumInsulationType.DigitalEarth).ToString())
                {
                    checkName = "辅助端子对外壳耐压";
                }
                else if (insulation.InsulationType == ((int)CLDC_DataCore.Struct.StInsulationParam.EnumInsulationType.AnalogEarth).ToString())
                {
                    checkName = "模拟量端子对外壳耐压";
                }
                else
                {
                    checkName = "端子间耐压";
                }

                Dgw_Data.Rows.Add(checkName, insulation.stringCurrent, insulation.Result);
            }

            base.SetData(meterInfo, allowedit);
        }
Пример #13
0
 /// <summary>
 /// 加载接口对象进行数据上传
 /// </summary>
 /// <param name="MeterInfo"></param>
 public static bool LoadMisScript(CLDC_DataCore.Model.DnbModel.DnbInfo.MeterBasicInfo MeterInfo, string FileName)
 {
     if (dataToMis == null)
     {
         return(false);
     }
     return(dataToMis.UpdateData(MeterInfo, FileName));
 }
Пример #14
0
        /// <summary>
        /// 刷新表单数据
        /// </summary>
        /// <param name="MeterGroup"></param>
        public override void SetData(CLDC_DataCore.Model.DnbModel.DnbInfo.MeterBasicInfo MeterInfo, bool allowedit)
        {
            Data_View.Rows.Clear();
            Data_View.Columns.Clear();
            if (MeterInfo.MeterDgns.Count == 0)
            {
                return;
            }

            string strShowValue = "运行时区|第一套时区表数据|第二套时区表数据|第一套第1日时段表数据|第二套第1日时段表数据|标准时段表数据";

            string[] _ShowValues = strShowValue.Split('|');


            for (int i = 0; i < _ShowValues.Length; i++)            //动态创建数据表单样式
            {
                int ColIndex = Data_View.Columns.Add("Data_" + i, _ShowValues[i]);
                Data_View.Columns[ColIndex].AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells;
                Data_View.Columns[ColIndex].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
                Data_View.Columns[ColIndex].SortMode = DataGridViewColumnSortMode.NotSortable;

                if (i == _ShowValues.Length - 1)
                {
                    Data_View.Columns[ColIndex].DefaultCellStyle.Font = new Font("Arial Black", 10);
                }
            }

            int RowIndex = Data_View.Rows.Add();

            if ((RowIndex + 1) % 4 == 0)
            {
                Data_View.Rows[RowIndex].DefaultCellStyle.BackColor = CLDC_DataCore.Const.Variable.Color_Grid_Alter;
            }
            else
            {
                Data_View.Rows[RowIndex].DefaultCellStyle.BackColor = CLDC_DataCore.Const.Variable.Color_Grid_Normal;
            }
            Data_View.Rows[RowIndex].HeaderCell.Value = MeterInfo.ToString();

            Data_View.Refresh();

            for (int j = 1; j <= 6; j++)
            {
                string _Key      = Key + j.ToString("D2");
                int    _ColIndex = (int)(_FirstColIndex + j - 1);
                if (!MeterInfo.MeterDgns.ContainsKey(_Key))
                {
                    Data_View.Rows[0].Cells[_ColIndex].Value = "";
                    continue;
                }
                if (MeterInfo.MeterDgns[_Key].Md_chrValue == null || MeterInfo.MeterDgns[_Key].Md_chrValue == string.Empty)
                {
                    continue;
                }

                Data_View.Rows[0].Cells[_ColIndex].Value = MeterInfo.MeterDgns[_Key].Md_chrValue;
            }
        }
 public override void SetData(CLDC_DataCore.Model.DnbModel.DnbInfo.MeterBasicInfo MeterInfo, bool allowedit)
 {
     base.SetData(MeterInfo, allowedit);
     if (allowedit)          //是否启用编辑
     {
         Dgv_PrjData.ReadOnly = false;
     }
     this.Refresh(MeterInfo);
 }
Пример #16
0
        /// <summary>
        /// 线程处理一个线程最多处理10行数据
        /// </summary>
        /// <param name="obj"></param>
        private void InsertGridRow(object obj)
        {
            int _firstRowIndex = (int)obj;

            for (int Index = _firstRowIndex; Index < _firstRowIndex + 10; Index++)
            {
                lock (Locked)
                {
                    if (Index >= Dgv_Data.Rows.Count)
                    {
                        AsyncOpDone.Set();
                        return;
                    }

                    CLDC_DataCore.Model.DnbModel.DnbInfo.MeterBasicInfo MeterInfo = _DnbInfo.MeterGroup[Index];

                    Dgv_Data.Rows[Index].Cells[0].Value = MeterInfo.ToString();

                    Dgv_Data.Rows[Index].Cells[4] = (DataGridViewComboBoxCell)_ProtocolNameCol.Clone();

                    if (MeterInfo.YaoJianYn)
                    {
                        Dgv_Data.Rows[Index].Cells[1].Value = MeterInfo.Mb_ChrTxm;
                        Dgv_Data.Rows[Index].Cells[2].Value = MeterInfo.Mb_ChrJlbh;
                        Dgv_Data.Rows[Index].Cells[3].Value = MeterInfo.Mb_ChrCcbh;
                        if (MeterInfo.DgnProtocol.Loading)
                        {
                            Dgv_Data.Rows[Index].Cells[4].Value = MeterInfo.DgnProtocol.ProtocolName;
                            Dgv_Data.Rows[Index].Cells[5].Value = MeterInfo.DgnProtocol.Setting;
                            Dgv_Data.Rows[Index].Cells[6].Value = MeterInfo.Mb_chrAddr;
                            Dgv_Data.Rows[Index].Cells[7].Value = MeterInfo.DgnProtocol.WritePassword + MeterInfo.DgnProtocol.WriteClass;
                            Dgv_Data.Rows[Index].Cells[7].Tag   = Dgv_Data.Rows[Index].Cells[7].Value;
                            Dgv_Data.Rows[Index].Cells[8].Value = MeterInfo.DgnProtocol.ClearDemandPassword + MeterInfo.DgnProtocol.ClearDemandClass;
                            Dgv_Data.Rows[Index].Cells[8].Tag   = Dgv_Data.Rows[Index].Cells[8].Value;
                            Dgv_Data.Rows[Index].Cells[9].Value = MeterInfo.DgnProtocol.ClearDLPassword + MeterInfo.DgnProtocol.ClearDLClass;
                            Dgv_Data.Rows[Index].Cells[9].Tag   = Dgv_Data.Rows[Index].Cells[9].Value;
                        }

                        if (Index % 2 == 0)         //设置单双行背景颜色
                        {
                            Dgv_Data.Rows[Index].DefaultCellStyle.BackColor = CLDC_DataCore.Const.Variable.Color_Grid_Normal;
                        }
                        else
                        {
                            Dgv_Data.Rows[Index].DefaultCellStyle.BackColor = CLDC_DataCore.Const.Variable.Color_Grid_Alter;
                        }
                    }
                    else            //设置不检表的行背景颜色
                    {
                        Dgv_Data.Rows[Index].DefaultCellStyle.BackColor = Color.FromName(System.Drawing.KnownColor.Control.ToString());
                        Dgv_Data.Rows[Index].ReadOnly = true;
                    }
                }
            }

            AsyncOpDone.Set();
        }
        /// <summary>
        /// 刷新单个电能表信息
        /// </summary>
        /// <param name="MeterInfo">电能表信息</param>
        /// <param name="allowedit"></param>
        public void SetData(CLDC_DataCore.Model.DnbModel.DnbInfo.MeterBasicInfo MeterInfo, bool allowedit)
        {
            if (MeterInfo.MeterSjJLgns.Count == 0)
            {
                return;
            }
            Data_View.Rows.Clear();
            int RowIndex = 0;

            for (int intCurrentNum = 1; intCurrentNum <= 12; intCurrentNum++)
            {
                RowIndex = Data_View.Rows.Add();
                if ((RowIndex + 1) % 2 == 0)
                {
                    Data_View.Rows[RowIndex].DefaultCellStyle.BackColor = CLDC_DataCore.Const.Variable.Color_Grid_Alter;
                }
                else
                {
                    Data_View.Rows[RowIndex].DefaultCellStyle.BackColor = CLDC_DataCore.Const.Variable.Color_Grid_Normal;
                }

                Data_View.Rows[intCurrentNum - 1].Cells[0].Value = MeterInfo.ToString();
                Data_View.Rows[intCurrentNum - 1].Cells[1].Value = string.Format("上{0}次", intCurrentNum);

                for (int intHappen = 1; intHappen <= 2; intHappen++)
                {
                    string _Key = Key + "00" + intCurrentNum.ToString("D2") + intHappen.ToString("D2");

                    if (!MeterInfo.MeterSjJLgns.ContainsKey(_Key))
                    {
                        for (int k = 0; k < 3; k++)
                        {
                            Data_View.Rows[intCurrentNum - 1].Cells[(intHappen - 1) * 3 + k + 2].Value = "";
                        }
                        continue;
                    }
                    if (MeterInfo.MeterSjJLgns[_Key].RecordOther == null || MeterInfo.MeterSjJLgns[_Key].RecordOther == string.Empty)
                    {
                        continue;
                    }
                    else
                    {
                        string[] arrValue = null;
                        if (MeterInfo.MeterSjJLgns[_Key].RecordOther.IndexOf('|') == -1)
                        {
                            continue;
                        }
                        arrValue = MeterInfo.MeterSjJLgns[_Key].RecordOther.Split('|');
                        for (int k = 0; k < arrValue.Length; k++)
                        {
                            Data_View.Rows[intCurrentNum - 1].Cells[(intHappen - 1) * 3 + k + 2].Value = arrValue[k];
                        }
                    }
                }
            }
        }
 public CheckInsulation(CLDC_DataCore.Model.DnbModel.DnbInfo.MeterBasicInfo meterInfo, bool allowedit)
     : base(meterInfo, allowedit)
 {
     InitializeComponent();
     if (CLDC_DataCore.Function.Common.IsVSDevenv())
     {
         return;
     }
     SetData(MeterInfo, AllowEdit);
 }
Пример #19
0
 public DisplayEventLog(CLDC_DataCore.Model.DnbModel.DnbInfo.MeterBasicInfo MeterInfo, bool allowedit)
     : base(MeterInfo, allowedit)
 {
     InitializeComponent();
     if (CLDC_DataCore.Function.Common.IsVSDevenv())
     {
         return;
     }
     SetData(MeterInfo, AllowEdit);
 }
        public override void SetData(CLDC_DataCore.Model.DnbModel.DnbInfo.MeterBasicInfo MeterInfo, bool allowedit)
        {
            try
            {
                if (MeterInfo.MeterResults.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 MeterInfo.MeterResults.Keys)
                {
                    if (Key.IndexOf(((int)CLDC_Comm.Enum.Cus_MeterResultPrjID.通讯协议检查试验).ToString("D3")) != -1)
                    {
                        CLDC_DataCore.Model.DnbModel.DnbInfo.MeterResult meterResult = MeterInfo.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 j = 0; j < Rows.Length; j++)
                {
                    string Key = Rows[j][0].ToString();
                    if (!MeterInfo.YaoJianYn)
                    {
                        continue;
                    }
                    if (!MeterInfo.MeterResults.ContainsKey(Key))
                    {
                        continue;
                    }
                    CLDC_DataCore.Model.DnbModel.DnbInfo.MeterResult meterResult = MeterInfo.MeterResults[Key];
                    if (meterResult.Mr_chrRstId != null)
                    {
                        int rowIndex = Conn_Data.Rows.Add();
                        Conn_Data["表位", rowIndex].Value   = MeterInfo.ToString();
                        Conn_Data["项目名称", rowIndex].Value = meterResult.Mr_chrRstName;
                        Conn_Data["项目数据", rowIndex].Value = meterResult.Mr_chrRstValue;
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.StackTrace);
            }
        }
        public override void SetData(CLDC_DataCore.Model.DnbModel.DnbInfo.MeterBasicInfo MeterInfo, bool allowedit)
        {
            base.SetData(MeterInfo, allowedit);

            IsDisplayAll = Chk_DisplayAll.Checked;

            checkWC_Normal1.IsDisplayAll  = IsDisplayAll;
            checkWC_PianCha1.IsDisplayAll = IsDisplayAll;

            checkWC_Normal1.SetData(MeterInfo, allowedit);
            checkWC_PianCha1.SetData(MeterInfo, allowedit);
        }
Пример #22
0
        public ViewPulseOutPut()
        {
            InitializeComponent();

            CLDC_Comm.Enum.Cus_Clfs _clfs = CLDC_Comm.Enum.Cus_Clfs.单相;
            CLDC_DataCore.Model.DnbModel.DnbInfo.MeterBasicInfo MeterFirstInfo = null;
            MeterFirstInfo = CLDC_DataCore.Const.GlobalUnit.g_CUS.DnbData.MeterGroup[CLDC_DataCore.Const.GlobalUnit.FirstYaoJianMeter];
            _clfs          = (CLDC_Comm.Enum.Cus_Clfs)MeterFirstInfo.Mb_intClfs;
            if (_clfs == CLDC_Comm.Enum.Cus_Clfs.单相)
            {
                bShowXl = false;
            }
            else
            {
                bShowXl = true;
            }

            int _ColIndex = Data_View.Columns.Add("Data_Z", "表号");

            Data_View.Columns[_ColIndex].Tag          = 0;
            Data_View.Columns[_ColIndex].AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells;
            Data_View.Columns[_ColIndex].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
            Data_View.Columns[_ColIndex].SortMode = DataGridViewColumnSortMode.Automatic;

            _ColIndex = Data_View.Columns.Add("Data_Z", "电能脉冲输出");
            Data_View.Columns[_ColIndex].Tag          = 0;
            Data_View.Columns[_ColIndex].AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells;
            Data_View.Columns[_ColIndex].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
            Data_View.Columns[_ColIndex].SortMode = DataGridViewColumnSortMode.Automatic;

            _ColIndex = Data_View.Columns.Add("Data_Z", "秒脉冲输出");
            Data_View.Columns[_ColIndex].Tag          = 0;
            Data_View.Columns[_ColIndex].AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells;
            Data_View.Columns[_ColIndex].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
            Data_View.Columns[_ColIndex].SortMode = DataGridViewColumnSortMode.Automatic;

            _ColIndex = Data_View.Columns.Add("Data_Z", "投切脉冲输出");
            Data_View.Columns[_ColIndex].Tag          = 0;
            Data_View.Columns[_ColIndex].AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells;
            Data_View.Columns[_ColIndex].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
            Data_View.Columns[_ColIndex].SortMode = DataGridViewColumnSortMode.Automatic;

            if (bShowXl)
            {
                _ColIndex = Data_View.Columns.Add("Data_Z", "需量脉冲输出");
                Data_View.Columns[_ColIndex].Tag          = 0;
                Data_View.Columns[_ColIndex].AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells;
                Data_View.Columns[_ColIndex].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
                Data_View.Columns[_ColIndex].SortMode = DataGridViewColumnSortMode.NotSortable;
            }
        }
        /// <summary>
        /// 刷新单个电能表信息
        /// </summary>
        /// <param name="MeterInfo">电能表信息</param>
        /// <param name="allowedit"></param>
        public void SetData(CLDC_DataCore.Model.DnbModel.DnbInfo.MeterBasicInfo MeterInfo, bool allowedit)
        {
            if (MeterInfo.MeterFunctions.Count == 0)
            {
                return;
            }
            Data_View.Rows.Clear();

            int RowIndex = Data_View.Rows.Add();

            if ((RowIndex + 1) % 2 == 0)
            {
                Data_View.Rows[RowIndex].DefaultCellStyle.BackColor = CLDC_DataCore.Const.Variable.Color_Grid_Alter;
            }
            else
            {
                Data_View.Rows[RowIndex].DefaultCellStyle.BackColor = CLDC_DataCore.Const.Variable.Color_Grid_Normal;
            }
            Data_View.Rows[RowIndex].Cells[0].Value = MeterInfo.ToString();

            for (int j = 1; j <= 8; j++)
            {
                string _Key = Key + j.ToString("D2");

                if (!MeterInfo.MeterFunctions.ContainsKey(_Key))
                {
                    for (int k = 0; k < 4; k++)
                    {
                        Data_View.Rows[RowIndex].Cells[(j - 1) * 4 + k + 1].Value = "";
                    }
                    continue;
                }
                if (MeterInfo.MeterFunctions[_Key].Mf_chrValue == null || MeterInfo.MeterFunctions[_Key].Mf_chrValue == string.Empty)
                {
                    continue;
                }


                string[] arrValue = null;
                if (MeterInfo.MeterFunctions[_Key].Mf_chrValue.IndexOf('|') == -1)
                {
                    return;
                }
                arrValue = MeterInfo.MeterFunctions[_Key].Mf_chrValue.Split('|');
                for (int k = 0; k < arrValue.Length; k++)
                {
                    Data_View.Rows[RowIndex].Cells[(j - 1) * 4 + k + 1].Value = arrValue[k];
                }
            }
        }
        public DisplayQiQianDong(CLDC_DataCore.Model.DnbModel.DnbInfo.MeterBasicInfo MeterInfo, bool allowedit)
            : base(MeterInfo, allowedit)
        {
            InitializeComponent();
            if (CLDC_DataCore.Function.Common.IsVSDevenv())
            {
                return;
            }

            //Dgv_PrjData.TopLeftHeaderCell.Value = "项目名称";
            //if (allowedit)          //是否启用编辑
            //{
            //    Dgv_PrjData.ReadOnly = false;
            //}
            this.Refresh();
        }
        public DisplayWcAndPianCha(CLDC_DataCore.Model.DnbModel.DnbInfo.MeterBasicInfo MeterInfo, bool allowedit)
            : base(MeterInfo, allowedit)
        {
            InitializeComponent();
            if (CLDC_DataCore.Function.Common.IsVSDevenv())
            {
                return;
            }

            this.Controls.Add(Chk_DisplayAll);
            this.Controls.SetChildIndex(Chk_DisplayAll, 0);
            Chk_DisplayAll.Location        = new Point(150, 3);
            Chk_DisplayAll.CheckedChanged += new EventHandler(Chk_DisplayAll_CheckedChanged);


            SetData(MeterInfo, AllowEdit);
        }
Пример #26
0
        public override void SetData(CLDC_DataCore.Model.DnbModel.DnbInfo.MeterBasicInfo MeterInfo, bool allowedit)
        {
            if (MeterInfo.MeterCarrierDatas.Count == 0)
            {
                return;
            }
            Dgw_Data.Rows.Clear();

            foreach (string _Key in MeterInfo.MeterCarrierDatas.Keys)
            {
                CLDC_DataCore.Model.DnbModel.DnbInfo.MeterCarrierData _Carrier = MeterInfo.MeterCarrierDatas[_Key];
                if (_Carrier.Mce_PrjID.Length > 0)         //大ID
                {
                    Dgw_Data.Rows.Add(MeterInfo.ToString(), _Carrier.Mce_PrjName, _Carrier.Mce_PrjValue, _Carrier.Mce_ItemResult);
                }
            }

            base.SetData(MeterInfo, allowedit);
        }
        public MeterBasicInfo(CLDC_DataCore.Model.DnbModel.DnbInfo.MeterBasicInfo meterInfo, bool allowedit)
            : base(meterInfo, allowedit)
        {
            InitializeComponent();
            if (CLDC_DataCore.Function.Common.IsVSDevenv())
            {
                return;
            }

            this.SetData(meterInfo, allowedit);

            this.Txt_ccrq.KeyPress      += new KeyPressEventHandler(Txt_KeyPress);
            this.Txt_Jdyj.KeyPress      += new KeyPressEventHandler(Txt_KeyPress);
            this.Txt_QianFeng1.KeyPress += new KeyPressEventHandler(Txt_KeyPress);
            this.Txt_QianFeng2.KeyPress += new KeyPressEventHandler(Txt_KeyPress);
            this.Txt_QianFeng3.KeyPress += new KeyPressEventHandler(Txt_KeyPress);
            this.Txt_Zsbh.KeyPress      += new KeyPressEventHandler(Txt_KeyPress);
            this.Txt_zzbz.KeyPress      += new KeyPressEventHandler(Txt_KeyPress);
        }
        /// <summary>
        /// 刷新单个电能表信息
        /// </summary>
        /// <param name="MeterInfo">电能表信息</param>
        /// <param name="allowedit"></param>
        public void SetData(CLDC_DataCore.Model.DnbModel.DnbInfo.MeterBasicInfo MeterInfo, bool allowedit)
        {
            if (MeterInfo.MeterSjJLgns.Count == 0)
            {
                return;
            }
            Data_View.Rows.Clear();
            int RowIndex = Data_View.Rows.Add();

            if ((RowIndex + 1) % 2 == 0)
            {
                Data_View.Rows[RowIndex].DefaultCellStyle.BackColor = CLDC_DataCore.Const.Variable.Color_Grid_Alter;
            }
            else
            {
                Data_View.Rows[RowIndex].DefaultCellStyle.BackColor = CLDC_DataCore.Const.Variable.Color_Grid_Normal;
            }
            Data_View.Rows[RowIndex].Cells[0].Value = MeterInfo.ToString();

            int CountIndex = 1;

            for (int j = 1; j <= 2; j++)
            {
                string _Key = Key + j.ToString("D2");
                if (MeterInfo.MeterSjJLgns.ContainsKey(_Key))
                {
                    string[] arrValue = null;
                    if (MeterInfo.MeterSjJLgns[_Key].RecordOther.IndexOf('|') == -1)
                    {
                        continue;
                    }
                    arrValue = MeterInfo.MeterSjJLgns[_Key].RecordOther.Split('|');
                    for (int k = 0; k < arrValue.Length; k++)
                    {
                        Data_View.Rows[RowIndex].Cells[CountIndex++].Value = arrValue[k];
                    }
                }
                else
                {
                    CountIndex += 2;
                }
            }
        }
Пример #29
0
        /// <summary>
        /// 显示一个电表的数据
        /// </summary>
        /// <param name="MeterInfo"></param>
        /// <param name="allowedit"></param>
        public override void SetData(CLDC_DataCore.Model.DnbModel.DnbInfo.MeterBasicInfo MeterInfo, bool allowedit)
        {
            if (MeterInfo.MeterResults.Count == 0)
            {
                _MeterInfo = null;
                return;
            }
            _MeterInfo = MeterInfo;
            Dgw_Data.Rows.Clear();

            if (MeterInfo.MeterResults.ContainsKey(ItemKey))
            {
                int rowIndex = Dgw_Data.Rows.Add();
                Dgw_Data["表位", rowIndex].Value   = MeterInfo.ToString();
                Dgw_Data["项目名称", rowIndex].Value = MeterInfo.MeterResults[ItemKey].Mr_chrRstName;
                Dgw_Data["项目结论", rowIndex].Value = "    " + MeterInfo.MeterResults[ItemKey].Mr_chrRstValue;
            }


            base.SetData(MeterInfo, allowedit);
        }
Пример #30
0
        public override void SetData(CLDC_DataCore.Model.DnbModel.DnbInfo.MeterBasicInfo MeterInfo, bool allowedit)
        {
            if (MeterInfo.MeterSjJLgns.Count == 0)
            {
                return;
            }
            Dgw_Data.Rows.Clear();

            foreach (string _Key in MeterInfo.MeterSjJLgns.Keys)
            {
                CLDC_DataCore.Model.DnbModel.DnbInfo.MeterSjJLgn _Event = MeterInfo.MeterSjJLgns[_Key];
                if (_Event.StatusNo.Trim().Length == 3)         //大ID
                {
                    int rowIndex = Dgw_Data.Rows.Add();
                    Dgw_Data["表位", rowIndex].Value   = MeterInfo.ToString();
                    Dgw_Data["项目名称", rowIndex].Value = _Event.ItemName;
                    Dgw_Data["项目结论", rowIndex].Value = "    " + _Event.ItemConc;
                }
            }

            base.SetData(MeterInfo, allowedit);
        }