From 2d414e3b007f750cdad4f9e4a7c04db696bca5e4 Mon Sep 17 00:00:00 2001 From: JLChen <551775569@qq.com> Date: 星期四, 23 四月 2020 16:13:59 +0800 Subject: [PATCH] 2020-04-23 1.优化远程连接提示,改为Loading方案,防止连接过程用户点击重连图标。 2.点击网络检测图标会判断,是否正在远程连接,如果是,会弹窗提示用户”正在远程连接,是否仍要重新检测“。 3.Help 增加隐藏长按功能,长按后,可以开启远程过程异常弹窗提示。长按后关闭。 --- Crabtree/SmartHome/UI/SimpleControl/Phone/User/UserMiddle.cs | 97 ++++++++++++++++++++++++++++++++---------------- 1 files changed, 64 insertions(+), 33 deletions(-) diff --git a/Crabtree/SmartHome/UI/SimpleControl/Phone/User/UserMiddle.cs b/Crabtree/SmartHome/UI/SimpleControl/Phone/User/UserMiddle.cs index a246b63..6299a4e 100644 --- a/Crabtree/SmartHome/UI/SimpleControl/Phone/User/UserMiddle.cs +++ b/Crabtree/SmartHome/UI/SimpleControl/Phone/User/UserMiddle.cs @@ -75,7 +75,7 @@ Width = Application.GetRealWidth (640), Height = Application.GetRealHeight (1136 - 126 - 90 - 90), BackgroundColor = SkinStyle.Current.ViewColor, - ScrollEnabled = false + //ScrollEnabled = true }; public static Button btnVersion = new Button () { Y = Application.GetRealHeight (1136 - 90 - 90), @@ -284,9 +284,38 @@ } } UserConfig.Instance.SaveUserConfig (); - btnLinkStatus.MouseUpEventHandler += (dd, ff) => { - EquipmentPublicClass.CheckLinkRemote (UserConfig.Instance.internetStatus); + + + EventHandler<MouseEventArgs> btnLinkEvent = (sender, e) => { + try { + if (SmartHome.MqttCommon.remoteMqttIsConnecting && CommonPage.IsRemote) { + Alert alert = new Alert ("", "Being connected remotely, do you still want to cancel and re-detect?", Language.StringByID (R.MyInternationalizationString.Cancel), Language.StringByID (R.MyInternationalizationString.Confrim)); + alert.ResultEventHandler += (sender2, e2) => { + if (e2) { + EquipmentPublicClass.CheckLinkRemote (UserConfig.Instance.internetStatus); + } + }; + alert.Show (); + //MainPage.ShowAlertOnMainThread ("Please wait, connecting remotely..."); + } else { + EquipmentPublicClass.CheckLinkRemote (UserConfig.Instance.internetStatus); + } + } catch { } }; + + try { + //2020-04-23 瑙e喅瀹夊崜閲嶅寮圭獥闂 + if (btnLinkStatus.MouseUpEventHandler == null) { + btnLinkStatus.MouseUpEventHandler += btnLinkEvent; + } else { + btnLinkStatus.MouseUpEventHandler -= btnLinkEvent; + btnLinkStatus.MouseUpEventHandler += btnLinkEvent; + } + + } catch { + //Utlis.WriteLine ("ccc"); + } + } @@ -311,31 +340,33 @@ return; } + + Language.CurrentLanguage = "English"; #if DEBUG //UserConfig.Instance.SkinCode = 1; Language.CurrentLanguage = "English"; - var lii = new LightLogic () { Type = DeviceType.LightRGB, LoopID = 1, DeviceID = 4, SubnetID = 42, Name = "RGB" }; - IO.FileUtils.SaveEquipmentMessage (lii, lii.LoopID.ToString ()); - var lii1 = new LightSwitch () { LoopID = 1, DeviceID = 2, SubnetID = 232, Name = "缁х數鍣�" }; - IO.FileUtils.SaveEquipmentMessage (lii1, lii1.LoopID.ToString ()); - //var lii11 = new LightDimming () { LoopID = 1, DeviceID = 1, SubnetID = 232, Name = "璋冨厜鍣�" }; - //IO.FileUtils.SaveEquipmentMessage (lii11, lii11.LoopID.ToString ()); - //var lii111 = new LightDimming () { LoopID = 1, DeviceID = 8, SubnetID = 232, Name = "璋冨厜鍣�2" }; - //IO.FileUtils.SaveEquipmentMessage (lii111, lii111.LoopID.ToString ()); + //var lii = new LightLogic () { Type = DeviceType.LightRGB, LoopID = 1, DeviceID = 4, SubnetID = 42, Name = "RGB" }; + //IO.FileUtils.SaveEquipmentMessage (lii, lii.LoopID.ToString ()); + //var lii1 = new LightSwitch () { LoopID = 1, DeviceID = 2, SubnetID = 232, Name = "缁х數鍣�" }; + //IO.FileUtils.SaveEquipmentMessage (lii1, lii1.LoopID.ToString ()); + ////var lii11 = new LightDimming () { LoopID = 1, DeviceID = 1, SubnetID = 232, Name = "璋冨厜鍣�" }; + ////IO.FileUtils.SaveEquipmentMessage (lii11, lii11.LoopID.ToString ()); + ////var lii111 = new LightDimming () { LoopID = 1, DeviceID = 8, SubnetID = 232, Name = "璋冨厜鍣�2" }; + ////IO.FileUtils.SaveEquipmentMessage (lii111, lii111.LoopID.ToString ()); - var mCurtainModel1 = new CurtainModel () { LoopID = 1, DeviceID = 9, SubnetID = 42, Name = "绐楀笜" }; - IO.FileUtils.SaveEquipmentMessage (mCurtainModel1, mCurtainModel1.LoopID.ToString ()); - //var mCurtainModel2 = new CurtainModel () { LoopID = 2, DeviceID = 9, SubnetID = 42, Name = "绐楀笜2" }; - //IO.FileUtils.SaveEquipmentMessage (mCurtainModel2, mCurtainModel2.LoopID.ToString ()); - //var mCurtainModel3 = new CurtainModel () { LoopID = 1, DeviceID = 2, SubnetID = 42, Name = "绐楀笜3" }; - //IO.FileUtils.SaveEquipmentMessage (mCurtainModel3, mCurtainModel3.LoopID.ToString ()); + //var mCurtainModel1 = new CurtainModel () { LoopID = 1, DeviceID = 9, SubnetID = 42, Name = "绐楀笜" }; + //IO.FileUtils.SaveEquipmentMessage (mCurtainModel1, mCurtainModel1.LoopID.ToString ()); + ////var mCurtainModel2 = new CurtainModel () { LoopID = 2, DeviceID = 9, SubnetID = 42, Name = "绐楀笜2" }; + ////IO.FileUtils.SaveEquipmentMessage (mCurtainModel2, mCurtainModel2.LoopID.ToString ()); + ////var mCurtainModel3 = new CurtainModel () { LoopID = 1, DeviceID = 2, SubnetID = 42, Name = "绐楀笜3" }; + ////IO.FileUtils.SaveEquipmentMessage (mCurtainModel3, mCurtainModel3.LoopID.ToString ()); - var mCurtainRoller = new CurtainRoller () { LoopID = 1, DeviceID = 88, SubnetID = 42, Name = "绐楀笜CurtainRoller" }; - IO.FileUtils.SaveEquipmentMessage (mCurtainRoller, mCurtainRoller.LoopID.ToString ()); + //var mCurtainRoller = new CurtainRoller () { LoopID = 1, DeviceID = 88, SubnetID = 42, Name = "绐楀笜CurtainRoller" }; + //IO.FileUtils.SaveEquipmentMessage (mCurtainRoller, mCurtainRoller.LoopID.ToString ()); - var mCurtainTrietex = new CurtainTrietex () { LoopID = 1, DeviceID = 87, SubnetID = 42, Name = "绐楀笜CurtainTrietex" }; - IO.FileUtils.SaveEquipmentMessage (mCurtainTrietex, mCurtainTrietex.LoopID.ToString ()); + //var mCurtainTrietex = new CurtainTrietex () { LoopID = 1, DeviceID = 87, SubnetID = 42, Name = "绐楀笜CurtainTrietex" }; + //IO.FileUtils.SaveEquipmentMessage (mCurtainTrietex, mCurtainTrietex.LoopID.ToString ()); @@ -346,20 +377,20 @@ //var s2 = new LightEnergySwitch () { LoopID = 11, DeviceID = 1, SubnetID = 44, Name = "EnergySwitch" }; //IO.FileUtils.SaveEquipmentMessage (s2, s2.LoopID.ToString ()); - InfraredMode infraredMode = new InfraredMode () { LoopID = 1, SubnetID = 100, DeviceID = 12, InfraredType = InfraredType.TV, Name = "娴嬭瘯鐢佃" }; - IO.FileUtils.SaveEquipmentMessage (infraredMode, "1"); - ACInfrared aCInfrared = new ACInfrared () { LoopID = 1, SubnetID = 100, DeviceID = 112, Name = "绌鸿皟ACInfrared" }; - IO.FileUtils.SaveEquipmentMessage (aCInfrared, "1"); + //InfraredMode infraredMode = new InfraredMode () { LoopID = 1, SubnetID = 100, DeviceID = 12, InfraredType = InfraredType.TV, Name = "娴嬭瘯鐢佃" }; + //IO.FileUtils.SaveEquipmentMessage (infraredMode, "1"); + //ACInfrared aCInfrared = new ACInfrared () { LoopID = 1, SubnetID = 100, DeviceID = 112, Name = "绌鸿皟ACInfrared" }; + //IO.FileUtils.SaveEquipmentMessage (aCInfrared, "1"); - ACPanel mACPanel = new ACPanel () { LoopID = 1, SubnetID = 100, DeviceID = 42, Name = "绌鸿皟闈㈡澘ACPanel" }; - IO.FileUtils.SaveEquipmentMessage (mACPanel, "1"); + //ACPanel mACPanel = new ACPanel () { LoopID = 1, SubnetID = 100, DeviceID = 42, Name = "绌鸿皟闈㈡澘ACPanel" }; + //IO.FileUtils.SaveEquipmentMessage (mACPanel, "1"); - CustomAC mCustomAC = new CustomAC () { LoopID = 1, SubnetID = 99, DeviceID = 42, Name = "绌鸿皟CustomAC" }; - IO.FileUtils.SaveEquipmentMessage (mCustomAC, "1"); + //CustomAC mCustomAC = new CustomAC () { LoopID = 1, SubnetID = 99, DeviceID = 42, Name = "绌鸿皟CustomAC" }; + //IO.FileUtils.SaveEquipmentMessage (mCustomAC, "1"); - HVAC mHVAC = new HVAC () { LoopID = 1, SubnetID = 98, DeviceID = 42, Name = "绌鸿皟HVAC" }; - IO.FileUtils.SaveEquipmentMessage (mHVAC, "1"); + //HVAC mHVAC = new HVAC () { LoopID = 1, SubnetID = 98, DeviceID = 42, Name = "绌鸿皟HVAC" }; + //IO.FileUtils.SaveEquipmentMessage (mHVAC, "1"); //var fanM = new FanModule () { Name = "Fan Module",SubnetID = 2,DeviceID = 1,LoopID = 1}; @@ -368,8 +399,8 @@ //IO.FileUtils.SaveEquipmentMessage (fanLoop1, "1"); //var fanLoop2 = new FanModule () { Name = "Fan 2", SubnetID = 2, DeviceID = 1, LoopID = 2 }; //IO.FileUtils.SaveEquipmentMessage (fanLoop2, "2"); - LightEnergySocket sddd = new LightEnergySocket () { LoopID = 1, SubnetID = 100, DeviceID = 122, Name = "娴嬭瘯鎻掑骇" }; - IO.FileUtils.SaveEquipmentMessage (sddd, "1"); + //LightEnergySocket sddd = new LightEnergySocket () { LoopID = 1, SubnetID = 100, DeviceID = 122, Name = "娴嬭瘯鎻掑骇" }; + //IO.FileUtils.SaveEquipmentMessage (sddd, "1"); //var ud = new UniversalDevice () { LoopID = 1,SubnetID = 42,DeviceID = 6,ActionType = 2,Name = "Universal-1",obj1 = 1,TargetType = 0}; //ud.SendBytes = new List<byte> () { 1 ,0}; -- Gitblit v1.8.0