Beispiel #1
0
        static RFullViewStatData()
        {
            DataTable dt = DataLayer.DataProvider.getDataTableFromSQL("select * from dict_statdata where isshow=1 order by ord");

            foreach (DataRow dr in dt.Rows)
            {
                StatData data = new StatData()
                {
                    name            = dr.getString("name"),
                    header          = dr.getString("header"),
                    format          = dr.getString("format"),
                    warningType     = dr.getString("warningType"),
                    warningMinValue = dr.getDouble("warningMinValue"),
                    warningMaxValue = dr.getDouble("warningMaxValue"),
                    isRefresh       = dr.getBool("isRefresh"),
                    ord             = dr.getInt("ord")
                };
                datas.Add(data.name, data);
            }


            timer.Interval = TimeSpan.FromSeconds(5);
            timer.Tick    += new EventHandler(timer_Tick);
        }
Beispiel #2
0
 ///<summary>读取指定数据项数据</summary>
 static void readData(StatData data, DistNetLibrary.DistNet distnet)
 {
     if (data.name == "变电站数")
     {
         data.value = distnet.getAllObjListByObjType(DistNetLibrary.EObjectType.变电站).Count();
     }
     if (data.name == "配电室数")
     {
         data.value = distnet.getAllObjListByObjType(DistNetLibrary.EObjectType.配电室).Count();
     }
     else if (data.name == "当年累计供电量")
     {
         data.value = 65145;
     }
     else if (data.name == "当年清洁能源累计发电量")
     {
         data.value = 5347;
     }
     else if (data.name == "当年最大供电负荷")
     {
         data.value = 2352;
     }
     else if (data.name == "供电面积")
     {
         data.value = 238;
     }
     else if (data.name == "开关站数")
     {
         data.value = distnet.getAllObjListByObjType(DistNetLibrary.EObjectType.开关站).Count();
     }
     else if (data.name == "线路总长")
     {
         data.value = 256;
     }
     else if (data.name == "主变容量")
     {
         data.value = distnet.getAllObjListByObjType(DistNetLibrary.EObjectType.两卷主变).Where(p => p.busiAccount != null).Sum(p => (p as DistNetLibrary.DNMainTransformer2W).thisAcntData.cap) +
                      distnet.getAllObjListByObjType(DistNetLibrary.EObjectType.卷主变).Where(p => p.busiAccount != null).Sum(p => (p as DistNetLibrary.DNMainTransformer3W).thisAcntData.cap);
         data.value2 = distnet.getAllObjListByObjType(DistNetLibrary.EObjectType.两卷主变).Count() +
                       distnet.getAllObjListByObjType(DistNetLibrary.EObjectType.卷主变).Count();
     }
     else if (data.name == "配变容量")
     {
         data.value  = distnet.getAllObjListByObjType(DistNetLibrary.EObjectType.配变).Where(p => p.busiAccount != null).Sum(p => (p as DistNetLibrary.DNDistTransformer).thisAcntData.cap);
         data.value2 = distnet.getAllObjListByObjType(DistNetLibrary.EObjectType.配变).Count();
     }
     else if (data.name == "清洁能源总装机")
     {
         data.value = 23.5;
     }
     else if (data.name == "清洁能源渗透率")
     {
         data.value = 5347.0 / 65145;
     }
     else if (data.name == "供电可靠率")
     {
         data.value = 0.998;
     }
     else if (data.name == "综合电压合格率")
     {
         data.value = 0.977;
     }
     else if (data.name == "当前供电负荷")
     {
         data.value = 100.0 + 100.0 * rd.NextDouble();
     }
     else if (data.name == "当前清洁能源出力")
     {
         data.value = 10.0 + 10.0 * rd.NextDouble();
     }
 }