| | |
| | | string curQueryType = "hour"; |
| | | string queryTime; |
| | | Function function; |
| | | public AcstSubHistoryPage(Function temp) |
| | | string colorString; |
| | | public AcstSubHistoryPage(Function temp,string colorStr) |
| | | { |
| | | function = temp; |
| | | bodyView = this; |
| | | colorString = colorStr; |
| | | } |
| | | |
| | | |
| | |
| | | /// </summary> |
| | | public void LoadPage() |
| | | { |
| | | new TopViewDiv(bodyView, function.GetRoomListName()).LoadTopView(); |
| | | new TopViewDiv(bodyView, function.name).LoadTopView(); |
| | | bodyView.BackgroundColor = CSS_Color.BackgroundColor; |
| | | |
| | | //var contentView = new FrameLayout() |
| | |
| | | { |
| | | Y = Application.GetRealHeight(222), |
| | | Height = Application.GetRealHeight(34), |
| | | Text = "最近24小时的平均室内温度", |
| | | TextID = StringId.Temp, |
| | | TextSize = 10, |
| | | TextColor = 0xFF798394, |
| | | TextAlignment = TextAlignment.Center, |
| | |
| | | { |
| | | Y = Application.GetRealHeight(222), |
| | | Height = Application.GetRealHeight(34), |
| | | Text = "最近24小时的平均室内湿度", |
| | | TextID = StringId.Humidity, |
| | | TextSize = 10, |
| | | TextColor = 0xFF798394, |
| | | TextAlignment = TextAlignment.Center, |
| | |
| | | |
| | | #if DEBUG |
| | | |
| | | List<string> vs = new List<string>() { |
| | | "1","2","3","4","5","6","7","8","9","10","11","12","13","14" |
| | | }; |
| | | tempEchartOption.InitXdataText(vs); |
| | | tempEchartOption.InitYdataText("yData", new List<EnvironmentalSensorHistor>() { |
| | | new EnvironmentalSensorHistor{ fieldName = "1", fieldValue= "23" }, |
| | | new EnvironmentalSensorHistor{ fieldName = "2", fieldValue= "22" }, |
| | | new EnvironmentalSensorHistor{ fieldName = "3", fieldValue= "-11" }, |
| | | new EnvironmentalSensorHistor{ fieldName = "4", fieldValue= "21" }, |
| | | new EnvironmentalSensorHistor{ fieldName = "5", fieldValue= "-41" }, |
| | | new EnvironmentalSensorHistor{ fieldName = "6", fieldValue= "23" }, |
| | | new EnvironmentalSensorHistor{ fieldName = "7", fieldValue= "-31" }, |
| | | new EnvironmentalSensorHistor{ fieldName = "8", fieldValue= "-23" }, |
| | | new EnvironmentalSensorHistor{ fieldName = "9", fieldValue= "-11" }, |
| | | new EnvironmentalSensorHistor{ fieldName = "10", fieldValue= "-21" }, |
| | | new EnvironmentalSensorHistor{ fieldName = "11", fieldValue= "24" }, |
| | | new EnvironmentalSensorHistor{ fieldName = "12", fieldValue= "41" }, |
| | | new EnvironmentalSensorHistor{ fieldName = "13", fieldValue= "32" }, |
| | | new EnvironmentalSensorHistor{ fieldName = "14", fieldValue= "23" } |
| | | }, "#FF9D54"); |
| | | tempEchartOption.yTitle = "温度 (°)"; |
| | | tempEchartOption.xTitle = ""; |
| | | var opString = tempEchartOption.InitOption(); |
| | | tempEchartsView.ShowWithOption(opString); |
| | | //List<string> vs = new List<string>() { |
| | | // "1","2","3","4","5","6","7","8","9","10","11","12","13","14" |
| | | // }; |
| | | //tempEchartOption.InitXdataText(vs); |
| | | //tempEchartOption.InitYdataText("yData", new List<EnvironmentalSensorHistor>() { |
| | | // new EnvironmentalSensorHistor{ fieldName = "1", fieldValue= "23" }, |
| | | // new EnvironmentalSensorHistor{ fieldName = "2", fieldValue= "22" }, |
| | | // new EnvironmentalSensorHistor{ fieldName = "3", fieldValue= "-11" }, |
| | | // new EnvironmentalSensorHistor{ fieldName = "4", fieldValue= "21" }, |
| | | // new EnvironmentalSensorHistor{ fieldName = "5", fieldValue= "-41" }, |
| | | // new EnvironmentalSensorHistor{ fieldName = "6", fieldValue= "23" }, |
| | | // new EnvironmentalSensorHistor{ fieldName = "7", fieldValue= "-31" }, |
| | | // new EnvironmentalSensorHistor{ fieldName = "8", fieldValue= "-23" }, |
| | | // new EnvironmentalSensorHistor{ fieldName = "9", fieldValue= "-11" }, |
| | | // new EnvironmentalSensorHistor{ fieldName = "10", fieldValue= "-21" }, |
| | | // new EnvironmentalSensorHistor{ fieldName = "11", fieldValue= "24" }, |
| | | // new EnvironmentalSensorHistor{ fieldName = "12", fieldValue= "41" }, |
| | | // new EnvironmentalSensorHistor{ fieldName = "13", fieldValue= "32" }, |
| | | // new EnvironmentalSensorHistor{ fieldName = "14", fieldValue= "23" } |
| | | //}, "#FF9D54"); |
| | | //tempEchartOption.yTitle = "温度 (°)"; |
| | | //tempEchartOption.xTitle = ""; |
| | | //var opString = tempEchartOption.InitOption(); |
| | | //tempEchartsView.ShowWithOption(opString); |
| | | |
| | | |
| | | |
| | | |
| | | List<string> vs2 = new List<string>() { |
| | | "1","2","3","4","5","6","7","8","9","10","11","12","13","14" |
| | | }; |
| | | humiEchartsOption.InitXdataText(vs2); |
| | | humiEchartsOption.InitYdataText("yData", new List<EnvironmentalSensorHistor>() { |
| | | new EnvironmentalSensorHistor{ fieldName = "1", fieldValue= "23" }, |
| | | new EnvironmentalSensorHistor{ fieldName = "2", fieldValue= "22" }, |
| | | new EnvironmentalSensorHistor{ fieldName = "3", fieldValue= "-11" }, |
| | | new EnvironmentalSensorHistor{ fieldName = "4", fieldValue= "21" }, |
| | | new EnvironmentalSensorHistor{ fieldName = "5", fieldValue= "-41" }, |
| | | new EnvironmentalSensorHistor{ fieldName = "6", fieldValue= "23" }, |
| | | new EnvironmentalSensorHistor{ fieldName = "7", fieldValue= "-31" }, |
| | | new EnvironmentalSensorHistor{ fieldName = "8", fieldValue= "-23" }, |
| | | new EnvironmentalSensorHistor{ fieldName = "9", fieldValue= "-11" }, |
| | | new EnvironmentalSensorHistor{ fieldName = "10", fieldValue= "-21" }, |
| | | new EnvironmentalSensorHistor{ fieldName = "11", fieldValue= "24" }, |
| | | new EnvironmentalSensorHistor{ fieldName = "12", fieldValue= "41" }, |
| | | new EnvironmentalSensorHistor{ fieldName = "13", fieldValue= "32" }, |
| | | new EnvironmentalSensorHistor{ fieldName = "14", fieldValue= "23" } |
| | | }, "#FF9D54"); |
| | | humiEchartsOption.yTitle = "湿度 (%)"; |
| | | humiEchartsOption.xTitle = ""; |
| | | var opString2 = humiEchartsOption.InitOption(); |
| | | //List<string> vs2 = new List<string>() { |
| | | // "1","2","3","4","5","6","7","8","9","10","11","12","13","14" |
| | | // }; |
| | | //humiEchartsOption.InitXdataText(vs2); |
| | | //humiEchartsOption.InitYdataText("yData", new List<EnvironmentalSensorHistor>() { |
| | | // new EnvironmentalSensorHistor{ fieldName = "1", fieldValue= "23" }, |
| | | // new EnvironmentalSensorHistor{ fieldName = "2", fieldValue= "22" }, |
| | | // new EnvironmentalSensorHistor{ fieldName = "3", fieldValue= "-11" }, |
| | | // new EnvironmentalSensorHistor{ fieldName = "4", fieldValue= "21" }, |
| | | // new EnvironmentalSensorHistor{ fieldName = "5", fieldValue= "-41" }, |
| | | // new EnvironmentalSensorHistor{ fieldName = "6", fieldValue= "23" }, |
| | | // new EnvironmentalSensorHistor{ fieldName = "7", fieldValue= "-31" }, |
| | | // new EnvironmentalSensorHistor{ fieldName = "8", fieldValue= "-23" }, |
| | | // new EnvironmentalSensorHistor{ fieldName = "9", fieldValue= "-11" }, |
| | | // new EnvironmentalSensorHistor{ fieldName = "10", fieldValue= "-21" }, |
| | | // new EnvironmentalSensorHistor{ fieldName = "11", fieldValue= "24" }, |
| | | // new EnvironmentalSensorHistor{ fieldName = "12", fieldValue= "41" }, |
| | | // new EnvironmentalSensorHistor{ fieldName = "13", fieldValue= "32" }, |
| | | // new EnvironmentalSensorHistor{ fieldName = "14", fieldValue= "23" } |
| | | //}, "#FF9D54"); |
| | | //humiEchartsOption.yTitle = "湿度 (%)"; |
| | | //humiEchartsOption.xTitle = ""; |
| | | //var opString2 = humiEchartsOption.InitOption(); |
| | | |
| | | humiEchartsView.ShowWithOption(opString2); |
| | | //humiEchartsView.ShowWithOption(opString2); |
| | | |
| | | #endif |
| | | |
| | | LoadEvent_ChangeSensorHistoryShowType(); |
| | | LoadMothed_GetHistoryData(); |
| | | } |
| | | |
| | | |
| | |
| | | btnShowHistroyData_Month.IsSelected = false; |
| | | btnShowHistroyData_Week.IsSelected = false; |
| | | curQueryType = "hour"; |
| | | tempEchartOption.YvalueText = ""; |
| | | humiEchartsOption.YvalueText = ""; |
| | | LoadMothed_GetHistoryData(); |
| | | }; |
| | | |
| | |
| | | btnShowHistroyData_Month.IsSelected = true; |
| | | btnShowHistroyData_Week.IsSelected = false; |
| | | curQueryType = "month"; |
| | | tempEchartOption.YvalueText = ""; |
| | | humiEchartsOption.YvalueText = ""; |
| | | LoadMothed_GetHistoryData(); |
| | | }; |
| | | btnShowHistroyData_Week.MouseUpEventHandler = (sender, e) => |
| | |
| | | btnShowHistroyData_Month.IsSelected = false; |
| | | btnShowHistroyData_Week.IsSelected = true; |
| | | curQueryType = "week"; |
| | | tempEchartOption.YvalueText = ""; |
| | | humiEchartsOption.YvalueText = ""; |
| | | LoadMothed_GetHistoryData(); |
| | | }; |
| | | |
| | |
| | | loadPage.Start(Language.StringByID(StringId.PleaseWait)); |
| | | }); |
| | | |
| | | var revertObj = new HttpServerRequest().GetSensorHistory( function.deviceId, curQueryType , "room_temp"); |
| | | var revertObj = new HttpServerRequest().GetSensorHistory(curQueryType, function.deviceId , "room_temp"); |
| | | if (revertObj != null) |
| | | { |
| | | if (revertObj.Code == StateCode.SUCCESS) |
| | |
| | | } |
| | | tempEchartOption.InitXdataText(vs); |
| | | } |
| | | tempEchartOption.InitYdataText("", revertData, "#FF80AEFF"); |
| | | tempEchartOption.InitYdataTextLinearGradient("(°C)", revertData, colorString); |
| | | |
| | | tempEchartOption.xTitle = Language.StringByID(StringId.timeMode); |
| | | var opString = tempEchartOption.InitOption(); |
| | | |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | tempEchartsView.ShowWithOption(opString); |
| | | }); |
| | | } |
| | | } |
| | | tempEchartOption.xTitle = Language.StringByID(StringId.timeMode); |
| | | var opString = tempEchartOption.InitOption(); |
| | | |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | tempEchartsView.ShowWithOption(opString); |
| | | }); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | } |
| | | finally |
| | | { |
| | | inReadTempHistory = false; |
| | | if (!inReadHumiHistory) |
| | | { |
| | | Application.RunOnMainThread(() => |
| | |
| | | loadPage.Start(Language.StringByID(StringId.PleaseWait)); |
| | | }); |
| | | |
| | | var revertObj = new HttpServerRequest().GetSensorHistory(function.deviceId, curQueryType, "room_humidity"); |
| | | var revertObj = new HttpServerRequest().GetSensorHistory(curQueryType,function.deviceId, "room_humidity"); |
| | | if (revertObj != null) |
| | | { |
| | | if (revertObj.Code == StateCode.SUCCESS) |
| | |
| | | } |
| | | humiEchartsOption.InitXdataText(vs); |
| | | } |
| | | humiEchartsOption.InitYdataText("", revertData, "#FF80AEFF"); |
| | | humiEchartsOption.InitYdataTextLinearGradient("(%)", revertData, colorString); |
| | | } |
| | | } |
| | | humiEchartsOption.xTitle = Language.StringByID(StringId.timeMode); |
| | |
| | | } |
| | | finally |
| | | { |
| | | inReadHumiHistory = false; |
| | | if (!inReadTempHistory) |
| | | { |
| | | Application.RunOnMainThread(() => |