From b71dfb3ca100340005d56e1298292807da82322d Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期一, 08 六月 2020 15:04:21 +0800
Subject: [PATCH] 20200608

---
 HDL_ON/UI/UI2/1-HomePage/HomePage.cs |   35 ++++++++++++++++++++++++++++++++++-
 1 files changed, 34 insertions(+), 1 deletions(-)

diff --git a/HDL_ON/UI/UI2/1-HomePage/HomePage.cs b/HDL_ON/UI/UI2/1-HomePage/HomePage.cs
index e0f7283..688c27e 100644
--- a/HDL_ON/UI/UI2/1-HomePage/HomePage.cs
+++ b/HDL_ON/UI/UI2/1-HomePage/HomePage.cs
@@ -1,7 +1,11 @@
 锘縰sing System;
 using System.Collections.Generic;
+using System.Text;
+using HDL_ON.DAL;
 using HDL_ON.Entity;
 using HDL_ON.UI.CSS;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
 using Shared;
 
 namespace HDL_ON.UI
@@ -110,6 +114,17 @@
                     IsBold = true
                 };
                 topView.AddChidren(btnResidenceName);
+
+#if DEBUG
+                btnResidenceName.MouseUpEventHandler = (sender, e) =>
+                {
+                    System.Threading.Tasks.Task.Run(
+                        async () => { await DAL.Net.MqttCommon.StartMqtt();
+                    });
+                };
+
+#endif
+
 
                 environmentalView = new FrameLayout()
                 {
@@ -541,6 +556,20 @@
                     view.AddChidren(btnCurtainOpen);
 
                     LoadEvent_ControlCurtain(function as Curtain, btnCurtainClose, btnCurtainOpen);
+                }else if(function.functionType== FunctionType.TV)
+                {
+                    btnIcon.UnSelectedImagePath = "FunctionIcon/Electrical/TVIcon.png";
+                    Button btnPower;
+                    btnPower = new Button()
+                    {
+                        X = Application.GetRealWidth(131),
+                        Y = Application.GetRealHeight(86),
+                        Width = Application.GetRealWidth(32),
+                        Height = Application.GetRealWidth(32),
+                        UnSelectedImagePath = "Public/PowerClose.png",
+                    };
+                    view.AddChidren(btnPower);
+                    LoadEvent_ControlTV(function as TV, btnPower);
                 }
                 else
                 {
@@ -608,7 +637,11 @@
                 btnName.MouseUpEventHandler = skipControlPageEvent;
                 btnIcon.MouseUpEventHandler = skipControlPageEvent;
                 btnState.MouseUpEventHandler = skipControlPageEvent;
-                UpdataFunctionStates(function);
+                //鐢佃涓嶉渶瑕佹洿鏂扮姸鎬�
+                if(function.functionType!= FunctionType.TV)
+                {
+                    UpdataFunctionStates(function);
+                }
             }
             catch (Exception ex)
             {

--
Gitblit v1.8.0