wjc
2023-03-28 a9d1161b1df96e7ddad566335989a1444e433ef5
HDL_ON/UI/UI2/FuntionControlView/Electrical/SocketPage_CumulativePowerConsumption.cs
@@ -136,7 +136,10 @@
                TextAlignment = TextAlignment.CenterLeft,
                TextID = StringId.RealTimePowerConsumption,
            };
            btnRealTimeData.Text = Language.StringByID(StringId.RealTimePowerConsumption).Replace("{0}", function.GetAttrState("active_power"));
            double realTimePower = 0;
            double.TryParse(function.GetAttrState("active_power"), out realTimePower);
            realTimePower /= 1000;
            btnRealTimeData.Text = Language.StringByID(StringId.RealTimePowerConsumption).Replace("{0}", realTimePower.ToString());
            generalTableView.AddChidren(btnRealTimeData);
@@ -174,11 +177,11 @@
            #region 选择数据日期范围
            var showDataTypeView = new FrameLayout()
            {
                X = Application.GetRealWidth(183),
                X = Application.GetRealWidth(136),
                Y = Application.GetRealHeight(12),
                Width = Application.GetRealWidth(144),
                Width = Application.GetRealWidth(144+47),
                Height = Application.GetRealHeight(24),
                BackgroundImagePath = "FunctionIcon/EnvironmentalScience/SensorHistoryBg1.png",
                BackgroundImagePath = "FunctionIcon/EnvironmentalScience/HistoryOpionBg1.png",
            };
            diagramView.AddChidren(showDataTypeView);
@@ -214,41 +217,68 @@
                TextColor = CSS_Color.PromptingColor2,
                SelectedTextColor = CSS_Color.MainColor,
                TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                Text = Language.StringByID(StringId.month),//DateTime.Now.Month.ToString() +
                Text = Language.StringByID(StringId.month)
            };
            showDataTypeView.AddChidren(btnShowHistroyData_Month);
            var btnShowHistroyData_Year = new Button()
            {
                X = Application.GetRealWidth(48 * 3),
                Width = Application.GetRealWidth(48),
                TextAlignment = TextAlignment.Center,
                TextColor = CSS_Color.PromptingColor2,
                SelectedTextColor = CSS_Color.MainColor,
                TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                Text = Language.StringByID(StringId.Years),
            };
            showDataTypeView.AddChidren(btnShowHistroyData_Year);
            btnShowHistroyData_Day.MouseUpEventHandler = (sender, e) =>
            {
                showDataTypeView.BackgroundImagePath = "FunctionIcon/EnvironmentalScience/SensorHistoryBg1.png";
                showDataTypeView.BackgroundImagePath = "FunctionIcon/EnvironmentalScience/HistoryOpionBg1.png";
                btnShowHistroyData_Day.IsSelected = true;
                btnShowHistroyData_Month.IsSelected = false;
                btnShowHistroyData_Week.IsSelected = false;
                btnShowHistroyData_Year.IsSelected = false;
                curQueryType = "hour";
                brokenLine.YvalueText = "";
                    LoadMothed_GetHistoryData();
                LoadMothed_GetHistoryData();
            };
            btnShowHistroyData_Week.MouseUpEventHandler = (sender, e) =>
            {
                showDataTypeView.BackgroundImagePath = "FunctionIcon/EnvironmentalScience/SensorHistoryBg2.png";
                showDataTypeView.BackgroundImagePath = "FunctionIcon/EnvironmentalScience/HistoryOpionBg2.png";
                btnShowHistroyData_Day.IsSelected = false;
                btnShowHistroyData_Month.IsSelected = false;
                btnShowHistroyData_Week.IsSelected = true;
                btnShowHistroyData_Year.IsSelected = false;
                curQueryType = "week";
                brokenLine.YvalueText = "";
                    LoadMothed_GetHistoryData();
                LoadMothed_GetHistoryData();
            };
            btnShowHistroyData_Month.MouseUpEventHandler = (sender, e) =>
            {
                showDataTypeView.BackgroundImagePath = "FunctionIcon/EnvironmentalScience/SensorHistoryBg3.png";
                showDataTypeView.BackgroundImagePath = "FunctionIcon/EnvironmentalScience/HistoryOpionBg3.png";
                btnShowHistroyData_Day.IsSelected = false;
                btnShowHistroyData_Month.IsSelected = true;
                btnShowHistroyData_Week.IsSelected = false;
                btnShowHistroyData_Year.IsSelected = false;
                curQueryType = "month";
                brokenLine.YvalueText = "";
                    LoadMothed_GetHistoryData();
                LoadMothed_GetHistoryData();
            };
            btnShowHistroyData_Year.MouseUpEventHandler = (sender, e) =>
            {
                showDataTypeView.BackgroundImagePath = "FunctionIcon/EnvironmentalScience/HistoryOpionBg4.png";
                btnShowHistroyData_Day.IsSelected = false;
                btnShowHistroyData_Month.IsSelected = false;
                btnShowHistroyData_Year.IsSelected = true;
                btnShowHistroyData_Week.IsSelected = false;
                curQueryType = "year_month";
                brokenLine.YvalueText = "";
                LoadMothed_GetHistoryData();
            };
            #endregion