wei
2021-10-28 270b3d8539f6b4a991a9ebf3b3a9eceb436d61d5
HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPage.cs
@@ -2,6 +2,7 @@
using Shared;
using HDL_ON.Entity;
using HDL_ON.UI.CSS;
using System.Collections.Generic;
namespace HDL_ON.UI
{
@@ -23,7 +24,7 @@
        /// </summary>
        Button btnCollection;
        /// <summary>
        /// 空调温度控制控件
        /// 温度控制控件
        /// </summary>
        DiyArcSeekBar arcBar;
        /// <summary>
@@ -62,7 +63,8 @@
        #endregion
        #region 区域变量
        FloorHeating fh;
        FloorHeating fhTemp = new FloorHeating();
        Function function;
        Button btnCollection_Out;
        Button btnFunctionName_Out;
        Button btnFromFloor_Out;
@@ -71,10 +73,18 @@
        /// </summary>
        Action actionRefresh;
        #endregion
        public FloorHeatingPage(FloorHeating func)
        /// <summary>
        /// app自己控制的温度数值记录
        /// </summary>
        List<string> seltControlTemp = new List<string>();
        public FloorHeatingPage(Function func)
        {
            bodyView = this;
            fh = func;
            function = func;
        }
        public void LoadPage(Button btnCollectionIcon, Button btnFunctionNameOut, Button btnFromFloorOut)
@@ -103,7 +113,7 @@
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextAlignment = TextAlignment.CenterLeft,
                TextSize = CSS_FontSize.EmphasisFontSize_FirstLevel,
                Text = fh.name,
                Text = function.name,
            };
            controlView.AddChidren(btnFunctionName);
@@ -116,7 +126,7 @@
                TextColor = CSS_Color.PromptingColor1,
                TextAlignment = TextAlignment.CenterLeft,
                TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                Text = fh.GetRoomListName()
                Text = function.GetRoomListName()
            };
            controlView.AddChidren(btnFromFoorAndRoom);
@@ -128,22 +138,33 @@
                Height = Application.GetMinRealAverage(40),
                SelectedImagePath = "Collection/CollectionIcon.png",
                UnSelectedImagePath = "Collection/CollectionGrayIcon.png",
                IsSelected = fh.collection
                IsSelected = function.collect
            };
            controlView.AddChidren(btnCollection);
            //2020-12-16 如果是成员隐藏收藏功能
            //if (!DB_ResidenceData.Instance.CurrentRegion.isOtherShare)
            //{
            //    controlView.AddChidren(btnCollection);
            //}
            var minValue = function.GetAttribute(FunctionAttributeKey.SetTemp).min;
            var maxValue = function.GetAttribute(FunctionAttributeKey.SetTemp).max;
            var progress = (int)Convert.ToDouble(function.GetAttrState(FunctionAttributeKey.SetTemp));
            arcBar = new DiyArcSeekBar()
            {
                Gravity = Gravity.CenterHorizontal,
                OpenAngle = 160,
                ThumbImagePath = fh.trait_on_off.value.ToString() == "on" ? "FunctionIcon/AC/DiyThumbIcon2On.png" : "FunctionIcon/AC/DiyThumbIcon.png",
                ThumbImagePath = function.trait_on_off.curValue.ToString() == "on" ? "FunctionIcon/FloorHeating/DiyThumbIconOn.png" : "FunctionIcon/AC/DiyThumbIcon.png",
                ThumbImageHeight = Application.GetRealWidth(50),
                ProgressBarColor = fh.trait_on_off.value.ToString() == "on" ? 0xFFFC9C04 : CSS_Color.PromptingColor2,
                MinValue = 5,
                MaxValue = 35,
                IsClickable = fh.trait_on_off.value.ToString() == "on",
                ProgressBarColor = CSS_Color.AuxiliaryColor1, // 0xFFFC9C04,
                OfflineProgressBarColor = CSS_Color.PromptingColor2,
                IsOffline = function.trait_on_off.curValue.ToString() == "off",
                MinValue = minValue,//function.GetAttribute(FunctionAttributeKey.SetTemp).min,
                MaxValue = maxValue,// function.GetAttribute(FunctionAttributeKey.SetTemp).max,
                ArcColor = CSS_Color.BackgroundColor,
                Progress = Convert.ToInt32(fh.curTemp),
                Progress = progress,
#if __IOS__
                Y = Application.GetRealHeight(120+25),
                Width = Application.GetRealWidth(260-40),
@@ -168,7 +189,7 @@
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextSize = 56,
                IsBold = true,
                Text = fh.curTemp.ToString(),
                Text = progress.ToString(),
                TextAlignment = TextAlignment.Center,
            };
            controlView.AddChidren(btnTemp);
@@ -183,7 +204,7 @@
                TextSize = CSS_FontSize.EmphasisFontSize_Secondary,
                IsBold = true,
                TextAlignment = TextAlignment.CenterLeft,
                Text = fh.tempUnitString
                Text = fhTemp.GetTempUnitString(function)
            };
            controlView.AddChidren(btnTempUint);
@@ -214,7 +235,7 @@
                X = Application.GetRealWidth(275),
                Y = Application.GetRealHeight(263),
                Width = Application.GetRealWidth(32),
                Height = Application.GetRealWidth(32),
               Height = Application.GetRealWidth(32),
                UnSelectedImagePath = "Public/PlusSignIcon.png",
            };
            controlView.AddChidren(btnPlus);
@@ -225,24 +246,32 @@
                Y = Application.GetRealHeight(337),
                Width = Application.GetRealWidth(30),
                Height = Application.GetRealWidth(30),
                UnSelectedImagePath = fh.curModeImage,
                UnSelectedImagePath = fhTemp.GetModeIconPath(function.GetAttrState(FunctionAttributeKey.Mode))
            };
            controlView.AddChidren(btnMode);
            if (function.GetAttribute(FunctionAttributeKey.Mode)!=null)
            {
                controlView.AddChidren(btnMode);
            }
            btnSwitch = new Button()
            {
                Gravity = Gravity.CenterHorizontal,
                Y = Application.GetRealHeight(462),
                Width = Application.GetRealWidth(40),
                Height = Application.GetRealWidth(40),
                Y = Application.GetRealHeight(466),
                Width = Application.GetRealWidth(32),
                Height = Application.GetRealWidth(32),
                UnSelectedImagePath = "Public/PowerClose.png",
                SelectedImagePath = "Public/PowerOpen.png",
                IsSelected = fh.trait_on_off.value.ToString() == "on"
                IsSelected = function.trait_on_off.curValue.ToString() == "on"
            };
            controlView.AddChidren(btnSwitch);
            LoadEventList();
            new TopViewDiv(bodyView, Language.StringByID(StringId.LocationManagement)).LoadTopView(fh, actionRefresh);
            new TopViewDiv(bodyView, Language.StringByID(StringId.FloorHeating)).LoadTopView_FunctionTop(function, actionRefresh);
            new System.Threading.Thread(() =>
            {
                DriverLayer.Control.Ins.SendReadCommand(function);
            })
            { IsBackground = true }.Start();
        }
        /// <summary>
        /// 加载修改模式区域
@@ -265,8 +294,6 @@
                Width = Application.GetRealWidth(160),
                Height = Application.GetRealHeight(287),
                BackgroundImagePath = "FunctionIcon/AC/DivBg1.png",
                AnimateSpeed = 0.3f,
                Animate = Animate.DownToUp,
            };
            dialogView.AddChidren(modeChangeView);
@@ -294,28 +321,29 @@
            };
            modeChangeView.AddChidren(btnLine);
            foreach (var m in fh.trait_mode.value_key)
            var modeList = function.GetAttribute(FunctionAttributeKey.Mode).value;
            foreach (var m in modeList)
            {
                Button btnModeIcon = new Button()
                {
                    X = btnTitle.X,
                    Y = Application.GetRealHeight(44 * (fh.trait_mode.value_key.IndexOf(m) + 1) + 10 + 8),
                    Y = Application.GetRealHeight(44 * (modeList.IndexOf(m) + 1) + 10 + 8),
                    Width = Application.GetRealWidth(24),
                    Height = Application.GetRealWidth(24),
                    IsSelected = fh.trait_mode.value.ToString() == m,
                    IsSelected = function.GetAttrState(FunctionAttributeKey.Mode) == m,
                };
                modeChangeView.AddChidren(btnModeIcon);
                Button btnModeText = new Button()
                {
                    X = Application.GetRealWidth(12) + btnModeIcon.Right,
                    Y = Application.GetRealHeight(44 * (fh.trait_mode.value_key.IndexOf(m) + 1) + 8),
                    Y = Application.GetRealHeight(44 * (modeList.IndexOf(m) + 1) + 8),
                    Height = Application.GetRealHeight(44),
                    Width = Application.GetRealWidth(70),
                    TextAlignment = TextAlignment.CenterLeft,
                    TextColor = CSS_Color.FirstLevelTitleColor,
                    SelectedTextColor = CSS_Color.MainColor,
                    IsSelected = fh.trait_mode.value.ToString() == m,
                    IsSelected = function.GetAttrState(FunctionAttributeKey.Mode) == m,
                };
                modeChangeView.AddChidren(btnModeText);
@@ -348,7 +376,7 @@
                        break;
                }
                if (fh.trait_mode.value_key.IndexOf(m) < fh.trait_mode.value_key.Count - 1)
                if (modeList.IndexOf(m) < modeList.Count - 1)
                {
                    modeChangeView.AddChidren(new Button()
                    {