From 0c0536e9b5db204fd3bd3c2443ef500b66bf7423 Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期二, 24 十一月 2020 17:48:40 +0800
Subject: [PATCH] 2020-11-24-1
---
HDL_ON/UI/UI2/FuntionControlView/Electrical/TVPageBLL.cs | 97 ++++++++++++++++++++++++++++--------------------
1 files changed, 56 insertions(+), 41 deletions(-)
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Electrical/TVPageBLL.cs b/HDL_ON/UI/UI2/FuntionControlView/Electrical/TVPageBLL.cs
index a278200..0330efe 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Electrical/TVPageBLL.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Electrical/TVPageBLL.cs
@@ -7,30 +7,11 @@
public partial class TVPage
{
/// <summary>
- /// 鏇存柊鐏厜鐘舵��
- /// </summary>
- public static void UpdataState(TV uTv)
- {
- Application.RunOnMainThread(() =>
- {
- try
- {
- if (bodyView == null)
- return;
- bodyView.btnSwitch.IsSelected = bodyView.btnSwitchIcon.IsSelected = uTv.on_off == "on";
- }
- catch (Exception ex)
- {
- MainPage.Log($"RelayPage error {ex.Message}");
- }
- });
- }
- /// <summary>
/// 鍔犺浇浜嬩欢鍒楄〃
/// </summary>
void LoadEventList()
{
- LoadSwitchEvent();
+ LoadControlEvent();
LoadCollectionEvent();
//鍥為��鍒锋柊淇℃伅浜嬩欢
@@ -47,38 +28,72 @@
{
btnCollection.MouseUpEventHandler += (sender, e) => {
btnCollection.IsSelected = tv.collection = btnCollection_Out.IsSelected = !btnCollection.IsSelected;
- DB_ResidenceData.residenceData.SaveResidenceData();
+ tv.SaveFunctionData();
};
}
/// <summary>
- /// 鍔犺浇寮�鍏充簨浠�
+ /// 鍔犺浇鎺у埗浜嬩欢
/// </summary>
- void LoadSwitchEvent()
+ void LoadControlEvent()
{
- btnSwitchIcon.MouseUpEventHandler += (sender, e) =>
+ btnChangeTVAV.MouseUpEventHandler = (sender, e) =>
{
- btnSwitchIcon.IsSelected = !btnSwitchIcon.IsSelected;
-
- new System.Threading.Thread(() =>
- {
- tv.on_off = btnSwitch.IsSelected ? "on" : "off";
- Control.Send(CommandType_A.write, this.tv);
- })
- { IsBackground = true }.Start();
+ tv.ControlTV(InfraredCode_TV.AV_TV);
};
- btnSwitch.MouseUpEventHandler += (sender, e) =>
+ btnChlPlus.MouseUpEventHandler = (sender, e) =>
{
- btnSwitch.IsSelected = !btnSwitch.IsSelected;
-
- new System.Threading.Thread(() =>
- {
- tv.on_off = btnSwitch.IsSelected ? "on" : "off";
- Control.Send(CommandType_A.write, this.tv);
- })
- { IsBackground = true }.Start();
+ tv.ControlTV(InfraredCode_TV.ChannelUp);
+ };
+ btnChlReduce.MouseUpEventHandler = (sender, e) =>
+ {
+ tv.ControlTV(InfraredCode_TV.ChannelDown);
+ };
+ btnVolPlus.MouseUpEventHandler = (sender, e) =>
+ {
+ tv.ControlTV(InfraredCode_TV.VolUp);
+ };
+ btnVolReduce.MouseUpEventHandler = (sender, e) =>
+ {
+ tv.ControlTV(InfraredCode_TV.VolDown);
+ };
+ btnBack.MouseUpEventHandler = (sender, e) =>
+ {
+ tv.ControlTV(InfraredCode_TV.Back);
};
+ btnMenu.MouseUpEventHandler = (sender, e) =>
+ {
+ tv.ControlTV(InfraredCode_TV.Menu);
+ };
+ btn123.MouseUpEventHandler = (sender, e) =>
+ {
+ ShowNumberView();
+ };
+ btnMute.MouseUpEventHandler = (sender, e) =>
+ {
+ tv.ControlTV(InfraredCode_TV.Mute);
+ };
+ btnPower.MouseUpEventHandler = (sender, e) =>
+ {
+ tv.ControlTV(InfraredCode_TV.Power);
+ };
+
+ btnTopMenuUp.MouseUpEventHandler = (sender, e) => {
+ tv.ControlTV(InfraredCode_TV.Up);
+ };
+ btnTopMenuLeft.MouseUpEventHandler = (sender, e) => {
+ tv.ControlTV(InfraredCode_TV.Left);
+ };
+ btnTopMenuRight.MouseUpEventHandler = (sender, e) => {
+ tv.ControlTV(InfraredCode_TV.Right);
+ };
+ btnTopMenuDown.MouseUpEventHandler = (sender, e) => {
+ tv.ControlTV(InfraredCode_TV.Down);
+ };
+ btnOk.MouseUpEventHandler = (sender, e) => {
+ tv.ControlTV(InfraredCode_TV.Confrim);
+ };
}
}
--
Gitblit v1.8.0