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/TVPageBLL.cs |  156 +++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 142 insertions(+), 14 deletions(-)

diff --git a/HDL_ON/UI/UI2/FuntionControlView/Electrical/TVPageBLL.cs b/HDL_ON/UI/UI2/FuntionControlView/Electrical/TVPageBLL.cs
index 2467e67..fd199d8 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Electrical/TVPageBLL.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Electrical/TVPageBLL.cs
@@ -1,6 +1,8 @@
 锘縰sing System;
 using Shared;
 using HDL_ON.Entity;
+using HDL_ON.DriverLayer;
+using System.Collections.Generic;
 
 namespace HDL_ON.UI
 {
@@ -40,32 +42,95 @@
         {
             btnChangeTVAV.MouseUpEventHandler = (sender, e) =>
             {
-                tvTemp.ControlTV(InfraredCode_TV.AV_TV,function);
+                if (DB_ResidenceData.Instance.GatewayType == 1)
+                {
+                    Dictionary<string, string> d = new Dictionary<string, string>();
+                    d.Add("av_tv", "");
+                    Control.Ins.SendWriteCommand(function, d);
+                }
+                else
+                {
+                    tvTemp.ControlTV(InfraredCode_TV.AV_TV, function);
+                }
             };
             btnChlPlus.MouseUpEventHandler = (sender, e) =>
             {
-                tvTemp.ControlTV(InfraredCode_TV.ChannelUp, function);
+                if (DB_ResidenceData.Instance.GatewayType == 1)
+                {
+                    Dictionary<string, string> d = new Dictionary<string, string>();
+                    d.Add("ch+", "");
+                    Control.Ins.SendWriteCommand(function, d);
+                }
+                else
+                {
+                    tvTemp.ControlTV(InfraredCode_TV.ChannelUp, function);
+                }
             };
             btnChlReduce.MouseUpEventHandler = (sender, e) =>
             {
-                tvTemp.ControlTV(InfraredCode_TV.ChannelDown, function);
+                if (DB_ResidenceData.Instance.GatewayType == 1)
+                {
+                    Dictionary<string, string> d = new Dictionary<string, string>();
+                    d.Add("ch-", "");
+                    Control.Ins.SendWriteCommand(function, d);
+                }
+                else
+                {
+                    tvTemp.ControlTV(InfraredCode_TV.ChannelDown, function);
+                }
             };
             btnVolPlus.MouseUpEventHandler = (sender, e) =>
             {
-                tvTemp.ControlTV(InfraredCode_TV.VolUp, function);
+                if (DB_ResidenceData.Instance.GatewayType == 1)
+                {
+                    Dictionary<string, string> d = new Dictionary<string, string>();
+                    d.Add("volume+", "");
+                    Control.Ins.SendWriteCommand(function, d);
+                }
+                else
+                {
+                    tvTemp.ControlTV(InfraredCode_TV.VolUp, function);
+                }
             };
             btnVolReduce.MouseUpEventHandler = (sender, e) =>
             {
-                tvTemp.ControlTV(InfraredCode_TV.VolDown, function);
+                if (DB_ResidenceData.Instance.GatewayType == 1)
+                {
+                    Dictionary<string, string> d = new Dictionary<string, string>();
+                    d.Add("volume-", "");
+                    Control.Ins.SendWriteCommand(function, d);
+                }
+                else
+                {
+                    tvTemp.ControlTV(InfraredCode_TV.VolDown, function);
+                }
             };
             btnBack.MouseUpEventHandler = (sender, e) =>
             {
-                tvTemp.ControlTV(InfraredCode_TV.Back, function);
+                if (DB_ResidenceData.Instance.GatewayType == 1)
+                {
+                    Dictionary<string, string> d = new Dictionary<string, string>();
+                    d.Add("return", "");
+                    Control.Ins.SendWriteCommand(function, d);
+                }
+                else
+                {
+                    tvTemp.ControlTV(InfraredCode_TV.Back, function);
+                }
             };
 
             btnMenu.MouseUpEventHandler = (sender, e) =>
             {
-                tvTemp.ControlTV(InfraredCode_TV.Menu, function);
+                if (DB_ResidenceData.Instance.GatewayType == 1)
+                {
+                    Dictionary<string, string> d = new Dictionary<string, string>();
+                    d.Add("menu", "");
+                    Control.Ins.SendWriteCommand(function, d);
+                }
+                else
+                {
+                    tvTemp.ControlTV(InfraredCode_TV.Menu, function);
+                }
             };
             btn123.MouseUpEventHandler = (sender, e) =>
             {
@@ -73,27 +138,90 @@
             };
             btnMute.MouseUpEventHandler = (sender, e) =>
             {
-                tvTemp.ControlTV(InfraredCode_TV.Mute, function);
+                if (DB_ResidenceData.Instance.GatewayType == 1)
+                {
+                    Dictionary<string, string> d = new Dictionary<string, string>();
+                    d.Add("mute", "");
+                    Control.Ins.SendWriteCommand(function, d);
+                }
+                else
+                {
+                    tvTemp.ControlTV(InfraredCode_TV.Mute, function);
+                }
             };
             btnPower.MouseUpEventHandler = (sender, e) =>
             {
-                tvTemp.ControlTV(InfraredCode_TV.Power, function);
+                if (DB_ResidenceData.Instance.GatewayType == 1)
+                {
+                    Dictionary<string, string> d = new Dictionary<string, string>();
+                    d.Add("on_off", "");
+                    Control.Ins.SendWriteCommand(function, d);
+                }
+                else
+                {
+                    tvTemp.ControlTV(InfraredCode_TV.Power, function);
+                }
             };
 
             btnTopMenuUp.MouseUpEventHandler = (sender, e) => {
-                tvTemp.ControlTV(InfraredCode_TV.Up, function);
+                if (DB_ResidenceData.Instance.GatewayType == 1)
+                {
+                    Dictionary<string, string> d = new Dictionary<string, string>();
+                    d.Add("up", "");
+                    Control.Ins.SendWriteCommand(function, d);
+                }
+                else
+                {
+                    tvTemp.ControlTV(InfraredCode_TV.Up, function);
+                }
             };
             btnTopMenuLeft.MouseUpEventHandler = (sender, e) => {
-                tvTemp.ControlTV(InfraredCode_TV.Left, function);
+                if (DB_ResidenceData.Instance.GatewayType == 1)
+                {
+                    Dictionary<string, string> d = new Dictionary<string, string>();
+                    d.Add("left", "");
+                    Control.Ins.SendWriteCommand(function, d);
+                }
+                else
+                {
+                    tvTemp.ControlTV(InfraredCode_TV.Left, function);
+                }
             };
             btnTopMenuRight.MouseUpEventHandler = (sender, e) => {
-                tvTemp.ControlTV(InfraredCode_TV.Right, function);
+                if (DB_ResidenceData.Instance.GatewayType == 1)
+                {
+                    Dictionary<string, string> d = new Dictionary<string, string>();
+                    d.Add("right", "");
+                    Control.Ins.SendWriteCommand(function, d);
+                }
+                else
+                {
+                    tvTemp.ControlTV(InfraredCode_TV.Right, function);
+                }
             };
             btnTopMenuDown.MouseUpEventHandler = (sender, e) => {
-                tvTemp.ControlTV(InfraredCode_TV.Down, function);
+                if (DB_ResidenceData.Instance.GatewayType == 1)
+                {
+                    Dictionary<string, string> d = new Dictionary<string, string>();
+                    d.Add("down", "");
+                    Control.Ins.SendWriteCommand(function, d);
+                }
+                else
+                {
+                    tvTemp.ControlTV(InfraredCode_TV.Down, function);
+                }
             };
             btnOk.MouseUpEventHandler = (sender, e) => {
-                tvTemp.ControlTV(InfraredCode_TV.Confrim, function);
+                if (DB_ResidenceData.Instance.GatewayType == 1)
+                {
+                    Dictionary<string, string> d = new Dictionary<string, string>();
+                    d.Add("ok", "");
+                    Control.Ins.SendWriteCommand(function, d);
+                }
+                else
+                {
+                    tvTemp.ControlTV(InfraredCode_TV.Confrim, function);
+                }
             };
         }
 

--
Gitblit v1.8.0