private void jiaoliucheck_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { ElectricShorti elc = new ElectricShorti(); //TreeListNode node = treeList1.FocusedNode; if (string.IsNullOrEmpty(strID)) { MessageBox.Show("请先选择电气计算方案!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } this.ZLcheck.Enabled = true; //strID = node["ID"].ToString(); WaitDialogForm wait = null; try { wait = new WaitDialogForm("", "正在处理数据, 请稍候..."); wait.Close(); elc.Allshortcheck(strID, this.ProjectUID, 100, 2); curDevice.Init(); } catch (Exception exc) { Debug.Fail(exc.Message); Itop.Client.Common.HandleException.TryCatch(exc); wait.Close(); return; } }
private void AllshortItem_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { ElectricShorti elc = new ElectricShorti(); //TreeListNode node = treeList1.FocusedNode; if (strID == null) { MessageBox.Show("请先选择电气计算方案!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } //strID = node["ID"].ToString(); //elc.CheckDL(strID, 100); int n3 = 0; ShorttypeForm shortfangshi = new ShorttypeForm(); ShortTform shorttype = new ShortTform(); frnReport wFrom = new frnReport(); wFrom.Text = "短路计算"; wFrom.Show(); wFrom.ShowText += "进行相关设置\t" + System.DateTime.Now.ToString(); if (shortfangshi.ShowDialog() == DialogResult.OK) { if (shortfangshi.Mathindex == 0) { shorttype.ShowDialog(); if (shorttype.DialogResult == DialogResult.OK) { switch (shorttype.DuanluType) { case "单相接地": n3 = 1; break; case "两相接地": n3 = 3; break; case "两相故障": n3 = 2; break; case "三相故障": n3 = 0; break; } elc.OutType = shorttype.Mathindex; elc.Compuflag = shorttype.Compuflag; } else { return; } //WaitDialogForm wait = null; try { // wait = new WaitDialogForm("", "正在处理数据, 请稍候..."); elc.AllShort(strID, this.ProjectUID, n3, 100, wFrom); //elc.ALLShortThread(strID, this.ProjectUID, n3, 100, wait); //wait.Close(); } catch (Exception exc) { wFrom.ShowText += "\r\n短路计算失败\t" + System.DateTime.Now.ToString(); Debug.Fail(exc.Message); Itop.Client.Common.HandleException.TryCatch(exc); // wait.Close(); return; } } if (shortfangshi.Mathindex == 1) { SelshortbusForm1 selbusfrm = new SelshortbusForm1(); selbusfrm.ProjectSUID = strID; selbusfrm.ProjectID = Itop.Client.MIS.ProgUID; selbusfrm.ShowDialog(); if (selbusfrm.DialogResult == DialogResult.OK) { List <PSPDEV> list = new List <PSPDEV>(); foreach (DataRow row in selbusfrm.DT.Rows) { try { if ((bool)row["C"]) { PSPDEV psp = new PSPDEV(); psp.SUID = row["A"].ToString(); psp = (PSPDEV)UCDeviceBase.DataService.GetObject("SelectPSPDEVByKey", psp); if (psp != null) { list.Add(psp); } } } catch (System.Exception ex) { } } if (list.Count == 0) { MessageBox.Show("没有选择短路的母线!"); return; } shorttype.ShowDialog(); if (shorttype.DialogResult == DialogResult.OK) { switch (shorttype.DuanluType) { case "单相接地": n3 = 1; break; case "两相接地": n3 = 3; break; case "两相故障": n3 = 2; break; case "三相故障": n3 = 0; break; } elc.OutType = shorttype.Mathindex; elc.Compuflag = shorttype.Compuflag; } else { return; } // WaitDialogForm wait = null; try { //wait = new WaitDialogForm("", "正在处理数据, 请稍候..."); elc.Partshort(strID, this.ProjectUID, n3, 100, list, wFrom); //wait.Close(); } catch (Exception exc) { wFrom.ShowText += "\r\n短路计算失败\t" + System.DateTime.Now.ToString(); Debug.Fail(exc.Message); Itop.Client.Common.HandleException.TryCatch(exc); //wait.Close(); return; } } } } }