From 902f19750cbf3e0e3dba7139947421ecb461f93f Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期二, 16 三月 2021 17:50:41 +0800
Subject: [PATCH] 2021-3-16-5

---
 HDL_ON/UI/UI2/FuntionControlView/AC/AcControlPage.cs |  142 +++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 142 insertions(+), 0 deletions(-)

diff --git a/HDL_ON/UI/UI2/FuntionControlView/AC/AcControlPage.cs b/HDL_ON/UI/UI2/FuntionControlView/AC/AcControlPage.cs
index 629a706..4874520 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/AC/AcControlPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/AC/AcControlPage.cs
@@ -206,6 +206,8 @@
 
             LoadEvent_TempChange();
             LoadEvent_AcStatesChange();
+
+            LoadDiv_IrView();
         }
 
         /// <summary>
@@ -445,6 +447,146 @@
             dialog.Show();
         }
 
+        /// <summary>
+        /// 鍔犺浇绾㈠閬ユ帶鍣紝棰濆鎸夐挳
+        /// </summary>
+        void LoadDiv_IrView()
+        {
+            if (device.spk == SPK.AcIr)
+            {
+                var btnMore = new Button()
+                {
+                    Gravity = Gravity.CenterHorizontal,
+                    Y = Application.GetRealHeight(334),
+                    Width = Application.GetRealWidth(30),
+                    Height = Application.GetRealWidth(30),
+                    UnSelectedImagePath = "FunctionIcon/AC/More.png",
+                };
+                FrameWhiteCentet1.AddChidren(btnMore);
+
+                btnMore.MouseUpEventHandler = (sender, e) => {
+                    LoadDialog_IrMoreView();
+                };
+            }
+        }
+        /// <summary>
+        /// 鍔犺浇棰濆瀵圭孩澶栨寜閽晫闈�
+        /// </summary>
+        void LoadDialog_IrMoreView()
+        {
+            Dialog dialog = new Dialog();
+
+            var div = new FrameLayout();
+            dialog.AddChidren(div);
+            div.MouseUpEventHandler = (sender, e) => {
+                dialog.Close();
+            };
+
+            var bodyView = new FrameLayout()
+            {
+                Y = Application.GetRealHeight(463),
+                Height = Application.GetRealHeight(375),
+                BackgroundColor = CSS_Color.MainBackgroundColor,
+            };
+            div.AddChidren(bodyView);
+
+            var contentView = new FrameLayout()
+            {
+                Y = Application.GetRealHeight(16),
+                Gravity = Gravity.CenterHorizontal,
+                Width = Application.GetRealWidth(296),
+            };
+            bodyView.AddChidren(contentView);
+
+                var row = new FrameLayout()
+                {
+                    Height = Application.GetRealHeight(60),
+                };
+                contentView.AddChidren(row);
+
+                int index = 0;
+            foreach (var attr in device.attributes)
+            {
+                if (attr.key == FunctionAttributeKey.Mode
+                    || attr.key == FunctionAttributeKey.OnOff
+                    || attr.key == FunctionAttributeKey.SetTemp
+                    || attr.key == FunctionAttributeKey.SetTempStep
+                    || attr.key == FunctionAttributeKey.FanSpeed
+                    || attr.key == FunctionAttributeKey.FanManual
+                    || attr.key == FunctionAttributeKey.FanAuto
+                    )
+                {
+                    continue;
+                }
+                if (index != 0 && index % 3 == 0)
+                {
+                    row = new FrameLayout()
+                    {
+                        Width = Application.GetRealWidth(200),
+                        Height = Application.GetRealHeight(56),
+                    };
+                    contentView.AddChidren(row);
+                }
+
+                var btn = new Button()
+                {
+                    Gravity = Gravity.CenterVertical,
+                    Width = Application.GetRealWidth(88),
+                    Height = Application.GetRealHeight(40),
+                    Radius = (uint)Application.GetRealHeight(18),
+                    BorderColor = CSS_Color.PromptingColor1,
+                    BorderWidth = (uint)Application.GetRealWidth(2),
+                    TextAlignment = TextAlignment.Center,
+                    TextSize = CSS_FontSize.TextFontSize,
+                    TextColor = CSS_Color.FirstLevelTitleColor,
+                    SelectedTextColor = CSS_Color.MainBackgroundColor,
+                    SelectedBackgroundColor = CSS_Color.MainColor,
+                };
+                if (attr.value.Count > 0)
+                {
+                    btn.Text = attr.value[0];
+                }
+                if (index % 3 == 1)
+                {
+                    btn.Gravity = Gravity.Center;
+                }
+                else if (index % 3 == 2)
+                {
+                    btn.X = Application.GetRealWidth(208);
+                }
+                row.AddChidren(btn);
+
+                btn.MouseUpEventHandler = (sender, e) =>
+                {
+                    System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
+                    d.Add(FunctionAttributeKey.Key, attr.key);
+                    Control.Ins.SendWriteCommand(device, d);
+
+                    new System.Threading.Thread(() =>
+                    {
+                        System.Threading.Thread.Sleep(2000);
+                        Application.RunOnMainThread(() =>
+                        {
+                            btn.IsSelected = false;
+                        });
+                    })
+                    { IsBackground = true }.Start();
+                };
+
+
+
+                index++;
+            }
+
+
+
+
+
+
+            dialog.Show();
+        }
+
+
         #endregion
 
         #region 鈻� 璁惧鐘舵�佸弽棣坃______________________

--
Gitblit v1.8.0