예제 #1
0
 public ActionResult AddPlant(int id)
 {
     Plant plant = new Plant();
     plant.id = id;
     plant.userID = UserUtil.getCurUser().id;
     return View(plant);
 }
예제 #2
0
 /// <summary>
 /// 功能:添加一个电站
 /// 描述:采集器没有对应一个电站
 /// </summary>
 /// <param name="plantInfo">电站实体</param>
 /// <returns>返回添加id</returns>
 public int AddPlantInfo(Plant plantInfo)
 {
     int res = _plantInfo.Insert(plantInfo);
     if (res > 0)
     {//创建系统报表
         ReportService.GetInstance().batchCreateSysRunReport(0, plantInfo.id);
         //给用户的电站用户集合增加一个用户
     }
     return res;
 }
예제 #3
0
 public ActionResult Save(Plant plant)
 {
     plant.description = Server.HtmlDecode(Request.Form["ctl00$MainContent$description"]);
     plantService.UpdatePlantInfo(plant);
     UserUtil.ResetLogin(UserUtil.getCurUser());
     return RedirectToAction("Includeallplants", "user");
 }
예제 #4
0
        public ActionResult SaveMap(Plant plant)
        {
            Plant newplant = FindPlant(plant.id);

            string long1 = Request.Form["long1"];
            string long2 = Request.Form["long2"];
            string long3 = Request.Form["long3"];
            double value = 0;
            double longValue = 0;
            double.TryParse(long1, out longValue);
            value += longValue;
            double.TryParse(long2, out longValue);
            value += (longValue / 60);

            double.TryParse(long3, out longValue);
            value += (longValue / 3600);

            newplant.longitude = value;
            value = 0;
            longValue = 0;
            string lat1 = Request.Form["lat1"];
            double.TryParse(lat1, out longValue);
            value += longValue;

            string lat2 = Request.Form["lat2"];
            double.TryParse(lat2, out longValue);
            value += (longValue / 60);

            string lat3 = Request.Form["lat3"];
            double.TryParse(lat3, out longValue);
            value += (longValue / 3600);
            newplant.latitude = value;

            newplant.longitudeString = string.Format("{0},{1},{2}", long1, long2, long3);
            newplant.latitudeString = string.Format("{0},{1},{2}", lat1, lat2, lat3);

            plantService.UpdatePlantInfo(newplant);
            return RedirectToAction("map", "plant", new { @id = plant.id });
        }
예제 #5
0
        public ActionResult Save(Plant plant)
        {
            plant.predictivedata = Request.Form["predictivedata"];
            plant.structPic = Request["sutpic"];

            if (string.IsNullOrEmpty(Request["structPic"]) == false && Request["structPic"].Equals(plant.structPic) == false)
                removeStructPicConfig(plant.id + "");
            string long1 = Request.Form["long1"];
            string long2 = Request.Form["long2"];
            string long3 = Request.Form["long3"];
            double value = 0;
            double longValue = 0;
            double.TryParse(long1, out longValue);
            value += longValue;
            double.TryParse(long2, out longValue);
            value += (longValue / 60);

            double.TryParse(long3, out longValue);
            value += (longValue / 3600);

            plant.longitude = value;
            value = 0;
            longValue = 0;
            string lat1 = Request.Form["lat1"];
            double.TryParse(lat1, out longValue);
            value += longValue;

            string lat2 = Request.Form["lat2"];
            double.TryParse(lat2, out longValue);
            value += (longValue / 60);

            string lat3 = Request.Form["lat3"];
            double.TryParse(lat3, out longValue);
            value += (longValue / 3600);
            plant.latitude = value;

            plant.longitudeString = string.Format("{0},{1},{2}", long1, long2, long3);
            plant.latitudeString = string.Format("{0},{1},{2}", lat1, lat2, lat3);

            CountryCity area = CountryCityService.GetInstance().GetCity(plant.country);
            plant.area = area == null ? string.Empty : area.weather_code;
            string start = Request.Form["fstart"];
            string end = Request.Form["fend"];
            string price = Request.Form["fprice"];
            ElecPriceService.GetInstance().Insert(new ElecPrice { fromHm = start, toHm = end, ptype = ElecPrice.Feng, plantId = plant.id, price = price });

            start = Request.Form["pstart"];
            end = Request.Form["pend"];
            price = Request.Form["pprice"];
            ElecPriceService.GetInstance().Insert(new ElecPrice { fromHm = start, toHm = end, ptype = ElecPrice.Ping, plantId = plant.id, price = price });

            start = Request.Form["gstart"];
            end = Request.Form["gend"];
            price = Request.Form["gprice"];
            ElecPriceService.GetInstance().Insert(new ElecPrice { fromHm = start, toHm = end, ptype = ElecPrice.Gu, plantId = plant.id, price = price });

            start = Request.Form["jstart"];
            end = Request.Form["jend"];
            price = Request.Form["jprice"];
            ElecPriceService.GetInstance().Insert(new ElecPrice { fromHm = start, toHm = end, ptype = ElecPrice.Jian, plantId = plant.id, price = price });

            plantService.UpdatePlantInfo(plant);

            //add by hbqian in 201305012 for修改城市后天气服务的静态城市列表能重新生效
            CityCodeService.codes = CountryCityService.GetInstance().GetCities();
            //重新取天气
            if (!string.IsNullOrEmpty(plant.city))
            {
                if (CityCodeService.plantTemp.ContainsKey(plant.city))
                {
                    CityCodeService.plantTemp.Remove(plant.city);
                }
            }
            UserUtil.ResetLogin(UserUtil.getCurUser());
            return RedirectToAction("profile", "plant", new { @id = plant.id });
        }
예제 #6
0
        public void generateEnergywarn(Plant plant)
        {
            int timezone = plant.timezone;
            //如果该电站没有设置系数,那么不处理
            if (!plant.rateEnable)
                return;

            DeviceMonthDayData dmdd = null;
            //找电站的发电量告警的最后处理日期,然后从其第二天进行处理
            DateTime waitHandleDate = plant.lastHandleDate;
            DateTime plantTime = CalenderUtil.curDateWithTimeZone(plant.timezone);
            //如果上一次处理的时间和电站是同一天那么就要小时来间隔处理了
            if (waitHandleDate.Year == plantTime.Year && waitHandleDate.Month == plantTime.Month && waitHandleDate.Day == plantTime.Day)
            {
                waitHandleDate = plantTime;
            }
            else
            {
                //上次处理时间和电站时间比较,如果不是昨天就置为昨天,就是只计算最近两天的
                if (!plantTime.AddDays(-1).ToString("yyyyMMdd").Equals(waitHandleDate.ToString("yyyyMMdd")))
                {
                    waitHandleDate = plantTime.AddDays(-1);
                }else{
                    waitHandleDate = waitHandleDate.AddDays(1);
                }
            }

            //找出电站非隐藏的逆变器
            IList<Device> devices = plant.typeDevices(DeviceData.INVERTER_CODE);

            //逐个判断逆变器设备是否有发电量比例告警,并将有告警的设备放入Hashtable中
            //首先取得电站设备的平均发电量
            double totalEnergy = 0;
            int deviceNum = 0;
            foreach (Device device in devices)
            {
                try
                {
                    dmdd = DeviceMonthDayDataService.GetInstance().GetDeviceMonthDayData(waitHandleDate.Year, device.id, waitHandleDate.Month);
                    totalEnergy += dmdd.getDayData(waitHandleDate.Day);
                    deviceNum++;
                }
                catch (Exception e)
                {

                }
            }

            //电站平均kwp发电量
            double avgRate = plant.design_power == 0 ? 0 : totalEnergy / plant.design_power;

            if (avgRate > 0)
            {
                //获取每个设备的发电量比率
                double rate = 0;
                double bizhi = 1;
                Energywarn energywarn = null;
                string warndate = waitHandleDate.ToString("yyyy-MM-dd");
                foreach (Device device in devices)
                {
                    energywarn = _EnergywarnDao.get(device.id, warndate);
                    if (energywarn == null)
                        energywarn = new Energywarn();

                    energywarn.deviceId = device.id;
                    try
                    {
                        dmdd = DeviceMonthDayDataService.GetInstance().GetDeviceMonthDayData(waitHandleDate.Year, device.id, waitHandleDate.Month);
                        ///rate = dmdd.getDayData(waitHandleDate.Day) / aveageEnergy;
                        rate = device.designPower == 0 ? 0 : dmdd.getDayData(waitHandleDate.Day) / device.designPower;
                    }
                    catch (Exception e)
                    {
                        continue;
                    }

                    bizhi = avgRate == 0 ? 0 : rate / avgRate;
                    //正常范围内不提示告警
                    if (bizhi < plant.maxEnergyRate && bizhi > plant.energyRate)
                    {
                        //上传当前设备已经生成过的发电量告警
                        if (energywarn.id > 0)
                            _EnergywarnDao.Remove(energywarn);
                        continue;
                    }

                    if (Math.Abs(rate) > plant.energyRate && Math.Abs(rate) < plant.maxEnergyRate) continue;

                    bizhi = Math.Round(bizhi, 2);
                    if (bizhi <= plant.energyRate)
                        energywarn.factRate = bizhi + "/" + plant.energyRate;
                    else
                        energywarn.factRate = bizhi + "/" + plant.maxEnergyRate;

                    energywarn.factValue = Math.Round(rate, 2);
                    energywarn.downRate = plant.energyRate.Value;
                    energywarn.upRate = plant.maxEnergyRate.Value;
                    energywarn.warndate = warndate;
                    energywarn.averageValue = Math.Round(avgRate, 2);
                    //创建一笔告警日志,存库
                    if (energywarn.id > 0)
                        _EnergywarnDao.Update(energywarn);
                    else
                        _EnergywarnDao.Insert(energywarn);
                }
            }
            //更新设备发电量告警日志随后处理时间为当前处理的日期
            plant.lastHandleDate = waitHandleDate;
            PlantService.GetInstance().Save(plant);
        }
예제 #7
0
 public int Remove(int id)
 {
     Plant p = new Plant();
     return _plantInfo.Remove(new Plant() { id = id });
 }
예제 #8
0
 public int UpdatePaymentLimitDate(Plant plant)
 {
     return _plantInfoDao.UpdatePaymentLimitDate(plant);
 }
예제 #9
0
 /// <summary>
 /// 生成电站多年 月kWp发电量对比
 /// </summary>
 /// <param name="id"></param>
 /// <param name="chartType"></param>
 /// <returns></returns>
 private ActionResult PlantYearCompareChart(Plant plant, string chartType, string name, MonitorType mt, string unit, float rate)
 {
     string reportCode = string.Empty;
     if (plant != null)
     {
         IList<int> workYears = CollectorYearDataService.GetInstance().GetWorkYears(plant);
         if (workYears.Count <= 2) chartType = ChartType.column;
         if (workYears.Count == 0)
         {
             reportCode = "error:" + LanguageUtil.getDesc("PLANT_CHART_NOWORK_YEAR");
             return Content(reportCode);
         }
         ChartData chartData = CompareChartService.GetInstance().PlantYearCompare(new List<Plant>() { plant }, workYears, name, mt, unit, chartType, rate);
         reportCode = JsonUtil.convertToJson(chartData, typeof(ChartData));
     }
     else
     {
         return Content("error:" + Resources.SunResource.NODATA);
     }
     return Content(reportCode);
 }
예제 #10
0
 //虚拟电站开始
 /// <summary>
 /// 保存电站,内部封装新和添加方法,依据id判断
 /// modify by qhb in 20120422
 /// </summary>
 /// <param name="plant"></param>
 /// <returns></returns>
 public int Save(Plant plant)
 {
     if (plant.id > 0)
     {
         _plantInfoDao.Update(plant);
         return plant.id;
     }
     else
         return _plantInfoDao.Insert(plant);
 }
예제 #11
0
 public int UpdateLastEmailRemindDate(Plant plant)
 {
     return _plantInfoDao.UpdateLastEmailRemindDate(plant);
 }
예제 #12
0
 /// <summary>
 /// 功能:根据id获取电站信息
 /// </summary>
 /// <param name="id">电站Id</param>
 /// <returns>返回电站实体</returns>
 public Plant GetPlantInfoById(int pid)
 {
     Plant p = new Plant();
     p.id = pid;
     return _plantInfoDao.Get(p);
 }
예제 #13
0
 /// <summary>
 /// 取得电站的某月的性能
 /// </summary>
 /// <param name="plant"></param>
 /// <param name="year"></param>
 /// <param name="month"></param>
 /// <param name="monthEnergy"></param>
 /// <returns>已经转化为百分率了</returns>
 public double getMonthPr(Plant plant, int year, int month, double monthEnergy)
 {
     Device device = plant.getDetectorWithRenderSunshine();
     if (device == null) return 0;
     DeviceYearMonthData deviceYearmonth = DeviceYearMonthDataService.GetInstance().GetDeviceYearMonthData(device.id, year);
     float monthsunlingt = deviceYearmonth.getMonthData(month);
     if (monthsunlingt == 0) return 0;
     double? precictValue = plant.monthpredictValue(month);//发电量预测值
     if (precictValue != null)
     {
         return monthEnergy / precictValue.Value;
     }
     else
     {
         float dp = plant.design_power == 0 ? 1 : plant.design_power;
         return monthEnergy / monthsunlingt * 1000 * dp;
     }
 }
예제 #14
0
        public ActionResult SavePlant(Plant plant)
        {
            string long1 = Request.Form["long1"];
            string long2 = Request.Form["long2"];
            string long3 = Request.Form["long3"];
            double value = 0;
            double longValue = 0;
            double.TryParse(long1, out longValue);
            value += longValue;
            double.TryParse(long2, out longValue);
            value += (longValue / 60);

            double.TryParse(long3, out longValue);
            value += (longValue / 3600);

            plant.longitude = value;
            value = 0;
            longValue = 0;
            string lat1 = Request.Form["lat1"];
            double.TryParse(lat1, out longValue);
            value += longValue;

            string lat2 = Request.Form["lat2"];
            double.TryParse(lat2, out longValue);
            value += (longValue / 60);

            string lat3 = Request.Form["lat3"];
            double.TryParse(lat3, out longValue);
            value += (longValue / 3600);
            plant.latitude = value;

            plant.longitudeString = string.Format("{0},{1},{2}", long1, long2, long3);
            plant.latitudeString = string.Format("{0},{1},{2}", lat1, lat2, lat3);

            if (string.IsNullOrEmpty(plant.pic))
                plant.pic = string.Empty;
            plant.userID = UserUtil.getCurUser().id;
            CountryCity area = CountryCityService.GetInstance().GetCity(plant.country);
            plant.area = area == null ? string.Empty : area.weather_code;
            int plantid = plantService.AddPlantInfo(plant);
            plantUserService.AddPlantUser(new PlantUser { plantID = plantid, userID = int.Parse(plant.userID.ToString()) });//添加电站时,向电站用户关系表中加记录
            UserUtil.ResetLogin(UserUtil.getCurUser());
            return RedirectToAction("allplants", "user");
        }
예제 #15
0
 /// <summary>
 /// 取得电站的某年的性能
 /// </summary>
 /// <param name="plant"></param>
 /// <param name="year"></param>
 /// <param name="yearEnergy"></param>
 /// <returns>已经转化为百分率了</returns>
 public double getYearPr(Plant plant, int year, double yearEnergy)
 {
     Device device = plant.getDetectorWithRenderSunshine();
     if (device == null) return 0;
     DeviceYearData deviceYearmonth = DeviceYearDataService.GetInstance().GetDeviceYearData(device.id, year);
     float monthsunlingt = deviceYearmonth.dataValue;
     if (monthsunlingt == 0) return 0;
     float dp = plant.design_power == 0 ? 1 : plant.design_power;
     return yearEnergy / monthsunlingt * 1000 * dp;
 }
예제 #16
0
        /// <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;
            }
        }
예제 #17
0
 /// <summary>
 /// 功能:修改电站图片
 /// </summary>
 /// <param name="plant">电站实体</param>
 /// <returns></returns>
 public int ModifyPlantPic(Plant plant)
 {
     return _plantInfo.ModifyPlantPic(plant);
 }
예제 #18
0
        /// <summary>
        /// 单个电站数据项数据
        /// </summary>
        /// <param name="plant">电站</param>
        /// <param name="dataItemCode">数据项代码</param>
        /// <param name="startTime">开始时间,日报表只取开始时间,周报表的时间格式为:yyyyMMdd-yyyyMMdd</param>
        /// <param name="endTime"></param>
        /// <returns>数据项为key</returns>
        private Hashtable getPlantItemData(Plant plant, int reportType, string startTime,string endTime)
        {
            Hashtable datahash = new Hashtable();
            float co2Rate = ItemConfigService.GetInstance().getCO2Config();
            switch (reportType)
            {
                //--------日报表数据 start--------------
                case DataReportType.TODAY_REPORT_CODE://日报表
                    //日发电量
                    float energy = CollectorMonthDayDataService.GetInstance().getDayData(plant.allFactUnits, startTime);
                    //add发电量
                    datahash.Add(DataItem.TODAY_ENERGY, StringUtil.formatDouble(energy, "0.00") + " " + MonitorType.getMonitorTypeByCode(MonitorType.PLANT_MONITORITEM_ENERGY_CODE).unit);
                    //add日最大功率 和发生时间
                    int year = int.Parse(startTime.Substring(0,4));
                    int month = int.Parse(startTime.Substring(4, 2));
                    int day = int.Parse(startTime.Substring(6, 2));
                    DeviceDataCount ddc = DeviceDataCountService.GetInstance().GetPlantMax(plant.id, MonitorType.PLANT_MONITORITEM_POWER_CODE, year, month, day);
                    string res = LanguageUtil.getDesc("NODATA");
                    if (ddc != null) {
                        res = ddc.maxTime+"("+ddc.maxValue+" " + MonitorType.getMonitorTypeByCode(MonitorType.PLANT_MONITORITEM_POWER_CODE).unit+")";
                    }
                    datahash.Add(DataItem.TODAY_MAX_POWER,res);
                    //今日CO2减排

                    double co2reduce = Plant.computeCO2Reduce(co2Rate, energy);
                    datahash.Add(DataItem.TODAY_AVOIDED_CO2, StringUtil.formatDouble(co2reduce, "0.00") + " " + Plant.computeReduceUnit(co2Rate * energy));
                    //日收入
                    datahash.Add(DataItem.TODAY_REVENUE, plant.currencies+" " +Currencies.format(plant.currencies,energy * plant.revenueRate));

                    //累计总发电量
                    datahash.Add(DataItem.TODAY_TOTAL_ENERGY, plant.DisplayTotalEnergy + " " + plant.TotalEnergyUnit);
                    //累计总收入
                    datahash.Add(DataItem.TODAY_TOTAL_REVENUE, plant.currencies + " " +plant.DisplayRevenue);

                    //累计CO2减排
                    datahash.Add(DataItem.TODAY_TOTAL_AVOIDED_CO2, StringUtil.formatDouble(plant.Reductiong) + " " + plant.ReductiongUnit);

                    //投资收益
                    datahash.Add(DataItem.TODAY_RATE, Math.Round(energy / plant.design_power, 2) + " kWh/kWp");

                    return datahash;
               //--------周报表数据--------------
                case DataReportType.WEEK_REPORT_CODE:
                    //周发电量
                    Hashtable w_dataHash = CollectorMonthDayDataService.GetInstance().GetUnitBetweenMonthData(plant.allFactUnits, startTime, endTime);
                    float w_energy = 0;
                    foreach (Object o in w_dataHash.Values)
                    {
                        w_energy += StringUtil.stringtoFloat(o.ToString());
                    }
                    datahash.Add(DataItem.WEEK_ENERGY, StringUtil.formatDouble(w_energy, "0.00") + " " + MonitorType.getMonitorTypeByCode(MonitorType.PLANT_MONITORITEM_ENERGY_CODE).unit);
                    //周CO2减排
                    double co2reduce1 = Plant.computeCO2Reduce(co2Rate, w_energy);
                    datahash.Add(DataItem.WEEK_AVOIDED_CO2, StringUtil.formatDouble(co2reduce1) + " " + Plant.computeReduceUnit(co2Rate * w_energy));
                    //周收益
                    datahash.Add(DataItem.WEEK_REVENUE, plant.currencies+" "+Currencies.format(plant.currencies, w_energy * plant.revenueRate));
                    //累计总发电量
                    datahash.Add(DataItem.WEEK_TOTAL_ENERGY, plant.DisplayTotalEnergy + " " + plant.TotalEnergyUnit);
                    //累计总收入
                    datahash.Add(DataItem.WEEK_TOTAL_REVENUE, plant.currencies+" "+plant.DisplayRevenue);
                    //累计CO2减排
                    datahash.Add(DataItem.WEEK_TOTAL_AVOIDED_CO2, StringUtil.formatDouble(plant.Reductiong, "0.00") + " " + plant.ReductiongUnit);

                    //投资收益
                    datahash.Add(DataItem.WEEK_RATE, Math.Round(w_energy / plant.design_power, 2) + " kWh/kWp");
                    return datahash;
                //--------月报表------------
                case DataReportType.MONTH_REPORT_CODE:
                    Hashtable m_dataHash = CollectorMonthDayDataService.GetInstance().GetUnitBetweenMonthData(plant.allFactUnits, startTime, endTime);
                    float m_energy = 0;
                    foreach (Object o in m_dataHash.Values)
                    {
                        m_energy += StringUtil.stringtoFloat(o.ToString());
                    }
                    datahash.Add(DataItem.MONTH_ENERGY, StringUtil.formatDouble(m_energy, "0.00") + " " + MonitorType.getMonitorTypeByCode(MonitorType.PLANT_MONITORITEM_ENERGY_CODE).unit);
                    //月CO2减排
                    double co2reduce_m = Plant.computeCO2Reduce(co2Rate, m_energy);
                    datahash.Add(DataItem.MONTH_AVOIDED_CO2, StringUtil.formatDouble(co2reduce_m, "0.00") + " " + Plant.computeReduceUnit(co2Rate * m_energy));
                    //月收益
                    datahash.Add(DataItem.MONTH_REVENUE, plant.currencies+" "+Currencies.format(plant.currencies, m_energy * plant.revenueRate));
                    //累计总发电量
                    datahash.Add(DataItem.MONTH_TOTAL_ENERGY, plant.DisplayTotalEnergy + " " + plant.TotalEnergyUnit);
                    //累计总收入
                    datahash.Add(DataItem.MONTH_TOTAL_REVENUE,plant.currencies+" "+plant.DisplayRevenue);
                    //累计CO2减排
                    datahash.Add(DataItem.MONTH_TOTAL_AVOIDED_CO2, StringUtil.formatDouble(plant.Reductiong, "0.00") + " " + plant.ReductiongUnit);

                    //投资收益
                    datahash.Add(DataItem.MONTH_RATE, Math.Round(m_energy / plant.design_power, 2) + " kWh/kWp");
                    return datahash;
                //------年报表-----------------
                case DataReportType.YEAR_REPORT_CODE:
                    int startYear = int.Parse(startTime.Substring(0,4));
                    int endYear = int.Parse(endTime.Substring(0, 4));
                    Hashtable y_dataHash = CollectorYearMonthDataService.GetInstance().GetUnitBetweenYearData(plant.allFactUnits, startYear, endYear);
                    float y_energy = 0;
                    foreach (Object o in y_dataHash.Values)
                    {
                        y_energy += StringUtil.stringtoFloat(o.ToString());
                    }
                    datahash.Add(DataItem.YEAR_ENERGY, StringUtil.formatDouble(y_energy, "0.00") + " " + MonitorType.getMonitorTypeByCode(MonitorType.PLANT_MONITORITEM_ENERGY_CODE).unit);
                    //年CO2减排
                    double co2reduce_y = Plant.computeCO2Reduce(co2Rate, y_energy);
                    datahash.Add(DataItem.YEAR_AVOIDED_CO2, co2reduce_y + " " + Plant.computeReduceUnit(co2Rate * y_energy));
                    //年收益
                    datahash.Add(DataItem.YEAR_REVENUE, plant.currencies+" "+Currencies.format(plant.currencies, y_energy * plant.revenueRate));
                    //累计总发电量
                    datahash.Add(DataItem.YEAR_TOTAL_ENERGY, plant.DisplayTotalEnergy + " " + plant.TotalEnergyUnit);
                    //累计总收入
                    datahash.Add(DataItem.YEAR_TOTAL_REVENUE, plant.currencies+" "+plant.DisplayRevenue);
                    //累计CO2减排
                    datahash.Add(DataItem.YEAR_TOTAL_AVOIDED_CO2, StringUtil.formatDouble(plant.Reductiong, "0.00") + " " + plant.ReductiongUnit);
                    //投资收益
                    datahash.Add(DataItem.YEAR_RATE, Math.Round(y_energy / plant.design_power, 2) + " kWh/kWp");
                    return datahash;
                //------总量报表-----------------
                case DataReportType.TOTAL_REPORT_CODE:
                    //累计总发电量
                    datahash.Add(DataItem.TOTAL_ENERGY, plant.DisplayTotalEnergy + " " + plant.TotalEnergyUnit);
                    //累计总收入
                    datahash.Add(DataItem.TOTAL_REVENUE, plant.currencies+" "+plant.DisplayRevenue);
                    //累计CO2减排
                    datahash.Add(DataItem.TOTAL_AVOIDED_CO2, StringUtil.formatDouble(plant.Reductiong) + " " + plant.ReductiongUnit);
                    //投资收益
                    datahash.Add(DataItem.TOTAL_RATE, Math.Round(plant.TotalEnergy / plant.design_power, 2) + " kWh/kWp");
                    return datahash;
                default:
                    return datahash;
            }
        }
예제 #19
0
 /// <summary>
 /// 功能:修改电站信息
 /// 描述:根据PlantInfo信息修改电站信息
 /// </summary>
 /// <param name="plantInfo">电站实体</param>
 /// <returns>1成功0没成功</returns>
 public int UpdatePlantInfo(Plant plantInfo)
 {
     return _plantInfo.Update(plantInfo);
 }
예제 #20
0
        /// <summary>
        /// 创建页面js结构树的脚本
        /// </summary>
        /// <param name="topLevelPlants">顶层电站集合</param>
        /// <param name="level">当前电站层次</param>
        /// <param name="uplevel">上级电站层次,必须传入-1</param>
        /// <returns></returns>
        public string createInverterContructTree(Plant plant, int uplevel)
        {
            string jsstr = string.Format(" d.add({0}, {1}, '{2}', '{3}', '', '', '/images/tree/folder.gif');", 1, -1, "选择设备", "javascript:void(0);");
            //
            int topLevel = 1;
            int deviceLevel = 1;
            string firstRun = "";
            int unitLevel = 1;
            //遍历单元,先显示单元层级
            PlantUnit pu = null;
            for (int i = 0; i < plant.plantUnits.Count; i++)
            {
                pu = plant.plantUnits[i];
                unitLevel = unitLevel * 100 + i;
                jsstr += string.Format(" d.add({0}, {1}, '{2}', '{3}', '', '', '');", unitLevel, topLevel, pu.displayname, "javascript:void(0);");

                //先装机逆变器类型设备节点
                IList<Device> devices = pu.typeDevices(DeviceData.INVERTER_CODE, false);
                if (devices != null && devices.Count > 0)
                {
                    deviceLevel = unitLevel + 10;
                    firstRun = ";";
                    jsstr += firstRun;
                    jsstr += generateInterverNode(devices, deviceLevel, unitLevel, DeviceData.getDeviceTypeByCode(DeviceData.INVERTER_CODE).name);
                }
            }
            jsstr += ";d.closeAll();";
            return jsstr;
        }
예제 #21
0
 /// <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;
 }
예제 #22
0
 public string generateDeviceRelation(Plant plant)
 {
     return generateDeviceRelation(plant, true);
 }
예제 #23
0
 /// <summary>
 /// 设置某个电站的设备
 /// </summary>
 /// <param name="plant"></param>
 public void SetDeviceList(Plant plant)
 {
     this.SetDeviceList(new List<Plant>() { plant });
 }
예제 #24
0
        /// <summary>
        /// 产生叶子电站的设备关系树数据
        /// </summary>
        /// <param name="plant">叶子实际电站</param>
        /// <returns></returns>
        public string generateDeviceRelation(Plant plant, bool warn)
        {
            string jsstr = string.Empty;
            int curLevel = 1;
            int uplevel = -1;
            jsstr += string.Format(" d.add({0}, {1}, \"{2}\", '{3}', '', '', '{4}');", curLevel, uplevel, plant.name, "javascript:void(0);", "");
            int topLevel = 1;
            int deviceLevel = 1;
            int unitLevel = 1;
            //遍历单元,先显示单元层级
            PlantUnit pu = null;
            for (int i = 0; i < plant.plantUnits.Count; i++)
            {
                pu = plant.plantUnits[i];
                //先装机逆变器类型设备节点
                IList<Device> devices = pu.displayDevices;
                unitLevel = unitLevel * 100 + i;
                string warnimg = pu.isDeviceFault(plant.timezone) && warn ? "/images/warning_16_small.gif" : "";
                jsstr += string.Format(" d.add({0}, {1}, \"{2}\", '{3}', '', '', '{4}');", unitLevel, topLevel, pu.displayname + "(" + devices.Count + ")", string.Format("javascript:setPara({0},{1},{2});", pu.id, "true", pu.id), warnimg);

                devices = devices.OrderByDescending(m => m.deviceModelCode).ToList<Device>();
                if (devices != null && devices.Count > 0)
                {
                    deviceLevel = unitLevel + 10;
                    jsstr += generateDeviceRelation(devices, deviceLevel, unitLevel, pu.id, plant.timezone, warn);
                }
            }
            return jsstr;
        }
예제 #25
0
 public ActionResult SaveEnergyRate(Plant plant)
 {
     double? rate = plant.energyRate;
     double? maxRate = plant.maxEnergyRate;
     bool rateEnable = plant.rateEnable;
     plant = plantService.GetPlantInfoById(plant.id);
     plant.energyRate = rate;
     plant.maxEnergyRate = maxRate;
     plant.rateEnable = rateEnable;
     plant.lastHandleDate = new DateTime(0002, 1, 1, 0, 0, 1);
     plantService.UpdatePlantInfo(plant);
     return View("energyrate", plant);
 }
예제 #26
0
        /// <summary>
        /// 创建页面js结构树的脚本
        /// </summary>
        /// <param name="topLevelPlants">顶层电站集合</param>
        /// <param name="level">当前电站层次</param>
        /// <param name="uplevel">上级电站层次,必须传入-1</param>
        /// <returns></returns>
        public string createDeviceContructTree(Plant plant, int uplevel)
        {
            string jsstr = "";

            int topLevel = -1;
            int deviceLevel = 1;
            string firstRun = "";
            int unitLevel = 1;
            //(string.IsNullOrEmpty(plant.firstPic) ? "/ufile/small/nopic/nopico02/gif" : "/ufile/small/"+plant.firstPic
            //增加电站节点
            jsstr += string.Format(" d.add({0}, {1}, '{2}', '{3}', '', '', '{4}');", unitLevel, topLevel, plant.name, "javascript:void(0);", "");
            topLevel = 1;
            //遍历单元,先显示单元层级
            PlantUnit pu = null;
            for (int i = 0; i < plant.plantUnits.Count; i++)
            {
                pu = plant.plantUnits[i];
                unitLevel = unitLevel * 100 + i;
                jsstr += string.Format("d.add({0}, {1}, '{2}', '{3}', '', '', '');", unitLevel, topLevel, pu.displayname, "javascript:void(0);");

                //先装机逆变器类型设备节点
                IList<Device> devices = pu.typeDevices(DeviceData.INVERTER_CODE, false);
                if (devices != null && devices.Count > 0)
                {
                    deviceLevel = unitLevel + 1;
                    firstRun = "parent.loadRunData(" + devices[0].id + ");";
                    jsstr += firstRun;
                    jsstr += generateDeviceNode(devices, deviceLevel, unitLevel, DeviceData.getDeviceTypeByCode(DeviceData.INVERTER_CODE).name, "/images/tree/inverter.png");
                }

                //汇流箱类型设备节点
                devices = pu.typeDevices(DeviceData.HUILIUXIANG_CODE, false);
                if (devices != null && devices.Count > 0)
                {
                    deviceLevel = unitLevel + 2;
                    if (string.IsNullOrEmpty(firstRun))
                    {
                        firstRun = "parent.loadRunData(" + devices[0].id + ");";
                        jsstr += firstRun;
                    }
                    jsstr += generateDeviceNode(devices, deviceLevel, unitLevel, DeviceData.getDeviceTypeByCode(DeviceData.HUILIUXIANG_CODE).name, "/images/tree/hlx.png");
                }

                //环境监测仪类型设备节点
                devices = pu.typeDevices(DeviceData.ENVRIOMENTMONITOR_CODE, false);
                if (devices != null && devices.Count > 0)
                {
                    deviceLevel = unitLevel + 3;
                    if (string.IsNullOrEmpty(firstRun))
                    {
                        firstRun = "parent.loadRunData(" + devices[0].id + ");";
                        jsstr += firstRun;
                    }
                    jsstr += generateDeviceNode(devices, deviceLevel, unitLevel, DeviceData.getDeviceTypeByCode(DeviceData.ENVRIOMENTMONITOR_CODE).name, "/images/tree/hjjcy.png");
                }
                //配电柜类型设备节点
                devices = pu.typeDevices(DeviceData.CABINET_CODE, false);
                if (devices != null && devices.Count > 0)
                {
                    deviceLevel = unitLevel + 4;
                    if (string.IsNullOrEmpty(firstRun))
                    {
                        firstRun = "parent.loadRunData(" + devices[0].id + ");";
                        jsstr += firstRun;
                    }
                    jsstr += generateDeviceNode(devices, deviceLevel, unitLevel, DeviceData.getDeviceTypeByCode(DeviceData.CABINET_CODE).name, "");
                }
                //电表
                devices = pu.typeDevices(DeviceData.AMMETER_CODE, false);
                if (devices != null && devices.Count > 0)
                {
                    deviceLevel = unitLevel + 5;
                    if (string.IsNullOrEmpty(firstRun))
                    {
                        firstRun = "parent.loadRunData(" + devices[0].id + ");";
                        jsstr += firstRun;
                    }
                    jsstr += generateDeviceNode(devices, deviceLevel, unitLevel, DeviceData.getDeviceTypeByCode(DeviceData.AMMETER_CODE).name, "/images/tree/dianbiao.png");
                }
            }
            return jsstr;
        }
예제 #27
0
 public ActionResult SavePlant(Plant plant)
 {
     plant.userID = UserUtil.getCurUser().id;
     if (plant.energyRate == null || plant.energyRate.Value == 0) plant.energyRate = 1;
     if (plant.id == 0)//添加电站设置其过期时间延迟3M
         plant.PaymentLimitDate = DateTime.Now.AddMonths(PaymentDelayMonth);
     int plantid = plantService.AddPlantInfo(plant);
     //添加电站时,向电站用户关系表中加记录
     plantUserService.AddPlantUser(new PlantUser { plantID = plantid, userID = plant.userID, shared = false, roleId = Role.ROLE_SYSMANAGER });
     UserUtil.ResetLogin(UserUtil.getCurUser());
     return RedirectToAction("profile", "plant", new { @id = plant.id });
 }
예제 #28
0
        public double GetEnergy(Plant plant, string startyyyyMMdd, string endyyyyMMdd)
        {
            double returnValue = 0;
            if (plant == null || plant.plantUnits == null || plant.plantUnits.Count.Equals(0))
                return 0;
            foreach (PlantUnit pu in plant.plantUnits)
            {
                returnValue += CollectorInfoService.GetInstance().GetEnergy(pu.id, startyyyyMMdd, endyyyyMMdd);
            }

            return returnValue;
        }
예제 #29
0
        /// <summary>
        /// 将单元列表转换成
        /// </summary>
        /// <param name="plants"></param>
        /// <returns></returns>
        private IList<TypeDeviceVO> convertToSDeviceVOs(IList<Device> devices, Plant plant)
        {
            string apath = Request.Url.AbsolutePath;
            string auri = Request.Url.AbsoluteUri;

            string devicePicBaseWebappUrl = auri.Substring(0, auri.IndexOf(apath)) + "/devicepic";

            IList<TypeDeviceVO> splants = new List<TypeDeviceVO>();
            IDictionary<string, IList<SimpleDeviceVO>> typeDic = new Dictionary<string, IList<SimpleDeviceVO>>();
            SimpleDeviceVO sdvo = null;
            foreach (Device device in devices)
            {
                sdvo = new SimpleDeviceVO();
                sdvo.deviceId = device.id;
                sdvo.deviceModel = (device.name != null && device.name.IndexOf("#") > -1) ? device.name.Substring(0, device.name.IndexOf("#")) : device.xinhaoName;

                sdvo.deviceType = device.typeName;

                if (device.deviceTypeCode == DeviceData.ENVRIOMENTMONITOR_CODE)
                {
                    MonitorType mt = MonitorType.getMonitorTypeByCode(MonitorType.MIC_DETECTOR_SUNLINGHT);
                    sdvo.displayField = mt.name + ":" + device.Sunlight + " " + mt.unit;
                }
                else if (device.deviceTypeCode == DeviceData.HUILIUXIANG_CODE || device.deviceTypeCode == DeviceData.CABINET_CODE)
                {
                    MonitorType mt = MonitorType.getMonitorTypeByCode(MonitorType.MIC_BUSBAR_TOTALCURRENT);
                    float totalCurrent = device.runData == null ? 0 : device.runData.getMonitorValue(MonitorType.MIC_BUSBAR_TOTALCURRENT);
                    sdvo.displayField = mt.name + ":" + totalCurrent + " " + mt.unit;
                }
                else if (device.deviceTypeCode == DeviceData.AMMETER_CODE)
                {
                    MonitorType mt = MonitorType.getMonitorTypeByCode(MonitorType.MIC_AMMETER_POSITIVEACTIVEPOWERDEGREE);
                    double totalCurrent = device.getMonitorValue(MonitorType.MIC_AMMETER_POSITIVEACTIVEPOWERDEGREE);
                    sdvo.displayField = mt.name + ": " + totalCurrent + mt.unit;
                }
                else
                {
                    MonitorType mt = MonitorType.getMonitorTypeByCode(MonitorType.MIC_INVERTER_TOTALYGPOWER);
                    sdvo.displayField = mt.name + ":" + device.TotalPower + " " + mt.unit;
                }

                sdvo.workStatus = (device.Over1Day(plant.timezone) ? 0 : 1).ToString();//超过一天无数据为不工作,工作返回1 不工作返回0
                sdvo.address = device.deviceAddress;
                sdvo.pic = devicePicBaseWebappUrl + "/devicepic_31.gif";
                int stoptime = device.stopTime(0);
                sdvo.displayStatus = (stoptime > 24 ? 3 : (stoptime > 1 ? 2 : 1)).ToString();
                sdvo.lastUpdatedTime = device.lastUpdateTime;
                IList<SimpleDeviceVO> deviceVoList = null;
                if (!typeDic.ContainsKey(device.typeName))
                {
                    deviceVoList = new List<SimpleDeviceVO>();
                }
                else
                {
                    deviceVoList = typeDic[device.typeName];
                }
                deviceVoList.Add(sdvo);
                typeDic[device.typeName] = deviceVoList;
            }
            TypeDeviceVO tdvo = null;
            foreach (string key in typeDic.Keys)
            {
                tdvo = new TypeDeviceVO();
                tdvo.type = key;
                tdvo.devices = typeDic[key];
                splants.Add(tdvo);
            }
            return splants;
        }
예제 #30
0
 /// <summary>
 /// 作者:鄢睿
 /// 功能:通过单个电站列表获得跨月天的天图表
 /// 创建时间:2011年02月25日
 /// 修改:胡圣忠
 /// </summary>
 /// <param name="id"></param>
 /// <returns></returns>
 public ChartData MMDDChartByPlant(Plant plant, string startYYYYMMDD, string endYYYYMMDD, string chartType, string unit)
 {
     return MMDDChartBypList(new List<Plant>() { plant }, startYYYYMMDD, endYYYYMMDD, chartType, unit);
 }