From 2774f5981a93cc6cc6aec22a6409f26889e925b4 Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期五, 03 七月 2020 16:36:56 +0800
Subject: [PATCH] 2020-07-03 1.修复修改红外TV模块修改备注出错问题。 2.如果搜索红外模块备注为空默认显示TV+回路号备注。 3.上传红外码指令,直接回路备注数据。4.网关配频模式时,开启自动搜索设备线程,定时3秒发送一次E548命令。

---
 Crabtree/SmartHome/UI/SimpleControl/Phone/Room/UserRoom.cs |   49 +++++++++++++++++++++++++++----------------------
 1 files changed, 27 insertions(+), 22 deletions(-)

diff --git a/Crabtree/SmartHome/UI/SimpleControl/Phone/Room/UserRoom.cs b/Crabtree/SmartHome/UI/SimpleControl/Phone/Room/UserRoom.cs
index 1257744..c8cfb7a 100644
--- a/Crabtree/SmartHome/UI/SimpleControl/Phone/Room/UserRoom.cs
+++ b/Crabtree/SmartHome/UI/SimpleControl/Phone/Room/UserRoom.cs
@@ -59,11 +59,13 @@
                                             if (btn.Tag.ToString () == DeviceType.LightEnergySocket.ToString () + "_Voltage" || btn.Tag.ToString () == DeviceType.LightEnergySwitch.ToString () + "_Voltage") {
                                                 btn.Text = energy.ToString () + " W";
                                             }
-                                        } else if (updataType == 11) {
-                                            if (btn.Tag.ToString () == DeviceType.LightEnergySocket.ToString () + "_Electric" || btn.Tag.ToString () == DeviceType.LightEnergySwitch.ToString () + "_Electric") {
-                                                btn.Text = ((double)(Convert.ToDouble (energy) / 10)).ToString () + " kw.h";
-                                            }
                                         }
+                                        //2020-07-01 瀹㈡埛鎻愬嚭闅愯棌kwh
+                                        //else if (updataType == 11) {
+                                        //    if (btn.Tag.ToString () == DeviceType.LightEnergySocket.ToString () + "_Electric" || btn.Tag.ToString () == DeviceType.LightEnergySwitch.ToString () + "_Electric") {
+                                        //        btn.Text = ((double)(Convert.ToDouble (energy) / 10)).ToString () + " kw.h";
+                                        //    }
+                                        //}
                                     }
                                 }
                             }
@@ -1821,9 +1823,10 @@
                                 }
                             };
                             #endregion
-                        } else if (devcieCommon.Type == DeviceType.LightSwitch ||
-                            devcieCommon.Type == DeviceType.LightEnergySocket ||
-                            devcieCommon.Type == DeviceType.LightEnergySwitch || devcieCommon.Type == DeviceType.LightSwitchSocket) {
+                        } else if (devcieCommon.Type == DeviceType.LightSwitch
+                            || devcieCommon.Type == DeviceType.LightEnergySocket
+                            || devcieCommon.Type == DeviceType.LightEnergySwitch
+                            || devcieCommon.Type == DeviceType.LightSwitchSocket) {
                             #region 缁х數鍣�
                             LightSwitch switchLight = devcieCommon as LightSwitch;
                             tempSwitch.IsSelected = switchLight.CurrentBrightness == 100 ? true : false;
@@ -1850,19 +1853,19 @@
                                 };
                                 DeviceRowView.AddChidren (btnEnergy);
                                 EnergtLightList.Add (devcieCommon);
-
-                                Button btnElectric = new Button () {
-                                    Width = Application.GetRealWidth (200),
-                                    Height = Application.GetRealHeight (35),
-                                    X = Application.GetRealWidth (320),
-                                    Y = tempSwitch.Bottom,
-                                    TextColor = SkinStyle.Current.TextColor1,
-                                    TextAlignment = TextAlignment.CenterRight,
-                                    SelectedTextColor = SkinStyle.Current.TextColor1,
-                                    Tag = devcieCommon.Type.ToString () + "_Electric",
-                                    Text = "0 kw.h"
-                                };
-                                DeviceRowView.AddChidren (btnElectric);
+                                //2020-07-01 瀹㈡埛鎻愬嚭闅愯棌kwh
+                                //Button btnElectric = new Button () {
+                                //    Width = Application.GetRealWidth (200),
+                                //    Height = Application.GetRealHeight (35),
+                                //    X = Application.GetRealWidth (320),
+                                //    Y = tempSwitch.Bottom,
+                                //    TextColor = SkinStyle.Current.TextColor1,
+                                //    TextAlignment = TextAlignment.CenterRight,
+                                //    SelectedTextColor = SkinStyle.Current.TextColor1,
+                                //    Tag = devcieCommon.Type.ToString () + "_Electric",
+                                //    Text = "0 kw.h"
+                                //};
+                                //DeviceRowView.AddChidren (btnElectric);
                             }
                             tempSwitch.MouseUpEventHandler += (sender3, e3) => {
                                 //tempSwitch.IsSelected = !tempSwitch.IsSelected;
@@ -1880,7 +1883,8 @@
                                 if (devcieCommon.Type == DeviceType.LightEnergySocket || devcieCommon.Type == DeviceType.LightEnergySwitch) {
                                     new System.Threading.Thread (() => {
                                         Control.ControlBytesSend (Command.ReadAnalogValue, switchLight.SubnetID, switchLight.DeviceID, new byte [] { 10, switchLight.LoopID }, SendCount.Zero);
-                                        Control.ControlBytesSend (Command.ReadAnalogValue, switchLight.SubnetID, switchLight.DeviceID, new byte [] { 11, switchLight.LoopID }, SendCount.Zero);
+                                        //2020-07-01 瀹㈡埛鎻愬嚭闅愯棌kwh
+                                        //Control.ControlBytesSend (Command.ReadAnalogValue, switchLight.SubnetID, switchLight.DeviceID, new byte [] { 11, switchLight.LoopID }, SendCount.Zero);
                                     }) { IsBackground = true }.Start ();
                                 }
                             };
@@ -2307,7 +2311,8 @@
                                 
                                 var c = EnergtLightList [i];
                                 Control.ControlBytesSend (Command.ReadAnalogValue, c.SubnetID, c.DeviceID, new byte [] { 10, c.LoopID }, SendCount.Zero);
-                                Control.ControlBytesSend (Command.ReadAnalogValue, c.SubnetID, c.DeviceID, new byte [] { 11, c.LoopID }, SendCount.Zero);
+                                //2020-07-01 瀹㈡埛鎻愬嚭闅愯棌kwh
+                                //Control.ControlBytesSend (Command.ReadAnalogValue, c.SubnetID, c.DeviceID, new byte [] { 11, c.LoopID }, SendCount.Zero);
 #if DEBUG
                                 Application.RunOnMainThread (() => {
                                     Utlis.WriteLine ($"璇诲彇 { c.Name } 鐢佃兘");

--
Gitblit v1.8.0