/// <summary> /// 设备的月天统计图表 /// </summary> /// <param name="device"></param> /// <param name="rate"></param> /// <param name="chartname"></param> /// <param name="startYearMMDD"></param> /// <param name="endYearMMDD"></param> /// <param name="chartType"></param> /// <param name="unit"></param> /// <returns></returns> public ChartData MonthDDChartByDevice(Device device, float rate, string chartname, string startYearMMDD, string endYearMMDD, string chartType, string unit) { if (device == null) { return(new ChartData()); } string name = LanguageUtil.getDesc("CHART_TITLE_MONTH_ENERGY"); string startYearMM = startYearMMDD.Substring(0, 6); string endYearMM = endYearMMDD.Substring(0, 6); Hashtable monthDDEnergy = DeviceMonthDayDataService.GetInstance().DeviceYearMMDDList(device, startYearMM, endYearMM); string[] ic = base.getXseriesFromYYYYMMDD(startYearMMDD, endYearMMDD).ToArray(); string[] xAxis = formatXaxis(ic, ChartTimeType.MonthDay); string xname = MonitorType.getMonitorTypeByCode(MonitorType.PLANT_MONITORITEM_ENERGY_CODE).name; KeyValuePair <string, float?[]> data = new KeyValuePair <string, float?[]>(); if (monthDDEnergy.Count > 0) { data = GenerateChartData(xname, ic, monthDDEnergy, rate); } return(ReportBuilder.createJsonChartXY(name, xAxis, data, "", unit, chartType, fromApp)); }
/// <summary> /// 取得多个电站的pr性能图表数据 /// </summary> /// <param name="plantList"></param> /// <param name="chartname"></param> /// <param name="newseriekey"></param> /// <param name="startYearMMDD"></param> /// <param name="endYearMMDD"></param> /// <param name="chartType"></param> /// <param name="unit"></param> /// <returns></returns> public ChartData MonthDDRPChartBypList(Device invertDevice, Device detectorDevice, string chartName, string startYearMMDD, string endYearMMDD, string chartType) { if (invertDevice == null) { return(new ChartData()); } MonitorType mt = MonitorType.getMonitorTypeByCode(MonitorType.PLANT_MONITORITEM_ENERGY_CODE); IList <string> chartTypes = new List <string>(); //图表类型 IList <string> units = new List <string>(); //单位 IList <string> ynames = new List <string>(); //y轴名称 //IList<string> compareObjs = null; //图例比较对象,因为是同一个电站,不追加 chartTypes.Add(chartType); chartTypes.Add(chartType); ynames.Add(mt.name); ynames.Add(mt.name); //产生坐标 string[] ic = base.getXseriesFromYYYYMMDD(startYearMMDD, endYearMMDD).ToArray(); string[] xAxis = formatXaxis(ic, ChartTimeType.MonthDay); float rate = 1.0F; string newseriekey; //取得多个采集器的实际发电量 Hashtable monthDDEnergy = DeviceMonthDayDataService.GetInstance().DeviceYearMMDDList(invertDevice, startYearMMDD, endYearMMDD); units.Add(mt.unit); units.Add(mt.unit); IList <KeyValuePair <string, float?[]> > datas = new List <KeyValuePair <string, float?[]> >(); KeyValuePair <string, float?[]> data = new KeyValuePair <string, float?[]>(); if (monthDDEnergy.Count > 0) { newseriekey = LanguageUtil.getDesc("ACTUALENERGY"); data = GenerateChartData(newseriekey, ic, monthDDEnergy, rate); } //string comobj = "";//plantList.Count > 1 ? "" : plantList[0].name; datas.Add(data); //取得日照增量强度,并依次计算理论发电量 rate = this.getEnergyRate(invertDevice.designPower); monthDDEnergy = DeviceMonthDayDataService.GetInstance().DeviceYearMMDDList(detectorDevice, startYearMMDD, endYearMMDD); newseriekey = LanguageUtil.getDesc("THEORYENERGY"); data = GenerateChartData(newseriekey, ic, monthDDEnergy, rate); datas.Add(data); float?[] newDataArr = computeByType(xAxis.ToArray(), datas, ComputeType.Ratio); KeyValuePair <string, float?[]> newdata = new KeyValuePair <string, float?[]>("PR", newDataArr); datas.Add(newdata); chartTypes.Add(ChartType.line); units.Add("%"); ynames.Add("PR"); return(ReportBuilder.createMultiJsonChartXY(chartName, xAxis, datas, ynames.ToArray(), chartTypes.ToArray(), units.ToArray(), fromApp)); }
/// <summary> /// 作者:鄢睿 /// 功能:取得设备多个年度的年月比较数据 /// 创建时间:2011年02月25日 /// </summary> /// <param name="device"></param> /// <param name="years"></param> /// <param name="monitorCode"></param> /// <param name="unit"></param> /// <param name="chartType"></param> /// <returns></returns> public ChartData DeviceMMCompare(Device device, IList <string> yearmms, MonitorType mt, string unit, string chartType, float rate) { ICollection <ICollection> keys = new List <ICollection>(); StringBuilder sb = new StringBuilder(); // foreach (string year in yearmms) //{ // sb.Append("," + year); //} string chartName = mt.name + " " + LanguageUtil.getDesc("CHART_TITLE_COMPARE"); IList <KeyValuePair <string, float?[]> > datas = new List <KeyValuePair <string, float?[]> >(); string[] chartTypes = new string[1] { chartType }; string[] units = new string[1] { unit }; string[] ynames = new string[1] { "" }; string[] ic = null; bool hasData = false; //取得多个年度的发电月数据 int i = 0; foreach (string yearMM in yearmms) { Hashtable dataHash = null; string curName = yearMM; dataHash = DeviceMonthDayDataService.GetInstance().DeviceYearMMDDList(device, yearMM, yearMM); string[] tmpic = base.getXseriesFromYYYYMMDD(yearMM + "01", yearMM + CalenderUtil.getMonthDays(yearMM).ToString("00")).ToArray(); if (ic == null || tmpic.Length > ic.Length) { ic = tmpic; } //如果有多个设备进行编辑,没有数据的时候也显示 //if (dataHash.Count > 0) //{ KeyValuePair <string, float?[]> data = GenerateChartData(curName, ic, dataHash, rate); datas.Add(data); //} //如果有数据则将有数据标识为true if (dataHash.Count > 0) { hasData = true; } i++; } if (!hasData) { //如果所有设备都没数据才清空数据,即图表中显示无数据提示 datas.Clear(); } string[] xAxis = formatXaxis(ic, ChartTimeType.MonthDay); return(ReportBuilder.createMultiJsonChartXY(chartName, xAxis, datas, ynames, chartTypes, units, fromApp)); }
public double GetEnergy(int did, string startyyyyMMdd, string endyyyyMMdd) { //20111130 20111130 double returnValue = 0; DateTime startTime = DateTime.Parse(startyyyyMMdd); DateTime endTime = DateTime.Parse(endyyyyMMdd); IList <DeviceYearMonthData> dymds = new List <DeviceYearMonthData>(); int yyyy = startTime.Year; while (yyyy <= endTime.Year)//计算开始到结束时间的所在年发电量 { dymds.Add(DeviceYearMonthDataService.GetInstance().GetDeviceYearMonthData(did, yyyy)); yyyy++; } //计算开始到结束时间内的所有发电量 foreach (DeviceYearMonthData dymd in dymds) { if (dymd.year.Equals(startTime.Year) && startTime.AddMonths(1) < endTime) { returnValue += dymd.count(startTime.Month + 1, 12); } else if (dymd.year.Equals(endTime.Year) && endTime.AddMonths(-1) > startTime) { returnValue += dymd.count(1, endTime.Month - 1); } else if (startTime.Year.Equals(endTime.Year) == false) { returnValue += dymd.count(); } } DeviceMonthDayData dmdd = null; //计算边缘月的发电量 if (!(startTime.Year.Equals(endTime.Year) && startTime.Month.Equals(endTime.Month))) { dmdd = DeviceMonthDayDataService.GetInstance().GetDeviceMonthDayData(startTime.Year, did, startTime.Month); returnValue += dmdd.count(startTime.Day, 31); dmdd = DeviceMonthDayDataService.GetInstance().GetDeviceMonthDayData(startTime.Year, did, endTime.Month); returnValue += dmdd.count(1, endTime.Day); } else { dmdd = DeviceMonthDayDataService.GetInstance().GetDeviceMonthDayData(startTime.Year, did, endTime.Month); returnValue += dmdd.count(startTime.Day, endTime.Day); } return(returnValue); }
/// <summary> /// 取得电站的某天的性能 /// </summary> /// <param name="plant"></param> /// <param name="year"></param> /// <param name="month"></param> /// <param name="day"></param> /// <param name="dayEnergy"></param> /// <returns>已经转化为百分率了</returns> public double getDayPr(Plant plant, int year, int month, int day, double dayEnergy) { Device device = plant.getDetectorWithRenderSunshine(); if (device == null) { return(0); } DeviceMonthDayData deviceYearmonth = DeviceMonthDayDataService.GetInstance().GetDeviceMonthDayData(year, device.id, month); float monthsunlingt = deviceYearmonth.getDayData(day); if (monthsunlingt == 0) { return(0); } float dp = plant.design_power == 0 ? 1 : plant.design_power; return((dayEnergy / monthsunlingt * 1000 * dp) * 100); }
/// <summary> /// 取得多个电站的pr性能图表数据 /// </summary> /// <param name="plantList"></param> /// <param name="chartname"></param> /// <param name="newseriekey"></param> /// <param name="startYearMMDD"></param> /// <param name="endYearMMDD"></param> /// <param name="chartType"></param> /// <param name="unit"></param> /// <returns></returns> public ChartData MonthDDRPChartBypList(IList <Plant> plantList, string chartName, string startYearMMDD, string endYearMMDD, string chartType) { if (plantList == null) { return(new ChartData()); } MonitorType mt = MonitorType.getMonitorTypeByCode(MonitorType.PLANT_MONITORITEM_ENERGY_CODE); IList <string> chartTypes = new List <string>(); //图表类型 IList <string> units = new List <string>(); //单位 IList <string> ynames = new List <string>(); //y轴名称 //IList<string> compareObjs = null;//图例比较对象,因为是同一个电站,不追加 chartTypes.Add(chartType); chartTypes.Add(chartType); ynames.Add(mt.name); ynames.Add(mt.name); ///所有单元累加 IList <PlantUnit> unitList = this.getUnitsByPlantList(plantList); //产生坐标 string[] ic = base.getXseriesFromYYYYMMDD(startYearMMDD, endYearMMDD).ToArray(); string[] xAxis; string[] years = getYearMonths(startYearMMDD, endYearMMDD); if (years.Length > 1) { xAxis = formatXaxis(ic, ChartTimeType.YearMonthDay); } else { xAxis = formatXaxis(ic, ChartTimeType.MonthDay); } float rate = 1.0F; string newseriekey; //取得多个采集器的实际发电量 Hashtable monthDDEnergy = CollectorMonthDayDataService.GetInstance().GetUnitBetweenMonthData(unitList, startYearMMDD, endYearMMDD); units.Add(mt.unit); IList <KeyValuePair <string, float?[]> > datas = new List <KeyValuePair <string, float?[]> >(); KeyValuePair <string, float?[]> data = new KeyValuePair <string, float?[]>(); if (monthDDEnergy.Count > 0) { newseriekey = LanguageUtil.getDesc("ACTUALENERGY"); data = GenerateChartData(newseriekey, ic, monthDDEnergy, rate); units.Add(mt.unit); //string comobj = "";//plantList.Count > 1 ? "" : plantList[0].name; datas.Add(data); //取得日照增量强度,并依次计算理论发电量 //取得有增量日照迁强度的环境监测仪设备 IList <Device> devices = getDevicesByPlantsWithSunshine(plantList); //计算理论发电量换算率 IList <float> rates = this.getDeviceRatesByPlantsWithSunshine(plantList); monthDDEnergy = DeviceMonthDayDataService.GetInstance().unionYearMMDDList(devices, startYearMMDD, endYearMMDD, rates); newseriekey = LanguageUtil.getDesc("THEORYENERGY"); data = GenerateChartData(newseriekey, ic, monthDDEnergy, rate); datas.Add(data); float?[] newDataArr = computeByType(xAxis.ToArray(), datas, ComputeType.Ratio); KeyValuePair <string, float?[]> newdata = new KeyValuePair <string, float?[]>("PR", newDataArr); datas.Add(newdata); chartTypes.Add(ChartType.line); units.Add("%"); ynames.Add("PR"); } return(ReportBuilder.createMultiJsonChartXY(chartName, xAxis, datas, ynames.ToArray(), chartTypes.ToArray(), units.ToArray(), fromApp)); }
/// <summary> /// 比较多个设备多测点的月天数据 /// </summary> /// <param name="chartName"></param> /// <param name="devices"></param> /// <param name="startYearMMDD"></param> /// <param name="endYearMMDD"></param> /// <returns></returns> public ChartData compareMMDDMultiDeviceMultiMonitor(string chartName, IList <DeviceStuct> devices, string startYearMMDD, string endYearMMDD, int computeType) { string reportData = string.Empty; //chartName = chartName + " from " + startYearMMDD + "to" + endYearMMDD; IList <KeyValuePair <string, float?[]> > datas = new List <KeyValuePair <string, float?[]> >(); string[] ic = base.getXseriesFromYYYYMMDD(startYearMMDD, endYearMMDD).ToArray(); string[] xAxis = formatXaxis(ic, ChartTimeType.MonthDay); string[] chartTypes = new string[devices.Count]; string[] units = new string[devices.Count]; string[] ynames = new string[devices.Count]; string[] compareObjs = new string[devices.Count]; DeviceStuct deviceStuct = null; bool hasData = false; for (int i = 0; i < devices.Count; i++) { ///所有子站累加 deviceStuct = devices[i]; int monitorCode = deviceStuct.monitorType.code; string deviceId = deviceStuct.deviceId; chartTypes[i] = deviceStuct.chartType; compareObjs[i] = deviceStuct.comareObj; ynames[i] = ""; units[i] = deviceStuct.unit; Hashtable dataHash = null; string startYearMM = startYearMMDD.Substring(0, 6); string endYearMM = endYearMMDD.Substring(0, 6); string curName = ""; if (deviceStuct.deviceType == ChartDeviceType.PLANT || deviceStuct.deviceType == ChartDeviceType.UNIT) { //电站 IList <PlantUnit> plantUnits = getUnitsBydeviceIDs(deviceId, deviceStuct.deviceType); curName = deviceStuct.name; dataHash = CollectorMonthDayDataService.GetInstance().GetUnitBetweenMonthData(plantUnits, startYearMM, endYearMM); } else { //设备 Device device = DeviceService.GetInstance().get(int.Parse(deviceId)); curName = deviceStuct.name; dataHash = DeviceMonthDayDataService.GetInstance().DeviceYearMMDDList(device, startYearMMDD, endYearMMDD); } //如果有多个设备进行编辑,没有数据的时候也显示 //if (dataHash.Count > 0) //{ KeyValuePair <string, float?[]> data = base.GenerateChartData(curName, ic, dataHash, deviceStuct.rate); datas.Add(data); //} //如果有数据则将有数据标识为true if (dataHash.Count > 0) { hasData = true; } } //如果所有设备都没数据才清空数据,即图表中显示无数据提示 if (!hasData) { datas.Clear(); } //如果有计算类型,就要追究相应计算维度 if (computeType != ComputeType.None && datas.Count > 0) { float?[] newDataArr = computeByType(xAxis.ToArray(), datas, computeType); KeyValuePair <string, float?[]> newdata = new KeyValuePair <string, float?[]>(LanguageUtil.getDesc("AVERAGE"), newDataArr); datas.Add(newdata); string[] newChartTypes = new string[chartTypes.Length + 1]; string[] newUnits = new string[units.Length + 1]; string[] newYnames = new string[ynames.Length + 1]; string[] newCompareObjs = new string[compareObjs.Length + 1]; string[] colors = new string[units.Length + 1]; ynames.CopyTo(newYnames, 0); newYnames[newYnames.Length - 1] = LanguageUtil.getDesc("AVERAGE"); units.CopyTo(newUnits, 0); newUnits[newUnits.Length - 1] = units[0]; chartTypes.CopyTo(newChartTypes, 0); newChartTypes[newChartTypes.Length - 1] = chartTypes[0]; newCompareObjs.CopyTo(newCompareObjs, 0); newCompareObjs[newCompareObjs.Length - 1] = ""; colors[colors.Length - 1] = "#EE0000"; return(ReportBuilder.createMultiJsonChartXY(chartName, xAxis, datas, newYnames, newChartTypes, newUnits, newCompareObjs, colors, fromApp)); } else { return(ReportBuilder.createMultiJsonChartXY(chartName, xAxis, datas, ynames, chartTypes, units, compareObjs, fromApp)); } //return ReportBuilder.createMultiJsonChartXY(chartName, xAxis.ToArray(), datas, ynames, chartTypes, units, compareObjs); }
/// <summary> /// 取得电站下的设备测点数据 /// </summary> /// <param name="plant"></param> /// <param name="reportType">报表类型</param> /// <param name="datetime"></param> /// <returns></returns> private Hashtable getPlantDeviceData(Plant plant, int reportType, IList <int> itemCodes, string startTime, string endTime) { Hashtable dataHash = new Hashtable(); switch (reportType) { case DataReportType.TODAY_REPORT_CODE: //日报表 IList <string[]> deviceDataList = null; foreach (int dataItemCode in itemCodes) { int intervalMins = 60; deviceDataList = new List <string[]>(); if (startTime.Length < 8) { continue; } ; //首先取得头部标题,即横坐标 string[] ic = DeviceChartService.GetInstance().getXseriesFromYYYYMMDDHH(startTime, endTime, intervalMins).ToArray(); string[] xAxis = DeviceChartService.GetInstance().formatXaxis(ic, ChartTimeType.Hour); string[] newxAxis = new string[xAxis.Length + 3]; xAxis.CopyTo(newxAxis, 2); //最前面添加一个空元素 newxAxis[0] = LanguageUtil.getDesc("REPORT_COUNT_ITEM"); newxAxis[1] = LanguageUtil.getDesc("REPORT_COUNT_DEVICE"); newxAxis[newxAxis.Length - 1] = LanguageUtil.getDesc("REPORT_COUNT_TODAYSUN"); deviceDataList.Add(newxAxis); int monitorCode = dataItemCode; //按照设备数据项和设备测点代码定义规则一致,这里的数据code就是测点code string[] tmpDataArr = new string[newxAxis.Length]; //取得电站所有设备 foreach (Device device in plant.displayDevices()) { if (device.deviceTypeCode != DeviceData.INVERTER_CODE) { continue; //只统计逆变器的 } tmpDataArr = new string[newxAxis.Length]; tmpDataArr[1] = device.fullName; //取得原始数据 Hashtable powerHash = DeviceDayDataService.GetInstance().GetDaydataList(device, startTime, endTime, intervalMins, monitorCode); if (powerHash.Count > 0) { //加工数据 bool isCount = false; if (dataItemCode == MonitorType.MIC_INVERTER_TODAYENERGY) { isCount = true; } HandleData(powerHash, ic, tmpDataArr, isCount); } deviceDataList.Add(tmpDataArr); } dataHash.Add(dataItemCode, deviceDataList); } return(dataHash); case DataReportType.WEEK_REPORT_CODE: //周报表 //取得设备发电量列表数据 deviceDataList = new List <string[]>(); //首先取得头部标题,即横坐标 string[] wic = DeviceChartService.GetInstance().getXseriesFromYYYYMMDD(startTime, endTime).ToArray(); string[] wxAxis = DeviceChartService.GetInstance().formatXaxis(wic, ChartTimeType.Week); string[] newWxAxis = new string[wxAxis.Length + 3]; wxAxis.CopyTo(newWxAxis, 2); //最前面添加一个空元素 newWxAxis[0] = LanguageUtil.getDesc("REPORT_COUNT_ITEM"); newWxAxis[1] = LanguageUtil.getDesc("REPORT_COUNT_DEVICE"); newWxAxis[newWxAxis.Length - 1] = LanguageUtil.getDesc("REPORT_COUNT_TODAYSUN"); deviceDataList.Add(newWxAxis); string[] tmpWDataArr = new string[newWxAxis.Length]; //取得电站所有设备 foreach (Device device in plant.displayDevices()) { if (device.deviceTypeCode != DeviceData.INVERTER_CODE) { continue; //只统计逆变器的 } tmpWDataArr = new string[newWxAxis.Length]; tmpWDataArr[1] = device.fullName; //取得原始数据 Hashtable powerHash = DeviceMonthDayDataService.GetInstance().DeviceYearMMDDList(device, startTime, endTime); if (powerHash.Count > 0) { //加工数据 HandleData(powerHash, wic, tmpWDataArr, true); } deviceDataList.Add(tmpWDataArr); } dataHash.Add(DataItem.WEEK_DEVICE_ENERGY, deviceDataList); return(dataHash); case DataReportType.MONTH_REPORT_CODE: //月报表 //取得设备发电量列表数据 deviceDataList = new List <string[]>(); //首先取得头部标题,即横坐标 string[] mic = DeviceChartService.GetInstance().getXseriesFromYYYYMMDD(startTime, endTime).ToArray(); string[] mxAxis = DeviceChartService.GetInstance().formatXaxis(mic, ChartTimeType.MonthDay); string[] newMxAxis = new string[mxAxis.Length + 3]; mxAxis.CopyTo(newMxAxis, 2); //最前面添加一个空元素 newMxAxis[0] = LanguageUtil.getDesc("REPORT_COUNT_ITEM"); newMxAxis[1] = LanguageUtil.getDesc("REPORT_COUNT_DEVICE"); newMxAxis[newMxAxis.Length - 1] = LanguageUtil.getDesc("REPORT_COUNT_TODAYSUN"); deviceDataList.Add(newMxAxis); string[] tmpMDataArr = new string[newMxAxis.Length]; //取得电站所有设备 foreach (Device device in plant.displayDevices()) { if (device.deviceTypeCode != DeviceData.INVERTER_CODE) { continue; //只统计逆变器的 } tmpMDataArr = new string[newMxAxis.Length]; tmpMDataArr[1] = device.fullName; //取得原始数据 Hashtable powerHash = DeviceMonthDayDataService.GetInstance().DeviceYearMMDDList(device, startTime, endTime); if (powerHash.Count > 0) { //加工数据 HandleData(powerHash, mic, tmpMDataArr, true); } deviceDataList.Add(tmpMDataArr); } dataHash.Add(DataItem.MONTH_DEVICE_ENERGY, deviceDataList); return(dataHash); case DataReportType.YEAR_REPORT_CODE: //年报表 //取得设备发电量列表数据 deviceDataList = new List <string[]>(); //首先取得头部标题,即横坐标 string[] yic = DeviceChartService.GetInstance().getXseriesFromYYYYMM(startTime, endTime).ToArray(); string[] yxAxis = DeviceChartService.GetInstance().formatXaxis(yic, ChartTimeType.YearMonth); string[] newYxAxis = new string[yxAxis.Length + 3]; yxAxis.CopyTo(newYxAxis, 2); //最前面添加一个空元素 newYxAxis[0] = LanguageUtil.getDesc("REPORT_COUNT_ITEM"); newYxAxis[1] = LanguageUtil.getDesc("REPORT_COUNT_DEVICE"); newYxAxis[newYxAxis.Length - 1] = LanguageUtil.getDesc("REPORT_COUNT_TODAYSUN"); deviceDataList.Add(newYxAxis); string[] tmpYDataArr = new string[newYxAxis.Length]; //取得电站所有设备 foreach (Device device in plant.displayDevices()) { if (device.deviceTypeCode != DeviceData.INVERTER_CODE) { continue; //只统计逆变器的 } tmpYDataArr = new string[newYxAxis.Length]; tmpYDataArr[1] = device.fullName; //取得原始数据 Hashtable powerHash = DeviceYearMonthDataService.GetInstance().GetDeviceBetweenYearData(device, int.Parse(startTime.Substring(0, 4)), int.Parse(endTime.Substring(0, 4))); if (powerHash.Count > 0) { //加工数据 HandleData(powerHash, yic, tmpYDataArr, true); } deviceDataList.Add(tmpYDataArr); } dataHash.Add(DataItem.YEAR_DEVICE_ENERGY, deviceDataList); return(dataHash); case DataReportType.TOTAL_REPORT_CODE: //总量报表 //取得设备发电量列表数据 deviceDataList = new List <string[]>(); //首先取得头部标题,即横坐标 IList <string> icList = new List <string>(); for (int mm = int.Parse(startTime); mm <= int.Parse(endTime); mm++) { icList.Add(mm.ToString()); } string[] tic = icList.ToArray(); string[] txAxis = DeviceChartService.GetInstance().formatXaxis(tic, ChartTimeType.Year); string[] newTxAxis = new string[txAxis.Length + 3]; txAxis.CopyTo(newTxAxis, 2); //最前面添加一个空元素 newTxAxis[0] = LanguageUtil.getDesc("REPORT_COUNT_ITEM"); newTxAxis[1] = LanguageUtil.getDesc("REPORT_COUNT_DEVICE"); newTxAxis[newTxAxis.Length - 1] = LanguageUtil.getDesc("REPORT_COUNT_TODAYSUN"); deviceDataList.Add(newTxAxis); string[] tmpTDataArr = new string[newTxAxis.Length]; //取得电站所有设备 foreach (Device device in plant.displayDevices()) { if (device.deviceTypeCode != DeviceData.INVERTER_CODE) { continue; //只统计逆变器的 } tmpTDataArr = new string[newTxAxis.Length]; tmpTDataArr[1] = device.fullName; //取得原始数据 Hashtable powerHash = DeviceYearDataService.GetInstance().GetTotalDatasByDevice(device); if (powerHash.Count > 0) { //加工数据 HandleData(powerHash, tic, tmpTDataArr, true); } deviceDataList.Add(tmpTDataArr); } dataHash.Add(DataItem.TOTAL_DEVICE_ENERGY, deviceDataList); return(dataHash); default: return(dataHash); } }