示例#1
0
        private List <string> GetUIShowStringList(CEntitySoilData entity)
        {
            // CEntitySoilStation station = CDBSoilDataMgr.Instance.GetSoilStationInfoByStationId(entity.StationID);
            //var stationEntity = CDBDataMgr.Instance.GetStationById(station.StationID);
            CEntitySoilStation stationEntity = CDBSoilDataMgr.Instance.GetSoilStationInfoByStationId(entity.StationID);
            //var stationEntity = CDBDataMgr.Instance.GetStationById(station.StationID);

            List <string> result = new List <string>();

            result.Add(stationEntity.StationID);
            result.Add(stationEntity.StationName);
            result.Add(CEnumHelper.StationTypeToUIStr(stationEntity.StationType));
            result.Add(entity.DataTime.ToString());

            result.Add(CEnumHelper.MessageTypeToUIStr(entity.MessageType));
            result.Add(CEnumHelper.ChannelTypeToUIStr(entity.ChannelType));
            result.Add(entity.Voltage10.HasValue ? entity.Voltage10.Value.ToString() : CS_NullUIStr);
            result.Add(entity.Moisture10.HasValue ? entity.Moisture10.ToString() : CS_NullUIStr);
            result.Add(entity.Voltage20.HasValue ? entity.Voltage20.ToString() : CS_NullUIStr);
            result.Add(entity.Moisture20.HasValue ? entity.Moisture20.ToString() : CS_NullUIStr);
            result.Add(entity.Voltage30.HasValue ? entity.Voltage30.ToString() : CS_NullUIStr);
            result.Add(entity.Moisture30.HasValue ? entity.Moisture30.ToString() : CS_NullUIStr);
            result.Add(entity.Voltage40.HasValue ? entity.Voltage40.ToString() : CS_NullUIStr);
            result.Add(entity.Moisture40.HasValue ? entity.Moisture40.ToString() : CS_NullUIStr);
            result.Add(entity.Voltage60.HasValue ? entity.Voltage60.ToString() : CS_NullUIStr);
            result.Add(entity.Moisture60.HasValue ? entity.Moisture60.ToString() : CS_NullUIStr);
            return(result);
        }
示例#2
0
        public void InitUI()
        {
            try
            {
                //// 初始化分中心
                for (int i = 0; i < m_listSubCenter.Count; ++i)
                {
                    cmb_SubCenter.Items.Add(m_listSubCenter[i].SubCenterName);
                }
                cmb_SubCenter.SelectedIndex = 0;
                // 初始化站点类型
                cmb_StationType.Items.Add(CEnumHelper.StationTypeToUIStr(EStationType.EHydrology));
                cmb_StationType.Items.Add(CEnumHelper.StationTypeToUIStr(EStationType.EH));
                cmb_StationType.Items.Add(CEnumHelper.StationTypeToUIStr(EStationType.RE));
                cmb_StationType.Items.Add(CEnumHelper.StationTypeToUIStr(EStationType.RP));
                cmb_StationType.Items.Add(CEnumHelper.StationTypeToUIStr(EStationType.GT));
                cmb_StationType.SelectedIndex = 0;

                // 初始化雨量精度
                cmb_RainAccuracy.Items.Add("0.1");
                cmb_RainAccuracy.Items.Add("0.2");
                cmb_RainAccuracy.Items.Add("0.5");
                cmb_RainAccuracy.Items.Add("1.0");
                cmb_RainAccuracy.SelectedIndex = 0;

                //浮子水位、气泡水位、压阻水位、雷达水位

                comb_WaterSensor.Items.Add("浮子水位");
                comb_WaterSensor.Items.Add("气泡水位");
                comb_WaterSensor.Items.Add("压阻水位");
                comb_WaterSensor.Items.Add("雷达水位");
                //  comb_WaterSensor.Items.Add("无");
                comb_WaterSensor.SelectedIndex = 0;

                //翻斗雨量、雨雪量计
                comb_RainSensor.Items.Add("翻斗雨量");
                comb_RainSensor.Items.Add("雨雪量计");
                //  comb_RainSensor.Items.Add("无");
                comb_RainSensor.SelectedIndex = 0;
                //comb_RainSensor.Enabled = false;

                //自报段次
                comb_Paragraph.Items.Add("1");
                comb_Paragraph.Items.Add("4");
                comb_Paragraph.Items.Add("8");
                comb_Paragraph.Items.Add("12");
                comb_Paragraph.Items.Add("24");
                comb_Paragraph.Items.Add("48");
                comb_Paragraph.SelectedIndex = 4;

                //报警信息初始化
                textBox_Voltage.Text = "11";

                //数值参数初始化


                if (cmb_StationType.Text == "雨量站")
                {
                    cmb_RainAccuracy.Enabled = true;
                    cmb_RainAccuracy.Items.Remove("无");
                    cmb_RainAccuracy.SelectedIndex = 2;

                    comb_WaterSensor.Enabled = false;
                    comb_WaterSensor.Items.Add("无");
                    comb_WaterSensor.SelectedIndex = 4;

                    comb_RainSensor.Enabled = true;
                    comb_RainSensor.Items.Remove("无");
                    comb_RainSensor.SelectedIndex = 0;

                    textBox_WaterMin.Enabled = false;
                    //textBox_WaterMin.Text = "0.1";

                    textBox_WaterMax.Enabled = false;
                    //textBox_WaterMax.Text = "100";

                    textBox_WaterChange.Enabled = false;
                    //textBox_WaterChange.Text = "2.2";

                    textBox_RainChange.Enabled = true;
                    textBox_RainChange.Text    = "80.0";

                    textBox_WaterBase.Enabled = false;
                    //textBox_WaterBase.Text = "0.0";
                }

                if (cmb_StationType.Text == "水位站")
                {
                    cmb_RainAccuracy.Enabled = false;
                    cmb_RainAccuracy.Items.Add("无");
                    cmb_RainAccuracy.SelectedIndex = 4;

                    comb_WaterSensor.Enabled = true;
                    comb_WaterSensor.Items.Remove("无");
                    comb_WaterSensor.SelectedIndex = 0;

                    comb_RainSensor.Enabled = false;
                    comb_RainSensor.Items.Add("无");
                    comb_RainSensor.SelectedIndex = 2;

                    textBox_WaterMin.Enabled = true;
                    textBox_WaterMin.Text    = "0";

                    textBox_WaterMax.Enabled = true;
                    textBox_WaterMax.Text    = "100";

                    textBox_WaterChange.Enabled = true;
                    textBox_WaterChange.Text    = "1";

                    textBox_RainChange.Enabled = false;
                    //textBox_RainChange.Text = "20.0";

                    textBox_WaterBase.Enabled = true;
                    textBox_WaterBase.Text    = "0.0";
                }
                if (cmb_StationType.Text == "水文站")
                {
                    cmb_RainAccuracy.Enabled = true;
                    cmb_RainAccuracy.Items.Remove("无");
                    cmb_RainAccuracy.SelectedIndex = 2;

                    comb_WaterSensor.Enabled = true;
                    comb_WaterSensor.Items.Remove("无");
                    comb_WaterSensor.SelectedIndex = 0;

                    comb_RainSensor.Enabled = true;
                    comb_RainSensor.Items.Remove("无");
                    comb_RainSensor.SelectedIndex = 0;

                    textBox_WaterMin.Enabled = true;
                    textBox_WaterMin.Text    = "0";

                    textBox_WaterMax.Enabled = true;
                    textBox_WaterMax.Text    = "100";

                    textBox_WaterChange.Enabled = true;
                    textBox_WaterChange.Text    = "1";

                    textBox_RainChange.Enabled = true;
                    textBox_RainChange.Text    = "80.0";

                    textBox_WaterBase.Enabled = true;
                    textBox_WaterBase.Text    = "0.0";
                }

                textBox_StationID.Text        = "0001";
                textBox_StationName.Text      = "测站1";
                cmb_StationType.SelectedIndex = 0;
                //comb_DataProtocol.Items.Add("辽宁");
                m_listProtocolData = XmlDocManager.Instance.DataProtocolNames;
                for (int i = 0; i < m_listProtocolData.Count; i++)
                {
                    comb_DataProtocol.Items.Add(m_listProtocolData[i]);
                }
                comb_DataProtocol.SelectedIndex = 0;

                XmlDocManager.Instance.ReadFromXml();
                m_dllCollections = Protocol.Manager.XmlDocManager.Instance.DllInfo;
                //10.12
                //comb_MainRoad.Items.Add("Gprs");
                //comb_PrepareRoad.Items.Add("Gprs");
                foreach (XmlDllInfo info in m_dllCollections.Infos)
                {
                    //  不显示已经被禁用的协议
                    if (!info.Enabled)
                    {
                        continue;
                    }
                    // 显示信道协议
                    if (info.Type == "channel")
                    {
                        //   m_mapChannelInfo.Add(info.Name, info);
                        comb_MainRoad.Items.Add(info.Name);
                        comb_PrepareRoad.Items.Add(info.Name);
                    }
                }
                comb_PrepareRoad.Items.Add("无");
                comb_MainRoad.SelectedIndex    = 0;
                comb_PrepareRoad.SelectedIndex = 1;


                //通讯参数初始化
                textBox_GSM.Text = "";
                //textBox_GSM.Enabled = false;

                textBox_GPRS.Text = "";
                //textBox_GPRS.Enabled = false;

                textBox_Beidou.Text    = "";
                textBox_Beidou.Enabled = false;

                textBox_BeidouMember.Text    = "";
                textBox_BeidouMember.Enabled = false;


                if (comb_MainRoad.Text == "SX-GPRS" || comb_PrepareRoad.Text == "SX-GPRS")
                {
                    //通讯参数初始化
                    textBox_GPRS.Enabled = true;
                    textBox_GPRS.Text    = "00000001";
                }
                if (comb_MainRoad.Text == "GSM" || comb_PrepareRoad.Text == "GSM" || comb_MainRoad.Text == "WebGSM" || comb_PrepareRoad.Text == "WebGSM")
                {
                    textBox_GSM.Text    = "13211111111";
                    textBox_GSM.Enabled = true;
                }
                if (comb_MainRoad.Text == "Beidou-Normal" || comb_PrepareRoad.Text == "Beidou-Normal")
                {
                    textBox_Beidou.Text          = "212880";
                    textBox_Beidou.Enabled       = true;
                    textBox_BeidouMember.Text    = "0";
                    textBox_BeidouMember.Enabled = true;
                }
                if (comb_MainRoad.Text == "Beidou-500" || comb_PrepareRoad.Text == "Beidou-500")
                {
                    textBox_Beidou.Text    = "212880";
                    textBox_Beidou.Enabled = true;

                    textBox_BeidouMember.Text    = "0";
                    textBox_BeidouMember.Enabled = true;
                }
                btn_Save.Enabled   = true;
                btn_Revert.Enabled = true;
            }
            catch (Exception ex) { }
        }
示例#3
0
        private List <string> GetUIShowStringList(CEntityRealTime entity)
        {
            List <string> result = new List <string>();
            TimeSpan      span   = entity.TimeReceived - entity.TimeDeviceGained;

            //表格头部信息
            //this.Header = new string[]
            //{
            //    CS_StationName, CS_StationId, CS_StationType, CS_TimeCollected, CS_DelayTime,
            //    CS_TodayRain, CS_LastdayRain,CS_PeriodRain, CS_WaterLevel,CS_V1,CS_V2,CS_V3,CS_V4, CS_WaterFlowActual,CS_WaterFlowFindInTable,
            //    CS_Volatage,CS_Port, CS_MsgType, CS_ChannelType
            //};

            result.Add(entity.StrStationName);                                                   //站名
            result.Add(entity.StrStationID.ToString());                                          //站号
            result.Add(CEnumHelper.StationTypeToUIStr(entity.EIStationType));                    //站类
            result.Add(entity.TimeDeviceGained.ToString());                                      //数据时间
            result.Add(string.Format("{0}m{1}s", span.Hours * 60 + span.Minutes, span.Seconds)); //延迟时间
            //if (entity.DDayRainFall.HasValue)
            //{
            //    result.Add(entity.DDayRainFall.Value.ToString("0.00"));/*今日雨量,计算*/
            //}
            //else
            //{
            //    result.Add(CS_NullUIStr);
            //}
            result.Add(CS_NullUIStr);//今日雨量
            //if (entity.LastDayRainFall.HasValue)
            //{
            //    result.Add(entity.LastDayRainFall.Value.ToString("0.00"));/*昨日雨量,计算*/
            //}
            //else
            //{
            //    result.Add(CS_NullUIStr);
            //}
            result.Add(CS_NullUIStr);//昨日雨量
            //if (entity.DPeriodRain.HasValue)
            //{
            //    if (entity.DPeriodRain.Value >= 0)
            //    {
            //        result.Add(entity.DPeriodRain.Value.ToString("0.00"));/*时段雨量,计算*/
            //    }
            //    else
            //    {
            //        result.Add("0.00");
            //    }
            //}
            //else
            //{
            //    result.Add(CS_NullUIStr);
            //}
            result.Add(CS_NullUIStr);//时段雨量

            //水位
            if (entity.DWaterYield.HasValue)
            {
                if (entity.DDayRainFall != (decimal) - 20000)
                {
                    result.Add(entity.DWaterYield.Value.ToString("0.00"));/*水位*/
                }
                else
                {
                    result.Add(CS_NullUIStr);
                }
            }
            else
            {
                result.Add(CS_NullUIStr);
            }



            //流速1
            if (entity.DV1.HasValue)
            {
                result.Add(entity.DV1.Value.ToString("0.000"));
            }
            else
            {
                result.Add(CS_NullUIStr);
            }

            //流速2
            if (entity.DV2.HasValue)
            {
                result.Add(entity.DV2.Value.ToString("0.000"));
            }
            else
            {
                result.Add(CS_NullUIStr);
            }

            //流速3
            if (entity.DV3.HasValue)
            {
                result.Add(entity.DV3.Value.ToString("0.000"));
            }
            else
            {
                result.Add(CS_NullUIStr);
            }

            //流速4
            if (entity.DV4.HasValue)
            {
                result.Add(entity.DV4.Value.ToString("0.000"));
            }
            else
            {
                result.Add(CS_NullUIStr);
            }

            //实测流量
            if (entity.DWaterFlowActual.HasValue)
            {
                result.Add(entity.DWaterFlowActual.Value.ToString("0.00"));/*实测流量*/
            }
            else
            {
                result.Add(CS_NullUIStr);
            }


            if (entity.DWaterFlowFindInTable.HasValue)
            {
                result.Add(entity.DWaterFlowFindInTable.Value.ToString("0.00"));/*相应流量*/
            }
            else
            {
                result.Add(CS_NullUIStr);/*相应流量*/
            }
            //result.Add(CS_NullUIStr); //相应流量

            result.Add(entity.Dvoltage.ToString());/*电压*/
            result.Add(entity.StrPort);
            result.Add(CEnumHelper.MessageTypeToUIStr(entity.EIMessageType));
            result.Add(CEnumHelper.ChannelTypeToUIStr(entity.EIChannelType));
            return(result);
        }
示例#4
0
        private List <string> GetUIShowStringList(CEntityRealTime entity)
        {
            List <string> result = new List <string>();
            TimeSpan      span   = entity.TimeReceived - entity.TimeDeviceGained;

            result.Add(entity.StrStationName);
            result.Add(entity.StrStationID.ToString());
            result.Add(CEnumHelper.StationTypeToUIStr(entity.EIStationType));
            result.Add(entity.TimeDeviceGained.ToString());
            result.Add(string.Format("{0}m{1}s", span.Hours * 60 + span.Minutes, span.Seconds));
            if (entity.DDayRainFall.HasValue)
            {
                result.Add(entity.DDayRainFall.Value.ToString("0.00"));/*今日雨量,计算*/
            }
            else
            {
                result.Add(CS_NullUIStr);
            }
            if (entity.LastDayRainFall.HasValue)
            {
                result.Add(entity.LastDayRainFall.Value.ToString("0.00"));/*昨日雨量,计算*/
            }
            else
            {
                result.Add(CS_NullUIStr);
            }
            if (entity.DPeriodRain.HasValue)
            {
                if (entity.DPeriodRain.Value >= 0)
                {
                    result.Add(entity.DPeriodRain.Value.ToString("0.00"));/*时段雨量,计算*/
                }
                else
                {
                    result.Add("0.00");
                }
            }
            else
            {
                result.Add(CS_NullUIStr);
            }
            if (entity.DWaterYield.HasValue)
            {
                if (entity.DDayRainFall != (decimal) - 20000)
                {
                    result.Add(entity.DWaterYield.Value.ToString("0.00"));/*水位*/
                }
                else
                {
                    result.Add(CS_NullUIStr);
                }
            }
            else
            {
                result.Add(CS_NullUIStr);
            }
            if (entity.DWaterFlowActual.HasValue)
            {
                result.Add(entity.DWaterFlowActual.Value.ToString("0.00"));/*实测流量*/
            }
            else
            {
                result.Add(CS_NullUIStr);
            }
            if (entity.DWaterFlowFindInTable.HasValue)
            {
                result.Add(entity.DWaterFlowFindInTable.Value.ToString("0.00"));/*相应流量*/
            }
            else
            {
                result.Add(CS_NullUIStr);/*相应流量*/
            }


            result.Add(entity.Dvoltage.ToString());/*电压*/
            result.Add(entity.StrPort);
            result.Add(CEnumHelper.MessageTypeToUIStr(entity.EIMessageType));
            result.Add(CEnumHelper.ChannelTypeToUIStr(entity.EIChannelType));
            return(result);
        }
示例#5
0
        public void InitUI()
        {
            try
            {
                //// 初始化分中心
                for (int i = 0; i < m_listSubCenter.Count; ++i)
                {
                    cmb_SubCenter.Items.Add(m_listSubCenter[i].SubCenterName);
                }
                cmb_SubCenter.SelectedIndex = 0;

                //ESoil = 3,         //  04墒情站
                //ESoilRain = 4,     //  05墒情雨量站
                //ESoilWater = 5,     //  06,16墒情水位站
                //ESoilHydrology = 6  //  07,17墒情水文站
                // 初始化站点类型
                cmb_StationType.Items.Add(CEnumHelper.StationTypeToUIStr(EStationType.ESoil));
                //cmb_StationType.Items.Add(CEnumHelper.StationTypeToUIStr(EStationType.ESoilRain));
                //cmb_StationType.Items.Add(CEnumHelper.StationTypeToUIStr(EStationType.ESoilWater));
                //cmb_StationType.Items.Add(CEnumHelper.StationTypeToUIStr(EStationType.ESoilHydrology));
                cmb_StationType.SelectedIndex = 0;

                textBox_StationID.Text   = "0001";
                textBox_StationName.Text = "测站1";
                //textBox_deviceNumber.Text = "21208890";
                textBox_Voltage.Text = "11";

                textBox_10a.Text = "1.0000";
                textBox_10b.Text = "2.0000";
                textBox_10c.Text = "3.0000";
                textBox_10d.Text = "4.0000";
                textBox_10m.Text = "1.0000";
                textBox_10n.Text = "2.0000";

                textBox_20a.Text = "1.0000";
                textBox_20b.Text = "2.0000";
                textBox_20c.Text = "3.0000";
                textBox_20d.Text = "4.0000";
                textBox_20m.Text = "1.0000";
                textBox_20n.Text = "2.0000";

                textBox_30a.Text = "1.0000";
                textBox_30b.Text = "2.0000";
                textBox_30c.Text = "3.0000";
                textBox_30d.Text = "4.0000";
                textBox_30m.Text = "1.0000";
                textBox_30n.Text = "2.0000";

                textBox_40a.Text = "1.0000";
                textBox_40b.Text = "2.0000";
                textBox_40c.Text = "3.0000";
                textBox_40d.Text = "4.0000";
                textBox_40m.Text = "1.0000";
                textBox_40n.Text = "2.0000";

                textBox_60a.Text = "1.0000";
                textBox_60b.Text = "2.0000";
                textBox_60c.Text = "3.0000";
                textBox_60d.Text = "4.0000";
                textBox_60m.Text = "1.0000";
                textBox_60n.Text = "2.0000";

                //自报段次
                comb_Paragraph.Items.Add("1");
                comb_Paragraph.Items.Add("4");
                comb_Paragraph.Items.Add("8");
                comb_Paragraph.Items.Add("12");
                comb_Paragraph.Items.Add("24");
                comb_Paragraph.Items.Add("48");
                comb_Paragraph.SelectedIndex = 4;

                //通讯参数初始化
                textBox_GSM.Text    = "";
                textBox_GSM.Enabled = false;

                textBox_GPRS.Text    = "";
                textBox_GPRS.Enabled = false;

                textBox_Beidou.Text    = "";
                textBox_Beidou.Enabled = false;

                textBox_BeidouMember.Text    = "";
                textBox_BeidouMember.Enabled = false;

                m_listProtocolData = XmlDocManager.Instance.DataProtocolNames;
                for (int i = 0; i < m_listProtocolData.Count; i++)
                {
                    comb_DataProtocol.Items.Add(m_listProtocolData[i]);
                }
                comb_DataProtocol.SelectedIndex = 0;

                XmlDocManager.Instance.ReadFromXml();
                m_dllCollections = Protocol.Manager.XmlDocManager.Instance.DllInfo;
                foreach (XmlDllInfo info in m_dllCollections.Infos)
                {
                    //  不显示已经被禁用的协议
                    if (!info.Enabled)
                    {
                        continue;
                    }
                    // 显示信道协议
                    if (info.Type == "channel")
                    {
                        //   m_mapChannelInfo.Add(info.Name, info);
                        comb_MainRoad.Items.Add(info.Name);
                        comb_PrepareRoad.Items.Add(info.Name);
                    }
                }
                comb_PrepareRoad.Items.Add("无");
                comb_MainRoad.SelectedIndex    = 0;
                comb_PrepareRoad.SelectedIndex = 1;

                if (comb_MainRoad.Text == "SX-GPRS" || comb_PrepareRoad.Text == "SX-GPRS")
                {
                    //通讯参数初始化
                    textBox_GPRS.Enabled = true;
                    textBox_GPRS.Text    = "00000001";
                }
                if (comb_MainRoad.Text == "GSM" || comb_PrepareRoad.Text == "GSM")
                {
                    textBox_GSM.Text    = "13211111111";
                    textBox_GSM.Enabled = true;
                }
                if (comb_MainRoad.Text == "Beidou-Normal" || comb_PrepareRoad.Text == "Beidou-Normal")
                {
                    textBox_Beidou.Text          = "212880";
                    textBox_Beidou.Enabled       = true;
                    textBox_BeidouMember.Text    = "0";
                    textBox_BeidouMember.Enabled = true;
                }
                if (comb_MainRoad.Text == "Beidou-500" || comb_PrepareRoad.Text == "Beidou-500")
                {
                    textBox_Beidou.Text    = "212880";
                    textBox_Beidou.Enabled = true;

                    textBox_BeidouMember.Text    = "0";
                    textBox_BeidouMember.Enabled = true;
                }
            }
            catch (Exception ex) { }
        }
        /// <summary>
        /// 设置显示的数据
        /// </summary>
        /// <param name="listSoilStation"></param>
        public void SetSoilStation(List <CEntitySoilStation> listSoilStation)
        {
            base.m_dataTable.Rows.Clear();
            XmlDocManager.Instance.ReadFromXml();
            m_dllCollections = Protocol.Manager.XmlDocManager.Instance.DllInfo;
            List <string> xmlDll = new List <string>();

            foreach (XmlDllInfo info in m_dllCollections.Infos)
            {
                xmlDll.Add(info.Name);
            }
            // 将用户信息显示到表格上
            foreach (CEntitySoilStation station in listSoilStation)
            {
                //var s = CDBDataMgr.Instance.GetStationById(station.StationID);
                string subcerterName  = "";
                int    reportInterval = 24;
                var    s = station;
                // 1103 gm
                //限制分中心名称
                for (int i = 0; i < m_listSubCenter.Count; i++)
                {
                    if (s.SubCenterID == m_listSubCenter[i].SubCenterID)
                    {
                        subcerterName = m_listSubCenter[i].SubCenterName;
                        break;
                    }
                }
                //限制报讯段次
                try
                {
                    int report = int.Parse(s.Reportinterval);
                    if (report == 1 || report == 4 || report == 8 || report == 12 || report == 24 || report == 48)
                    {
                        reportInterval = report;
                    }
                }
                catch (Exception e)
                {
                    reportInterval = 24;
                }
                // 限制主信道
                if (!xmlDll.Contains(s.Maintran))
                {
                    s.Maintran = "未知通讯协议";
                }
                // 限制备用信道
                if (!xmlDll.Contains(s.Subtran) && s.Subtran != "无")
                {
                    s.Subtran = "未知通讯协议";
                }
                if (s.StationType == EStationType.ESoil ||
                    s.StationType == EStationType.ESoilHydrology ||
                    s.StationType == EStationType.ESoilRain ||
                    s.StationType == EStationType.ESoilWater)
                {
                    base.AddRow(new string[]
                    {
                        "False", s.StationID, s.StationName.ToString(),
                        //CEnumHelper.StationTypeToUIStr(s.StationType),m_listSubCenter[int.Parse(s.SubCenterID.ToString())-1].SubCenterName.ToString(),
                        CEnumHelper.StationTypeToUIStr(s.StationType), subcerterName,
                        station.GSM, station.GPRS, station.BDSatellite, station.BDMemberSatellite, station.Maintran, station.Subtran, station.Datapotocol, reportInterval.ToString(),
                        s.VoltageMin.ToString(),
                        station.A10.ToString(), station.B10.ToString(), station.C10.ToString(), station.D10.ToString(), station.M10.ToString(), station.N10.ToString(),
                        station.A20.ToString(), station.B20.ToString(), station.C20.ToString(), station.D20.ToString(), station.M20.ToString(), station.N20.ToString(),
                        station.A30.ToString(), station.B30.ToString(), station.C30.ToString(), station.D30.ToString(), station.M30.ToString(), station.N30.ToString(),
                        station.A40.ToString(), station.B40.ToString(), station.C40.ToString(), station.D40.ToString(), station.M40.ToString(), station.N40.ToString(),
                        station.A60.ToString(), station.B60.ToString(), station.C60.ToString(), station.D60.ToString(), station.M60.ToString(), station.N60.ToString(),
                    }, EDataState.ENormal);
                }
            }
            UpdateDataToUI();
            UpdateSoilStationCount(listSoilStation.Count);
        }
示例#7
0
        private void EHStationChanged(object sender, CEventSingleArgs <CEntityStation> e)
        {
            //如果为空,则不选择所有,如果不为空,更新站点类型复选框
            m_currentStation = e.Value;
            if (null == m_currentStation)
            {
                textBox_StationType.Text = "";
                cmb_AddDataType.Items.Clear(); //清空
                cmb_AddDataType.Text = "";
                chk_Water.Enabled    = false;
                chk_Voltage.Enabled  = false;
                chk_Rain.Enabled     = false;
            }
            else
            {
                cmb_AddDataType.Items.Clear();
                cmb_AddDataType.Text     = "";
                textBox_StationType.Text = CEnumHelper.StationTypeToUIStr(m_currentStation.StationType);
                // 根据站点类型,输入可选的数据类型
                switch (m_currentStation.StationType)
                {
                case EStationType.EHydrology:
                {
                    chk_Rain.Enabled    = true;
                    chk_Voltage.Enabled = true;
                    chk_Water.Enabled   = true;
                    // 水位站
                    //cmb_AddDataType.Items.Add(CS_AddData_Rain);
                    //cmb_AddDataType.Items.Add(CS_AddData_Water);
                    //cmb_AddDataType.Items.Add(CS_AddData_Voltage);

                    //cmb_AddDataType.Items.Add(CS_AddData_Rain + " " + CS_AddData_Water);
                    //cmb_AddDataType.Items.Add(CS_AddData_Rain + " " + CS_AddData_Voltage);
                    //cmb_AddDataType.Items.Add(CS_AddData_Water + " " + CS_AddData_Voltage);

                    //cmb_AddDataType.Items.Add(CS_AddData_Rain + " " + CS_AddData_Water + " " + CS_AddData_Voltage);
                }
                break;

                case EStationType.ERainFall:
                {
                    //雨量站
                    chk_Rain.Enabled    = true;
                    chk_Voltage.Enabled = true;
                    //cmb_AddDataType.Items.Add(CS_AddData_Rain);
                    //cmb_AddDataType.Items.Add(CS_AddData_Voltage);
                    //cmb_AddDataType.Items.Add(CS_AddData_Rain + " " + CS_AddData_Voltage);
                }
                break;

                case EStationType.ERiverWater:
                {
                    //水位站
                    chk_Voltage.Enabled = true;
                    chk_Water.Enabled   = true;
                    //cmb_AddDataType.Items.Add(CS_AddData_Water);
                    //cmb_AddDataType.Items.Add(CS_AddData_Voltage);
                    //cmb_AddDataType.Items.Add(CS_AddData_Water + " " + CS_AddData_Voltage);
                }
                break;
                }
            }
        }