wxr
2024-09-14 c00da77d00a479fa5d022346a6d9075f90a5c087
HDL_ON/UI/UI2/FuntionControlView/Acst/AcstSubHistoryPage.cs
@@ -35,10 +35,12 @@
        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;
        }
@@ -47,7 +49,10 @@
        /// </summary>
        public void LoadPage()
        {
            new TopViewDiv(bodyView, function.GetRoomListName()).LoadTopView();
            var topView = new TopViewDiv(bodyView, function.name);
            topView.maginY = 10;
            topView.LoadTopView();
            bodyView.BackgroundColor = CSS_Color.BackgroundColor;
            //var contentView = new FrameLayout()
@@ -134,7 +139,7 @@
            {
                Y = Application.GetRealHeight(222),
                Height = Application.GetRealHeight(34),
                Text = "最近24小时的平均室内温度",
                TextID = StringId.Temp,
                TextSize = 10,
                TextColor = 0xFF798394,
                TextAlignment = TextAlignment.Center,
@@ -169,7 +174,7 @@
            {
                Y = Application.GetRealHeight(222),
                Height = Application.GetRealHeight(34),
                Text = "最近24小时的平均室内湿度",
                TextID = StringId.Humidity,
                TextSize = 10,
                TextColor = 0xFF798394,
                TextAlignment = TextAlignment.Center,
@@ -234,7 +239,9 @@
            humiEchartsView.ShowWithOption(opString2);
#endif
            LoadEvent_ChangeSensorHistoryShowType();
            LoadMothed_GetHistoryData();
        }
@@ -247,6 +254,8 @@
                btnShowHistroyData_Month.IsSelected = false;
                btnShowHistroyData_Week.IsSelected = false;
                curQueryType = "hour";
                tempEchartOption.YvalueText = "";
                humiEchartsOption.YvalueText = "";
                LoadMothed_GetHistoryData();
            };
@@ -257,6 +266,8 @@
                btnShowHistroyData_Month.IsSelected = true;
                btnShowHistroyData_Week.IsSelected = false;
                curQueryType = "month";
                tempEchartOption.YvalueText = "";
                humiEchartsOption.YvalueText = "";
                LoadMothed_GetHistoryData();
            };
            btnShowHistroyData_Week.MouseUpEventHandler = (sender, e) =>
@@ -266,6 +277,8 @@
                btnShowHistroyData_Month.IsSelected = false;
                btnShowHistroyData_Week.IsSelected = true;
                curQueryType = "week";
                tempEchartOption.YvalueText = "";
                humiEchartsOption.YvalueText = "";
                LoadMothed_GetHistoryData();
            };
@@ -303,7 +316,7 @@
                        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)
@@ -319,16 +332,17 @@
                                }
                                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)
                {
@@ -336,6 +350,7 @@
                }
                finally
                {
                    inReadTempHistory = false;
                    if (!inReadHumiHistory)
                    {
                        Application.RunOnMainThread(() =>
@@ -357,7 +372,7 @@
                        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)
@@ -373,7 +388,7 @@
                                }
                                humiEchartsOption.InitXdataText(vs);
                            }
                            humiEchartsOption.InitYdataText("", revertData, "#FF80AEFF");
                            humiEchartsOption.InitYdataTextLinearGradient("(%)", revertData, colorString);
                        }
                    }
                    humiEchartsOption.xTitle = Language.StringByID(StringId.timeMode);
@@ -390,6 +405,7 @@
                }
                finally
                {
                    inReadHumiHistory = false;
                    if (!inReadTempHistory)
                    {
                        Application.RunOnMainThread(() =>