From 0891d90cd0d435338cc2851fd0830cd318a17fff Mon Sep 17 00:00:00 2001
From: wei <kaede@kaededeMacBook-Air.local>
Date: 星期三, 23 十二月 2020 14:25:55 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/WJC' into NewFilePath
---
HDL_ON/UI/UI2/FuntionControlView/Electrical/TVPageBLL.cs | 100 +++++++++++++++++++++++++++++---------------------
1 files changed, 58 insertions(+), 42 deletions(-)
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Electrical/TVPageBLL.cs b/HDL_ON/UI/UI2/FuntionControlView/Electrical/TVPageBLL.cs
index a278200..718ffed 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Electrical/TVPageBLL.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Electrical/TVPageBLL.cs
@@ -7,36 +7,18 @@
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();
//鍥為��鍒锋柊淇℃伅浜嬩欢
actionRefresh = () => {
btnFunctionName.Text = btnFunctionName_Out.Text = tv.name;
btnFromFloor_Out.Text = btnFromFoorAndRoom.Text = tv.GetRoomListName();
+ tv.SaveFunctionData(true);
};
}
@@ -46,39 +28,73 @@
void LoadCollectionEvent()
{
btnCollection.MouseUpEventHandler += (sender, e) => {
- btnCollection.IsSelected = tv.collection = btnCollection_Out.IsSelected = !btnCollection.IsSelected;
- DB_ResidenceData.residenceData.SaveResidenceData();
+ btnCollection.IsSelected = tv.collect = btnCollection_Out.IsSelected = !btnCollection.IsSelected;
+ tv.CollectFunction();
};
}
/// <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