old mode 100644
new mode 100755
| | |
| | | using HDL_ON.Entity; |
| | | using HDL_ON.UI.CSS; |
| | | using System.Collections.Generic; |
| | | using HDL_ON.DAL.Server; |
| | | |
| | | namespace HDL_ON.UI |
| | | { |
| | |
| | | TextColor = CSS_Color.PromptingColor2, |
| | | SelectedTextColor = CSS_Color.MainColor, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | TextID = StringId.month, |
| | | Text = DateTime.Now.Month.ToString() + Language.StringByID(StringId.month), |
| | | }; |
| | | showDataTypeView.AddChidren(btnShowHistroyData_Month); |
| | | #endregion |
| | |
| | | |
| | | switch (sensor.functionType) |
| | | { |
| | | case FunctionType.PM10: |
| | | case FunctionType.PM25: |
| | | tipValuesView.AddChidren(new Button() |
| | | { |
| | |
| | | //_levelTextList.Add(StringId.MildPollution); |
| | | //_levelTextList.Add(StringId.HeavyPollution); |
| | | //break; |
| | | //case FunctionType.Noise: |
| | | // break; |
| | | case FunctionType.WindPower: |
| | | break; |
| | | case FunctionType.CO2: |
| | | tipValuesView.AddChidren(new Button() |
| | | { |
| | |
| | | |
| | | bool initTitleButton = true; |
| | | |
| | | foreach (var tempSensor in DB_ResidenceData.residenceData.functionList.sensorsEnvironmentalScience) |
| | | foreach (var tempSensor in FunctionList.List.sensorsEnvironmentalScience) |
| | | { |
| | | if (tempSensor.sid == sensor.sid) |
| | | { |
| | |
| | | curMonth = DateTime.Now.Month; |
| | | } |
| | | int i = 0; |
| | | foreach (var tempSensor 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 FunctionList.List.sensorsEnvironmentalScience) |
| | | { |
| | | if (tempSensor.sid == sensor.sid) |
| | | if (sr.functionType != sensor.functionType) |
| | | { |
| | | continue; |
| | | } |
| | | if (tempSensor.functionType != sensor.functionType) |
| | | { |
| | | continue; |
| | | } |
| | | var sr = DB_ResidenceData.residenceData.functionList.sensorsEnvironmentalScience[i]; |
| | | if (showSensors.Find((obj) => obj.sid == sr.sid) == null) |
| | | { |
| | | i++; |
| | | continue; |
| | | } |
| | | var revertObj = new DAL.Server.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); |
| | | var revertObj = new HttpServerRequest().GetSensorHistory(sr.bus.SubnetID, sr.bus.DeviceID, |
| | | 5, (int)(sr.functionType) % 256, (int)curQueryType, sr.bus.LoopId, curMonth, |
| | | DB_ResidenceData.Instance.residenceGatewayMAC); |
| | | |
| | | if (revertObj != null) |
| | | { |
| | | if (revertObj.StateCode == "SUCCESS") |
| | | if (revertObj.StateCode == StateCode.SUCCESS) |
| | | { |
| | | var revertData = Newtonsoft.Json.JsonConvert.DeserializeObject<List<SensorPushHistoryRes>>(revertObj.ResponseData.ToString()); |
| | | |
| | |
| | | int ass = 0; |
| | | for (int j = 0; j < revertData.Count; j++) |
| | | { |
| | | if (curQueryType == QueryType.NowMonth && revertData[j].CreatedOnUtc.Day > DateTime.Now.Day) |
| | | { |
| | | continue; |
| | | } |
| | | if (revertData[j].TargetValue.ToString() != "NaN") |
| | | { |
| | | ass = Convert.ToInt32(revertData[j].TargetValue); |
| | | } |
| | | else |
| | | { |
| | | ass = 0; |
| | | } |
| | | sItem.data.Add(ass); |
| | | switch (curQueryType) |
| | |
| | | i++; |
| | | } |
| | | |
| | | //echartRootJson.title.text = "温度(℃)";lineStyle |
| | | //echartRootJson.color = new List<string> { "#80AEFF" };//, "FFD154", "FF9D54", "FE6A6A", "B183C3", "ADE764" |
| | | echartRootJson.series = seriesList; |
| | | |
| | | |