From e53a1951d6aa07ad22aad9816da4703496fcbccd Mon Sep 17 00:00:00 2001 From: wei <kaede@kaededeMacBook-Air.local> Date: 星期五, 27 十一月 2020 14:27:16 +0800 Subject: [PATCH] 1127最新合并代码,合并嘉乐更新 --- HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSensorPage.cs | 75 +++++++++++++++++++++++++++++++------ 1 files changed, 63 insertions(+), 12 deletions(-) diff --git a/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSensorPage.cs b/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSensorPage.cs index de9b405..0cf683f 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSensorPage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSensorPage.cs @@ -3,6 +3,7 @@ using HDL_ON.Entity; using HDL_ON.UI.CSS; using System.Collections.Generic; +using HDL_ON.DAL.Server; namespace HDL_ON.UI { @@ -164,7 +165,6 @@ switch (sensor.functionType) { - case FunctionType.PM10: case FunctionType.PM25: tipValuesView.AddChidren(new Button() { @@ -233,10 +233,6 @@ //_levelTextList.Add(StringId.MildPollution); //_levelTextList.Add(StringId.HeavyPollution); //break; - //case FunctionType.Noise: - // break; - case FunctionType.WindPower: - break; case FunctionType.CO2: tipValuesView.AddChidren(new Button() { @@ -646,7 +642,7 @@ bool initTitleButton = true; - foreach (var tempSensor in DB_ResidenceData.residenceData.functionList.sensorsEnvironmentalScience) + foreach (var tempSensor in DB_ResidenceData.functionList.sensorsEnvironmentalScience) { if (tempSensor.sid == sensor.sid) { @@ -840,7 +836,64 @@ curMonth = DateTime.Now.Month; } int i = 0; - foreach (var sr in DB_ResidenceData.residenceData.functionList.sensorsEnvironmentalScience) + +//#if DEBUG +// var sItem = new EchartSeriesItem +// { +// name = sensor.GetRoomListName(), +// data = new List<int>(), +// lineStyle = new EchartLineStyle() +// { +// color = tipColorStringList[i], +//#if __IOS__ +// width = 5, +//#elif __ANDROID__ +// width = 2, +//#endif +// }, +// }; +// Random random = new Random(); +// double level = 0.0; +// int countddd = 24; +// for (int j = 0; j < countddd; j++) +// { +// switch (sensor.functionType) +// { +// case FunctionType.PM25: +// level = Math.Round(random.NextDouble() * 130, 0); +// break; +// case FunctionType.CO2: +// level = Math.Round(random.NextDouble() * 6000, 0); +// break; +// case FunctionType.Temp: +// level = Math.Round(random.NextDouble() * 40, 0); +// break; +// case FunctionType.TVOC: +// level = Math.Round(random.NextDouble() * 10, 1); +// break; +// case FunctionType.Humidity: +// level = Math.Round(random.NextDouble() * 100, 0); +// break; +// } +// sItem.data.Add((int)level); +// } +// seriesList.Add(sItem); +// echartRootJson.series = seriesList; +//#if __IOS__ +// echartRootJson.xAxis.axisLabel.fontSize = 22; +// echartRootJson.yAxis.axisLabel.fontSize = 22; +//#else +// echartRootJson.xAxis.axisLabel.fontSize = 8; +// echartRootJson.yAxis.axisLabel.fontSize = 8; +//#endif +// echartRootJsonString = Newtonsoft.Json.JsonConvert.SerializeObject(echartRootJson); +// Application.RunOnMainThread(() => +// { +// myEchartsView.ShowWithOptionJsonString(echartRootJsonString); +// }); +//#endif + + foreach (var sr in DB_ResidenceData.functionList.sensorsEnvironmentalScience) { if (sr.functionType != sensor.functionType) { @@ -851,13 +904,13 @@ i++; continue; } - var revertObj = new DAL.Server.HttpServerRequest().GetSensorHistory(sr.bus_Data.SubnetID, sr.bus_Data.DeviceID, + var revertObj = new HttpServerRequest().GetSensorHistory(sr.bus_Data.SubnetID, sr.bus_Data.DeviceID, 5, (int)(sr.functionType) % 256, (int)curQueryType, sr.bus_Data.LoopID, curMonth, DB_ResidenceData.residenceData.residenceGatewayMAC); if (revertObj != null) { - if (revertObj.StateCode == "SUCCESS") + if (revertObj.StateCode == StateCode.SUCCESS) { var revertData = Newtonsoft.Json.JsonConvert.DeserializeObject<List<SensorPushHistoryRes>>(revertObj.ResponseData.ToString()); @@ -879,7 +932,7 @@ int ass = 0; for (int j = 0; j < revertData.Count; j++) { - if (curQueryType == QueryType.NowMonth && revertData[j].CreatedOnUtc.Day > DateTime.Now.Day ) + if (curQueryType == QueryType.NowMonth && revertData[j].CreatedOnUtc.Day > DateTime.Now.Day) { continue; } @@ -918,8 +971,6 @@ i++; } - //echartRootJson.title.text = "娓╁害(鈩�)";lineStyle - //echartRootJson.color = new List<string> { "#80AEFF" };//, "FFD154", "FF9D54", "FE6A6A", "B183C3", "ADE764" echartRootJson.series = seriesList; -- Gitblit v1.8.0