Beispiel #1
0
        /// <summary>
        /// 加载首页数据,抽取出来供首页加载方法和首页登录方法调用
        /// author:hbqian in 2013/02/21
        /// </summary>
        private void loadIndexData()
        {
            //取得最新加入的电站
            IList <Plant> newPlants = PlantService.GetInstance().GetNewPlantInfoList(4);
            User          userinfo  = UserService.GetInstance().GetUserByName(UserUtil.demousername);

            if (userinfo != null)
            {
                IList <PlantUser> plant = PlantUserService.GetInstance().GetAllPlantUserByUserID(new PlantUser {
                    userID = userinfo.id
                });
                ViewData["examplePlant"] = plant;
            }
            ViewData["newPlants"] = newPlants;
            float co2Rate = ItemConfigService.GetInstance().getCO2Config();

            ViewData["AllPlant"] = PlantService.GetInstance().GetPlantNum();

            double alltotalenergy = DeviceRunDataService.GetInstance().GetAllTotalEnergy();
            double dayEnergy      = CollectorRunDataService.GetInstance().GetAllDayEnergy();
            double co2Value       = alltotalenergy * co2Rate;

            ViewData["co2Unit"]           = Util.upCo2Unit(co2Value);
            ViewData["energyUnit"]        = Util.upEnergyUnit(alltotalenergy);
            ViewData["dayenergyUnit"]     = Util.upEnergyUnit(dayEnergy);
            ViewData["AllTotalEnergy"]    = StringUtil.formatDouble(Util.upDigtal(alltotalenergy));
            ViewData["AlldayTotalEnergy"] = StringUtil.formatDouble(Util.upDigtal(dayEnergy));
            ViewData["AllCO2"]            = StringUtil.formatDouble(Util.upDigtal(co2Value));
            getPPics();
            getAdPics();
        }
Beispiel #2
0
        /// <summary>
        /// 取得所有统计数据
        /// </summary>
        /// <param name="app_key">第三方应用唯一key</param>
        /// <param name="call_id">请求序号</param>
        /// <param name="sig">签名</param>
        /// <param name="v">api版本</param>
        /// <param name="format">返回结果格式,暂时值支持json</param>
        /// <param name="lan">语言环境,暂时只支持中英文</param>
        /// <returns></returns>
        public ActionResult TotalInfo(string app_key, string call_id, string sig, string v, string format, string username, string lan)
        {
            setlan(lan);
            TotalInfo tinfo = new TotalInfo();

            if (string.IsNullOrEmpty(username))
            {
                double allTotalEnergy = DeviceRunDataService.GetInstance().GetAllTotalEnergy();
                double allDayEnergy   = CollectorRunDataService.GetInstance().GetAllDayEnergy();
                double allDayPower    = CollectorRunDataService.GetInstance().getAllPower();
                tinfo.totalDayEnergy      = Util.upDigtal(allDayEnergy);
                tinfo.totalDayEnergyUnit  = Util.upEnergyUnit(allDayEnergy);
                tinfo.plantsCount         = PlantService.GetInstance().GetPlantInfoList().Count();
                tinfo.totalCO2Reduce      = Util.upDigtal(ItemConfig.reductionRate * allTotalEnergy);
                tinfo.totalCO2ReduceUnit  = Util.upCo2Unit(ItemConfig.reductionRate * allTotalEnergy);
                tinfo.totalEnergy         = Util.upDigtal(allTotalEnergy);
                tinfo.totalEnergyUnit     = Util.upEnergyUnit(allTotalEnergy);
                tinfo.totalTodayPower     = Util.upDigtal(allDayPower);
                tinfo.totalTodayPowerUnit = Util.upPowerUnit(allDayPower);
                double top = PlantService.GetInstance().getTotalPower();
                tinfo.totalPower     = Util.upDigtal(top);
                tinfo.totalPowerUnit = Util.upPowerUnit(top);
                tinfo.treeNum        = (allTotalEnergy / 40).ToString("0");
            }
            else
            {
                User user = UserService.GetInstance().GetUserByName(username);
                if (user != null)
                {
                    double allTotalEnergy = user.TotalEnergy;
                    double allDayEnergy   = user.TotalDayEnergy;
                    double allDayPower    = user.TotalPower;
                    tinfo.totalDayEnergy      = Util.upDigtal(allDayEnergy);
                    tinfo.totalDayEnergyUnit  = Util.upEnergyUnit(allDayEnergy);
                    tinfo.plantsCount         = user.plants.Count;
                    tinfo.totalCO2Reduce      = Util.upDigtal(ItemConfig.reductionRate * allTotalEnergy);
                    tinfo.totalCO2ReduceUnit  = Util.upCo2Unit(ItemConfig.reductionRate * allTotalEnergy);
                    tinfo.totalEnergy         = Util.upDigtal(allTotalEnergy);
                    tinfo.totalEnergyUnit     = Util.upEnergyUnit(allTotalEnergy);
                    tinfo.totalTodayPower     = Util.upDigtal(allDayPower);
                    tinfo.totalTodayPowerUnit = Util.upPowerUnit(allDayPower);
                    double top = 0;
                    foreach (Plant p in user.plants)
                    {
                        top += p.design_power;
                    }
                    tinfo.totalPower     = Util.upDigtal(top);
                    tinfo.totalPowerUnit = Util.upPowerUnit(top);
                    tinfo.treeNum        = (allTotalEnergy / 40).ToString("0");
                }
            }
            string data = JsonUtil.convertToJson(tinfo, typeof(TotalInfo));

            return(Content(data));
        }
Beispiel #3
0
        //
        // GET: /Wap/

        public ActionResult Index()
        {
            float co2Rate = ItemConfigService.GetInstance().getCO2Config();

            double alltotalenergy = DeviceRunDataService.GetInstance().GetAllTotalEnergy();
            double dayEnergy      = CollectorRunDataService.GetInstance().GetAllDayEnergy();
            double co2Value       = alltotalenergy * co2Rate;

            ViewData["co2Unit"]           = Util.upCo2Unit(co2Value);
            ViewData["energyUnit"]        = Util.upEnergyUnit(alltotalenergy);
            ViewData["dayenergyUnit"]     = Util.upEnergyUnit(dayEnergy);
            ViewData["AllTotalEnergy"]    = StringUtil.formatDouble(Util.upDigtal(alltotalenergy));
            ViewData["AlldayTotalEnergy"] = StringUtil.formatDouble(Util.upDigtal(dayEnergy));
            ViewData["AllCO2"]            = StringUtil.formatDouble(Util.upDigtal(co2Value));

            return(View());
        }
Beispiel #4
0
        /// <summary>
        /// 将数据放入缓存
        /// </summary>
        /// <param name="tcpmessage"></param>
        public static void CacheData()
        {
            try
            {
                DateTime curdt = DateTime.Now;

                //将采集器天数据批量加入缓存
                CollectorDayDataService.GetInstance().batchToCache(BaseMessage.collectordayDataMap);
                LogUtil.writeline("memcached collectordayDataMap用时:" + (DateTime.Now.Subtract(curdt).TotalSeconds));
            }
            catch (Exception e)
            {
                LogUtil.error("batch Cache day data error:" + e.Message);
            }
            try
            {
                DateTime curdt = DateTime.Now;
                //DeviceDayDataService.GetInstance().batchToCache(BaseMessage.devicedayDataMapList);
                ////将设备天数据批量放入缓存
                DeviceDayDataCacheHandler ddch = null;
                for (int i = 0; i < 50; i++)
                {
                    if (cacheDayOjectMap.ContainsKey(i))
                    {
                        ddch = cacheDayOjectMap[i];
                    }
                    else
                    {
                        ddch = new DeviceDayDataCacheHandler(i);
                        cacheDayOjectMap[i] = ddch;
                    }

                    Thread m_thread = new Thread(new ThreadStart(ddch.batchToCacheList));
                    m_thread.Name = "memcache Handel Thread-" + i;
                    m_thread.Start();
                }
                int  times  = 0;
                bool iswork = isWork();
                //如果线程都在工作并且持续时间一分钟之内继续循环,否则跳出循环,进行以后动作,add by qhb in 20120927 for 解析其中有个现场死了,整个程序
                //就停在这里了。
                while (iswork && times < 60)
                {
                    times++;
                    iswork = isWork();
                    Thread.Sleep(1000);
                }
                LogUtil.writeline("memcached devicedayDataMap用时:" + (DateTime.Now.Subtract(curdt).TotalSeconds));
            }
            catch (Exception e)
            {
                LogUtil.error("batch Cache device day data  error:" + e.Message);
            }

            try
            {
                DateTime curdt = DateTime.Now;
                //缓存采集器实时数据
                CollectorRunDataService.GetInstance().batchCache(BaseMessage.collectorRunDataMap.Values);
                LogUtil.writeline("memcached collectorRunDataMap用时:" + (DateTime.Now.Subtract(curdt).TotalSeconds));
            }
            catch (Exception e)
            {
                LogUtil.error("batch Cache run data error:" + e.Message);
            }

            try
            {
                DateTime curdt = DateTime.Now;
                //批量保存设备实时数据到缓存
                DeviceRunDataService.GetInstance().BatchCache(BaseMessage.deviceRunDataMap.Values);
                LogUtil.writeline("memcached deviceRunDataMap用时:" + (DateTime.Now.Subtract(curdt).TotalSeconds));
            }
            catch (Exception e)
            {
                LogUtil.error("batch Cache device run data error:" + e.Message);
            }

            try
            {
                FaultService.GetInstance().batchSave(BaseMessage.faultList);
                BaseMessage.faultList.Clear();
            }
            catch (Exception e)
            {
                LogUtil.info("batch Cache fualt error:" + e.Message);
            }
            try
            {
                DateTime curdt = DateTime.Now;
                //将设备最大值统计数据放入缓存
                DeviceDataCountService.GetInstance().batchCache(BaseMessage.deviceDataCounts);
                BaseMessage.deviceDataCounts.Clear();
                LogUtil.writeline("memcached deviceDataCounts用时:" + (DateTime.Now.Subtract(curdt).TotalSeconds));
            }
            catch (Exception e)
            {
                LogUtil.error("save max value error:" + e.Message);
            }

            //将本地内存数据放入缓存后,就要清理本地内存,否有内存溢出问题
            //clearDayDataMap();

            //每次缓存后 同时将同步到memcahced
            if (syndata != null && syndata.Equals("true"))
            {
                SynDataService.GetInstance().synRunData();
            }
        }
        public static void peristentData()
        {
            Console.WriteLine("开始持久化");
            //持久化设备天数据
            try
            {
                DeviceDayDataService.GetInstance().batchSave(BaseMessage.devicedayDataMapList);
            }
            catch (Exception ee)
            {
                LogUtil.error("持久化设备天数据异常:" + ee.Message);
            }

            //持久化采集器天数据
            try
            {
                CollectorDayDataService.GetInstance().batchSave(BaseMessage.collectordayDataMap);
            }
            catch (Exception ee) {
                LogUtil.error("持久化采集器天数据异常:" + ee.Message);
            }

            //持久化设备实时数据
            try{
                DeviceRunDataService.GetInstance().batchSave();
            }
            catch (Exception ee)
            {
                LogUtil.error("持久化设备实时数据数据异常:" + ee.Message);
            }
            //持久化采集器实时数据
            try
            {
                LogUtil.writeline("start 持久化采集器实时数据");
                CollectorRunDataService.GetInstance().batchSave();
            }
            catch (Exception ee)
            {
                LogUtil.error("持久化采集器实时数据异常:" + ee.Message);
            }

            //持久化最大值统计
            try{
                DeviceDataCountService.GetInstance().batchSave();
            }
            catch (Exception ee)
            {
                LogUtil.error("持久化最大值统计异常:" + ee.Message);
            }

            //持久化设备月天数据
            try{
                DeviceMonthDayDataService.GetInstance().batchSave();
            }
            catch (Exception ee)
            {
                LogUtil.error("持久化设备月天数据异常:" + ee.Message);
            }
            //持久化采集器月天数据
            try{
                CollectorMonthDayDataService.GetInstance().batchSave();
            }
            catch (Exception ee)
            {
                LogUtil.error("持久化采集器月天数据异常:" + ee.Message);
            }
            //持久化设备年月数据
            try{
                DeviceYearMonthDataService.GetInstance().batchSave();
            }
            catch (Exception ee)
            {
                LogUtil.error("持久化设备年月数据异常:" + ee.Message);
                //DeviceYearMonthDataService.GetInstance().batchSave();
            }
            //持久化采集器年月数据
            try{
                CollectorYearMonthDataService.GetInstance().batchSave();
            }
            catch (Exception ee)
            {
                LogUtil.error("持久化采集器年月数据异常:" + ee.Message);
            }
            //持久化设备总体数据
            try{
                DeviceYearDataService.GetInstance().batchSave();
            }
            catch (Exception ee)
            {
                LogUtil.error("持久化采集器年月数据异常:" + ee.Message);
            }
            //持久化采集器总体数据
            try
            {
                CollectorYearDataService.GetInstance().batchSave();
            }
            catch (Exception ee)
            {
                LogUtil.error("持久化采集器总体数据异常:" + ee.Message);
            }

            //add by qhb in 20120415 for 2.0协议持久化电站信息,持久化后不删除,
            try
            {
                PlantService.GetInstance().batchSave(BaseMessage.plantInfoMap);
            }
            catch (Exception ee)
            {
                LogUtil.error("持久化电站信息数据异常:" + ee.Message);
            }

            //add by qhb in 20120715 for 2.0协议持久化设备信息,持久化后不删除,
            try
            {
                DeviceService.GetInstance().batchSave(BaseMessage.deviceInfoMap);
            }
            catch (Exception ee)
            {
                LogUtil.error("持久化设备信息数据异常:" + ee.Message);
            }
        }
        public void peristentData()
        {
            Console.WriteLine("开始持久化");
            //持久化设备天数据
            try
            {
                DeviceDayDataService.GetInstance().batchSave(BaseMessage.devicedayDataMapList);
            }
            catch (Exception ee)
            {
                LogUtil.error("持久化设备天数据异常:" + ee.Message);
            }
            //持久化采集器天数据
            try
            {
                CollectorDayDataService.GetInstance().batchSave(BaseMessage.collectordayDataMap);
            }
            catch (Exception ee) {
                LogUtil.error("持久化采集器天数据异常:" + ee.Message);
            }

            //持久化设备实时数据
            try{
                DeviceRunDataService.GetInstance().batchSave();
            }
            catch (Exception ee)
            {
                LogUtil.error("持久化设备实时数据数据异常:" + ee.Message);
            }
            //持久化采集器实时数据
            try
            {
                LogUtil.writeline("start 持久化采集器实时数据");
                CollectorRunDataService.GetInstance().batchSave();
            }
            catch (Exception ee)
            {
                LogUtil.error("持久化采集器实时数据异常:" + ee.Message);
            }

            //持久化最大值统计
            try{
                DeviceDataCountService.GetInstance().batchSave();
            }
            catch (Exception ee)
            {
                LogUtil.error("持久化最大值统计异常:" + ee.Message);
            }

            //持久化设备月天数据
            try{
                DeviceMonthDayDataService.GetInstance().batchSave();
            }
            catch (Exception ee)
            {
                LogUtil.error("持久化设备月天数据异常:" + ee.Message);
            }
            //持久化采集器月天数据
            try{
                CollectorMonthDayDataService.GetInstance().batchSave();
            }
            catch (Exception ee)
            {
                LogUtil.error("持久化采集器月天数据异常:" + ee.Message);
            }
            //持久化设备年月数据
            try{
                DeviceYearMonthDataService.GetInstance().batchSave();
            }
            catch (Exception ee)
            {
                LogUtil.error("持久化设备年月数据异常:" + ee.Message);
                DeviceYearMonthDataService.GetInstance().batchSave();
            }
            //持久化采集器年月数据
            try{
                CollectorYearMonthDataService.GetInstance().batchSave();
            }
            catch (Exception ee)
            {
                LogUtil.error("持久化采集器年月数据异常:" + ee.Message);
            }
            //持久化设备总体数据
            try{
                DeviceYearDataService.GetInstance().batchSave();
            }
            catch (Exception ee)
            {
                LogUtil.error("持久化采集器年月数据异常:" + ee.Message);
            }
            //持久化采集器总体数据
            try
            {
                CollectorYearDataService.GetInstance().batchSave();
            }
            catch (Exception ee)
            {
                LogUtil.error("持久化采集器总体数据异常:" + ee.Message);
            }
        }
Beispiel #7
0
        /// <summary>
        /// 取得采集器实时数据
        /// </summary>
        /// <returns></returns>
        public void GetCollectorRunData()
        {
            int collectorID = GetCollectorId();
            CollectorRunData dsrd;

            if (!collectorRunDataMap.ContainsKey(collectorID))
            {
                dsrd = CollectorRunDataService.GetInstance().Get(collectorID);
                if (dsrd == null)
                {
                    dsrd = new CollectorRunData();
                }
                dsrd.collectorID = collectorID;
                collectorRunDataMap[collectorID] = dsrd;
            }
            else
            {
                dsrd = collectorRunDataMap[collectorID];
            }

            if ((dsrd.dayEnergy < messageHeader.DayEnergy || dsrd.sendTime.Day != messageHeader.TimeNow.Day) || (messageHeader.TimeNow.Hour < 6 && messageHeader.DayEnergy == 0))
            {
                dsrd.dayEnergy = messageHeader.DayEnergy;
            }

            if (dsrd.totalEnergy < messageHeader.TotalEnergy)
            {
                dsrd.totalEnergy = messageHeader.TotalEnergy;
            }

            dsrd.power    = messageHeader.Power;
            dsrd.sendTime = messageHeader.TimeNow;

            if (realMonitorMap.ContainsKey(MonitorType.PLANT_MONITORITEM_WINDSPEED))
            {
                string str = this.realMonitorMap[MonitorType.PLANT_MONITORITEM_WINDSPEED].ToString();
                dsrd.windSpeed = str.IndexOf(".") > 0 ? int.Parse(str.Substring(0, str.IndexOf("."))) : int.Parse(str);
            }
            else
            {
                dsrd.windSpeed = null;
            }

            if (realMonitorMap.ContainsKey(MonitorType.PLANT_MONITORITEM_WINDDIRECTION))
            {
                string str = this.realMonitorMap[MonitorType.PLANT_MONITORITEM_WINDDIRECTION].ToString();
                dsrd.windDirection = str.IndexOf(".") > 0 ? int.Parse(str.Substring(0, str.IndexOf("."))) : int.Parse(str);
            }
            else
            {
                dsrd.windDirection = null;
            }

            if (realMonitorMap.ContainsKey(MonitorType.PLANT_MONITORITEM_AMBIENTTEMP_CODE))
            {
                dsrd.temperature = float.Parse(this.realMonitorMap[MonitorType.PLANT_MONITORITEM_AMBIENTTEMP_CODE].ToString());
            }
            else
            {
                dsrd.temperature = null;
            }

            if (realMonitorMap.ContainsKey(MonitorType.PLANT_MONITORITEM_LINGT_CODE))
            {
                string str = this.realMonitorMap[MonitorType.PLANT_MONITORITEM_LINGT_CODE].ToString();
                dsrd.sunStrength = str.IndexOf(".") > 0 ? int.Parse(str.Substring(0, str.IndexOf("."))) : int.Parse(str);
            }
            else
            {
                dsrd.sunStrength = null;
            }
            //dsrd.changed = true;
        }
Beispiel #8
0
        /// <summary>
        /// 将数据放入缓存
        /// </summary>
        /// <param name="tcpmessage"></param>
        public static void CacheData()
        {
            try
            {
                DateTime curdt = DateTime.Now;

                //将采集器天数据批量加入缓存
                CollectorDayDataService.GetInstance().batchToCache(BaseMessage.collectordayDataMap);
                LogUtil.writeline("memcached collectordayDataMap用时:" + (DateTime.Now.Subtract(curdt).TotalSeconds));
            }
            catch (Exception e)
            {
                LogUtil.error("batch Cache day data error:" + e.Message);
            }
            try
            {
                DateTime curdt = DateTime.Now;
                //DeviceDayDataService.GetInstance().batchToCache(BaseMessage.devicedayDataMapList);
                ////将设备天数据批量放入缓存
                DeviceDayDataCacheHandler ddch = null;
                for (int i = 0; i < 50; i++)
                {
                    if (cacheDayOjectMap.ContainsKey(i))
                    {
                        ddch = cacheDayOjectMap[i];
                    }
                    else
                    {
                        ddch = new DeviceDayDataCacheHandler(i);
                        cacheDayOjectMap[i] = ddch;
                    }

                    Thread m_thread = new Thread(new ThreadStart(ddch.batchToCacheList));
                    m_thread.Name = "memcache Handel Thread-" + i;
                    m_thread.Start();
                }
                while (isWork())
                {
                    Thread.Sleep(1000);
                }
                LogUtil.writeline("memcached devicedayDataMap用时:" + (DateTime.Now.Subtract(curdt).TotalSeconds));
            }
            catch (Exception e)
            {
                LogUtil.error("batch Cache device day data  error:" + e.Message);
            }

            try
            {
                DateTime curdt = DateTime.Now;
                //缓存采集器实时数据
                CollectorRunDataService.GetInstance().batchCache(BaseMessage.collectorRunDataMap.Values);
                LogUtil.writeline("memcached collectorRunDataMap用时:" + (DateTime.Now.Subtract(curdt).TotalSeconds));
            }
            catch (Exception e)
            {
                LogUtil.error("batch Cache run data error:" + e.Message);
            }

            try
            {
                DateTime curdt = DateTime.Now;
                //批量保存设备实时数据到缓存
                DeviceRunDataService.GetInstance().BatchCache(BaseMessage.deviceRunDataMap.Values);
                LogUtil.writeline("memcached deviceRunDataMap用时:" + (DateTime.Now.Subtract(curdt).TotalSeconds));
            }
            catch (Exception e)
            {
                LogUtil.error("batch Cache device run data error:" + e.Message);
            }

            try
            {
                FaultService.GetInstance().batchSave(BaseMessage.faultList);
                BaseMessage.faultList.Clear();
            }
            catch (Exception e)
            {
                LogUtil.info("batch Cache fualt error:" + e.Message);
            }
            try
            {
                DateTime curdt = DateTime.Now;
                //将设备最大值统计数据放入缓存
                DeviceDataCountService.GetInstance().batchCache(BaseMessage.deviceDataCounts);
                BaseMessage.deviceDataCounts.Clear();
                LogUtil.writeline("memcached deviceDataCounts用时:" + (DateTime.Now.Subtract(curdt).TotalSeconds));
            }
            catch (Exception e)
            {
                LogUtil.error("save max value error:" + e.Message);
            }

            clearDayDataMap();
        }
Beispiel #9
0
        /// <summary>
        /// 取得采集器实时数据
        /// </summary>
        /// <returns></returns>
        public void GetCollectorRunData()
        {
            //如果没有数据则直接返回,增加for2.0协议,分包发送消息的情况
            if (!messageHeader.hasData)
            {
                return;
            }

            int collectorID = GetCollectorId();
            CollectorRunData dsrd;

            if (!collectorRunDataMap.ContainsKey(collectorID))
            {
                dsrd = CollectorRunDataService.GetInstance().Get(collectorID);
                if (dsrd == null)
                {
                    dsrd = new CollectorRunData();
                }
                dsrd.collectorID = collectorID;
                collectorRunDataMap[collectorID] = dsrd;
            }
            else
            {
                dsrd = collectorRunDataMap[collectorID];
            }

            //modify by hbqian for 历史数据不更新实时数据,只有当原有数据是超前的才会被历史数据替换 at 2013-07-29
            //比如他现在传输的应该是 17号11点30的数据,传输完了后,又传了个历史数据是17号6点的数据,那么这个时候实时数据显示的是17号6点的历史数据,而不是17号11点30的实时数据,要显示为最新的即11:30的数据,这个地方请加个判断
            //旧的数据不再更新实时数据,20130729修改为 当原有时间是超前的仍然更新,这里用服务器时间判断没有考虑时差,还是有点不准确,非超前则不更新,即实时数据始终显示最新的
            if (messageHeader.TimeNow < dsrd.sendTime && dsrd.sendTime < DateTime.Now)
            {
                return;
            }

            if ((messageHeader.DayEnergy != null && dsrd.dayEnergy < messageHeader.DayEnergy) || (messageHeader.DayEnergy != null && dsrd.sendTime.Day != messageHeader.TimeNow.Day))
            {
                dsrd.dayEnergy = messageHeader.DayEnergy.Value;
            }

            if (messageHeader.TotalEnergy != null && dsrd.totalEnergy < messageHeader.TotalEnergy)
            {
                dsrd.totalEnergy = messageHeader.TotalEnergy.Value;
            }

            if (messageHeader.Power != null)
            {
                dsrd.power = messageHeader.Power.Value;
            }

            dsrd.sendTime = messageHeader.TimeNow;

            //if (realMonitorMap.ContainsKey(MonitorType.PLANT_MONITORITEM_WINDSPEED))
            //{
            //string str = this.realMonitorMap[MonitorType.PLANT_MONITORITEM_WINDSPEED].ToString();
            //dsrd.windSpeed = str.IndexOf(".") > 0 ? int.Parse(str.Substring(0, str.IndexOf("."))) : int.Parse(str);
            // }
            //else {
            //dsrd.windSpeed = null;
            //}

            //if (realMonitorMap.ContainsKey(MonitorType.PLANT_MONITORITEM_WINDDIRECTION))
            //{
            //string str = this.realMonitorMap[MonitorType.PLANT_MONITORITEM_WINDDIRECTION].ToString();
            //dsrd.windDirection = str.IndexOf(".") > 0 ? int.Parse(str.Substring(0, str.IndexOf("."))) : int.Parse(str);
            //}
            //else {
            //dsrd.windDirection = null;
            //}

            //if (realMonitorMap.ContainsKey(MonitorType.PLANT_MONITORITEM_AMBIENTTEMP_CODE))
            //dsrd.temperature = float.Parse(this.realMonitorMap[MonitorType.PLANT_MONITORITEM_AMBIENTTEMP_CODE].ToString());
            //else {
            //只有电站数据才用其数据更新实时数据
            //if (!messageHeader.issub)
            //{
            dsrd.temperature = messageHeader.temperature;
            //}
            //}
            //不在从环境监测仪取数据,该有前台显示时判断 先去环境建议侧
            //if (realMonitorMap.ContainsKey(MonitorType.PLANT_MONITORITEM_LINGT_CODE))
            //{
            //string str = this.realMonitorMap[MonitorType.PLANT_MONITORITEM_LINGT_CODE].ToString();
            //dsrd.sunStrength = str.IndexOf(".") > 0 ? int.Parse(str.Substring(0, str.IndexOf("."))) : int.Parse(str);
            //}
            //else {
            //只有电站数据才用其数据更新实时数据
            //if (!messageHeader.issub)
            //{
            dsrd.sunStrength = messageHeader.sunStrength;
            //}
            //}
            //dsrd.changed = true;
        }