Пример #1
0
        private void InitTreeViewData()
        {
            List <NodeEntry> m_NodeEntrys;
            List <NodeEntry> m_outputList;

            m_NodeEntrys = new List <NodeEntry>()
            {
                new NodeEntry {
                    ID = 0, Name = "截止昨日本年度生产数据统计"
                },

                new NodeEntry {
                    ID = 1, Name = "供电数据", ParentID = 0
                },
                new NodeEntry {
                    ID = 2, Name = "停电数据", ParentID = 0
                },
                new NodeEntry {
                    ID = 3, Name = "客户用电数据", ParentID = 0
                },
                new NodeEntry {
                    ID = 4, Name = "清洁能源", ParentID = 0
                },
                new NodeEntry {
                    ID = 5, Name = "其它", ParentID = 0
                },

                new NodeEntry {
                    ID = 41, Name = "供电量:", Value = "22892", Unit = "KW.H", ParentID = 1
                },
                new NodeEntry {
                    ID = 42, Name = "平均负荷:", Value = "1682", Unit = "KW", ParentID = 1
                },
                new NodeEntry {
                    ID = 43, Name = "最大负荷:", Value = "2282", Unit = "KW", ParentID = 1
                },
                new NodeEntry {
                    ID = 44, Name = "最小负荷:", Value = "892", Unit = "KW", ParentID = 1
                },
                new NodeEntry {
                    ID = 45, Name = "平均负荷率:", Value = "68%", Unit = "", ParentID = 1
                },

                new NodeEntry {
                    ID = 21, Name = "停电时间:", Value = "228", Unit = "H", ParentID = 2
                },
                new NodeEntry {
                    ID = 22, Name = "停电电量:", Value = "22802", Unit = "KW.H", ParentID = 2
                },

                new NodeEntry {
                    ID = 31, Name = "大客户用电:", Value = "22823", Unit = "KW.H", ParentID = 3
                },
                new NodeEntry {
                    ID = 32, Name = "充电桩用电:", Value = "12823", Unit = "KW.H", ParentID = 3
                },
                new NodeEntry {
                    ID = 33, Name = "储能装置充放电:", Value = "2823", Unit = "KW.H", ParentID = 3
                },

                new NodeEntry {
                    ID = 12, Name = "风力发电:", Value = "23099", Unit = "KW.H", ParentID = 4
                },
                new NodeEntry {
                    ID = 13, Name = "光伏发电:", Value = "32899", Unit = "KW.H", ParentID = 4
                },

                new NodeEntry {
                    ID = 51, Name = "平均馈线电压标幺值:", Value = "1.02", Unit = "", ParentID = 5
                },
            };
            m_outputList = TreeViewDataBind.Bind(m_NodeEntrys);
            this.treeView.ItemsSource = m_outputList;
        }
Пример #2
0
        private void LoadTreeViewData()
        {
            List <NodeEntry> m_NodeEntrys;
            List <NodeEntry> m_outputList;

            m_NodeEntrys = new List <NodeEntry>()
            {
                new NodeEntry {
                    ID = 1, Name = "变电站"
                },
                new NodeEntry {
                    ID = 2, Name = "开关"
                },
                new NodeEntry {
                    ID = 3, Name = "变压器"
                },
                new NodeEntry {
                    ID = 4, Name = "线路"
                },

                new NodeEntry {
                    ID = 11, Name = "110KV变电站", ParentID = 1
                },
                new NodeEntry {
                    ID = 12, Name = "220KV变电站", ParentID = 1
                },
                new NodeEntry {
                    ID = 13, Name = "500KV变电站", ParentID = 1
                },

                new NodeEntry {
                    ID = 111, Name = "变电站座数:", Value = lstBDZ110_NUM[9].Value.ToString(), Unit = "座", ParentID = 11
                },
                new NodeEntry {
                    ID = 112, Name = "变电站容量:", Value = lstBDZ110_VOL[9].Value.ToString(), Unit = "KW.H", ParentID = 11
                },

                new NodeEntry {
                    ID = 121, Name = "变电站座数:", Value = lstBDZ220_NUM[9].Value.ToString(), Unit = "座", ParentID = 12
                },
                new NodeEntry {
                    ID = 122, Name = "变电站容量:", Value = lstBDZ220_VOL[9].Value.ToString(), Unit = "KW.H", ParentID = 12
                },

                new NodeEntry {
                    ID = 131, Name = "变电站座数:", Value = lstBDZ500_NUM[9].Value.ToString(), Unit = "座", ParentID = 13
                },
                new NodeEntry {
                    ID = 132, Name = "变电站容量:", Value = lstBDZ500_VOL[9].Value.ToString(), Unit = "KW.H", ParentID = 13
                },

                new NodeEntry {
                    ID = 21, Name = "分段开关个数:", Value = lstKGD_NUM[9].Value.ToString(), Unit = "个", ParentID = 2
                },
                new NodeEntry {
                    ID = 22, Name = "联络开关个数:", Value = lstKGL_NUM[9].Value.ToString(), Unit = "个", ParentID = 2
                },
                new NodeEntry {
                    ID = 23, Name = "环网柜个数:", Value = lstHWG_VOL[9].Value.ToString(), Unit = "个", ParentID = 2
                },

                new NodeEntry {
                    ID = 31, Name = "两卷变:", ParentID = 3
                },
                new NodeEntry {
                    ID = 32, Name = "三卷变:", ParentID = 3
                },

                new NodeEntry {
                    ID = 311, Name = "两卷变座数:", Value = lstBYQ2_NUM[9].Value.ToString(), Unit = "座", ParentID = 31
                },
                new NodeEntry {
                    ID = 312, Name = "两卷变容量:", Value = lstBYQ2_VOL[9].Value.ToString(), Unit = "KW.H", ParentID = 31
                },

                new NodeEntry {
                    ID = 321, Name = "三卷变座数:", Value = lstBYQ3_NUM[9].Value.ToString(), Unit = "座", ParentID = 32
                },
                new NodeEntry {
                    ID = 322, Name = "三卷变容量:", Value = lstBYQ3_VOL[9].Value.ToString(), Unit = "KW.H", ParentID = 32
                },

                new NodeEntry {
                    ID = 41, Name = "已有线路条数:", Value = lstLineOld_NUM[9].Value.ToString(), Unit = "条", ParentID = 4
                },
                new NodeEntry {
                    ID = 42, Name = "已有线路长度:", Value = lstLineOld_VOL[9].Value.ToString(), Unit = "千米", ParentID = 4
                },
            };
            m_outputList = TreeViewDataBind.Bind(m_NodeEntrys);
            this.treeView1.ItemsSource = m_outputList;
        }