コード例 #1
0
ファイル: frmlinenew.cs プロジェクト: EdgarEDT/myitoppsp
        public frmLinenew(PSPDEV pspDev)
        {
            InitializeComponent();
            mc.Select();
            WireCategory wirewire = new WireCategory();
            wirewire.WireLevel = pspDev.VoltR.ToString();
            IList list1 = Services.BaseService.GetList("SelectWireCategoryListBYWireLevel", wirewire);
            foreach (WireCategory sub in list1)
            {
                comboBox22.Properties.Items.Add(sub.WireType);
            }
            InitData(pspDev);
            this.comboBox22.SelectedIndexChanged += new System.EventHandler(this.comboBox22_SelectedIndexChanged);
            this.textBox11.Leave += new System.EventHandler(this.textBox11_Leave);
            this.textBox11.TextChanged += new System.EventHandler(this.textBox11_TextChanged);
            this.comboBoxEdit1.SelectedIndexChanged += new System.EventHandler(this.comboBoxEdit1_SelectedIndexChanged);
            this.comboBoxEdit1.Leave += new System.EventHandler(this.comboBoxEdit1_Leave);
            object[] o = new object[30];

            for (int i = 0; i < 30; i++)
            {
                o[i] = 2009 + i;
            }
            this.tyear.Properties.Items.AddRange(o);
            //this.tyear.Visible = false;
        }
コード例 #2
0
        public override void Add()
        {
            frmFHZLdlg dlg = new frmFHZLdlg();

            if (ID == "63" || ID == "64")
            {
                dlg.SetEnable();
            }
            dlg.ParentID  = ParentID;
            dlg.Name      = "";
            dlg.ProjectID = this.ProjectID;
            PSPDEV pd = new PSPDEV();

            pd.AreaID    = ParentID;
            pd.ProjectID = ProjectID;

            Stream fs = Assembly.GetExecutingAssembly().GetManifestResourceStream("Itop.TLPSP.DEVICE.devicetypes.xml");
            //Assembly.GetExecutingAssembly().GetManifestResourceStream
            XmlDocument xml = new XmlDocument();

            xml.Load(fs);
            XmlNode node = xml.SelectSingleNode("devicetype/*[@id='" + ID + "']");

            if (ID != null)
            {
                dlg.Text = node.Attributes["name"].Value.ToString() + "信息";
            }
            dlg.DeviceMx = pd;
            //if(ID=="55"){
            //    dlg.Text = "开关站信息";
            //}
            //if (ID == "56")
            //{
            //    dlg.Text = "环网柜信息";
            //}
            //if (ID == "57")
            //{
            //    dlg.Text = "柱上开关信息";
            //}
            //if (ID == "58")
            //{
            //    dlg.Text = "电缆分支箱信息";
            //}
            //if (ID == "59")
            //{
            //    dlg.Text = "负荷开关信息";
            //}
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                //增加记录
                PSPDEV dev = dlg.DeviceMx;
                dev.Type      = ID;
                dev.ProjectID = this.ProjectID;
                UCDeviceBase.DataService.Create("InsertPSPDEV", dev);
                DataRow row = datatable1.NewRow();

                Itop.Common.DataConverter.ObjectToRow(dev, row);
                datatable1.Rows.Add(row);
            }
        }
コード例 #3
0
ファイル: UCDeviceXL.cs プロジェクト: EdgarEDT/myitoppsp
        /// <summary>
        /// ������·ĸ�߸������ڱ��վ
        /// </summary>
        /// <param name="line"></param>
        public static void UpdateBDZ(PSPDEV line)
        {
            LineInfo lineinfo = UCDeviceBase.DataService.GetOneByKey<LineInfo>(line.SUID);
            if (lineinfo == null) {
                return;
            }
            string iname = line.IName;
            string jname = line.JName;

            string sql = "where (name='" + iname + "' ) and projectid='" + Itop.Client.MIS.ProgUID + "' and Type='05' ORDER BY Number";
            IList<PSPDEV> list = UCDeviceBase.DataService.GetList<PSPDEV>("SelectPSPDEVByCondition", sql);
            string bdz1 = "";
            string bdz2 = "";
            if (list.Count > 0) {
               bdz1= DeviceHelper.GetBdzNameByID(list[0].SvgUID);
            }
            sql = "where (name='" + jname + "' ) and projectid='" + Itop.Client.MIS.ProgUID + "' and Type='05' ORDER BY Number";
            list = UCDeviceBase.DataService.GetList<PSPDEV>("SelectPSPDEVByCondition", sql);
            if (list.Count > 0) {
               bdz2= DeviceHelper.GetBdzNameByID(list[0].SvgUID);
            }
            lineinfo.ObligateField6 = bdz1;
            lineinfo.ObligateField7 = bdz2;
            UCDeviceBase.DataService.Update<LineInfo>(lineinfo);
        }
コード例 #4
0
        //添加馈线
        private void barButtonItem1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            TreeListNode tln = treeList1.FocusedNode;

            if (tln != null)
            {
                DataRow       row = (tln.TreeList.GetDataRecordByNode(tln) as DataRowView).Row;
                Ps_pdtypenode v   = DataConverter.RowToObject <Ps_pdtypenode>(row);
                if (tln.GetValue("devicetype").ToString() == "01" || tln.GetValue("devicetype").ToString() == "73")
                {
                    adducdevice("73");
                    curDevice.Add();
                    PSPDEV pd = curDevice.SelectedDevice as PSPDEV;
                    //馈线段记录
                    if (pd == null)
                    {
                        return;
                    }
                    Ps_pdtypenode pn = new Ps_pdtypenode();
                    pn.title       = pd.Name;
                    pn.pdreltypeid = pdreltypeid;
                    pn.devicetype  = "73";
                    pn.DeviceID    = pd.SUID;
                    pn.ParentID    = tln.GetValue("ID").ToString();
                    pn.Code        = (tln.Level + 1).ToString() + "1" + (tln.Nodes.Count + 1).ToString();
                    Services.BaseService.Create <Ps_pdtypenode>(pn);
                    dt.Rows.Add(Itop.Common.DataConverter.ObjectToRow(pn, dt.NewRow()));
                }
                else
                {
                    MsgBox.Show("请选择电源后,再操作!");
                    return;
                }
            }
        }
コード例 #5
0
ファイル: DefineDelform.cs プロジェクト: github188/myitoppsp
        public DefineDelform(PSPDEV pspDEV)           //出入图层的SvgUID
        {
            InitializeComponent();
            pspulic = pspDEV;
            string strCon2 = null;
            string strCon1 = ",PSP_ELCDEVICE WHERE PSPDEV.SUID = PSP_ELCDEVICE.DeviceSUID AND PSP_ELCDEVICE.ProjectSUID = '" + pspulic.SvgUID + "'";

            strCon2 = " AND Type = '01'";
            string strCon = strCon1 + strCon2;
            IList  listMX = UCDeviceBase.DataService.GetList("SelectPSPDEVByCondition", strCon);

            strCon2 = " AND Type = '05'";
            strCon  = strCon1 + strCon2;
            IList listXL = UCDeviceBase.DataService.GetList("SelectPSPDEVByCondition", strCon);

            strCon2 = " AND Type = '02'";
            strCon  = strCon1 + strCon2;
            IList listBYQ2 = UCDeviceBase.DataService.GetList("SelectPSPDEVByCondition", strCon);

            strCon2 = " AND Type = '03'";
            strCon  = strCon1 + strCon2;
            IList listBYQ3 = UCDeviceBase.DataService.GetList("SelectPSPDEVByCondition", strCon);

            int linecount = listXL.Count;

            for (int i = 0; i < listXL.Count; i++)
            {
                pspDEV = (PSPDEV)listXL[i];
                if (pspDEV.KSwitchStatus == "0")
                {
                    // psdevclass psd = new psdevclass(pspDEV.Number,pspDEV.FirstNode,pspDEV.LastNode, pspDEV.Name);

                    this.WaitLinelist.Items.Add(new psdevclass(i + 1, pspDEV.FirstNode, pspDEV.LastNode, pspDEV.Type, pspDEV.Name));
                }
            }
            int trans2count = listBYQ2.Count;

            for (int i = 0; i < listBYQ2.Count; i++)
            {
                pspDEV = (PSPDEV)listBYQ2[i];
                psdevclass psd = new psdevclass(linecount + i + 1, pspDEV.FirstNode, pspDEV.LastNode, pspDEV.Type, pspDEV.Name);
                this.WaitLinelist.Items.Add(psd);
            }
            //psp.Lable = "母线节点";
            for (int i = 0; i < listBYQ3.Count; i++)
            {
                pspDEV = (PSPDEV)listBYQ3[i];
                psdevclass psdi = new psdevclass(linecount + trans2count + i + 1, pspDEV.FirstNode, pspDEV.LastNode, pspDEV.Type, pspDEV.Name + "i");
                psdevclass psdj = new psdevclass(linecount + trans2count + i + 2, pspDEV.FirstNode, pspDEV.Flag, pspDEV.Type, pspDEV.Name + "j");
                psdevclass psdk = new psdevclass(linecount + trans2count + i + 3, pspDEV.LastNode, pspDEV.Flag, pspDEV.Type, pspDEV.Name + "k");
                this.WaitLinelist.Items.Add(psdi);
                this.WaitLinelist.Items.Add(psdj);
                this.WaitLinelist.Items.Add(psdk);
            }
            foreach (PSPDEV dev in listMX)
            {
                comboBoxEdit1.Properties.Items.Add(dev.Name);
                //comboBoxEdit2.Properties.Items.Add(dev.Name);
            }
        }
コード例 #6
0
ファイル: frmMuLian.cs プロジェクト: EdgarEDT/myitoppsp
 public frmMuLian(PSPDEV dev, string svgDocumentUID)
 {
     svgUID = svgDocumentUID;
     InitializeComponent();
     InitCom();
     InitData(dev);
 }
コード例 #7
0
ファイル: UCDeviceXL.cs プロジェクト: github188/myitoppsp
        /// <summary>
        /// 根据线路母线更新所在变电站
        /// </summary>
        /// <param name="line"></param>
        public static void UpdateBDZ(PSPDEV line)
        {
            LineInfo lineinfo = UCDeviceBase.DataService.GetOneByKey <LineInfo>(line.SUID);

            if (lineinfo == null)
            {
                return;
            }
            string iname = line.IName;
            string jname = line.JName;

            string         sql  = "where (name='" + iname + "' ) and projectid='" + Itop.Client.MIS.ProgUID + "' and Type='05' ORDER BY Number";
            IList <PSPDEV> list = UCDeviceBase.DataService.GetList <PSPDEV>("SelectPSPDEVByCondition", sql);
            string         bdz1 = "";
            string         bdz2 = "";

            if (list.Count > 0)
            {
                bdz1 = DeviceHelper.GetBdzNameByID(list[0].SvgUID);
            }
            sql  = "where (name='" + jname + "' ) and projectid='" + Itop.Client.MIS.ProgUID + "' and Type='05' ORDER BY Number";
            list = UCDeviceBase.DataService.GetList <PSPDEV>("SelectPSPDEVByCondition", sql);
            if (list.Count > 0)
            {
                bdz2 = DeviceHelper.GetBdzNameByID(list[0].SvgUID);
            }
            lineinfo.ObligateField6 = bdz1;
            lineinfo.ObligateField7 = bdz2;
            UCDeviceBase.DataService.Update <LineInfo>(lineinfo);
        }
コード例 #8
0
ファイル: frmBDZdlg2.cs プロジェクト: github188/myitoppsp
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            RefreshData(DeviceMx.UID);
            PSPDEV p = new PSPDEV();

            if (DeviceHelper.xml1 != null)
            {
                p.SvgUID = DeviceHelper.xml1.GetAttribute("Deviceid");
            }
            else
            {
                p.SvgUID = DeviceMx.UID;
            }
            p.Type = "01";
            if (p.SvgUID == "")
            {
                return;
            }
            IList l2 = UCDeviceBase.DataService.GetList("SelectPSPDEVBySvgUIDAndType", p);

            for (int i = 0; i < l2.Count; i++)
            {
                PSPDEV _dev1 = (PSPDEV)l2[i];
                string _sql  = " where (IName='" + _dev1.Name + "' or JName='" + _dev1.Name + "') and type='05' and ProjectID='" + Itop.Client.MIS.ProgUID + "' ";
                IList  l3    = UCDeviceBase.DataService.GetList("SelectPSPDEVByCondition", _sql);
                for (int j = 0; j < l3.Count; j++)
                {
                    burthen = burthen + ((PSPDEV)l3[j]).Burthen;
                }
            }
            //spinEdit3.Text = burthen.ToString();
        }
コード例 #9
0
ファイル: frmGNDLine.cs プロジェクト: github188/myitoppsp
 public void InitFrm(PSPDEV dev)
 {
     if (dev == null)
     {
         textBox1.Text      = "";
         textBox2.Text      = "0";
         textBox3.Text      = "0";
         textBox4.Text      = "0";
         textBox5.Text      = "0";
         textBox6.Text      = "0";
         comboBoxEdit1.Text = "";
         comboBoxEdit2.Text = "";
         comboBoxEdit8.Text = "";
     }
     else
     {
         textBox1.Text      = dev.Name;
         textBox2.Text      = dev.LineR.ToString();
         textBox3.Text      = dev.LineTQ.ToString();
         textBox4.Text      = dev.LineGNDC.ToString();
         textBox5.Text      = dev.K.ToString();
         textBox6.Text      = dev.G.ToString();
         comboBoxEdit1.Text = dev.HuganLine1;
         comboBoxEdit2.Text = dev.HuganLine2;
         comboBoxEdit8.Text = dev.ReferenceVolt.ToString();
     }
 }
コード例 #10
0
        protected void Init()
        {
            //comboBoxEdit4.Properties.Items.Add("投产");
            //comboBoxEdit4.Properties.Items.Add("退出");
            //comboBoxEdit4.Properties.Items.Add("扩容");
            for (int i = 0; i < 30; i++)
            {
                string s = (2000 + i).ToString();
                if (!string.IsNullOrEmpty(startyear))
                {
                    s = (Convert.ToInt32(startyear) + i).ToString();
                }

                comboBoxEdit2.Properties.Items.Add(s);
                comboBoxEdit3.Properties.Items.Add(s);
                comboBoxEdit5.Properties.Items.Add(s);
            }
            //string sql = "where type='02'or type='03'and projectid='"+ Itop.Client.MIS.ProgUID+"' ORDER BY Number";
            //IList<PSPDEV> list1 = UCDeviceBase.DataService.GetList<PSPDEV>("SelectPSPDEVByCondition", sql);
            //foreach (PSPDEV ps in list1)
            //{
            //    comboBoxEdit1.Properties.Items.Add(ps.Name);
            //}
            string         sql   = "c.UID='" + rowdate.RelatetableID + "'";
            IList <string> list1 = UCDeviceBase.DataService.GetList <string>("SelectPSPDEV_byqSUID", sql);

            foreach (string ps in list1)
            {
                PSPDEV pd = new PSPDEV();
                pd.SUID = ps;
                pd      = UCDeviceBase.DataService.GetOneByKey <PSPDEV>(pd);
                comboBoxEdit1.Properties.Items.Add(pd.Name);
            }
        }
コード例 #11
0
ファイル: AddDlqiform.cs プロジェクト: github188/myitoppsp
        public void intdata(PSPDEV dev)
        {
            subsedit.Text = dev.HuganLine1;   //读取母线节点所属的变电站
            object o = new object();

            for (int i = -30; i <= 30; i++)
            {
                o = System.DateTime.Now.Year + i;
                comboBoxEdit3.Properties.Items.Add(o);
            }
            string sql  = " where  (type ='74'or type='01') and ProjectID='" + this.ProjectUID + "'";
            IList  list = Services.BaseService.GetList("SelectPSPDEVByCondition", sql);

            lookUpEdit1.Properties.DataSource = list;
            string con = " where Type ='01' and ProjectID ='" + this.ProjectUID + "' order by name";

            list = UCDeviceBase.DataService.GetList("SelectPSPDEVByCondition", con);
            foreach (PSPDEV pspdev in list)
            {
                if (comboBoxEdit4.Properties.Items.IndexOf(pspdev.Name) == -1)
                {
                    comboBoxEdit4.Properties.Items.Add(pspdev.Name);
                }
            }

            //Dlqiname.Text=
        }
コード例 #12
0
ファイル: UcPdreltype.cs プロジェクト: EdgarEDT/myitoppsp
        public void init(PSPDEV psxl)
        {
            try
            {
                if (dataTable != null)
                {
                    dataTable.Columns.Clear();
                    treeList1.Columns.Clear();
                }
                AddFixColumn();
                //Ps_pdreltype pr = new Ps_pdreltype();
                //pr.ProjectID = Itop.Client.MIS.ProgUID;
                //pr.ID = psxl.SUID;
                string con = "ID='" + psxl.SUID + "'";
                IList<Ps_pdreltype> listTypes = Services.BaseService.GetList<Ps_pdreltype>("SelectPs_pdreltypeByCon", con);
                barButtonItem1.Enabled = false;
                bar2.Visible = false;

                dataTable = Itop.Common.DataConverter.ToDataTable((IList)listTypes, typeof(Ps_pdreltype));
                treeList1.BeginInit();
                treeList1.DataSource = dataTable;

                //treeList1.Columns["Sort"].SortOrder = SortOrder.Ascending;
                treeList1.EndInit();
                Application.DoEvents();
                treeList1.ExpandAll();
            }
            catch (System.Exception ex)
            {

            }
        }
コード例 #13
0
 public void init(PSPDEV psxl)
 {
     if (psxl != null)
     {
         ucPdreltype1.init(psxl);
     }
 }
コード例 #14
0
ファイル: FrmpdrelProject.cs プロジェクト: EdgarEDT/myitoppsp
 public void init(PSPDEV psxl)
 {
     if (psxl!=null)
     {
         ucPdreltype1.init(psxl);
     }
 }
コード例 #15
0
ファイル: frmDuanlu.cs プロジェクト: github188/myitoppsp
        public void InitData(PSPDEV pspDev)
        {
            PSPDEV dev = new PSPDEV();

            dev.SvgUID = pspDev.SvgUID;
            leel       = pspDev;
        }
コード例 #16
0
ファイル: UCDevicePWB.cs プロジェクト: github188/myitoppsp
        public override void Add()
        {
            frmPWdlg dlg = new frmPWdlg();

            dlg.Name      = "";
            dlg.ProjectID = this.ProjectID;
            if (ID == "50")
            {
                dlg.Text = "配电室信息";
            }
            if (ID == "51")
            {
                dlg.Text = "箱式变信息";
            }
            if (ID == "52")
            {
                dlg.Text = "柱上变信息";
            }
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                //增加记录
                PSPDEV dev = dlg.DeviceMx;
                dev.Type      = ID;
                dev.ProjectID = this.ProjectID;
                UCDeviceBase.DataService.Create("InsertPSPDEV", dev);
                DataRow row = datatable1.NewRow();

                Itop.Common.DataConverter.ObjectToRow(dev, row);
                datatable1.Rows.Add(row);
            }
        }
コード例 #17
0
ファイル: frmMain_wj.ex.cs プロジェクト: github188/myitoppsp
        private void SetPolyLineType(XmlElement xml, PSPDEV dev)
        {
            LineType lt = new LineType();

            lt.TypeName = dev.RateVolt.ToString("###") + "kV";
            lt          = (LineType)Services.BaseService.GetObject("SelectLineTypeByTypeName", lt);
            string styleValue = "";

            if (lt != null)
            {
                if (string.IsNullOrEmpty(dev.OperationYear))
                {
                    styleValue = "stroke-dasharray:" + ghType + ";stroke-width:" + lt.ObligateField1 + ";";
                }
                else
                {
                    if (Convert.ToInt32(dev.OperationYear) > DateTime.Now.Year)
                    {
                        styleValue = "stroke-dasharray:" + ghType + ";stroke-width:" + lt.ObligateField1 + ";";
                    }
                    else
                    {
                        styleValue = "stroke-width:" + lt.ObligateField1 + ";";
                    }
                }

                //string aa= ColorTranslator.ToHtml(Color.Black);
                styleValue = styleValue + "stroke:" + ColorTranslator.ToHtml(Color.FromArgb(Convert.ToInt32(lt.Color)));
                //SvgElement se = DeviceHelper.xml1;
                xml.RemoveAttribute("style");
                xml.SetAttribute("style", styleValue);
                xml.SetAttribute("info-name", dev.Name);
            }
        }
コード例 #18
0
ファイル: frmImport.funs.cs プロジェクト: github188/myitoppsp
        /// <summary>
        /// 发电机
        /// </summary>
        /// <returns></returns>
        private IEnumerator importFDJ()
        {
            DataTable data = gridControl1.DataSource as DataTable;
            PSPDEV    dev  = new PSPDEV();

            dev.ProjectID = Itop.Client.MIS.ProgUID;
            dev.Type      = "04";
            foreach (DataRow row in data.Rows)
            {
                dev.SUID   = "psasp_fdj_" + dev.ProjectID.Substring(0, 4) + row[0].ToString();
                dev.Name   = row["ID_Name"].ToString();
                dev.Number = Convert.ToInt32(row[0]);
                dev.OutP   = Convert.ToDouble(row["Pg"]);
                dev.OutQ   = Convert.ToDouble(row["Qg"]);
                dev.SjN    = Convert.ToDouble(row["Xdp1"]);
                dev.SkN    = Convert.ToDouble(row["Xdpp1"]);
                dev.Vimax  = Convert.ToDouble(row["Pmax"]);
                dev.Vimin  = Convert.ToDouble(row["Pmin"]);
                dev.Vjmax  = Convert.ToDouble(row["Qmax"]);
                dev.Vjmin  = Convert.ToDouble(row["Qmin"]);

                dev.UnitFlag = row["Unit"].ToString();
                dev.IName    = row["Node_Name"].ToString();

                try {
                    UCDeviceBase.DataService.Create <PSPDEV>(dev);
                } catch {
                    //UCDeviceBase.DataService.Update<PSPDEV>(dev);
                }
                yield return(ncurrent++);
            }
        }
コード例 #19
0
ファイル: frmlinenew.cs プロジェクト: github188/myitoppsp
        public void InitData(PSPDEV pspDev)
        {
            PSPDEV dev = new PSPDEV();

            dev.Number      = pspDev.FirstNode;//首节点
            dev.SvgUID      = pspDev.SvgUID;
            leel.EleID      = pspDev.EleID;
            leel.SvgUID     = pspDev.SvgUID;
            leel.Name       = pspDev.Name;
            leel.LineType   = pspDev.LineType;
            leel.LineLength = pspDev.LineLength;
            leel.FirstNode  = pspDev.FirstNode;
            leel.LastNode   = pspDev.LastNode;
            leel.LineStatus = pspDev.LineStatus;
            leel.VoltR      = pspDev.VoltR;

            dev.Type = "Use";
            dev      = (PSPDEV)Services.BaseService.GetObject("SelectPSPDEVByNumberAndSvgUIDAndType", dev);
            if (dev != null)
            {
                if (dev.Name != null)
                {
                    textBox5.Text = dev.Name;
                }

                dev.Number = pspDev.LastNode;//末节点

                dev.SvgUID = pspDev.SvgUID;
                dev.Type   = "Use";

                dev = (PSPDEV)Services.BaseService.GetObject("SelectPSPDEVByNumberAndSvgUIDAndType", dev);
                if (dev.Name != null)
                {
                    textBox6.Text = dev.Name;
                }
                textBox6.Text = dev.Name;
            }
            textBox11.Text  = pspDev.LineLength.ToString(); //线路长度
            comboBox22.Text = pspDev.LineType;              //线路型号
            comboBox33.Text = pspDev.LineLevel;
            //if (comboBox33.Text == "")//单回路双回路
            //    comboBox33.Text = "单回路";
            comboBox44.Text = pspDev.LineStatus;
            if (comboBox44.Text == "")//线路状态
            {
                comboBox44.Text = "运行";
            }
            if (pspDev.Name != null)
            {
                mc.Text   = pspDev.Name;
                leel.Name = pspDev.Name;
            }

            comboBoxEdit1.Text = pspDev.VoltR.ToString();
            comboBoxEdit8.Text = pspDev.ReferenceVolt.ToString();

            textBox2.Text = pspDev.LineR.ToString();    //支路电阻
            textBox3.Text = pspDev.LineTQ.ToString();   //支路电抗
            textBox4.Text = pspDev.LineGNDC.ToString(); //支路电纳
        }
コード例 #20
0
ファイル: frmImport.funs.cs プロジェクト: github188/myitoppsp
        /// <summary>
        /// 线路
        /// </summary>
        private IEnumerator importXL()
        {
            DataTable data = gridControl1.DataSource as DataTable;
            PSPDEV    dev  = new PSPDEV();

            dev.ProjectID = Itop.Client.MIS.ProgUID;
            dev.Type      = "05";
            foreach (DataRow row in data.Rows)
            {
                dev.SUID          = "psasp_xl_" + dev.ProjectID.Substring(0, 4) + row[0].ToString();
                dev.Name          = row["ID_Name"].ToString();
                dev.LineR         = Convert.ToDouble(row["R1"]);
                dev.LineTQ        = Convert.ToDouble(row["X1"]);
                dev.LineGNDC      = Convert.ToDouble(row["B1_Half"]) * 2;
                dev.ZeroR         = Convert.ToDouble(row["R0"]);
                dev.ZeroTQ        = Convert.ToDouble(row["X0"]);
                dev.Number        = Convert.ToInt32(row[0]);
                dev.KSwitchStatus = row["Valid"].ToString() == "1" ? "0" : "1";
                dev.UnitFlag      = row["Unit"].ToString();
                dev.IName         = row["I_Name"].ToString();
                dev.JName         = row["J_Name"].ToString();
                dev.ISwitch       = row["I_Break"].ToString();
                dev.LineType      = row["type"].ToString();
                dev.JSwitch       = row["J_Break"].ToString();
                dev.ZeroGNDC      = Convert.ToDouble(row["B0_Half"]);
                dev.Burthen       = Convert.ToDecimal(row["Rate_Ka"]);
                dev.LineLength    = Convert.ToDouble(row["Length_Km"]);
                try {
                    UCDeviceBase.DataService.Create <PSPDEV>(dev);
                } catch {
                    //UCDeviceBase.DataService.Update<PSPDEV>(dev);
                }
                yield return(ncurrent++);
            }
        }
コード例 #21
0
ファイル: frmImport.funs.cs プロジェクト: github188/myitoppsp
        /// <summary>
        /// 负荷
        /// </summary>
        /// <returns></returns>
        private IEnumerator importFH()
        {
            DataTable data = gridControl1.DataSource as DataTable;
            PSPDEV    dev  = new PSPDEV();

            dev.ProjectID = Itop.Client.MIS.ProgUID;
            dev.Type      = "12";
            foreach (DataRow row in data.Rows)
            {
                dev.SUID   = "psasp_fh_" + dev.ProjectID.Substring(0, 4) + row[0].ToString();
                dev.Name   = row["ID_Name"].ToString();
                dev.Number = Convert.ToInt32(row[0]);
                dev.InPutP = Convert.ToDouble(row["Pl"]);
                dev.InPutQ = Convert.ToDouble(row["Ql"]);
                dev.VoltR  = Convert.ToDouble(row["V0"]);
                dev.VoltV  = Convert.ToDouble(row["Angle"]);

                dev.KSwitchStatus = row["Valid"].ToString() == "1" ? "0" : "1";
                dev.UnitFlag      = row["Unit"].ToString();
                dev.IName         = row["Node_Name"].ToString();

                try {
                    UCDeviceBase.DataService.Create <PSPDEV>(dev);
                } catch {
                }
                yield return(ncurrent++);
            }
        }
コード例 #22
0
ファイル: frmImport.funs.cs プロジェクト: github188/myitoppsp
        /// <summary>
        /// 母线
        /// </summary>
        private IEnumerator importMX()
        {
            DataTable data = gridControl1.DataSource as DataTable;
            PSPDEV    dev  = new PSPDEV();

            dev.ProjectID = Itop.Client.MIS.ProgUID;
            dev.Type      = "01";
            foreach (DataRow row in data.Rows)
            {
                dev.SUID   = "psasp_mx_" + dev.ProjectID.Substring(0, 4) + row[0].ToString();
                dev.Name   = row["bus_name"].ToString();
                dev.Number = Convert.ToInt32(row[0]);
                Type t = row["SC3_MVA"].GetType();

                dev.Burthen = Convert.ToDecimal(row["SC3_MVA"]);

                dev.ReferenceVolt = (double)row["Base_kV"];
                try {
                    UCDeviceBase.DataService.Create <PSPDEV>(dev);
                    //break;
                } catch (Exception e) {
                    //UCDeviceBase.DataService.Update<PSPDEV>(dev);
                }
                yield return(ncurrent++);
            }
        }
コード例 #23
0
 public frmTwoTra(PSPDEV dev, string svgDocumentUID)
 {
     svgUID = svgDocumentUID;
     InitializeComponent();
     InitData(dev);
     InitCom();
 }
コード例 #24
0
ファイル: frmGNDLine.cs プロジェクト: github188/myitoppsp
 private void simpleButton1_MouseDown(object sender, MouseEventArgs e)
 {
     if (textBox1.Text == "")
     {
         MessageBox.Show("名称不能为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     else
     {
         PSPDEV pspName = new PSPDEV();
         pspName.Name   = textBox1.Text;
         pspName.SvgUID = localsvgUID;
         pspName.Type   = "TransformLine";
         IList listName = Services.BaseService.GetList("SelectPSPDEVByName", pspName);
         pspName.Type = "PolyLine";
         IList listName1 = Services.BaseService.GetList("SelectPSPDEVByName", pspName);
         if (listName.Count > 1 || (listName.Count == 1 && (((PSPDEV)listName[0]).SUID) != leel.SUID) || listName1.Count > 1 || (listName1.Count == 1 && ((PSPDEV)listName1[0]).EleID != leel.EleID))
         {
             MessageBox.Show("名称已存在!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
             return;
         }
         else
         {
             simpleButton1.DialogResult = DialogResult.OK;
         }
     }
 }
コード例 #25
0
ファイル: ImportJxt2.cs プロジェクト: EdgarEDT/myitoppsp
 private PSPDEV createline(SvgElement element)
 {
     PSPDEV pspDev = new PSPDEV();
     pspDev.SUID = Guid.NewGuid().ToString();
     pspDev.EleID = element.ID;
     pspDev.SvgUID = svgid;
     PSPDEV pspDev2 = (PSPDEV)Services.BaseService.GetObject("SelectPSPDEVBySvgUIDandEleID", pspDev);
     if (pspDev2 == null) {
         pspDev.Number = -1;
         pspDev.FirstNode = -1;
         pspDev.LastNode = -1;
         pspDev.Type = "Polyline";
         pspDev.Lable = "֧·";
         pspDev.Name = element.GetAttribute("info-name");
         IList list = Services.BaseService.GetList("SelectLineInfoByWhere", "eleid='" + pspDev.EleID + "'");
         if (list.Count > 0) {
             LineInfo line = list[0] as LineInfo;
             pspDev.Name = line.LineName;
             pspDev.VoltR = double.Parse(line.Voltage);
             pspDev.LineStatus = line.ObligateField1;
             try {
                 pspDev.LineLength = double.Parse(line.Length);
             } catch { }
             pspDev.LineType = line.LineType;
         }
         Services.BaseService.Create<PSPDEV>(pspDev);
     } else {
         pspDev = pspDev2;
     }
     return pspDev;
 }
コード例 #26
0
        private void InitCom()
        {
            PSPDEV psp = new PSPDEV();

            psp.SvgUID = UID;
            psp.Lable  = "母线节点";
            psp.Type   = "Use";
            IList list = Services.BaseService.GetList("SelectPSPDEVBySvgUIDandLableandType", psp);

            psp.SvgUID = UID;
            psp.Lable  = "负荷支路";
            psp.Type   = "loadline";
            IList list1 = Services.BaseService.GetList("SelectPSPDEVBySvgUIDandLableandType", psp);

            psp.SvgUID = UID;
            psp.Lable  = "支路";
            psp.Type   = "Polyline";
            IList list2 = Services.BaseService.GetList("SelectPSPDEVBySvgUIDandLableandType", psp);

            foreach (PSPDEV dev in list)
            {
                comboBoxEdit1.Properties.Items.Add(dev.Name);
                comboBoxEdit6.Properties.Items.Add(dev.Name);
            }
            foreach (PSPDEV dev in list1)
            {
                comboBoxEdit3.Properties.Items.Add(dev.Name);
                comboBoxEdit4.Properties.Items.Add(dev.Name);
            }
            foreach (PSPDEV dev in list2)
            {
                comboBoxEdit2.Properties.Items.Add(dev.Name);
                comboBoxEdit5.Properties.Items.Add(dev.Name);
            }
        }
コード例 #27
0
        private PSPDEV createsub(SvgElement element)
        {
            PSPDEV pspDev = new PSPDEV();

            pspDev.SUID   = Guid.NewGuid().ToString();
            pspDev.EleID  = element.ID;
            pspDev.SvgUID = svgid;
            PSPDEV pspDev2 = (PSPDEV)Services.BaseService.GetObject("SelectPSPDEVBySvgUIDandEleID", pspDev);

            if (pspDev2 == null)
            {
                pspDev.Number    = -1;
                pspDev.FirstNode = -1;
                pspDev.LastNode  = -1;
                pspDev.Type      = "Use";
                pspDev.Lable     = "变电站";
                pspDev.Name      = element.GetAttribute("info-name");
                IList list = Services.BaseService.GetList("SelectsubstationByWhere", "eleid='" + pspDev.EleID + "'");
                if (list.Count > 0)
                {
                    substation sub = list[0] as substation;
                    pspDev.Name    = sub.EleName;
                    pspDev.VoltR   = double.Parse(sub.ObligateField1); //电压
                    pspDev.Burthen = sub.Number;                       //容量
                }
                Services.BaseService.Create <PSPDEV>(pspDev);
            }
            else
            {
                pspDev = pspDev2;
            }
            return(pspDev);
        }
コード例 #28
0
ファイル: frmSubstation.cs プロジェクト: github188/myitoppsp
        private void simpleButton1_MouseDown(object sender, MouseEventArgs e)
        {
            if (mc.Text == "")
            {
                MessageBox.Show("名称不能为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                PSPDEV pspName = new PSPDEV();
                pspName.Name   = mc.Text;
                pspName.SvgUID = leel.SvgUID;
                pspName.Type   = "Use";
                IList listName = Services.BaseService.GetList("SelectPSPDEVByName", pspName);
                if (listName.Count > 1 || (listName.Count == 1 && ((PSPDEV)listName[0]).EleID != leel.EleID))
                {
                    MessageBox.Show("名称已存在!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
                else
                {
                    simpleButton1.DialogResult = DialogResult.OK;
                }
            }

            //frmSubstation dlg = new frmSubstation();
            //return;
        }
コード例 #29
0
        public override void Edit()
        {
            frmZXdlg dlg = new frmZXdlg();
            DataRow  row = gridView1.GetDataRow(gridView1.FocusedRowHandle);

            if (row != null)
            {
                PSPDEV dev = Itop.Common.DataConverter.RowToObject <PSPDEV>(row);


                dlg.DeviceMx  = dev;
                dlg.ProjectID = dev.ProjectID;
                Stream fs = Assembly.GetExecutingAssembly().GetManifestResourceStream("Itop.TLPSP.DEVICE.devicetypes.xml");
                //Assembly.GetExecutingAssembly().GetManifestResourceStream
                XmlDocument xml = new XmlDocument();
                xml.Load(fs);
                XmlNode node = xml.SelectSingleNode("devicetype/*[@id='" + ID + "']");
                dlg.Text = "支线信息";
                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    //更新记录
                    dev           = dlg.DeviceMx;
                    dev.ProjectID = this.ProjectID;
                    dev.Type      = ID;
                    UCDeviceBase.DataService.Update <PSPDEV>(dev);

                    Itop.Common.DataConverter.ObjectToRow(dev, row);
                }
            }
        }
コード例 #30
0
ファイル: frmDHXdlg.cs プロジェクト: github188/myitoppsp
 private void simpleButton3_Click(object sender, EventArgs e)
 {
     try
     {
         if (p != null)
         {
             p.X1    = Convert.ToDouble(text1.Value);
             p.Y1    = Convert.ToDouble(text2.Value);
             p.Lable = comboBox1.Text;
             p.Type  = "555";
             lines   = lines.Replace("'", "@");
             p.Name  = lines;
             Services.BaseService.Update <PSPDEV>(p);
         }
         else
         {
             p       = new PSPDEV();
             p.SUID  = Guid.NewGuid().ToString();
             p.X1    = Convert.ToDouble(text1.Value);
             p.Y1    = Convert.ToDouble(text2.Value);
             p.Lable = comboBox1.Text;
             p.EleID = uid;
             p.Type  = "555";
             lines   = lines.Replace("'", "@");
             p.Name  = lines;
             Services.BaseService.Create <PSPDEV>(p);
         }
     }
     catch { }
     this.Close();
 }
コード例 #31
0
ファイル: frmlinenew.cs プロジェクト: github188/myitoppsp
        public frmLinenew(PSPDEV pspDev)
        {
            InitializeComponent();
            mc.Select();
            WireCategory wirewire = new WireCategory();

            wirewire.WireLevel = pspDev.VoltR.ToString();
            IList list1 = Services.BaseService.GetList("SelectWireCategoryListBYWireLevel", wirewire);

            foreach (WireCategory sub in list1)
            {
                comboBox22.Properties.Items.Add(sub.WireType);
            }
            InitData(pspDev);
            this.comboBox22.SelectedIndexChanged += new System.EventHandler(this.comboBox22_SelectedIndexChanged);
            this.textBox11.Leave       += new System.EventHandler(this.textBox11_Leave);
            this.textBox11.TextChanged += new System.EventHandler(this.textBox11_TextChanged);
            this.comboBoxEdit1.SelectedIndexChanged += new System.EventHandler(this.comboBoxEdit1_SelectedIndexChanged);
            this.comboBoxEdit1.Leave += new System.EventHandler(this.comboBoxEdit1_Leave);
            object[] o = new object[30];

            for (int i = 0; i < 30; i++)
            {
                o[i] = 2009 + i;
            }
            this.tyear.Properties.Items.AddRange(o);
            //this.tyear.Visible = false;
        }
コード例 #32
0
ファイル: UCDeviceRDQ.cs プロジェクト: github188/myitoppsp
        public override void Add()
        {
            frmRDQdlg dlg = new frmRDQdlg();

            dlg.Name      = "";
            dlg.ProjectID = this.ProjectID;
            Stream fs = Assembly.GetExecutingAssembly().GetManifestResourceStream("Itop.TLPSP.DEVICE.devicetypes.xml");
            //Assembly.GetExecutingAssembly().GetManifestResourceStream
            XmlDocument xml = new XmlDocument();

            xml.Load(fs);
            XmlNode node = xml.SelectSingleNode("devicetype/*[@id='" + ID + "']");

            dlg.Text = "支线信息";

            if (dlg.ShowDialog() == DialogResult.OK)
            {
                //增加记录
                PSPDEV dev = dlg.DeviceMx;
                dev.Type      = ID;
                dev.ProjectID = this.ProjectID;
                UCDeviceBase.DataService.Create("InsertPSPDEV", dev);
                DataRow row = datatable1.NewRow();

                Itop.Common.DataConverter.ObjectToRow(dev, row);
                datatable1.Rows.Add(row);
            }
        }
コード例 #33
0
ファイル: frmCapacity.cs プロジェクト: github188/myitoppsp
        private void InitCom()
        {
            PSPDEV psp = new PSPDEV();

            psp.SvgUID = UID;
            psp.Lable  = "母线节点";
            psp.Type   = "Use";
            IList list = Services.BaseService.GetList("SelectPSPDEVBySvgUIDandLableandType", psp);

            foreach (PSPDEV dev in list)
            {
                busclass bus = new busclass(dev.Number, dev.Name);
                comboBoxEdit1.Properties.Items.Add(bus);
                // comboBoxEdit2.Properties.Items.Add(bus);
            }
            PSPDEV pspDev = new PSPDEV();

            pspDev.Type   = "Polyline";
            pspDev.SvgUID = UID;
            pspDev.Lable  = "支路";
            IList list1 = Services.BaseService.GetList("SelectPSPDEVBySvgUIDandLableandType", pspDev);

            foreach (PSPDEV dev in list1)
            {
                busclass bus = new busclass(dev.Number, dev.Name);
                comboBoxEdit6.Properties.Items.Add(bus);
                // comboBoxEdit2.Properties.Items.Add(bus);
            }
            //psp.SvgUID=UID;
            //psp.Type = "";
        }
コード例 #34
0
ファイル: frmGProList.cs プロジェクト: EdgarEDT/myitoppsp
        private void gridView_DoubleClick(object sender, EventArgs e)
        {
            List<LineInfo> clist =new List<LineInfo>();
            clist.Clear();
            LineInfo a = gridView.GetRow(this.gridView.FocusedRowHandle) as LineInfo;
            PSPDEV psp = new PSPDEV();
            psp.SvgUID = a.SvgUID;
            psp.Type = "Polyline";
            IList list1 = Services.BaseService.GetList("SelectPSPDEVBySvgUIDAndType", psp);
            if (a.ObligateField1=="�������ܹ滮")
            {
                for (int i = 0; i < list1.Count;i++ )
                {
                    LineInfo l1 = new LineInfo();
                    psp = list1[i] as PSPDEV;
                    if (psp.LineStatus=="�ȴ�")
                    {

                        l1.EleID = psp.EleID;
                        l1.ObligateField2 = psp.Name;
                        l1.ObligateField3 = "��̭";
                        clist.Add(l1);
                    }
                    else if (psp.LineStatus=="��ѡ")
                    {
                        l1.EleID = psp.EleID;
                        l1.ObligateField2 = psp.Name;
                        l1.ObligateField3 = "��ѡ";
                        clist.Add(l1);
                    }
                }
            }
            else
            {
                for (int i = 0; i < list1.Count; i++)
                {
                    LineInfo l1 = new LineInfo();
                    psp = list1[i] as PSPDEV;
                    if (psp.LineStatus == "�ȴ�")
                    {

                        l1.EleID = psp.EleID;
                        l1.ObligateField2 = psp.Name;
                        l1.ObligateField3 = "��ѡ";
                        clist.Add(l1);
                    }
                    else if (psp.LineStatus == "��ѡ")
                    {
                        l1.EleID = psp.EleID;
                        l1.ObligateField2 = psp.Name;
                        l1.ObligateField3 = "����";
                        clist.Add(l1);
                    }
                }
            }
            FormGXXlist gxx = new FormGXXlist();
            gxx.gridview.GroupPanelText = a.ObligateField1+"��·���";
            gxx.Show();
            gxx.LoadData(clist);
        }
コード例 #35
0
        public void init(PSPDEV psxl)
        {
            try
            {
                if (dataTable != null)
                {
                    dataTable.Columns.Clear();
                    treeList1.Columns.Clear();
                }
                AddFixColumn();
                //Ps_pdreltype pr = new Ps_pdreltype();
                //pr.ProjectID = Itop.Client.MIS.ProgUID;
                //pr.ID = psxl.SUID;
                string con = "ID='" + psxl.SUID + "'";
                IList <Ps_pdreltype> listTypes = Services.BaseService.GetList <Ps_pdreltype>("SelectPs_pdreltypeByCon", con);
                barButtonItem1.Enabled = false;
                bar2.Visible           = false;

                dataTable = Itop.Common.DataConverter.ToDataTable((IList)listTypes, typeof(Ps_pdreltype));
                treeList1.BeginInit();
                treeList1.DataSource = dataTable;

                //treeList1.Columns["Sort"].SortOrder = SortOrder.Ascending;
                treeList1.EndInit();
                Application.DoEvents();
                treeList1.ExpandAll();
            }
            catch (System.Exception ex)
            {
            }
        }
コード例 #36
0
        public void InitData(string svgUID)
        {
            PSPDEV pspDev = new PSPDEV();

            pspDev.SvgUID = svgUID;
            pspDev.Type   = "Polyline";
            pspDev.Lable  = "支路";
            IList list = Services.BaseService.GetList("SelectPSPDEVBySvgUIDandLableandType", pspDev);

            foreach (PSPDEV dev in list)
            {
                if (dev.HuganLine1 == null)
                {
                    dev.HuganLine1 = "";
                }
                if (dev.HuganLine2 == null)
                {
                    dev.HuganLine2 = "";
                }
                if (dev.HuganLine3 == null)
                {
                    dev.HuganLine3 = "";
                }
                if (dev.HuganLine4 == null)
                {
                    dev.HuganLine4 = "";
                }
                if (dev.LineType == null)
                {
                    dev.LineType = "";
                }
                if (!huganLine1DataGridViewTextBoxColumn.Items.Contains(dev.HuganLine1))
                {
                    dev.HuganLine1 = "";
                }
                if (!huganLine2DataGridViewTextBoxColumn.Items.Contains(dev.HuganLine2))
                {
                    dev.HuganLine2 = "";
                }
                if (!huganLine3DataGridViewTextBoxColumn.Items.Contains(dev.HuganLine3))
                {
                    dev.HuganLine3 = "";
                }
                if (!huganLine4DataGridViewTextBoxColumn.Items.Contains(dev.HuganLine4))
                {
                    dev.HuganLine4 = "";
                }
                if (!lineTypeDataGridViewTextBoxColumn.Items.Contains(dev.LineType))
                {
                    dev.LineType = "";
                }
                dev.LineLevel = dev.VoltR.ToString() + "KV";
                Services.BaseService.Update <PSPDEV>(dev);
            }
            list = Services.BaseService.GetList("SelectPSPDEVBySvgUIDandLableandType", pspDev);
            DataTable dt = Itop.Common.DataConverter.ToDataTable(list, typeof(PSPDEV));

            dataGridView1.DataSource = dt;
        }
コード例 #37
0
ファイル: UCDeviceDX.cs プロジェクト: EdgarEDT/myitoppsp
 public override void Add()
 {
     frmDXdlg dlg = new frmDXdlg();
     dlg.ProjectSUID = this.ProjectID;
     dlg.newflag = true;
     dlg.Name = "";
     PSPDEV p = new PSPDEV();
     p.ProjectID = this.ProjectID;
     p.JName = ParentID;
     dlg.DeviceMx = p;
     if (dlg.ShowDialog() == DialogResult.OK) {
         //���Ӽ�¼
         PSPDEV dev = dlg.DeviceMx;
         dev.ProjectID = this.ProjectID;
         UCDeviceBase.DataService.Create("InsertPSPDEV", dev);
         if (dev.NodeType == "0")
         {
             dev.NodeType = "ƽ��ڵ�";
         }
         else if (dev.NodeType == "1")
         {
             dev.NodeType = "PQ�ڵ�";
         }
         else if (dev.NodeType == "2")
         {
             dev.NodeType = "PV�ڵ�";
         }
         else
         {
             dev.NodeType = null;
         }
         if (dev.KSwitchStatus == "1")
         {
             dev.KSwitchStatus = "�˳�����";
         }
         else
         {
             dev.KSwitchStatus = "Ͷ������";
         }
         if (dev.UnitFlag == "0")
         {
             dev.UnitFlag = "p.u.";
         }
         else
         {
             if (dev.Type == "01" || dev.Type == "04" || dev.Type == "12")
             {
                 dev.UnitFlag = "kV/MW/MVar";
             }
             else
             {
                 dev.UnitFlag = "Ohm/10-6Siem";
             }
         }
         DataRow row=datatable1.NewRow();
         Itop.Common.DataConverter.ObjectToRow(dev, row);
         datatable1.Rows.Add(row);
     }
 }
コード例 #38
0
        /// <summary>
        ///线路首末节点号进行更新
        /// </summary>
        public override void UpdateNumber()
        {
            try
            {
                if (updatenumberflag)
                {
                    con = "where projectid='" + Itop.Client.MIS.ProgUID + "' and Type='08'";

                    IList list = UCDeviceBase.DataService.GetList("SelectPSPDEVByCondition", con);
                    foreach (PSPDEV dev in list)
                    {
                        string iname = dev.IName;
                        if (iname != null)
                        {
                            con = "where projectid='" + Itop.Client.MIS.ProgUID + "'and type='05'and name='" + iname + "'";
                            PSPDEV psp = (PSPDEV)UCDeviceBase.DataService.GetObject("SelectPSPDEVByCondition", con);
                            if (psp != null)
                            {
                                dev.FirstNode     = psp.FirstNode;
                                dev.LastNode      = psp.LastNode;
                                dev.RateVolt      = psp.RateVolt;
                                dev.ReferenceVolt = psp.ReferenceVolt;
                            }
                        }
                        UCDeviceBase.DataService.Update <PSPDEV>(dev);
                    }
                    Init();
                    MessageBox.Show("更新完成!");
                }
                else
                {
                    con = ",psp_elcdevice where psp_elcdevice.devicesuid = pspdev.suid and psp_elcdevice.projectsuid = '" + projectdeviceid + "' and pspdev.Type='08'";

                    IList list = UCDeviceBase.DataService.GetList("SelectPSPDEVByCondition", con);
                    foreach (PSPDEV dev in list)
                    {
                        string iname = dev.IName;
                        if (iname != null)
                        {
                            con = ",psp_elcdevice where psp_elcdevice.devicesuid = pspdev.suid and psp_elcdevice.projectsuid = '" + projectdeviceid + "'and pspdev.type='05'and pspdev.name='" + iname + "'";
                            PSPDEV psp = (PSPDEV)UCDeviceBase.DataService.GetObject("SelectPSPDEVByCondition", con);
                            if (psp != null)
                            {
                                dev.FirstNode     = psp.FirstNode;
                                dev.LastNode      = psp.LastNode;
                                dev.RateVolt      = psp.RateVolt;
                                dev.ReferenceVolt = psp.ReferenceVolt;
                            }
                        }
                        UCDeviceBase.DataService.Update <PSPDEV>(dev);
                    }
                    Init();
                    MessageBox.Show("更新完成!");
                }
            }
            catch (System.Exception ex)
            {
            }
        }
コード例 #39
0
 public BelonSubstationfrm(PSPDEV pspDEV)
 {
     InitializeComponent();
     if (pspDEV.HuganLine1!=null)
     {
         mc.Text = pspDEV.HuganLine1;
     }
 }
コード例 #40
0
ファイル: frmGNDLine.cs プロジェクト: EdgarEDT/myitoppsp
 public frmGNDLine(string svg,PSPDEV psp)
 {
     leel = psp;
     localsvgUID = svg;
     InitializeComponent();
     InitData(svg);
     InitFrm(psp);
 }
コード例 #41
0
ファイル: DefineDelform.cs プロジェクト: EdgarEDT/myitoppsp
        //����ͼ���SvgUID
        public DefineDelform(PSPDEV pspDEV)
        {
            InitializeComponent();
            pspulic = pspDEV;
            string strCon2 = null;
            string strCon1 = ",PSP_ELCDEVICE WHERE PSPDEV.SUID = PSP_ELCDEVICE.DeviceSUID AND PSP_ELCDEVICE.ProjectSUID = '" + pspulic.SvgUID + "'";
            strCon2 = " AND Type = '01'";
            string strCon = strCon1 + strCon2;
            IList listMX = UCDeviceBase.DataService.GetList("SelectPSPDEVByCondition", strCon);
            strCon2 = " AND Type = '05'";
            strCon = strCon1 + strCon2;
            IList listXL = UCDeviceBase.DataService.GetList("SelectPSPDEVByCondition", strCon);
            strCon2 = " AND Type = '02'";
            strCon = strCon1 + strCon2;
            IList listBYQ2 = UCDeviceBase.DataService.GetList("SelectPSPDEVByCondition", strCon);
            strCon2 = " AND Type = '03'";
            strCon = strCon1 + strCon2;
            IList listBYQ3 = UCDeviceBase.DataService.GetList("SelectPSPDEVByCondition", strCon);

              int linecount=listXL.Count;
            for (int i = 0; i < listXL.Count; i++)
            {
                pspDEV = (PSPDEV)listXL[i];
                if (pspDEV.KSwitchStatus == "0")
                {

                   // psdevclass psd = new psdevclass(pspDEV.Number,pspDEV.FirstNode,pspDEV.LastNode, pspDEV.Name);

                    this.WaitLinelist.Items.Add(new psdevclass(i+1, pspDEV.FirstNode, pspDEV.LastNode,pspDEV.Type, pspDEV.Name));

                }
            }
            int trans2count=listBYQ2.Count;
            for (int i = 0; i <listBYQ2.Count; i++)
            {
                pspDEV = (PSPDEV)listBYQ2[i];
                psdevclass psd = new psdevclass(linecount+i+1, pspDEV.FirstNode, pspDEV.LastNode,pspDEV.Type, pspDEV.Name);
                this.WaitLinelist.Items.Add(psd);
            }
            //psp.Lable = "ĸ�߽ڵ�";
            for (int i = 0; i < listBYQ3.Count; i++)
            {
                pspDEV = (PSPDEV)listBYQ3[i];
                psdevclass psdi = new psdevclass(linecount+trans2count+i+1, pspDEV.FirstNode, pspDEV.LastNode, pspDEV.Type, pspDEV.Name+"i");
                psdevclass psdj = new psdevclass(linecount + trans2count + i + 2, pspDEV.FirstNode, pspDEV.Flag, pspDEV.Type, pspDEV.Name + "j");
                psdevclass psdk = new psdevclass(linecount + trans2count + i + 3, pspDEV.LastNode, pspDEV.Flag, pspDEV.Type, pspDEV.Name + "k");
                this.WaitLinelist.Items.Add(psdi);
                this.WaitLinelist.Items.Add(psdj);
                this.WaitLinelist.Items.Add(psdk);
            }
            foreach (PSPDEV dev in listMX)
            {
                comboBoxEdit1.Properties.Items.Add(dev.Name);
                //comboBoxEdit2.Properties.Items.Add(dev.Name);
            }
        }
コード例 #42
0
ファイル: frmGNDLineParam.cs プロジェクト: EdgarEDT/myitoppsp
        public void InitData()
        {
            PSPDEV pspDev = new PSPDEV();
            pspDev.SvgUID = svgUID;
            pspDev.Type = "GNDLine";
            IList list = Services.BaseService.GetList("SelectPSPDEVBySvgUIDAndType", pspDev);
            DataTable dt = Itop.Common.DataConverter.ToDataTable(list, typeof(PSPDEV));

            dataGridView1.DataSource = dt;
        }
コード例 #43
0
ファイル: UCDevicePWFHZL.cs プロジェクト: EdgarEDT/myitoppsp
        public override void Add()
        {
            frmFHZLdlg dlg = new frmFHZLdlg();
            if (ID == "63" || ID == "64")
            {
                dlg.SetEnable();
            }
            dlg.ParentID = ParentID;
            dlg.Name = "";
            dlg.ProjectID = this.ProjectID;
            PSPDEV pd = new PSPDEV();
            pd.AreaID = ParentID;
            pd.ProjectID = ProjectID;

            Stream fs = Assembly.GetExecutingAssembly().GetManifestResourceStream("Itop.TLPSP.DEVICE.devicetypes.xml");
            //Assembly.GetExecutingAssembly().GetManifestResourceStream
            XmlDocument xml = new XmlDocument();
            xml.Load(fs);
            XmlNode node = xml.SelectSingleNode("devicetype/*[@id='" + ID + "']");
            if (ID!=null)
            {
                dlg.Text = node.Attributes["name"].Value.ToString() + "��Ϣ";
            }
            dlg.DeviceMx = pd;
            //if(ID=="55"){
            //    dlg.Text = "����վ��Ϣ";
            //}
            //if (ID == "56")
            //{
            //    dlg.Text = "��������Ϣ";
            //}
            //if (ID == "57")
            //{
            //    dlg.Text = "���Ͽ�����Ϣ";
            //}
            //if (ID == "58")
            //{
            //    dlg.Text = "���·�֧����Ϣ";
            //}
            //if (ID == "59")
            //{
            //    dlg.Text = "���ɿ�����Ϣ";
            //}
            if (dlg.ShowDialog() == DialogResult.OK) {
                //���Ӽ�¼
                PSPDEV dev = dlg.DeviceMx;
                dev.Type = ID;
                dev.ProjectID = this.ProjectID;
                UCDeviceBase.DataService.Create("InsertPSPDEV", dev);
                DataRow row=datatable1.NewRow();

                Itop.Common.DataConverter.ObjectToRow(dev, row);
                datatable1.Rows.Add(row);
            }
        }
コード例 #44
0
ファイル: PartRelform.cs プロジェクト: EdgarEDT/myitoppsp
        public PartRelform(PSPDEV pspDEV)
        {
            InitializeComponent();
            leel = pspDEV;
            //WireCategory wirewire = new WireCategory();
            //IList list1 = Services.BaseService.GetList("SelectWireCategoryList", wirewire);
            //foreach (WireCategory sub in list1)
            //{

            //}
        }
コード例 #45
0
ファイル: frmVoltLimit.cs プロジェクト: EdgarEDT/myitoppsp
 void dataGridView1_CellValueChanged(object sender, DataGridViewCellEventArgs e)
 {
     DataTable dt = dataGridView1.DataSource as DataTable;
     DataGridViewRow td =dataGridView1.CurrentRow;
     DataRow dr = dt.Rows[e.RowIndex];
     string guid = td.Cells["sUIDDataGridViewTextBoxColumn"].Value.ToString();
     string guid2 = td.Cells["voltRDataGridViewTextBoxColumn"].Value.ToString();
     string fadiansc = td.Cells["outPDataGridViewTextBoxColumn"].Value.ToString();
     string outq=td.Cells["outQDataGridViewTextBoxColumn"].Value.ToString();
     string inputp = td.Cells["inPutPDataGridViewTextBoxColumn"].Value.ToString();
     string intputq = td.Cells["inPutQDataGridViewTextBoxColumn"].Value.ToString();
     string bt = td.Cells["burthenDataGridViewTextBoxColumn"].Value.ToString();
     string Vmin=td.Cells["iV"].Value.ToString();
     string Vmax=td.Cells["jV"].Value.ToString();
     //string outq = td.Cells["outQDataGridViewTextBoxColumn"].Value.ToString();
     if (dr!=null)
     {
         PSPDEV temp = new PSPDEV();
         temp.SUID = guid;
         temp = (PSPDEV)Services.BaseService.GetObject("SelectPSPDEVByKey", temp);
         if (guid2 == "")
             guid2 = "0";
         if (fadiansc == "")
             fadiansc = "0";
         if (outq == "")
             outq = "0";
         if (inputp == "")
             inputp = "0";
         if (intputq == "")
             intputq = "0";
         if (bt == "")
             bt = "0";
         if (Vmin == "")
         {
             Vmin = "0";
         }
         if (Vmax == "")
         {
             Vmax = "0";
         }
         temp.VoltR = Convert.ToDouble(guid2);
         temp.OutP = Convert.ToDouble(fadiansc);
         temp.OutQ = Convert.ToDouble(outq);
         temp.InPutP = Convert.ToDouble(inputp);
         temp.InPutQ = Convert.ToDouble(intputq);
         temp.Burthen = Convert.ToDecimal(bt);
         temp.iV = Convert.ToDouble(Vmin);
         temp.jV = Convert.ToDouble(Vmax);
         Services.BaseService.Update<PSPDEV>(temp);
     }
 }
コード例 #46
0
ファイル: frmLineParamDL.cs プロジェクト: EdgarEDT/myitoppsp
        public frmLineParamDL(string svgUID)
        {
            InitializeComponent();
            dataGridView1.DataError += new DataGridViewDataErrorEventHandler(dataGridView1_DataError);
            dataGridView1.CellValueChanged += new DataGridViewCellEventHandler(dataGridView1_CellValueChanged);

            WireCategory wirewire = new WireCategory();
            IList list1 = Services.BaseService.GetList("SelectWireCategoryList", wirewire);
            IList list2 = Services.BaseService.GetList("SelectWireCategoryList", wirewire);
            list2.Clear();
            foreach (WireCategory sub in list1)
            {
                list2.Add(sub);
                lineTypeDataGridViewTextBoxColumn.Items.Add(sub.WireType);
                int i = 1;
                foreach (WireCategory sub2 in list2)
                {
                    if (sub2.WireType == sub.WireType)
                    {
                        i++;
                        if (i > 2)
                            lineTypeDataGridViewTextBoxColumn.Items.Remove(sub.WireType);
                        //list2.Remove(sub2);
                    }
                }
                Refresh();
            }
            PSPDEV dev = new PSPDEV();
            //dev.Number = pspDev.FirstNode;
            dev.SvgUID = svgUID;
            dev.Type = "Polyline";
            IList list = Services.BaseService.GetList("SelectPSPDEVBySvgUIDAndType", dev);
            foreach (PSPDEV sub in list)
            {
                if (sub.Lable == "֧·")
                {
                    huganLine1DataGridViewTextBoxColumn.Items.Add(sub.Name);
                    huganLine2DataGridViewTextBoxColumn.Items.Add(sub.Name);
                    huganLine3DataGridViewTextBoxColumn.Items.Add(sub.Name);
                    huganLine4DataGridViewTextBoxColumn.Items.Add(sub.Name);
                }
            }
            InitData(svgUID);
            //huganLine1DataGridViewTextBoxColumn.Items.Add(" ");
            //huganLine2DataGridViewTextBoxColumn.Items.Add(" ");
            //huganLine3DataGridViewTextBoxColumn.Items.Add(" ");
            //huganLine4DataGridViewTextBoxColumn.Items.Add(" ");
        }
コード例 #47
0
ファイル: frmDHXdlg.cs プロジェクト: EdgarEDT/myitoppsp
 public void LoadData(string id)
 {
     string sql = " where EleID='" + id + "' and type='555'";
     p = (PSPDEV)Services.BaseService.GetObject("SelectPSPDEVByCondition", sql);
     if(p!=null){
         text1.Text = p.X1.ToString();
         comboBox1.Text = p.Lable;
         text2.Text = p.Y1.ToString();
         //comboBox2.Text = p.RateVolt.ToString();
         if(p.Name!=""){
             lines = p.Name;
             lines = lines.Replace("@", "'");
             LoadGrid();
         }
     }
 }
コード例 #48
0
ファイル: frmFadejieDL.cs プロジェクト: EdgarEDT/myitoppsp
        public void InitData(string svgUID)
        {
            PSPDEV pspDev = new PSPDEV();
            pspDev.SvgUID = svgUID;
            pspDev.Type = "dynamotorline";
            pspDev.Lable = "���糧֧·";
            IList list = Services.BaseService.GetList("SelectPSPDEVBySvgUIDandLableandType", pspDev);
            DataTable dt = Itop.Common.DataConverter.ToDataTable(list, typeof(PSPDEV));
            pspDev.Type = "gndline";
            pspDev.Lable = "�ӵ�֧·";
            IList list2 = Services.BaseService.GetList("SelectPSPDEVBySvgUIDandLableandType", pspDev);

            DataTable dt2 = Itop.Common.DataConverter.ToDataTable(list2, typeof(PSPDEV));
            dt.Merge(dt2);
            dataGridView1.DataSource = dt;
        }
コード例 #49
0
ファイル: frmSubstation.cs プロジェクト: EdgarEDT/myitoppsp
 public frmSubstation(PSPDEV pspDev)
 {
     InitializeComponent();
     InitData(pspDev);
     mc.Select();
     //B8D2F8
     //this.textBox7.TextChanged += new System.EventHandler(this.textBox7_TextChanged);
     this.textBox4.TextChanged += new System.EventHandler(this.textBox4_TextChanged);
     this.textBox7.Leave += new EventHandler(textBox7_Leave);
     object[] o = new object[30];
     for (int i = 0; i < 30; i++)
     {
         o[i] = 2009 + i;
     }
     this.tyear.Properties.Items.AddRange(o);
 }
コード例 #50
0
ファイル: frmFadejie.cs プロジェクト: EdgarEDT/myitoppsp
 public frmFadejie(string svgDocumentUID)
 {
     SvgUID = svgDocumentUID;
     InitializeComponent();
     textBox1.Text = null;
     textBox1.Select();
     PSPDEV psp = new PSPDEV();
     psp.SvgUID = SvgUID;
     psp.Lable = "母线节点";
     psp.Type = "use";
     IList list = Services.BaseService.GetList("SelectPSPDEVBySvgUIDandLableandType", psp);
     foreach (PSPDEV dev in list)
     {
         //comboBoxEdit1.Properties.Items.Add(dev.Name);
         comboBoxEdit2.Properties.Items.Add(dev.Name);
     }
 }
コード例 #51
0
ファイル: frmLine.cs プロジェクト: EdgarEDT/myitoppsp
        public frmLine(PSPDEV pspDev)
        {
            InitializeComponent();
            mc.Select();
            WireCategory wirewire = new WireCategory();
            wirewire.WireLevel = pspDev.VoltR.ToString();
            IList list1 = Services.BaseService.GetList("SelectWireCategoryListBYWireLevel", wirewire);
            foreach (WireCategory sub in list1)
            {
                comboBox22.Properties.Items.Add(sub.WireType);
            }
            InitData(pspDev);
            this.comboBox22.SelectedIndexChanged += new System.EventHandler(this.comboBox22_SelectedIndexChanged);
            this.comboBoxEdit5.SelectedIndexChanged += new System.EventHandler(this.comboBoxEdit5_SelectedIndexChanged);

            this.textBox11.Leave += new System.EventHandler(this.textBox11_Leave);
            this.textBox11.TextChanged += new System.EventHandler(this.textBox11_TextChanged);
        }
コード例 #52
0
ファイル: chaoliuResult.cs プロジェクト: EdgarEDT/myitoppsp
        public void InitData(string svgUID)
        {
            PSPDEV pspDev = new PSPDEV();
            pspDev.SvgUID = svgUID;
            pspDev.Type = "Polyline";
            IList list = Services.BaseService.GetList("SelectPSPDEVBySvgUIDAndType", pspDev);
            foreach (PSPDEV dev in list)
            {
                if (dev.LineType != null)
                {
                    //if (!lineTypeDataGridViewTextBoxColumn.Items.Contains(dev.LineType))
                    //{
                    //    dev.LineType = "";
                    //}
                }
                Services.BaseService.Update<PSPDEV>(dev);
            }
            list = Services.BaseService.GetList("SelectPSPDEVBySvgUIDAndType", pspDev);
            DataTable dt = Itop.Common.DataConverter.ToDataTable(list, typeof(PSPDEV));

            gridControl1.DataSource = dt;
        }
コード例 #53
0
ファイル: frmImport.funs.cs プロジェクト: EdgarEDT/myitoppsp
        /// <summary>
        /// ��Ȧ��ѹ��
        /// </summary>
        /// <returns></returns>
        private IEnumerator importBYQ2()
        {
            DataTable data = gridControl1.DataSource as DataTable;
            PSPDEV dev = new PSPDEV();
            dev.ProjectID = Itop.Client.MIS.ProgUID;
            dev.Type = "02";
            foreach (DataRow row in data.Rows) {
                dev.SUID = "psasp_byq2_" + dev.ProjectID.Substring(0, 4) + row[0].ToString();
                dev.Name = row["ID_Name"].ToString();
                dev.Number = Convert.ToInt32(row[0]);
                dev.LineR = Convert.ToDouble(row["R1"]);
                dev.LineTQ = Convert.ToDouble(row["X1"]);
                dev.LineGNDC = Convert.ToDouble(row["gm"]);
                dev.Burthen = Convert.ToDecimal(row["Rate_MVA"]);
                dev.LineLevel = row["I_Conn"].ToString();
                dev.LineType = row["J_Conn"].ToString();
                dev.BigTQ = Convert.ToDouble(row["R0"]);
                dev.SmallTQ = Convert.ToDouble(row["X0"]);
                dev.K = Convert.ToDouble(row["Tk"]);
                dev.G = Convert.ToDouble(row["Bm"]);
                //dev.KName = row["Name_3"].ToString();
                dev.KSwitchStatus = row["Valid"].ToString() == "1" ? "0" : "1";
                dev.UnitFlag = row["Unit"].ToString();
                dev.IName = row["I_Name"].ToString();
                dev.JName = row["J_Name"].ToString();
                //dev.ISwitch = row["I_Break"].ToString();
                //dev.JSwitch = row["J_Break"].ToString();
                //dev.ZeroGNDC = Convert.ToDouble(row["B0_Half"]);

                try {
                    UCDeviceBase.DataService.Create<PSPDEV>(dev);

                } catch {
                    //UCDeviceBase.DataService.Update<PSPDEV>(dev);
                }
                yield return ncurrent++;
            }
        }
コード例 #54
0
ファイル: DefineDelform.cs プロジェクト: EdgarEDT/myitoppsp
        //����ͼ���SvgUID
        public DefineDelform(PSPDEV pspDEV)
        {
            InitializeComponent();
            pspulic = pspDEV;
            pspDEV.Type = "Polyline";
               // pspDev.SvgUID = tlVectorControl1.SVGDocument.SvgdataUid;
            IList list1 = Services.BaseService.GetList("SelectPSPDEVBySvgUIDAndType", pspDEV);
               // int j = 0;
            for (int i = 0; i < list1.Count;i++ )
            {
                pspDEV = (PSPDEV)list1[i];
                if (pspDEV.LineStatus != "�Ͽ�")
                {

                   // psdevclass psd = new psdevclass(pspDEV.Number,pspDEV.FirstNode,pspDEV.LastNode, pspDEV.Name);

                    this.WaitLinelist.Items.Add(new psdevclass(pspDEV.Number, pspDEV.FirstNode, pspDEV.LastNode,pspDEV.Type, pspDEV.Name));

                }
            }
            pspDEV.Type = "TransformLine";
            IList list2 = Services.BaseService.GetList("SelectPSPDEVBySvgUIDAndType", pspDEV);
            for (int i = 0; i <list2.Count; i++)
            {
                pspDEV = (PSPDEV)list2[i];
                psdevclass psd = new psdevclass(pspDEV.Number, pspDEV.FirstNode, pspDEV.LastNode,pspDEV.Type, pspDEV.Name);
                this.WaitLinelist.Items.Add(psd);
            }
            //psp.Lable = "ĸ�߽ڵ�";
            pspDEV.Type = "Use";
            IList list = Services.BaseService.GetList("SelectPSPDEVBySvgUIDAndType", pspDEV);
            foreach (PSPDEV dev in list)
            {
                comboBoxEdit1.Properties.Items.Add(dev.Name);
                //comboBoxEdit2.Properties.Items.Add(dev.Name);
            }
        }
コード例 #55
0
ファイル: frmImport.funs.cs プロジェクト: EdgarEDT/myitoppsp
        /// <summary>
        /// ��������
        /// </summary>
        /// <returns></returns>
        private IEnumerator importBLDR()
        {
            DataTable data = gridControl1.DataSource as DataTable;
            PSPDEV dev = new PSPDEV();
            dev.ProjectID = Itop.Client.MIS.ProgUID;
            dev.Type = "09";
            foreach (DataRow row in data.Rows) {
                dev.SUID = "psasp_bldr_" + dev.ProjectID.Substring(0, 4) + row[0].ToString();
                dev.Name = row["ID_Name"].ToString();
                dev.Number = Convert.ToInt32(row[0]);
                dev.LineTQ = Convert.ToDouble(row["X1"]);
                dev.KSwitchStatus = row["Valid"].ToString() == "1" ? "0" : "1";
                dev.UnitFlag = row["Unit"].ToString();
                dev.IName = row["Node_Name"].ToString();

                try {
                    UCDeviceBase.DataService.Create<PSPDEV>(dev);

                } catch {
                    //UCDeviceBase.DataService.Update<PSPDEV>(dev);
                }
                yield return ncurrent++;
            }
        }
コード例 #56
0
ファイル: frmDXdlg.cs プロジェクト: EdgarEDT/myitoppsp
 private void comboBoxEdit4_SelectedIndexChanged(object sender, EventArgs e)
 {
     PSPDEV devMX = new PSPDEV();
     string strCon = strCon = " WHERE Name = '" + comboBoxEdit4.Text + "' AND ProjectID = '" + this.ProjectSUID + "' AND Type = '01'";
     devMX = (PSPDEV)UCDeviceBase.DataService.GetObject("SelectPSPDEVByCondition", strCon);
     if (devMX != null)
     {
         dev.LastNode = devMX.Number;
     }
 }
コード例 #57
0
ファイル: frmDXdlg.cs プロジェクト: EdgarEDT/myitoppsp
        //��������豸Ԫ����ʱ��
        private void xtraTabControl1_SelectedPageChanged(object sender, DevExpress.XtraTab.TabPageChangedEventArgs e)
        {
            if (xtraTabControl1.SelectedTabPage.Name == "xtraTabPage4")
            {
                if (newflag)
                {
                    //����һ���ɿ��Է����ķ��� ��id�����ߵ�ID��ͬ��
                    //�����жϴ����������ݿ���û��
                    PSPDEV obj = Services.BaseService.GetOneByKey<PSPDEV>(dev);
                    if (obj==null)
                    {
                        MessageBox.Show("����·��û�б��浽���ݿ��У��뱣����ٲ�����");
                        return;
                    }
                    //���������ͬ��������ɾ��ԭ����
                    Ps_pdreltype pdr = new Ps_pdreltype();
                    pdr.ID = dev.SUID;
                    pdr = Services.BaseService.GetOneByKey<Ps_pdreltype>(pdr);
                    if (pdr!=null)
                    {
                        Ps_pdtypenode pn2 = new Ps_pdtypenode();
                        pn2.pdreltypeid = pdr.ID;
                        Services.BaseService.Update("DeletePs_pdtypepdreltypeid", pn2);
                        Services.BaseService.Delete<Ps_pdreltype>(pdr);
                    }
                    pdr = new Ps_pdreltype();
                    pdr.ID = dev.SUID;
                    pdr.ProjectID = this.ProjectSUID;
                    pdr.Createtime = DateTime.Now;
                    pdr.Title = textEdit1.Text;
                    pdr.S1 = dev.IName;
                    //pdr.PeopleSum = PDT.Peplesum;
                    //pdr.AreaName = PDT.Areaname;
                    //pdr.Year = PDT.Year;
                    Services.BaseService.Create<Ps_pdreltype>(pdr);
                    //������Դ
                    Ps_pdtypenode pn = new Ps_pdtypenode();
                    pn.pdreltypeid = pdr.ID;
                    pn.devicetype = "01";
                    PSPDEV devzx = new PSPDEV();
                    devzx.SUID = pdr.S1;
                    devzx = Services.BaseService.GetOneByKey<PSPDEV>(devzx);
                    if (devzx != null)
                    {
                        pn.title = devzx.Name;
                        pn.DeviceID = devzx.SUID;
                    }
                    else
                    {
                        pn.title = "�޵�Դ"+pdr.Title;

                    }
                    pn.Code = "0";
                    Services.BaseService.Create<Ps_pdtypenode>(pn);

                   //���������Ԫ����
                    Ps_pdtypenode pn1 = new Ps_pdtypenode();
                    pn1.ID = dev.SUID;
                    pn1.title = textEdit1.Text;
                    pn1.pdreltypeid = pdr.ID;
                    pn1.devicetype = "73";
                    pn1.DeviceID = dev.SUID;
                    pn1.ParentID = pn.ID;
                    pn1.Code = "111";
                    Services.BaseService.Create<Ps_pdtypenode>(pn1);
                    //�����֧·��Ϣ ���ҵ��������� ������������
                    //if (!string.IsNullOrEmpty(dev.JName))
                    //{
                    //    pn = new Ps_pdtypenode();
                    //    pn.ID = dev.JName;
                    //    pn = Services.BaseService.GetOneByKey<Ps_pdtypenode>(pn);
                    //    if (pn!=null)
                    //    {
                    //        pn1 = new Ps_pdtypenode();

                    //        pn1.title = textEdit1.Text;
                    //        pn1.pdreltypeid =pn.pdreltypeid;
                    //        pn1.devicetype = "73";
                    //        pn1.DeviceID = dev.SUID;
                    //        pn1.ParentID = pn.ID;
                    //        pn1.Code = "211";
                    //        Services.BaseService.Create<Ps_pdtypenode>(pn1);
                    //    }
                    //}
                    AddPDtypenode(pn1, "2", pn1.pdreltypeid);
                }
                else
                {
                    Ps_pdreltype pdr = new Ps_pdreltype();
                    pdr.ID = dev.SUID;
                    pdr = Services.BaseService.GetOneByKey<Ps_pdreltype>(pdr);
                    if (pdr!=null)
                    {
                        pdr.Title = textEdit1.Text;
                        pdr.S1 = dev.IName;
                        Services.BaseService.Update<Ps_pdreltype>(pdr);
                        //�޸ĵ�Դ��Ϣ
                        IList<Ps_pdtypenode> list1 = Services.BaseService.GetList<Ps_pdtypenode>("SelectPs_pdtypenodeByCon", "pdreltypeid='" + pdr.ID + "' and devicetype = '01'");
                        Ps_pdtypenode pn = new Ps_pdtypenode();
                        if (list1.Count>0)
                      {
                          pn = list1[0];
                          pn.DeviceID = dev.IName;
                          Services.BaseService.Update<Ps_pdtypenode>(pn);
                      }
                        else
                      {

                          pn.pdreltypeid = pdr.ID;
                          pn.devicetype = "01";
                          PSPDEV devzx = new PSPDEV();
                          devzx.SUID = pdr.S1;
                          devzx = Services.BaseService.GetOneByKey<PSPDEV>(devzx);
                          if (devzx != null)
                          {
                              pn.title = devzx.Name;
                              pn.DeviceID = devzx.SUID;
                          }
                          else
                          {
                              pn.title = "�޵�Դ" + pdr.Title;

                          }
                          pn.Code = "0";
                          Services.BaseService.Create<Ps_pdtypenode>(pn);
                      }

                      //�޸Ĵ����߽ڵ����Ϣ

                      Ps_pdtypenode pdn = new Ps_pdtypenode();
                      pdn.ID = dev.SUID;
                      pdn = Services.BaseService.GetOneByKey<Ps_pdtypenode>(pdn);
                        if (pdn!=null)
                        {
                            pdn.title = dev.Name;
                            pdn.devicetype = "73";
                            pdn.ParentID = pn.ID;
                            Services.BaseService.Update<Ps_pdtypenode>(pdn);
                        }
                        else
                        {
                            pdn = new Ps_pdtypenode();
                            pdn.ID = dev.SUID;
                            pdn.title = textEdit1.Text;
                            pdn.pdreltypeid = pdr.ID;
                            pdn.devicetype = "73";
                            pdn.DeviceID = dev.SUID;
                            pdn.ParentID = pn.ID;
                            pdn.Code = "111";
                            Services.BaseService.Create<Ps_pdtypenode>(pdn);
                        }
                     //�ҵ�������Ϣ �޸�������Ϣ
                        DeleteNode(pdn);
                        AddPDtypenode(pdn, "2", pdn.pdreltypeid);

                    }
                    else
                    {
                        pdr = new Ps_pdreltype();
                        pdr.ID = dev.SUID;
                        pdr.ProjectID = this.ProjectSUID;
                        pdr.Createtime = DateTime.Now;
                        pdr.Title = textEdit1.Text;
                        pdr.S1 = dev.IName;
                        //pdr.PeopleSum = PDT.Peplesum;
                        //pdr.AreaName = PDT.Areaname;
                        //pdr.Year = PDT.Year;
                        Services.BaseService.Create<Ps_pdreltype>(pdr);
                        //������Դ
                        Ps_pdtypenode pn = new Ps_pdtypenode();
                        pn.pdreltypeid = pdr.ID;
                        pn.devicetype = "01";
                        PSPDEV devzx = new PSPDEV();
                        devzx.SUID = pdr.S1;
                        devzx = Services.BaseService.GetOneByKey<PSPDEV>(devzx);
                        if (devzx != null)
                        {
                            pn.title = devzx.Name;
                            pn.DeviceID = devzx.SUID;
                        }
                        else
                        {
                            pn.title = "�޵�Դ" + pdr.Title;

                        }
                        pn.Code = "0";
                        Services.BaseService.Create<Ps_pdtypenode>(pn);
                        //���������Ԫ����
                        Ps_pdtypenode pn1 = new Ps_pdtypenode();
                        pn1.ID = dev.SUID;
                        pn1.title = textEdit1.Text;
                        pn1.pdreltypeid = pdr.ID;
                        pn1.devicetype = "73";
                        pn1.DeviceID = dev.SUID;
                        pn1.ParentID = pn.ID;
                        pn1.Code = "111";
                        Services.BaseService.Create<Ps_pdtypenode>(pn1);
                        //if (!string.IsNullOrEmpty(dev.JName))
                        //{
                        //    pn = new Ps_pdtypenode();
                        //    pn.ID = dev.JName;
                        //    pn = Services.BaseService.GetOneByKey<Ps_pdtypenode>(pn);
                        //    if (pn != null)
                        //    {
                        //        pn1 = new Ps_pdtypenode();

                        //        pn1.title = textEdit1.Text;
                        //        pn1.pdreltypeid = pn.pdreltypeid;
                        //        pn1.devicetype = "73";
                        //        pn1.DeviceID = dev.SUID;
                        //        pn1.ParentID = pn.ID;
                        //        pn1.Code = "211";
                        //        Services.BaseService.Create<Ps_pdtypenode>(pn1);
                        //    }
                        //}
                        AddPDtypenode(pn1, "2", pn1.pdreltypeid);
                    }

                    //pdr.PeopleSum = PDT.Peplesum;
                    //pdr.AreaName = PDT.Areaname;
                    //pdr.Year = PDT.Year;

                }
                  //�ж���֧·�Ƿ���Ԫ�� ���û�� Ȼ���ж�����û������Ԫ�� ����
                //Ps_pdtypenode pnf = new Ps_pdtypenode();
                //pnf.ID = dev.SUID;
                //pnf = Services.BaseService.GetOneByKey<Ps_pdtypenode>(pnf);
                //   string sql = "where JName='" + dev.SUID + "' and type='73' ";
                //   IList<PSPDEV> list = UCDeviceBase.DataService.GetList<PSPDEV>("SelectPSPDEVByCondition", sql);
                //if (list.Count>0)
                //{
                //    int count = 0;
                //    foreach (PSPDEV ps in list)
                //    {
                //        count++;
                //        sql = "pdreltypeid='" + dev.SUID + "'and devicetype='73'and deviceID='" + ps.SUID + "'";
                //        Ps_pdtypenode ptn = UCDeviceBase.DataService.GetObject("SelectPs_pdtypenodeByCon", sql) as Ps_pdtypenode;
                //        if (ptn!=null)
                //        {
                //            //�ж��丽���Ԫ��û�������
                //            AddPDtypenode(ps.SUID, (Convert.ToInt32(ptn.Code.Substring(0, 1)) + 1).ToString(), dev.SUID);
                //        }
                //        else
                //        {
                //            Ps_pdtypenode pn1 = new Ps_pdtypenode();

                //            pn1.title = ps.Name;
                //            pn1.pdreltypeid = dev.SUID;
                //            pn1.devicetype = "73";
                //            pn1.DeviceID = ps.SUID;
                //            pn1.ParentID = dev.SUID;
                //            pn1.Code =(Convert.ToInt32(pnf.Code.Substring(0,1))+1).ToString()+"1"+count.ToString();
                //            Services.BaseService.Create<Ps_pdtypenode>(pn1);
                //        }
                //    }
                //}
                ucdxchildnode1.DXObj = dev;

            }
        }
コード例 #58
0
ファイル: frmDXdlg.cs プロジェクト: EdgarEDT/myitoppsp
        private void textEdit1_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
        {
            if (DeviceHelper.xml1 == null) { return; }
            PSPDEV obj = new PSPDEV();
            string deviceid = DeviceHelper.xml1.GetAttribute("Deviceid");
            DeviceHelper.pspflag = false;
            DeviceHelper.Wjghflag = false;
            //if (string.IsNullOrEmpty(deviceid))
            //{
            obj = (PSPDEV)DeviceHelper.SelectDevice(DeviceType.XL, Itop.Client.MIS.ProgUID);

            if (obj is PSPDEV)
            {
                deviceid = ((PSPDEV)obj).SUID;

                obj.LayerID = DeviceHelper.layerid;
                obj.SvgUID = DeviceHelper.uid;
                obj.EleID = DeviceHelper.eleid;
                Services.BaseService.Update<PSPDEV>(obj);

                if (DeviceHelper.xml1 != null)
                {
                    DeviceHelper.xml1.SetAttribute("Deviceid", deviceid);
                    string styleValue = "";
                    string ghType = ConfigurationSettings.AppSettings.Get("ghType");
                    LineType lt = new LineType();
                    lt.TypeName = obj.RateVolt.ToString("###") + "kV";
                    lt = (LineType)Services.BaseService.GetObject("SelectLineTypeByTypeName", lt);
                    if (lt != null)
                    {
                        if (Convert.ToInt32(obj.OperationYear) > DateTime.Now.Year)
                        {
                            styleValue = "stroke-dasharray:" + ghType + ";stroke-width:" + lt.ObligateField1 + ";";
                        }
                        else
                        {
                            styleValue = "stroke-width:" + lt.ObligateField1 + ";";
                        }
                        //string aa= ColorTranslator.ToHtml(Color.Black);
                        styleValue = styleValue + "stroke:" + ColorTranslator.ToHtml(Color.FromArgb(Convert.ToInt32(lt.Color)));
                        //SvgElement se = DeviceHelper.xml1;
                        DeviceHelper.xml1.RemoveAttribute("style");
                        DeviceHelper.xml1.SetAttribute("style", styleValue);
                        DeviceHelper.xml1.SetAttribute("info-name", obj.Name);
                    }
                }
            }

            this.Close();
        }
コード例 #59
0
ファイル: UCDeviceBYQ3.cs プロジェクト: EdgarEDT/myitoppsp
        public override void Add()
        {
            frmBYQ3dlg dlg = new frmBYQ3dlg();
            dlg.Name = "";
            dlg.ProjectSUID = this.ProjectID;
            PSPDEV p = new PSPDEV();
            p.ProjectID = this.ProjectID;
            p.SvgUID = ParentID;
            if (ParentObj is PSP_Substation_Info)
            {
                p.Name = (ParentObj as PSP_Substation_Info).Title + "-��ѹ��";
                p.OperationYear = (ParentObj as PSP_Substation_Info).S2;
                p.Date1 = (ParentObj as PSP_Substation_Info).S2;
                p.Date2 = (ParentObj as PSP_Substation_Info).L29;
            }
            else if (ParentObj is PSP_PowerSubstation_Info)
            {
                p.Name = (ParentObj as PSP_PowerSubstation_Info).Title + "-��ѹ��";
                p.OperationYear = (ParentObj as PSP_PowerSubstation_Info).S3;
                p.Date1 = (ParentObj as PSP_PowerSubstation_Info).S3;
                p.Date2 = (ParentObj as PSP_PowerSubstation_Info).S30;
            }

            dlg.DeviceMx = p;
            if (dlg.ShowDialog() == DialogResult.OK) {
                //���Ӽ�¼
                PSPDEV dev = dlg.DeviceMx;
                dev.ProjectID = this.ProjectID;
                UCDeviceBase.DataService.Create("InsertPSPDEV", dev);
                DataRow row=datatable1.NewRow();
                if (dev.NodeType == "0")
                {
                    dev.NodeType = "ƽ��ڵ�";
                }
                else if (dev.NodeType == "1")
                {
                    dev.NodeType = "PQ�ڵ�";
                }
                else if (dev.NodeType == "2")
                {
                    dev.NodeType = "PV�ڵ�";
                }
                else
                {
                    dev.NodeType = null;
                }
                if (dev.KSwitchStatus == "1")
                {
                    dev.KSwitchStatus = "�˳�����";
                }
                else
                {
                    dev.KSwitchStatus = "Ͷ������";
                }
                if (dev.UnitFlag == "0")
                {
                    dev.UnitFlag = "p.u.";
                }
                else
                {
                    if (dev.Type == "01" || dev.Type == "04" || dev.Type == "12")
                    {
                        dev.UnitFlag = "kV/MW/MVar";
                    }
                    else
                    {
                        dev.UnitFlag = "Ohm/10-6Siem";
                    }
                }
                Itop.Common.DataConverter.ObjectToRow(dev, row);
                datatable1.Rows.Add(row);
            }
        }
コード例 #60
0
ファイル: frmMuLian.cs プロジェクト: EdgarEDT/myitoppsp
 private void InitData(PSPDEV dev)
 {
     svgUID = dev.SvgUID;
     Name = dev.Name;
     FirstNodeName = dev.HuganLine1;
     LastNodeName = dev.HuganLine2;
     SwitchStatus = dev.HuganLine3;
 }