public Frm_XieBoSetup() { InitializeComponent(); Tb_New.Click += new EventHandler(Tb_New_Click); //方案新增 this.Load += new EventHandler(Frm_XieBoSetup_Load); //窗体加载 Tb_Del.Click += new EventHandler(Tb_Del_Click); //方案删除 Tb_Close.Click += new EventHandler(Tb_Close_Click); //窗体关闭 Cmd_Cancel.Click += new EventHandler(Cmd_Cancel_Click); //取消保存 Tb_Save.Click += new EventHandler(Tb_Save_Click); //方案存档 Tb_Copy.Click += new EventHandler(Tb_Copy_Click); //方案拷贝 Tb_Plaster.Click += new EventHandler(Tb_Plaster_Click); //方案粘贴 Cmd_Save.Click += new EventHandler(Cmd_Save_Click); //方案新增存档 Opt_Ua.CheckedChanged += new EventHandler(Opt_U_CheckedChanged); Opt_Ub.CheckedChanged += new EventHandler(Opt_U_CheckedChanged); Opt_Uc.CheckedChanged += new EventHandler(Opt_U_CheckedChanged); Opt_Ia.CheckedChanged += new EventHandler(Opt_I_CheckedChanged); Opt_Ib.CheckedChanged += new EventHandler(Opt_I_CheckedChanged); Opt_Ic.CheckedChanged += new EventHandler(Opt_I_CheckedChanged); Cmd_AddU.Click += new EventHandler(Cmd_Add_Click); //方案项目内容新增 Cmd_AddI.Click += new EventHandler(Cmd_Add_Click); //方案项目内容新增 Cmd_RemoveU.Click += new EventHandler(Cmd_Remove_Click); //方案项目内容删除 Cmd_RemoveI.Click += new EventHandler(Cmd_Remove_Click); //方案项目内容删除 Pic_U.SizeChanged += new EventHandler(Pic_SizeChanged); Pic_I.SizeChanged += new EventHandler(Pic_SizeChanged); Tv_FaList.NodeMouseClick += new TreeNodeMouseClickEventHandler(Tv_FaList_NodeMouseClick); //方案选择 this.Text = CONST_TITLE; _XieBo = new CLDC_DataCore.SystemModel.Item.csXieBo(); tableLayoutPanel1.Enabled = false; DrawXieBoI = new CLDC_Comm.DrawXieBo.CCLHarmonious(Pic_I); DrawXieBoI.Draw(); DrawXieBoU = new CLDC_Comm.DrawXieBo.CCLHarmonious(Pic_U); DrawXieBoU.Draw(); }
/// <summary> /// 画谐波图像 /// </summary> /// <param name="IsUb">是否是电压</param> /// <param name="Yuan">元件</param> /// <param name="Grid">数据表单</param> private void DrawXieBo(bool IsUb, CLDC_Comm.Enum.Cus_PowerYuanJian Yuan, DataGridView Grid) { CLDC_Comm.DrawXieBo.CCLHarmonious _Draw = null; if (IsUb) { _Draw = DrawXieBoU; } else { _Draw = DrawXieBoI; } _Draw.ClearXieBo(); for (int i = 0; i < Grid.Rows.Count; i++) { if (_Draw.MaxTimes < int.Parse(Grid.Rows[i].Cells[0].Value.ToString())) { _Draw.MaxTimes = int.Parse(Grid.Rows[i].Cells[0].Value.ToString()); } } for (int i = 0; i < Grid.Rows.Count; i++) { switch (Yuan) { case CLDC_Comm.Enum.Cus_PowerYuanJian.A: if (IsUb) { _Draw.UaPhase[0] = 0; _Draw.UaValue[0] = 100; _Draw.UaSelected[0] = true; _Draw.UaPhase[int.Parse(Grid[0, i].Value.ToString()) - 1] = float.Parse(Grid[2, 0].Value.ToString()); _Draw.UaValue[int.Parse(Grid[0, i].Value.ToString()) - 1] = float.Parse(Grid[1, 0].Value.ToString()) / 100f; _Draw.UaSelected[int.Parse(Grid[0, i].Value.ToString()) - 1] = true; } else { _Draw.IaPhase[0] = 0; _Draw.IaValue[0] = 100; _Draw.IaSelected[0] = true; _Draw.IaPhase[int.Parse(Grid[0, i].Value.ToString()) - 1] = float.Parse(Grid[2, 0].Value.ToString()); _Draw.IaValue[int.Parse(Grid[0, i].Value.ToString()) - 1] = float.Parse(Grid[1, 0].Value.ToString()) / 100f; _Draw.IaSelected[int.Parse(Grid[0, i].Value.ToString()) - 1] = true; } break; case CLDC_Comm.Enum.Cus_PowerYuanJian.B: if (IsUb) { _Draw.UbPhase[0] = 0; _Draw.UbValue[0] = 100; _Draw.UbSelected[0] = true; _Draw.UbPhase[int.Parse(Grid[0, i].Value.ToString()) - 1] = float.Parse(Grid[2, 0].Value.ToString()); _Draw.UbValue[int.Parse(Grid[0, i].Value.ToString()) - 1] = float.Parse(Grid[1, 0].Value.ToString()) / 100f; _Draw.UbSelected[int.Parse(Grid[0, i].Value.ToString()) - 1] = true; } else { _Draw.IbPhase[0] = 0; _Draw.IbValue[0] = 100; _Draw.IbSelected[0] = true; _Draw.IbPhase[int.Parse(Grid[0, i].Value.ToString()) - 1] = float.Parse(Grid[2, 0].Value.ToString()); _Draw.IbValue[int.Parse(Grid[0, i].Value.ToString()) - 1] = float.Parse(Grid[1, 0].Value.ToString()) / 100f; _Draw.IbSelected[int.Parse(Grid[0, i].Value.ToString()) - 1] = true; } break; case CLDC_Comm.Enum.Cus_PowerYuanJian.C: if (IsUb) { _Draw.UcPhase[0] = 0; _Draw.UcValue[0] = 100; _Draw.UcSelected[0] = true; _Draw.UcPhase[int.Parse(Grid[0, i].Value.ToString()) - 1] = float.Parse(Grid[2, 0].Value.ToString()); _Draw.UcValue[int.Parse(Grid[0, i].Value.ToString()) - 1] = float.Parse(Grid[1, 0].Value.ToString()) / 100f; _Draw.UcSelected[int.Parse(Grid[0, i].Value.ToString()) - 1] = true; } else { _Draw.IcPhase[0] = 0; _Draw.IcValue[0] = 100; _Draw.IcSelected[0] = true; _Draw.IcPhase[int.Parse(Grid[0, i].Value.ToString()) - 1] = float.Parse(Grid[2, 0].Value.ToString()); _Draw.IcValue[int.Parse(Grid[0, i].Value.ToString()) - 1] = float.Parse(Grid[1, 0].Value.ToString()) / 100f; _Draw.IcSelected[int.Parse(Grid[0, i].Value.ToString()) - 1] = true; } break; } } _Draw.Draw(); }