/// <summary> /// 构造 /// </summary> /// <param name="enumMethod">走字方法</param> public UI_ZouZiFeiLv(CLDC_Comm.Enum.Cus_ZouZiMethod enumMethod, List <StPlan_ZouZi.StPrjFellv> FeiLvItem) { InitializeComponent(); switch (enumMethod) { case CLDC_Comm.Enum.Cus_ZouZiMethod.校核常数: case CLDC_Comm.Enum.Cus_ZouZiMethod.标准表法: this.Ltv_FeiLv.Columns[2].Text = "电量(度)"; Lab_Dw.Text = "(度)"; Lab_Pram.Text = "走字电量:"; break; case CLDC_Comm.Enum.Cus_ZouZiMethod.基本走字法: this.Ltv_FeiLv.Columns[2].Text = "时间(分)"; Lab_Dw.Text = "(分)"; Lab_Pram.Text = "走字时长:"; break; default: this.Ltv_FeiLv.Columns[2].Text = "时间(分)"; Lab_Dw.Text = "(分)"; Lab_Pram.Text = "走字时长:"; break; } for (int i = 0; i < 5; i++) { Cmb_Feilv.Items.Add(((CLDC_Comm.Enum.Cus_FeiLv)i).ToString()); } this.InsertListItem(FeiLvItem); }
/// <summary> /// 设置查看或修改走字内容 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Dgv_Data_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex == 6) //项目内容 { if (Dgv_Data[e.ColumnIndex - 1, e.RowIndex].Value == null) { MessageBoxEx.Show(this, "请选择走字方式...", "错误提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } CLDC_Comm.Enum.Cus_ZouZiMethod _Tmp = new CLDC_Comm.Enum.Cus_ZouZiMethod(); if (Dgv_Data[e.ColumnIndex - 1, e.RowIndex].Value.ToString() == CLDC_Comm.Enum.Cus_ZouZiMethod.标准表法.ToString()) { _Tmp = CLDC_Comm.Enum.Cus_ZouZiMethod.标准表法; } else if (Dgv_Data[e.ColumnIndex - 1, e.RowIndex].Value.ToString() == CLDC_Comm.Enum.Cus_ZouZiMethod.基本走字法.ToString()) { _Tmp = CLDC_Comm.Enum.Cus_ZouZiMethod.基本走字法; } else if (Dgv_Data[e.ColumnIndex - 1, e.RowIndex].Value.ToString() == CLDC_Comm.Enum.Cus_ZouZiMethod.计读脉冲法.ToString()) { _Tmp = CLDC_Comm.Enum.Cus_ZouZiMethod.计读脉冲法; } else if (Dgv_Data[e.ColumnIndex - 1, e.RowIndex].Value.ToString() == CLDC_Comm.Enum.Cus_ZouZiMethod.校核常数.ToString()) { _Tmp = CLDC_Comm.Enum.Cus_ZouZiMethod.校核常数; } if (this.Controls[0] is PrjUI.UI_ZouZiFeiLv) { return; } PrjUI.UI_ZouZiFeiLv _Panel; if (Dgv_Data.CurrentCell.Tag is List <StPlan_ZouZi.StPrjFellv> ) { _Panel = new CLDC_MeterUI.UI_FA.FAPrj.PrjUI.UI_ZouZiFeiLv(_Tmp, (List <StPlan_ZouZi.StPrjFellv>)Dgv_Data.CurrentCell.Tag); } else { _Panel = new CLDC_MeterUI.UI_FA.FAPrj.PrjUI.UI_ZouZiFeiLv(_Tmp); } _Panel.ClosePanel += new CLDC_MeterUI.UI_FA.FAPrj.PrjUI.UI_ZouZiFeiLv.Evt_ClosePanel(FeiLv_ClosePanel); this.Controls.Add(_Panel); this.Controls.SetChildIndex(_Panel, 0); _Panel.Left = Dgv_Data.GetCellDisplayRectangle(e.ColumnIndex, e.RowIndex, false).Left; _Panel.Top = Dgv_Data.GetCellDisplayRectangle(e.ColumnIndex, e.RowIndex, false).Bottom + this.panel1.Height; _Panel.BringToFront(); Dgv_Data.Enabled = false; } }
/// <summary> /// 拷贝方案 /// </summary> public CLDC_DataCore.Model.Plan.Plan_ZouZi Copy() { if (Dgv_Data.Rows.Count == 1) { return(new CLDC_DataCore.Model.Plan.Plan_ZouZi((int)TaiType, "")); } CLDC_DataCore.Model.Plan.Plan_ZouZi _Obj = new CLDC_DataCore.Model.Plan.Plan_ZouZi((int)TaiType, ""); for (int i = 0; i < Dgv_Data.Rows.Count; i++) { if (Dgv_Data[Dgv_Data.Columns.Count - 1, i].Value.ToString() == CONST_ADD) { break; } else { if (!this.CheckOK(i)) { return(new CLDC_DataCore.Model.Plan.Plan_ZouZi((int)TaiType, "")); } CLDC_Comm.Enum.Cus_PowerFangXiang _Tmp = new CLDC_Comm.Enum.Cus_PowerFangXiang(); if (Dgv_Data[1, i].Value.ToString() == CLDC_Comm.Enum.Cus_PowerFangXiang.正向有功.ToString()) { _Tmp = CLDC_Comm.Enum.Cus_PowerFangXiang.正向有功; } else if (Dgv_Data[1, i].Value.ToString() == CLDC_Comm.Enum.Cus_PowerFangXiang.反向有功.ToString()) { _Tmp = CLDC_Comm.Enum.Cus_PowerFangXiang.反向有功; } else if (Dgv_Data[1, i].Value.ToString() == CLDC_Comm.Enum.Cus_PowerFangXiang.正向无功.ToString()) { _Tmp = CLDC_Comm.Enum.Cus_PowerFangXiang.正向无功; } else if (Dgv_Data[1, i].Value.ToString() == CLDC_Comm.Enum.Cus_PowerFangXiang.反向无功.ToString()) { _Tmp = CLDC_Comm.Enum.Cus_PowerFangXiang.反向无功; } else if (Dgv_Data[1, i].Value.ToString() == CLDC_Comm.Enum.Cus_PowerFangXiang.第一象限无功.ToString()) { _Tmp = CLDC_Comm.Enum.Cus_PowerFangXiang.第一象限无功; } else if (Dgv_Data[1, i].Value.ToString() == CLDC_Comm.Enum.Cus_PowerFangXiang.第二象限无功.ToString()) { _Tmp = CLDC_Comm.Enum.Cus_PowerFangXiang.第二象限无功; } else if (Dgv_Data[1, i].Value.ToString() == CLDC_Comm.Enum.Cus_PowerFangXiang.第三象限无功.ToString()) { _Tmp = CLDC_Comm.Enum.Cus_PowerFangXiang.第三象限无功; } else if (Dgv_Data[1, i].Value.ToString() == CLDC_Comm.Enum.Cus_PowerFangXiang.第四象限无功.ToString()) { _Tmp = CLDC_Comm.Enum.Cus_PowerFangXiang.第四象限无功; } else { _Tmp = CLDC_Comm.Enum.Cus_PowerFangXiang.正向有功; } CLDC_Comm.Enum.Cus_ZouZiMethod _TmpMethod = new CLDC_Comm.Enum.Cus_ZouZiMethod(); if (Dgv_Data[5, i].Value.ToString() == CLDC_Comm.Enum.Cus_ZouZiMethod.标准表法.ToString()) { _TmpMethod = CLDC_Comm.Enum.Cus_ZouZiMethod.标准表法; } else if (Dgv_Data[5, i].Value.ToString() == CLDC_Comm.Enum.Cus_ZouZiMethod.基本走字法.ToString()) { _TmpMethod = CLDC_Comm.Enum.Cus_ZouZiMethod.基本走字法; } else if (Dgv_Data[5, i].Value.ToString() == CLDC_Comm.Enum.Cus_ZouZiMethod.计读脉冲法.ToString()) { _TmpMethod = CLDC_Comm.Enum.Cus_ZouZiMethod.计读脉冲法; } else if (Dgv_Data[5, i].Value.ToString() == CLDC_Comm.Enum.Cus_ZouZiMethod.校核常数.ToString()) { _TmpMethod = CLDC_Comm.Enum.Cus_ZouZiMethod.校核常数; } else { _TmpMethod = CLDC_Comm.Enum.Cus_ZouZiMethod.标准表法; } CLDC_Comm.Enum.Cus_PowerYuanJian _TmpYuan = new CLDC_Comm.Enum.Cus_PowerYuanJian(); if (Dgv_Data[2, i].Value.ToString() == CLDC_Comm.Enum.Cus_PowerYuanJian.H.ToString()) { _TmpYuan = CLDC_Comm.Enum.Cus_PowerYuanJian.H; } else if (Dgv_Data[2, i].Value.ToString() == CLDC_Comm.Enum.Cus_PowerYuanJian.A.ToString()) { _TmpYuan = CLDC_Comm.Enum.Cus_PowerYuanJian.A; } else if (Dgv_Data[2, i].Value.ToString() == CLDC_Comm.Enum.Cus_PowerYuanJian.B.ToString()) { _TmpYuan = CLDC_Comm.Enum.Cus_PowerYuanJian.B; } else if (Dgv_Data[2, i].Value.ToString() == CLDC_Comm.Enum.Cus_PowerYuanJian.C.ToString()) { _TmpYuan = CLDC_Comm.Enum.Cus_PowerYuanJian.C; } else { _TmpYuan = CLDC_Comm.Enum.Cus_PowerYuanJian.H; } _Obj.Add(_Tmp, //功率方向 _TmpMethod, //走字方法 _TmpYuan, //元件 Dgv_Data[3, i].Value.ToString(), //功率因素 Dgv_Data[4, i].Value.ToString(), //电流倍数 "", //走字描述 Dgv_Data[7, i].Value == null?"0":(bool)Dgv_Data[7, i].Value == false?"0":"1", //组合误差 (List <StPlan_ZouZi.StPrjFellv>)Dgv_Data[6, i].Tag); //走字项目 } } _Obj.SetPram((int)base.TaiType, base.FaName); return(_Obj); }