コード例 #1
0
ファイル: Shwxqhxy.cs プロジェクト: genganpeng/zhglzxt
        /// <summary>
        /// 微小气候
        /// </summary>
        /// <returns></returns>
        public static Microclimate getendata()
        {
            string url  = AppConfig.swwxqhxy + "/getendata";
            string data = GetResponseData(url);

            if (data == null)
            {
                return(null);
            }
            Microclimate microclimate = JsonConvert.DeserializeObject(data, typeof(Microclimate)) as Microclimate;

            return(microclimate);
        }
コード例 #2
0
ファイル: FormMain.cs プロジェクト: genganpeng/zhglzxt
        private void updateSHWXQH(ChemicalToxic chemicalToxic, Bioaerosol bioaerosol, Microclimate microlimate)
        {
            if (chemicalToxic != null)
            {
                this.navBarItem_huaxue.Caption = chemicalToxic.gastype + ":" + chemicalToxic.reading;
            }
            else
            {
                this.navBarItem_huaxue.Caption = "化学毒剂在线监测系统无法连接,请检查!";
            }

            if (bioaerosol != null)
            {
                //超标
                if (!String.IsNullOrWhiteSpace(bioaerosol.error))
                {
                    MessageBox.Show("生物气溶剂超标了!-->是否需要关闭所有的闸机-->是否需要弹出应急预案", "超标");
                }
                this.navBarItem_shengwu.Caption = bioaerosol.Status + "    " + bioaerosol.reading;
            }
            else
            {
                this.navBarItem_shengwu.Caption = "生物气溶胶在线监测系统无法连接,请检查!";
            }

            if (microlimate != null)
            {
                this.navBarItem_weixiaoqihou.Caption =
                    microlimate.Temperature + "\n" + microlimate.Humidity + "\n"
                    + microlimate.Lux + "\n" + microlimate.Pm + "\n"
                    + microlimate.Pressure + "\n" + microlimate.Co + "\n"
                    + microlimate.Co2 + "\n" + microlimate.Ms + "\n"
                    + microlimate.Hcho + "\n" + microlimate.Db;
            }
            else
            {
                this.navBarItem_weixiaoqihou.Caption = "微小气候在线监测系统无法连接,请检查!";
            }
        }