示例#1
0
        public async Task Initialize()
        {
            _devices  = new List <TurnOnOffDevice>();
            _readers  = new List <ReaderDevice>();
            _displays = new List <DisplayDevice>();

            Devices           = new List <ITurnOnOffModule>();
            Readers           = new List <IReaderModule>();
            Displays          = new List <IDisplayModule>();
            _conditions       = new List <Condition>();
            _conditionManager = new ConditionManager(_conditions, Devices);

            var config = new BridgeConfiguration(StationHelper.GetDeviceID(), "com.guybrush")
            {
                ModelName       = "Guybrush Bridge",
                DeviceName      = "Guybrush Smart Home",
                ApplicationName = "Guybrush Station",
                Vendor          = "Guybrush"
            };

            _homeDevice = new SmarthomeAdapter(config, _conditionManager);
            await AllJoynDsbServiceManager.Current.StartAsync(_homeDevice);

            Status = StationStatus.Running;
        }
示例#2
0
        public void MainFormLoad(object sender, EventArgs e)
        {
            StationHelper.LoadStation(NameStation, LincStation, NumOfOpen);
            LoadMainForm();
            var settings     = SettingsHelper.LoadSetting();
            var cSaveChecked = settings.SaveChecked;
            var volum        = settings.Volum;
            var mute         = settings.Mutee;
            var selectIndex  = settings.SelectIndex;
            var IsPlay       = settings.IsPlay;

            if (cSaveChecked == true)
            {
                this.BackColor = ColorHelper.LoadColor();

                //TODO В отдельный метод к хуям!!!!
                _setForm.cSave.Checked = cSaveChecked; tVolum.Value = volum; _mute = !mute; ListStatinName.SelectedIndex = selectIndex;
                Player.Volume(volum);
                BMuteClick(sender, e);
                if (IsPlay)
                {
                    PlayStation(ListStatinName.SelectedIndex);
                }

                сохраниятьСостояниеToolStripMenuItem.Checked = cSaveChecked;
            }

            Save = cSaveChecked;
        }
示例#3
0
        public void WriteToFile(string operation, int Index)
        {
            StationHelper.SaveStation(NameStation, LincStation, NumOfOpen, operation, Index);

            this.deleteToolStripMenuItem.DropDownItems.Clear();
            this.playToolStripMenuItem.DropDownItems.Clear();
            MenuItemAdd();
            ColorHelper.SaveColor(this.BackColor.ToArgb());
            StationHelper.LoadStation(NameStation, LincStation, NumOfOpen);
        }
示例#4
0
        public void LoadMainForm()
        {
            ListStatinName.Items.Clear();
            foreach (string s in StationHelper.LoadStation(NameStation, LincStation, NumOfOpen).Items)
            {
                ListStatinName.Items.Add(s);
            }

            tVolum.Maximum = 100;
            tVolum.Minimum = 0;
            tVolum.Value   = 100;
            MenuItemAdd();
        }
示例#5
0
        public void DelStation(int SelectIndex)
        {
            var dellString = "Удалить " + ListStatinName.Items[SelectIndex].ToString() + "?";
            var rezult     = MessageBox.Show(ListStatinName, dellString, "Подтвеждение удаления", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);

            if (rezult == System.Windows.Forms.DialogResult.Yes)
            {
                // _nameStation.Items.RemoveAt(SelectIndex);
                // LincStation.Items.RemoveAt(SelectIndex);
                StationHelper.SaveStation(NameStation, LincStation, NumOfOpen, "Удалить", SelectIndex);
                StationHelper.LoadStation(NameStation, LincStation, NumOfOpen);
                _operation = null;
                LoadMainForm();
            }
        }
示例#6
0
        public static List <OnTimeEntity> GetReadDatas(int uId, List <string> stationList, string trans)
        {
            ReadDatas rDatas = new ReadDatas();
            //储出返回的信息
            List <OnTimeEntity> onTimeList = new List <OnTimeEntity>();
            var options = new List <ChannelOption> {
                new ChannelOption(ChannelOptions.MaxReceiveMessageLength, int.MaxValue)
            };
            var channel = new Channel(Conf.Config.DB_SERVER_IP, ChannelCredentials.Insecure, options);
            var client  = new BatchService(new gRPCServices.gRPCServicesClient(channel));

            rDatas = client.GetReadMsg(stationList, trans);

            //初始话站点信息
            if (StationHelper.stationInfoList == null || StationHelper.stationInfoList.Count == 0)
            {
                StationHelper.getStationInfoList();
            }
            for (int i = 0; i < rDatas.RData.Count; i++)
            {
                string id = rDatas.RData[i].StationId;
                //获取雨量精度
                //double accuracy = StationHelper.stationInfoDic4[id].
                double accuracy = 0.5;
                string state    = "-";
                if (rDatas.RData[i].Data != null && rDatas.RData[i].Data.Length > 0)
                {
                    int    rawData   = int.Parse(rDatas.RData[i].Data);
                    double totalRain = rawData * accuracy;
                    state = totalRain.ToString();
                }
                else
                {
                    state = "获取失败";
                }
                onTimeList.Add(new OnTimeEntity
                {
                    id          = id,
                    stationId   = StationHelper.stationInfoDic4[id].stationId,
                    stationName = StationHelper.stationInfoDic4[id].stationName,
                    state       = state
                });
            }

            channel.ShutdownAsync().Wait();
            client.StopGrpcClient();
            return(onTimeList);
        }
示例#7
0
        public static List <OnTimeEntity> GetTruList(int uId, List <string> stationList)
        {
            TruList             tList      = new TruList();
            List <OnTimeEntity> onTimeList = new List <OnTimeEntity>();
            var options = new List <ChannelOption> {
                new ChannelOption(ChannelOptions.MaxReceiveMessageLength, int.MaxValue)
            };
            var channel = new Channel(Conf.Config.DB_SERVER_IP, ChannelCredentials.Insecure, options);
            var client  = new BatchService(new gRPCServices.gRPCServicesClient(channel));

            tList = client.GetTruMsg(stationList);

            if (StationHelper.stationInfoList == null || StationHelper.stationInfoList.Count == 0)
            {
                StationHelper.getStationInfoList();
            }
            for (int i = 0; i < tList.TruData.Count; i++)
            {
                string id    = tList.TruData[i].StationId;
                string state = "正在对时";
                bool   tru   = false;
                if (tList.TruData[i].Tru == true)
                {
                    tru = tList.TruData[i].Tru;
                }
                if (tru)
                {
                    state = "√";
                }
                else
                {
                    state = "对时失败";
                }
                onTimeList.Add(new OnTimeEntity
                {
                    id          = id,
                    stationId   = StationHelper.stationInfoDic4[id].stationId,
                    stationName = StationHelper.stationInfoDic4[id].stationName,
                    state       = state
                });
            }

            channel.ShutdownAsync().Wait();
            client.StopGrpcClient();
            return(onTimeList);
        }
示例#8
0
        public void PlayStation(int selectIndex)
        {
            progressBar1.Value = 0;
            IsPlay             = true;

            if (selectIndex != -1 && selectIndex <= (LincStation.Items.Count - 1))
            {
                LincStation.SelectedIndex = selectIndex;
                Player.OpenFile(LincStation.SelectedItem.ToString());
                progressBar1.Minimum = 0;
                progressBar1.Maximum = 100;
                progressBar1.Step    = 1;
                timer1.Interval      = 900;
                timer1.Start();

                bPlayStop.Text = "Стоп";
                //Прослушиваний +1
                //var i = Convert.ToInt32(NumOfOpen.Items[selectIndex]);
                //i += 1;
                NumOfOpen.Items[selectIndex] = Convert.ToInt32(NumOfOpen.Items[selectIndex]) + 1;
                StationHelper.SaveStation(NameStation, LincStation, NumOfOpen, "Изменить", selectIndex);
            }
        }
示例#9
0
        /// <summary>
        /// 查询站点数据状态信息
        /// </summary>
        /// <param name="subcenter"></param>
        /// <param name="time_from"></param>
        /// <param name="time_to"></param>
        /// <returns></returns>
        public static DataStatus ListDataStatus(int subcenter, DateTime time_from, DateTime time_to)
        {
            //异常数据信息

            //工况信息 用于统计缺数
            //List<voltage> voltageList = new List<voltage>();
            DataStatus result = new DataStatus();

            //1.组合查询参数
            Dictionary <string, object> param      = new Dictionary <string, object>();
            Dictionary <string, string> paramInner = new Dictionary <string, string>();

            paramInner["subcenter"] = subcenter.ToString();
            paramInner["datatime"]  = time_from.ToString();
            paramInner["strttime"]  = time_from.ToString();
            paramInner["endtime"]   = time_to.ToString();
            string dataStsUrl = suffix + "/datasts/getDatasts";
            string voltageUrl = suffix + "/voltage/getSharpVoltage";
            //string dataStsUrl = "http://127.0.0.1:8088/datasts/getDatasts";
            //string voltageUrl = "http://127.0.0.1:8088/voltage/getSharpVoltage";
            string jsonStr = HttpHelper.SerializeDictionaryToJsonString(paramInner);

            param["datasts"] = jsonStr;
            param["voltage"] = jsonStr;

            //2.1查询数据状态信息
            try
            {
                string resultJson = HttpHelper.Post(dataStsUrl, param);
                dataStsList = (List <DataStatus>)HttpHelper.JsonDeserialize <List <DataStatus> >(resultJson, new List <DataStatus>());
            }
            catch (Exception e)
            {
                Debug.WriteLine("查询数据状态信息失败");
                throw e;
            }
            //2.2 查询工况信息
            try
            {
                string resultJson = HttpHelper.Post(voltageUrl, param);
                voltageList = (List <VoltageDbData>)HttpHelper.JsonDeserialize <List <VoltageDbData> >(resultJson, new List <VoltageDbData>());
            }
            catch (Exception e)
            {
                Debug.WriteLine("查询数据状态信息失败");
                throw e;
            }
            //3.获取站点信息
            List <Station> stationInfoList = new List <Station>();

            if (StationHelper.stationInfoList == null || StationHelper.stationInfoList.Count == 0)
            {
                StationHelper.getStationInfoList();
            }
            for (int i = 0; i < StationHelper.stationInfoList.Count; i++)
            {
                if (StationHelper.stationInfoList[i].stationType != StationTypes.rain2Station)
                {
                    stationInfoList.Add(StationHelper.stationInfoList[i]);
                }
            }
            //4.统计应收数据、警告数据、缺数
            int hours        = (time_to - time_from).Hours + 1;
            int deserverdNum = stationInfoList.Count * hours;
            int lackNum      = deserverdNum - voltageList.Count;
            int errorNum     = dataStsList.Count;
            int realNum      = voltageList.Count - dataStsList.Count;

            result.deserverNum = deserverdNum;
            result.errorNum    = errorNum;
            result.lackNum     = lackNum;
            result.realNum     = realNum;
            return(result);
        }
示例#10
0
        /// <summary>
        /// 显示数据信息饼状图具体信息
        /// </summary>
        /// <param name="subcenter"></param>
        /// <param name="time_from"></param>
        /// <param name="time_to"></param>
        /// <returns></returns>
        public static List <DataStatus> StatDataStatus(int subcenter, DateTime time_from, DateTime time_to)
        {
            List <DataStatus>    retList           = new List <DataStatus>();
            List <DataStatus>    errorStatusList   = new List <DataStatus>();
            List <VoltageDbData> voltageStatusList = new List <VoltageDbData>();
            List <DateTime>      dataTimeList      = new List <DateTime>();
            //1.1获取所有站点信息
            List <Station> stationInfoList = new List <Station>();

            if (StationHelper.stationInfoList == null || StationHelper.stationInfoList.Count == 0)
            {
                StationHelper.getStationInfoList();
            }
            //过滤 只统计接收的站点
            for (int i = 0; i < StationHelper.stationInfoList.Count; i++)
            {
                if (StationHelper.stationInfoList[i].stationType != StationTypes.rain2Station)
                {
                    stationInfoList.Add(StationHelper.stationInfoList[i]);
                }
            }
            //1.2 获取数据信息
            if (dataStsList != null)
            {
                errorStatusList.AddRange(dataStsList);
            }
            if (voltageList != null)
            {
                voltageStatusList.AddRange(voltageList);
            }
            //2.1统计时间段
            for (DateTime dataTime = time_from; dataTime <= time_to; dataTime = dataTime.AddHours(1))
            {
                dataTimeList.Add(dataTime);
            }
            //2.2
            //3.1 统计异常数据信息 STATE为0
            if (errorStatusList != null)
            {
                for (int i = 0; i < errorStatusList.Count; i++)
                {
                    errorStatusList[i].state = "0";
                }
                retList.AddRange(errorStatusList);
            }
            //2.统计缺数信息
            int             total           = dataTimeList.Count * stationInfoList.Count;
            int             voltageCount    = voltageStatusList.Count;
            string          stationid       = "";
            List <voltage>  tmpVoltageList  = new List <voltage>();
            List <DateTime> tmpDataTimeList = new List <DateTime>();

            //3.1 循环,按站点分组,并取出
            for (int i = 0; i < voltageStatusList.Count; i++)
            {
                tmpDataTimeList.Add(voltageStatusList[i].datatime);
                if ((voltageStatusList[i].stationid != stationid && stationid.Length > 0 && i >= 1) || i == voltageStatusList.Count - 1)
                {
                    //取出该站点该段时间内的缺少的数据
                    for (int j = 0; j < dataTimeList.Count; j++)
                    {
                        if (!tmpDataTimeList.Contains(dataTimeList[j]))
                        {
                            DataStatus dataStatus = new DataStatus();
                            dataStatus.stationid   = voltageStatusList[i - 1].stationid;
                            dataStatus.stationName = StationHelper.stationInfoDic[voltageStatusList[i - 1].stationid].stationName;
                            dataStatus.datatime    = dataTimeList[j];
                            dataStatus.state       = "-1";
                            retList.Add(dataStatus);
                        }
                    }
                    //更新站点和时间信息
                    tmpDataTimeList.Clear();
                    tmpDataTimeList.Add(voltageStatusList[i].datatime);
                }
                stationid = voltageStatusList[i].stationid;
            }
            //3.统计正常数据条数
            //TODO 暂时不统计正常数据
            return(retList);
        }
示例#11
0
 public void ParseCode_ShouldReturnCorrectResult(string stationName, string featureCode)
 {
     Assert.AreEqual(featureCode, StationHelper.ParseCode(stationName));
 }
示例#12
0
 public void ParseNumber_ShouldReturnCorrectResult(string stationName, string stationNumber)
 {
     Assert.AreEqual(stationNumber, StationHelper.ParseNumber(stationName));
 }
示例#13
0
        public void Operations(string operation)
        {
            switch (operation)
            {
            case "Изменить":
            {
                TextUrl.Enabled = true;

                panel1.Visible = true;
                bAdd.Text      = "Изменить";

                if (_doOperation)
                {
                    NameStation.Items[_selectIndex] = TextName.Text;
                    LincStation.Items[_selectIndex] = TextUrl.Text;

                    WriteToFile("Изменить", _selectIndex);
                    _doOperation = false;
                    bAdd.Text    = "Ok";
                }

                {
                    if (_selectIndex >= 0)
                    {
                        TextName.Text = NameStation.Items[_selectIndex].ToString();
                        TextUrl.Text  = LincStation.Items[_selectIndex].ToString();
                    }
                }
            }
                LoadMainForm();
                break;

            case "Удалить":
            {
                DelStation(_selectIndex);
                LoadMainForm();
                break;
            }

            case "Переименовать":
            {
                bAdd.Text = "Переименовать";
            }

                if (_doOperation)
                {
                    NameStation.Items[_selectIndex] = TextName.Text;
                    LincStation.Items[_selectIndex] = TextUrl.Text;
                    WriteToFile("Переименовать", _selectIndex);
                    _doOperation     = false;
                    TextUrl.ReadOnly = false;
                    TextUrl.Enabled  = true;
                    bAdd.Text        = "Ok";
                    TextName.Text    = TextUrl.Text = null;
                }
                {
                    panel1.Visible = true;


                    TextUrl.Enabled = false;
                    if (_selectIndex >= 0)
                    {
                        TextName.Text = NameStation.Items[_selectIndex].ToString();
                        TextUrl.Text  = LincStation.Items[_selectIndex].ToString();
                    }
                    LoadMainForm();
                    break;
                }

            case "Добавить":
            {
                if (_doOperation)
                {
                    NameStation.Items.Add(TextName.Text);
                    LincStation.Items.Add(TextUrl.Text);
                    StationHelper.SaveStation(NameStation, LincStation, NumOfOpen, "Добавить", NameStation.Items.Count - 1);

                    TextName.Text = TextUrl.Text = null;
                    LoadMainForm();
                    MenuItemAdd();
                    bAdd.Text    = "OK";
                    _doOperation = false;
                }
                else
                {
                    bAdd.Text     = "Добавить";
                    TextName.Text = TextUrl.Text = null;
                }

                LoadMainForm();
                break;
            }
            }
        }
示例#14
0
 // Use this for initialization
 public virtual void Start()
 {
     stationHelper = operatingPoint.AddComponent<StationHelper>();
     stationHelper.ownerStation = this;
 }
示例#15
0
        /// <summary>
        /// 添加运维库站点信息
        /// </summary>
        /// <returns></returns>
        public ActionResult maintainStation()
        {
            State s = new State();

            try
            {
                int UID = int.Parse(Request.Params.Get("UID"));//用户UID
                //判定四位码或者八位码是否重复
                if (StationHelper.stationInfoList == null || StationHelper.stationInfoList.Count == 0)
                {
                    StationHelper.getStationInfoList();
                }
                string stationid = Request.Params.Get("stationid");//8位站号
                if (StationHelper.stationInfoDic.ContainsKey(stationid))
                {
                    s.code    = 5;
                    s.message = "数据库中已存在该用户ID!" + stationid;
                    var ret1 = JsonConvert.SerializeObject(s);
                    return(Json(ret1, JsonRequestBehavior.AllowGet));
                }
                string id = Request.Params.Get("id");//4位站号
                if (StationHelper.stationInfoDic4.ContainsKey(id))
                {
                    s.code    = 5;
                    s.message = "数据库中已存在该站码!" + id;
                    var ret2 = JsonConvert.SerializeObject(s);
                    return(Json(ret2, JsonRequestBehavior.AllowGet));
                }
                string stationName = Server.UrlDecode(Request.Params.Get("stationname"));
                int    subcenterId = int.Parse(Request.Params.Get("newSubcenter"));//所属分中心

                int stationType = 0;
                stationType = Int32.Parse(Request.Params.Get("stationType")); //站类

                decimal?WMax    = null;                                       //水位上限
                string  WMaxstr = Request.Params.Get("WMax");
                if (WMaxstr != "")
                {
                    WMax = decimal.Parse(WMaxstr);
                }

                decimal?WMin    = null;//水位下限
                string  WMinstr = Request.Params.Get("WMin");
                if (WMinstr != "")
                {
                    WMin = decimal.Parse(WMinstr);
                }

                decimal?RMax    = null;//雨量跳变阈值
                string  RMaxstr = Request.Params.Get("RMax");
                if (RMaxstr != "")
                {
                    RMax = decimal.Parse(RMaxstr);
                }

                decimal?Longitude    = null;//经度
                string  Longitudestr = Request.Params.Get("Longitude");
                if (Longitudestr != "")
                {
                    Longitude = decimal.Parse(Longitudestr);
                }
                decimal?Latitude    = null;//纬度
                string  Latitudestr = Request.Params.Get("Latitude");
                if (Latitudestr != "")
                {
                    Latitude = decimal.Parse(Latitudestr);
                }

                //"&Watershed=" + $('#watershed').val() +
                //    "&Project=" + $('#project').val() +
                //    "&Company=" + $('#company').val() +
                //    "&Pass="******"&Content=" + $('#content').val() +
                string Watershed = Request.Params.Get("Watershed");
                string Company   = Request.Params.Get("Company");
                string Project   = Request.Params.Get("Project");
                string Pass      = Request.Params.Get("Pass");
                string Content   = Request.Params.Get("Content");

                s.code = StationService.AddMaintainStation(id, stationid, stationName, stationType, subcenterId,
                                                           RMax, WMax, WMin, Longitude, Latitude, Watershed, Company, Project, Pass, Content);

                if (s.code != 0)
                {
                    s.message = "数据库添加失败!";
                }
                else
                {
                    s.message = "添加成功!";
                }
            }
            catch (FormatException f)
            {
                s.code    = 1;
                s.message = "参数格式错误!";
            }
            catch (ArgumentNullException a)
            {
                s.code    = 2;
                s.message = "缺少参数!";
            }
            catch (InvalidOperationException i)
            {
                s.code    = 3;
                s.message = "数据库中已存在该条数据!";
            }

            var ret = JsonConvert.SerializeObject(s);

            return(Json(ret, JsonRequestBehavior.AllowGet));
        }
示例#16
0
        /// <summary>
        /// 根据CURRENTData
        /// </summary>
        /// <param name="subcenter"></param>
        /// <returns></returns>
        public static List <StationStatusInfo> ListStationStatus(int subcenter)
        {
            List <StationStatusInfo>    result          = new List <StationStatusInfo>();
            List <CurrentData>          resultList      = new List <CurrentData>();
            List <CurrentData>          currentdataList = new List <CurrentData>();
            Dictionary <string, object> param           = new Dictionary <string, object>();
            Dictionary <string, string> paramInner      = new Dictionary <string, string>();

            paramInner["StationID"] = "";
            string url     = "http://127.0.0.1:8088/currentdata/getCurrentdata";
            string jsonStr = HttpHelper.SerializeDictionaryToJsonString(paramInner);

            param["currentdata"] = jsonStr;
            try
            {
                string resultJson = HttpHelper.Post(url, param);
                currentdataList = (List <CurrentData>)HttpHelper.JsonDeserialize <List <CurrentData> >(resultJson, new List <CurrentData>());
            }
            catch (Exception e)
            {
                Debug.WriteLine("查询实时数据失败");
                throw e;
            }
            //1.获取当前所有的站点,缓存有则直接使用,没有则
            if (StationHelper.stationInfoList == null || StationHelper.stationInfoList.Count == 0)
            {
                StationHelper.getStationInfoList();
            }
            //2.将已有最新数据的站点信息获取,并放入DIC
            Dictionary <string, CurrentData> currentDataDic = new Dictionary <string, CurrentData>();

            for (int i = 0; i < currentdataList.Count; i++)
            {
                if (int.Parse(currentdataList[i].CType) <= 10)
                {
                    if (!currentDataDic.ContainsKey(currentdataList[i].StationID))
                    {
                        currentDataDic[currentdataList[i].StationID] = currentdataList[i];
                    }
                }
            }
            //3.获取在线信息列表
            //TODO
            //获取在线列表信息,默认全部是在线的,1代表在线 0代表离线


            //4.根据站点信息 和  站点已有数据信息获取站点状态信息
            //0代表数据警告  1代表数据正常  -1代表数据异常
            //异常原因 0代表通讯故障 1代表电池欠压 2代表设备故障
            for (int i = 0; i < StationHelper.stationInfoList.Count; i++)
            {
                if (StationHelper.stationInfoList[i].stationType == StationTypes.rain2Station)
                {
                    continue;
                }
                StationStatusInfo stationStatusInfo = new StationStatusInfo();
                //5.1 如果有数据
                if (currentDataDic.ContainsKey(StationHelper.stationInfoList[i].stationId))
                {
                    DateTime dataTime = currentDataDic[StationHelper.stationInfoList[i].stationId].DataTime;
                    int      hours    = (DateTime.Now - dataTime).Hours;
                    stationStatusInfo.stationID   = StationHelper.stationInfoList[i].stationId;
                    stationStatusInfo.dataTime    = currentDataDic[StationHelper.stationInfoList[i].stationId].DataTime;
                    stationStatusInfo.stationName = StationHelper.stationInfoList[i].stationName;
                    stationStatusInfo.voltage     = currentDataDic[StationHelper.stationInfoList[i].stationId].Voltage;
                    if (hours >= 2)
                    {
                        stationStatusInfo.onlineState = "1";
                        if (stationStatusInfo.onlineState == "0")
                        {
                            stationStatusInfo.errorReason = "0";
                        }
                        else if (stationStatusInfo.voltage < (decimal)11.5)
                        {
                            stationStatusInfo.errorReason = "1";
                        }
                        else
                        {
                            stationStatusInfo.errorReason = "2";
                        }
                        stationStatusInfo.state = "-1";
                    }
                    else if (hours >= 1)
                    {
                        stationStatusInfo.onlineState = "1";
                        if (stationStatusInfo.onlineState == "0")
                        {
                            stationStatusInfo.errorReason = "0";
                        }
                        else if (stationStatusInfo.voltage < (decimal)11.5)
                        {
                            stationStatusInfo.errorReason = "1";
                        }
                        else
                        {
                            stationStatusInfo.errorReason = "2";
                        }
                        stationStatusInfo.state = "0";
                    }
                    else
                    {
                        stationStatusInfo.onlineState = "1";
                        stationStatusInfo.errorReason = "";
                        stationStatusInfo.state       = "1";
                    }
                }
                //如果无数据
                else
                {
                    stationStatusInfo.stationID   = StationHelper.stationInfoList[i].stationId;
                    stationStatusInfo.stationName = StationHelper.stationInfoList[i].stationName;
                    stationStatusInfo.dataTime    = null;
                    stationStatusInfo.voltage     = null;
                    stationStatusInfo.onlineState = "1";
                    stationStatusInfo.errorReason = "2";
                    stationStatusInfo.state       = "-1";
                }
                result.Add(stationStatusInfo);
            }


            return(result);
        }