Exemplo n.º 1
0
        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;

                        }

                    }
                }

            }
        }
Exemplo n.º 2
0
        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;
                        }
                    }
                }
            }
        }