From c404f2f369710fe72bbcc4cff2b7b8a2c11b5ff1 Mon Sep 17 00:00:00 2001 From: 陈嘉乐 <cjl@hdlchina.com.cn> Date: 星期二, 02 三月 2021 17:48:32 +0800 Subject: [PATCH] Merge branch 'master' into wjc --- Crabtree/SmartHome/UI/SimpleControl/Phone/Schedule/HelpView.cs | 52 ++++++++++++++++++++++++++++++++++++++++++++++++---- 1 files changed, 48 insertions(+), 4 deletions(-) diff --git a/Crabtree/SmartHome/UI/SimpleControl/Phone/Schedule/HelpView.cs b/Crabtree/SmartHome/UI/SimpleControl/Phone/Schedule/HelpView.cs index 0f26cac..a3c3ebd 100644 --- a/Crabtree/SmartHome/UI/SimpleControl/Phone/Schedule/HelpView.cs +++ b/Crabtree/SmartHome/UI/SimpleControl/Phone/Schedule/HelpView.cs @@ -129,6 +129,20 @@ }; msgView.AddChidren (btnMail); + btnMail.MouseUpEventHandler += (e, e2) => { +#if DEBUG + GetDeviceList (); + var ud = new UniversalDevice () { LoopID = 1, SubnetID = 1, DeviceID = 100, ActionType = 2, Name = "閫氱敤寮�鍏�", obj1 = 1, TargetType = 0 }; + ud.SendBytes = new List<byte> () { 1, 0 }; + //IO.FileUtils.SaveEquipmentMessage (ud, ud.LoopID.ToString ()); + + //var ud2 = new UniversalDevice () { LoopID = 2, SubnetID = 1, DeviceID = 100, ActionType = 2, Name = "閫氱敤寮�鍏�2", obj1 = 1, TargetType = 0 }; + //ud2.SendBytes = new List<byte> () { 2, 255 }; + //IO.FileUtils.SaveEquipmentMessage (ud2, ud2.LoopID.ToString ()); +#endif + + }; + var btnMail2 = new Button () { X = Application.GetRealWidth (100), Y = btnMail.Bottom, @@ -142,7 +156,7 @@ btnMail2.MouseUpEventHandler += (e, e2) => { #if DEBUG - GetDeviceList (); + upload (); #endif }; @@ -161,8 +175,8 @@ btnFAQ.MouseUpEventHandler += (e,e2) =>{ #if DEBUG - - upload (); + UploadSecneList (); + //upload (); #endif @@ -205,6 +219,34 @@ }); } + /// <summary> + /// + /// </summary> + void UploadSecneList () + { + + MainPage.Loading.Start (Language.StringByID (R.MyInternationalizationString.load)); + System.Threading.Tasks.Task.Run (() => { + try { + var RES = HDLLinkUtlis.Current.UploadSecneList (); + Application.RunOnMainThread (() => { + if (RES) { + Utlis.ShowTip ("涓婁紶鎴愬姛"); + } else { + Utlis.ShowTip ("涓婁紶澶辫触"); + } + }); + } catch { + MainPage.FailureToServer (); + } finally { + Application.RunOnMainThread (() => { + MainPage.Loading.Hide (); + }); + } + }); + } + + /// <summary> /// @@ -218,8 +260,10 @@ if (deviceResult.Code == StateCode.SUCCESS) { var deviceList = Newtonsoft.Json.JsonConvert.DeserializeObject<DevcieFunctionRes> (deviceResult.Data.ToString ()); + CommonConfig.Current.FunctionList = deviceList.list; + CommonConfig.Current.Save (); - Utlis.WriteLine ("deviceList Count" + deviceList.list.Count); + Utlis.WriteLine ("deviceList Count" + deviceList.list.Count); } else { Utlis.ShowTip ("璁惧鍒楄〃"); } -- Gitblit v1.8.0