From c7c61c603b16c0bf2582d81561bdfbe48ab9440c Mon Sep 17 00:00:00 2001
From: wei <kaede@kaededeMacBook-Air.local>
Date: 星期五, 19 三月 2021 09:42:37 +0800
Subject: [PATCH] 1.电视控制修改

---
 HDL_ON/UI/UI2/FuntionControlView/Electrical/TVPage.cs |   57 +++++++++++++++++++++++++++++++++++----------------------
 1 files changed, 35 insertions(+), 22 deletions(-)

diff --git a/HDL_ON/UI/UI2/FuntionControlView/Electrical/TVPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Electrical/TVPage.cs
index 737c59b..824fc89 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Electrical/TVPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Electrical/TVPage.cs
@@ -2,6 +2,9 @@
 using Shared;
 using HDL_ON.UI.CSS;
 using HDL_ON.Entity;
+using System.Collections.Generic;
+using HDL_ON.DriverLayer;
+
 namespace HDL_ON.UI
 {
     public partial class TVPage : FrameLayout
@@ -43,7 +46,8 @@
         #endregion
 
         #region 鍖哄煙鍙橀噺
-        TV tv;
+        TV tvTemp = new TV();
+        Function function;
         Button btnCollection_Out;
         Button btnFunctionName_Out;
         Button btnFromFloor_Out;
@@ -56,7 +60,7 @@
         public TVPage(Function func)
         {
             bodyView = this;
-            tv = func as TV;
+            function = func;
         }
 
 
@@ -86,7 +90,7 @@
                 TextColor = CSS_Color.FirstLevelTitleColor,
                 TextAlignment = TextAlignment.CenterLeft,
                 TextSize = CSS_FontSize.EmphasisFontSize_FirstLevel,
-                Text = tv.name,
+                Text = function.name,
             };
             controlView.AddChidren(btnFunctionName);
 
@@ -99,7 +103,7 @@
                 TextColor = CSS_Color.PromptingColor1,
                 TextAlignment = TextAlignment.CenterLeft,
                 TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
-                Text = tv.GetRoomListName()
+                Text = function.GetRoomListName()
             };
             controlView.AddChidren(btnFromFoorAndRoom);
 
@@ -111,7 +115,7 @@
                 Height = Application.GetMinRealAverage(40),
                 SelectedImagePath = "Collection/CollectionIcon.png",
                 UnSelectedImagePath = "Collection/CollectionGrayIcon.png",
-                IsSelected = tv.collect
+                IsSelected = function.collect
             };
             //controlView.AddChidren(btnCollection);
             //2020-12-16 濡傛灉鏄垚鍛橀殣钘忔敹钘忓姛鑳�
@@ -124,7 +128,7 @@
             {
                 Y = Application.GetRealHeight(8),
                 Gravity = Gravity.CenterHorizontal,
-                Width = Application.GetRealWidth(78),
+                Width = Application.GetRealWidth(90),
                 Height = Application.GetRealHeight(49),
                 Text = "TV/AV",
                 TextAlignment = TextAlignment.Center,
@@ -197,12 +201,12 @@
                 X = Application.GetRealWidth(26),
                 Y = Application.GetRealHeight(246),
                 Width = Application.GetRealWidth(44),
-                Height = Application.GetRealHeight(102),
+                Height = Application.GetRealWidth(102),
                 BackgroundImagePath = "FunctionIcon/Electrical/TV/MenuBgIcon.png",
             };
             controlView.AddChidren(channleView);
 
-            btnChlReduce = new Button()
+            btnChlPlus = new Button()
             {
                 Gravity = Gravity.CenterHorizontal,
                 Y = Application.GetRealHeight(10),
@@ -210,7 +214,7 @@
                 Height = Application.GetRealWidth(24),
                 UnSelectedImagePath = "FunctionIcon/Electrical/TV/PlusIcon.png"
             };
-            channleView.AddChidren(btnChlReduce);
+            channleView.AddChidren(btnChlPlus);
 
             Button btnChlText;
             btnChlText = new Button()
@@ -224,27 +228,27 @@
             };
             channleView.AddChidren(btnChlText);
 
-            btnChlPlus = new Button()
+            btnChlReduce = new Button()
             {
                 Gravity = Gravity.CenterHorizontal,
-                Y = Application.GetRealHeight(66),
+                Y = Application.GetRealWidth(66),
                 Width = Application.GetRealWidth(24),
                 Height = Application.GetRealWidth(24),
                 UnSelectedImagePath = "FunctionIcon/Electrical/TV/ReduceIcon.png"
             };
-            channleView.AddChidren(btnChlPlus);
+            channleView.AddChidren(btnChlReduce);
 
             volView = new FrameLayout()
             {
                 X = Application.GetRealWidth(257),
                 Y = Application.GetRealHeight(246),
                 Width = Application.GetRealWidth(44),
-                Height = Application.GetRealHeight(102),
+                Height = Application.GetRealWidth(102),
                 BackgroundImagePath = "FunctionIcon/Electrical/TV/MenuBgIcon.png",
             };
             controlView.AddChidren(volView);
 
-            btnVolReduce = new Button()
+            btnVolPlus = new Button()
             {
                 Gravity = Gravity.CenterHorizontal,
                 Y = Application.GetRealHeight(10),
@@ -252,7 +256,7 @@
                 Height = Application.GetRealWidth(24),
                 UnSelectedImagePath = "FunctionIcon/Electrical/TV/PlusIcon.png"
             };
-            volView.AddChidren(btnVolReduce);
+            volView.AddChidren(btnVolPlus);
 
             Button btnVolText;
             btnVolText = new Button()
@@ -266,15 +270,15 @@
             };
             volView.AddChidren(btnVolText);
 
-            btnVolPlus = new Button()
+            btnVolReduce = new Button()
             {
                 Gravity = Gravity.CenterHorizontal,
-                Y = Application.GetRealHeight(66),
+                Y = Application.GetRealWidth(66),
                 Width = Application.GetRealWidth(24),
                 Height = Application.GetRealWidth(24),
                 UnSelectedImagePath = "FunctionIcon/Electrical/TV/ReduceIcon.png"
             };
-            volView.AddChidren(btnVolPlus);
+            volView.AddChidren(btnVolReduce);
 
 
 
@@ -335,8 +339,8 @@
 
             LoadEventList();
 
-            new TopViewDiv(bodyView, Language.StringByID(StringId.TV)).LoadTopView_FunctionTop(tv, actionRefresh);
-            DriverLayer.Control.Ins.SendReadCommand(tv);
+            new TopViewDiv(bodyView, Language.StringByID(StringId.TV)).LoadTopView_FunctionTop(function, actionRefresh);
+            DriverLayer.Control.Ins.SendReadCommand(function);
 
         }
 
@@ -367,7 +371,6 @@
 
             for (int i = 0; i < 10; i++)
             {
-
                 Button btn = new Button()
                 {
                     Width = Application.GetRealWidth(98),
@@ -419,8 +422,18 @@
                 }
                 numberView.AddChidren(btn);
                 btn.MouseUpEventHandler = (sender, e) => {
+                    string index = (sender as  Button ).Text;
                     btn.IsSelected = false;
-                    tv.ControlTV(i);
+                    if (DB_ResidenceData.Instance.GatewayType == 1)
+                    {
+                        Dictionary<string, string> d = new Dictionary<string, string>();
+                        d.Add($"number_{index}", "");
+                        Control.Ins.SendWriteCommand(function, d);
+                    }
+                    else
+                    {
+                        tvTemp.ControlTV(i, function);
+                    }
                 };
                 btn.MouseDownEventHandler = (sender, e) => {
                     btn.IsSelected = true;

--
Gitblit v1.8.0