Beispiel #1
0
 static void genplant(DistNet dn)
 {
     foreach (DNPlantBase item in dn.getAllObjListByCategory(EObjectCategory.电厂设施类))
     {
         RunDataPlantBase rundata = item.busiRunData as RunDataPlantBase;
         AcntPlantBase    acnt    = item.busiAccount as AcntPlantBase;
         rundata.rateOfLoad = 0.8 + 0.2 * rd.NextDouble();
         rundata.power      = rundata.rateOfLoad * acnt.cap;
     }
 }
Beispiel #2
0
        public void readData()
        {
            //配网生产
            curLoad = (int)(500 + rd.Next(1000));
            RaisePropertyChanged(() => curLoad);
            dayElectricity += (int)rd.Next(20);
            RaisePropertyChanged(() => dayElectricity);
            loadrates.Clear(); //负载率

            List <MyClassLibrary.DevShare.VListItem> lst = new List <MyClassLibrary.DevShare.VListItem>();

            foreach (var item in root.distnet.getAllObjListByCategory(EObjectCategory.变压器类).OrderByDescending(p => (p.busiRunData as RunDataTransformerBase).rateOfLoad).Take(10))
            {
                RunDataTransformerBase            rundata = item.busiRunData as RunDataTransformerBase;
                MyClassLibrary.DevShare.VListItem vi      = new MyClassLibrary.DevShare.VListItem()
                {
                    id = item.id, name = item.name, value = rundata.rateOfLoad, format = "{0:p0}", brush = rundata.rateOfLoadBrush,
                };
                lst.Add(vi);
            }
            foreach (var item in root.distnet.getAllObjListByObjType(EObjectType.输电线路).OrderByDescending(p => (p.busiRunData as RunDataACLine).rateOfLoad).Take(10))
            {
                RunDataACLine rundata = item.busiRunData as RunDataACLine;
                MyClassLibrary.DevShare.VListItem vi = new MyClassLibrary.DevShare.VListItem()
                {
                    id = item.id, name = item.name, value = rundata.rateOfLoad, format = "{0:p0}", brush = rundata.rateOfLoadBrush
                };
                lst.Add(vi);
            }
            foreach (var item in lst.OrderByDescending(p => p.value))
            {
                loadrates.Add(item);
            }
            RaisePropertyChanged(() => loadrates);

            volts.Clear();
            foreach (var item in root.distnet.getAllObjListByObjType(EObjectType.节点).OrderByDescending(p => Math.Abs((p.busiRunData as RunDataNode).voltPUV - 1)).Take(10))
            {
                RunDataNode rundata = item.busiRunData as RunDataNode;
                MyClassLibrary.DevShare.VListItem vi = new MyClassLibrary.DevShare.VListItem()
                {
                    id = item.id, name = item.name, value = rundata.voltPUV, format = "{0:f2}", brush = rundata.voltPUVBrush
                };
                vi.value2 = 1 + 2 * (vi.value - 1);
                volts.Add(vi);
            }
            RaisePropertyChanged(() => volts);

            //清洁能源
            greenPower = 0;
            greenpowers.Clear();
            foreach (var item in root.distnet.getAllObjListByCategory(EObjectCategory.电厂设施类))
            {
                RunDataPlantBase rundata = item.busiRunData as RunDataPlantBase;
                greenPower += rundata.power;
                MyClassLibrary.DevShare.VListItem vi = new MyClassLibrary.DevShare.VListItem()
                {
                    id = item.id, name = item.name, value = rundata.rateOfLoad, format = "{0:p0}", brush = rundata.rateOfLoadBrush
                };
                greenpowers.Add(vi);
            }
            greenPower = ((int)(greenPower * 10)) / 10;
            RaisePropertyChanged(() => greenPower);
            RaisePropertyChanged(() => greenpowers);
            greenscales.Clear();
            greenscales.Add(new MyClassLibrary.DevShare.ChartDataPoint()
            {
                argu = "清洁能源", value = greenPower / curLoad
            });
            greenscales.Add(new MyClassLibrary.DevShare.ChartDataPoint()
            {
                argu = " ", value = (curLoad - greenPower) / curLoad
            });
            RaisePropertyChanged(() => greenscales);


            //电动汽车
            carLoad = (int)(40 + rd.Next(80));
            RaisePropertyChanged(() => carLoad);
            //大客户
            customLoad = (int)(200 + rd.Next(300));
            RaisePropertyChanged(() => customLoad);
            //停电
            cutLoad = (int)(10 + rd.Next(20));
            RaisePropertyChanged(() => cutLoad);
            //事件
            lstEvent = DataGenerator.events;
            RaisePropertyChanged(() => lstEvent);
        }