From 40f46f32cb00f4304a691d4f027a76a13a9ebb6d Mon Sep 17 00:00:00 2001 From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local> Date: 星期一, 16 十二月 2019 15:11:36 +0800 Subject: [PATCH] 2019.12.16 --- ZigbeeApp/Shared/Phone/Device/CommonForm/CategoryFunctionForWinRow.cs | 2 ZigbeeApp/Shared/Phone/UserView/UserHomeView.cs | 82 ++++++------- ZigbeeApp/GateWay.Droid/Assets/Language.ini | 3 ZigbeeApp/GateWay.Droid/Resources/Resource.designer.cs | 93 ++++++++------- ZigbeeApp/.vs/GateWay/xs/UserPrefs.xml | 24 ++- ZigbeeApp/GateWay.Droid/Assets/Phone/Item/SwitchSelected.png | 0 ZigbeeApp/Shared/Phone/Device/Light/OnOffControl.cs | 4 ZigbeeApp/Shared/Phone/Device/Light/LightControl.cs | 4 ZigbeeApp/Shared/Phone/Device/CommonForm/CategoryFunctionRow.cs | 2 ZigbeeApp/Shared/Phone/Device/Light/DimmableLightControl.cs | 14 +- ZigbeeApp/Shared/DLL/Android/Shared.Droid.Smartrefresh.dll | 0 ZigbeeApp/Shared/Phone/Device/DeviceLogic/ReadDeviceAttributeLogic.cs | 20 ++ ZigbeeApp/Shared/R.cs | 6 ZigbeeApp/Shared/Phone/Device/Category/Category.cs | 91 ++++++++------ ZigbeeApp/Shared/DLL/Android/Shared.Droid.dll | 0 ZigbeeApp/Shared/Phone/Device/Light/AirSwitchControl.cs | 2 ZigbeeApp/Shared/Phone/Device/Light/PlugControl.cs | 4 ZigbeeApp/Shared/DLL/Android/Shared.Droid.HDLWidget.dll | 0 ZigbeeApp/Shared/Phone/Device/AC/ACControl.cs | 6 ZigbeeApp/GateWay.Droid/Assets/Phone/Item/Switch.png | 0 20 files changed, 195 insertions(+), 162 deletions(-) diff --git a/ZigbeeApp/.vs/GateWay/xs/UserPrefs.xml b/ZigbeeApp/.vs/GateWay/xs/UserPrefs.xml index eb59957..81d09cc 100644 --- a/ZigbeeApp/.vs/GateWay/xs/UserPrefs.xml +++ b/ZigbeeApp/.vs/GateWay/xs/UserPrefs.xml @@ -4,42 +4,48 @@ <MonoDevelop.Ide.ItemProperties.ShardLib PreferredExecutionTarget="Android.M7BBB18B19152766" /> <MonoDevelop.Ide.Workbench ActiveDocument="Shared/Phone/UserView/UserPage.cs"> <Files> - <File FileName="Shared/Phone/UserView/UserPage.cs" Line="298" Column="6" /> - <File FileName="Shared/Phone/UserView/HomePage.cs" /> <File FileName="Shared/R.cs" /> <File FileName="GateWay.Droid/Assets/Language.ini" /> + <File FileName="Shared/Phone/Device/Light/DimmableLightControl.cs" Line="411" Column="15" /> + <File FileName="Shared/Phone/Device/Category/Category.cs" Line="1354" Column="47" /> + <File FileName="Shared/Phone/Device/AC/ACControl.cs" Line="422" Column="61" /> + <File FileName="Shared/Phone/UserView/UserHomeView.cs" Line="1" Column="1" /> + <File FileName="Shared/Phone/Device/DeviceLogic/ReadDeviceAttributeLogic.cs" Line="46" Column="1" /> + <File FileName="Shared/Common/CommonPage.cs" Line="60" Column="99" /> + <File FileName="Shared/Phone/UserView/UserPage.cs" Line="251" Column="30" /> </Files> <Pads> <Pad Id="ProjectPad"> <State name="__root__"> <Node name="GateWay" expanded="True"> <Node name="GateWay.Droid" expanded="True"> - <Node name="Assets" expanded="True" /> + <Node name="Assets" expanded="True"> + <Node name="Phone" expanded="True" /> + </Node> </Node> - <Node name="Home.IOS" expanded="True" /> <Node name="Shared" expanded="True"> <Node name="Common" expanded="True" /> <Node name="Phone" expanded="True"> <Node name="Device" expanded="True"> - <Node name="Account" expanded="True" /> + <Node name="AC" expanded="True" /> <Node name="Category" expanded="True" /> <Node name="CommonForm" expanded="True" /> + <Node name="DeviceLogic" expanded="True" /> + <Node name="Light" expanded="True" /> <Node name="Room" expanded="True" /> </Node> <Node name="UserCenter" expanded="True"> <Node name="Abount" expanded="True" /> <Node name="CommonBase" expanded="True"> - <Node name="Form" expanded="True"> - <Node name="Base" expanded="True" /> - </Node> + <Node name="Logic" expanded="True" /> </Node> - <Node name="UserMain" expanded="True" /> </Node> <Node name="UserView" expanded="True"> <Node name="UserPage.cs" selected="True" /> </Node> <Node name="ZigBee" expanded="True"> <Node name="Common" expanded="True" /> + <Node name="Device" expanded="True" /> </Node> </Node> </Node> diff --git a/ZigbeeApp/GateWay.Droid/Assets/Language.ini b/ZigbeeApp/GateWay.Droid/Assets/Language.ini index 7c8e850..04240e8 100755 --- a/ZigbeeApp/GateWay.Droid/Assets/Language.ini +++ b/ZigbeeApp/GateWay.Droid/Assets/Language.ini @@ -693,7 +693,7 @@ 11019=鍒嗕韩鐨� 11020=閫夋嫨鍥炬爣 11021=淇濆瓨 -11022=鎻愮ず +11022=鎻愰啋 11023=鍙栨秷 11024=娌℃湁鍦烘櫙 {\r\n} 璇风偣鍑诲彸涓婅娣诲姞 11025=璁剧疆 @@ -705,6 +705,7 @@ 11031=娣诲姞鎵ц鐩爣 11032=閫夋嫨鍖哄煙 11033=閫夋嫨鍦烘櫙鍥剧墖 +11034=纭畾鍒犻櫎鍚楋紵 12100=鏈煡璁惧 diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Item/Switch.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Item/Switch.png old mode 100755 new mode 100644 index 39f3349..f8b5b97 --- a/ZigbeeApp/GateWay.Droid/Assets/Phone/Item/Switch.png +++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Item/Switch.png Binary files differ diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Item/SwitchSelected.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Item/SwitchSelected.png old mode 100755 new mode 100644 index c5a8f2e..050c35f --- a/ZigbeeApp/GateWay.Droid/Assets/Phone/Item/SwitchSelected.png +++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Item/SwitchSelected.png Binary files differ diff --git a/ZigbeeApp/GateWay.Droid/Resources/Resource.designer.cs b/ZigbeeApp/GateWay.Droid/Resources/Resource.designer.cs index bcf64c2..4d98be1 100644 --- a/ZigbeeApp/GateWay.Droid/Resources/Resource.designer.cs +++ b/ZigbeeApp/GateWay.Droid/Resources/Resource.designer.cs @@ -1698,44 +1698,44 @@ public partial class Color { - // aapt resource value: 0x7f0d0051 - public const int abc_background_cache_hint_selector_material_dark = 2131558481; - // aapt resource value: 0x7f0d0052 - public const int abc_background_cache_hint_selector_material_light = 2131558482; + public const int abc_background_cache_hint_selector_material_dark = 2131558482; // aapt resource value: 0x7f0d0053 - public const int abc_btn_colored_borderless_text_material = 2131558483; + public const int abc_background_cache_hint_selector_material_light = 2131558483; // aapt resource value: 0x7f0d0054 - public const int abc_btn_colored_text_material = 2131558484; + public const int abc_btn_colored_borderless_text_material = 2131558484; // aapt resource value: 0x7f0d0055 - public const int abc_color_highlight_material = 2131558485; + public const int abc_btn_colored_text_material = 2131558485; // aapt resource value: 0x7f0d0056 - public const int abc_hint_foreground_material_dark = 2131558486; + public const int abc_color_highlight_material = 2131558486; // aapt resource value: 0x7f0d0057 - public const int abc_hint_foreground_material_light = 2131558487; + public const int abc_hint_foreground_material_dark = 2131558487; + + // aapt resource value: 0x7f0d0058 + public const int abc_hint_foreground_material_light = 2131558488; // aapt resource value: 0x7f0d0000 public const int abc_input_method_navigation_guard = 2131558400; - // aapt resource value: 0x7f0d0058 - public const int abc_primary_text_disable_only_material_dark = 2131558488; - // aapt resource value: 0x7f0d0059 - public const int abc_primary_text_disable_only_material_light = 2131558489; + public const int abc_primary_text_disable_only_material_dark = 2131558489; // aapt resource value: 0x7f0d005a - public const int abc_primary_text_material_dark = 2131558490; + public const int abc_primary_text_disable_only_material_light = 2131558490; // aapt resource value: 0x7f0d005b - public const int abc_primary_text_material_light = 2131558491; + public const int abc_primary_text_material_dark = 2131558491; // aapt resource value: 0x7f0d005c - public const int abc_search_url_text = 2131558492; + public const int abc_primary_text_material_light = 2131558492; + + // aapt resource value: 0x7f0d005d + public const int abc_search_url_text = 2131558493; // aapt resource value: 0x7f0d0001 public const int abc_search_url_text_normal = 2131558401; @@ -1746,29 +1746,29 @@ // aapt resource value: 0x7f0d0003 public const int abc_search_url_text_selected = 2131558403; - // aapt resource value: 0x7f0d005d - public const int abc_secondary_text_material_dark = 2131558493; - // aapt resource value: 0x7f0d005e - public const int abc_secondary_text_material_light = 2131558494; + public const int abc_secondary_text_material_dark = 2131558494; // aapt resource value: 0x7f0d005f - public const int abc_tint_btn_checkable = 2131558495; + public const int abc_secondary_text_material_light = 2131558495; // aapt resource value: 0x7f0d0060 - public const int abc_tint_default = 2131558496; + public const int abc_tint_btn_checkable = 2131558496; // aapt resource value: 0x7f0d0061 - public const int abc_tint_edittext = 2131558497; + public const int abc_tint_default = 2131558497; // aapt resource value: 0x7f0d0062 - public const int abc_tint_seek_thumb = 2131558498; + public const int abc_tint_edittext = 2131558498; // aapt resource value: 0x7f0d0063 - public const int abc_tint_spinner = 2131558499; + public const int abc_tint_seek_thumb = 2131558499; // aapt resource value: 0x7f0d0064 - public const int abc_tint_switch_track = 2131558500; + public const int abc_tint_spinner = 2131558500; + + // aapt resource value: 0x7f0d0065 + public const int abc_tint_switch_track = 2131558501; // aapt resource value: 0x7f0d0004 public const int accent_material_dark = 2131558404; @@ -1815,8 +1815,8 @@ // aapt resource value: 0x7f0d003c public const int design_bottom_navigation_shadow_color = 2131558460; - // aapt resource value: 0x7f0d0065 - public const int design_error = 2131558501; + // aapt resource value: 0x7f0d0066 + public const int design_error = 2131558502; // aapt resource value: 0x7f0d003d public const int design_fab_shadow_end_color = 2131558461; @@ -1842,8 +1842,8 @@ // aapt resource value: 0x7f0d0044 public const int design_snackbar_background_color = 2131558468; - // aapt resource value: 0x7f0d0066 - public const int design_tint_password_toggle = 2131558502; + // aapt resource value: 0x7f0d0067 + public const int design_tint_password_toggle = 2131558503; // aapt resource value: 0x7f0d0012 public const int dim_foreground_disabled_material_dark = 2131558418; @@ -1865,6 +1865,9 @@ // aapt resource value: 0x7f0d0018 public const int foreground_material_light = 2131558424; + + // aapt resource value: 0x7f0d0048 + public const int gd_top_view = 2131558472; // aapt resource value: 0x7f0d0019 public const int highlighted_text_material_dark = 2131558425; @@ -1920,32 +1923,32 @@ // aapt resource value: 0x7f0d003b public const int notification_material_background_media_default_color = 2131558459; - // aapt resource value: 0x7f0d0048 - public const int pickerview_bgColor_default = 2131558472; - // aapt resource value: 0x7f0d0049 - public const int pickerview_bgColor_overlay = 2131558473; + public const int pickerview_bgColor_default = 2131558473; // aapt resource value: 0x7f0d004a - public const int pickerview_bg_topbar = 2131558474; + public const int pickerview_bgColor_overlay = 2131558474; // aapt resource value: 0x7f0d004b - public const int pickerview_timebtn_nor = 2131558475; + public const int pickerview_bg_topbar = 2131558475; // aapt resource value: 0x7f0d004c - public const int pickerview_timebtn_pre = 2131558476; + public const int pickerview_timebtn_nor = 2131558476; // aapt resource value: 0x7f0d004d - public const int pickerview_topbar_title = 2131558477; + public const int pickerview_timebtn_pre = 2131558477; // aapt resource value: 0x7f0d004e - public const int pickerview_wheelview_textcolor_center = 2131558478; + public const int pickerview_topbar_title = 2131558478; // aapt resource value: 0x7f0d004f - public const int pickerview_wheelview_textcolor_divider = 2131558479; + public const int pickerview_wheelview_textcolor_center = 2131558479; // aapt resource value: 0x7f0d0050 - public const int pickerview_wheelview_textcolor_out = 2131558480; + public const int pickerview_wheelview_textcolor_divider = 2131558480; + + // aapt resource value: 0x7f0d0051 + public const int pickerview_wheelview_textcolor_out = 2131558481; // aapt resource value: 0x7f0d0027 public const int primary_dark_material_dark = 2131558439; @@ -1995,11 +1998,11 @@ // aapt resource value: 0x7f0d0036 public const int switch_thumb_disabled_material_light = 2131558454; - // aapt resource value: 0x7f0d0067 - public const int switch_thumb_material_dark = 2131558503; - // aapt resource value: 0x7f0d0068 - public const int switch_thumb_material_light = 2131558504; + public const int switch_thumb_material_dark = 2131558504; + + // aapt resource value: 0x7f0d0069 + public const int switch_thumb_material_light = 2131558505; // aapt resource value: 0x7f0d0037 public const int switch_thumb_normal_material_dark = 2131558455; diff --git a/ZigbeeApp/Shared/DLL/Android/Shared.Droid.HDLWidget.dll b/ZigbeeApp/Shared/DLL/Android/Shared.Droid.HDLWidget.dll index 0abb720..866897a 100644 --- a/ZigbeeApp/Shared/DLL/Android/Shared.Droid.HDLWidget.dll +++ b/ZigbeeApp/Shared/DLL/Android/Shared.Droid.HDLWidget.dll Binary files differ diff --git a/ZigbeeApp/Shared/DLL/Android/Shared.Droid.Smartrefresh.dll b/ZigbeeApp/Shared/DLL/Android/Shared.Droid.Smartrefresh.dll index 2eb1eaf..5638501 100644 --- a/ZigbeeApp/Shared/DLL/Android/Shared.Droid.Smartrefresh.dll +++ b/ZigbeeApp/Shared/DLL/Android/Shared.Droid.Smartrefresh.dll Binary files differ diff --git a/ZigbeeApp/Shared/DLL/Android/Shared.Droid.dll b/ZigbeeApp/Shared/DLL/Android/Shared.Droid.dll index 5b52ea8..ac2ea32 100644 --- a/ZigbeeApp/Shared/DLL/Android/Shared.Droid.dll +++ b/ZigbeeApp/Shared/DLL/Android/Shared.Droid.dll Binary files differ diff --git a/ZigbeeApp/Shared/Phone/Device/AC/ACControl.cs b/ZigbeeApp/Shared/Phone/Device/AC/ACControl.cs index 230ce9c..a54a1bf 100644 --- a/ZigbeeApp/Shared/Phone/Device/AC/ACControl.cs +++ b/ZigbeeApp/Shared/Phone/Device/AC/ACControl.cs @@ -417,10 +417,10 @@ else { //闃叉鐭椂闂村唴澶氭璇诲彇璁惧鐘舵�� - if ((DateTime.Now - ac.LastDateTime).TotalSeconds > CommonPage.ReadDeviceStatuSpan) - { + //if ((DateTime.Now - ac.LastDateTime).TotalSeconds > CommonPage.ReadDeviceStatuSpan) + //{ ReadDeviceAttributeLogic.Instance.SendACStatuComand(device.CommonDevice); - } + //} } var de = Shared.Common.Room.LoveRoomDeviceUIFilePathList.Find((obj) => obj == device.FileName); diff --git a/ZigbeeApp/Shared/Phone/Device/Category/Category.cs b/ZigbeeApp/Shared/Phone/Device/Category/Category.cs index bff8cca..a9211dd 100644 --- a/ZigbeeApp/Shared/Phone/Device/Category/Category.cs +++ b/ZigbeeApp/Shared/Phone/Device/Category/Category.cs @@ -345,7 +345,20 @@ { var dimmableLight = deviceUI.CommonDevice as DimmableLight; dimmableLight.DeviceStatusReport = common.DeviceStatusReport; - //璁板綍銆佹洿鏂扮姸鎬� + if (dimmableLight.DeviceStatusReport.AttriBute == null || dimmableLight.DeviceStatusReport.AttriBute.Count == 0) + { + continue; + } + dimmableLight.OnOffStatus = dimmableLight.DeviceStatusReport.AttriBute[0].AttriButeData; + var row = rowLayout.GetChildren(0) as CategoryFunctionRow; + row.SetStatu(dimmableLight.OnOffStatus == 1); + row.SetStatuText(deviceUI.GetDeviceStatu()); + dimmableLight.LastDateTime = DateTime.Now; + } + if (common.DeviceStatusReport.CluterID == 8) + { + var dimmableLight = deviceUI.CommonDevice as DimmableLight; + dimmableLight.DeviceStatusReport = common.DeviceStatusReport; if (dimmableLight.DeviceStatusReport.AttriBute == null || dimmableLight.DeviceStatusReport.AttriBute.Count == 0) { continue; @@ -876,7 +889,7 @@ { var alert = new CustomAlert(); AddChidren(alert); - alert.Show(Language.StringByID(R.MyInternationalizationString.ConfirmDelete)); + alert.Show(Language.StringByID(R.MyInternationalizationString.DeleteFunction)); alert.ResultEventHandler += (e2) => { if (e2) @@ -1299,7 +1312,7 @@ Tag = deviceUI, Radius = 0 }; - var delBtn = new Device.CommonForm.RowLayoutDeleteButton() + var delBtn = new CommonForm.RowLayoutDeleteButton() { Tag = deviceUI, Radius = 0 @@ -1675,57 +1688,53 @@ /// GetDelayScene /// </summary> /// <param name="scrolViewLayout"></param> - private void GetDelayScene(VerticalScrolViewLayout scrolViewLayout) + private async void GetDelayScene(VerticalScrolViewLayout scrolViewLayout) { - new System.Threading.Thread(async () => + var catDelaySceneResponseAllData = await Scene.CatDelaySceneAsync(); + if (catDelaySceneResponseAllData == null) { - var catDelaySceneResponseAllData = await Scene.CatDelaySceneAsync(); - if (catDelaySceneResponseAllData == null) - { - return; - } - var catDelaySceneResponseData = catDelaySceneResponseAllData.catDelaySceneResponseData; - if (catDelaySceneResponseData == null || catDelaySceneResponseData.DelayScenesList.Count == 0) - { - return; - } - var delayList = catDelaySceneResponseData.DelayScenesList; + return; + } + var catDelaySceneResponseData = catDelaySceneResponseAllData.catDelaySceneResponseData; + if (catDelaySceneResponseData == null || catDelaySceneResponseData.DelayScenesList.Count == 0) + { + return; + } + var delayList = catDelaySceneResponseData.DelayScenesList; - Application.RunOnMainThread(() => + for (int i = 0; scrolViewLayout != null && i < scrolViewLayout.ChildrenCount; i++) + { + var sceneView = scrolViewLayout.GetChildren(i) as SceneCategoryView; + foreach (var delayScenesListResponseInfo in delayList) { - for (int i = 0; scrolViewLayout != null && i < scrolViewLayout.ChildrenCount; i++) + if (delayScenesListResponseInfo.ScenesId == sceneView.scene.Id) { - var sceneView = scrolViewLayout.GetChildren(i) as SceneCategoryView; - foreach (var delayScenesListResponseInfo in delayList) + sceneView.scene.RemainTime = delayScenesListResponseInfo.RemainTime; + var remainTime= delayScenesListResponseInfo.RemainTime; + if (remainTime > 0) { - if (delayScenesListResponseInfo.ScenesId == sceneView.scene.Id) + new System.Threading.Thread(() => { - sceneView.scene.RemainTime = delayScenesListResponseInfo.RemainTime; - new System.Threading.Thread(() => + while (remainTime-- > 0) { - while (sceneView.scene.RemainTime > 0) - { - System.Threading.Thread.Sleep(1000); - Application.RunOnMainThread(() => - { - sceneView.SetTimeText(CommonFormResouce.GetTimeString(sceneView.scene.RemainTime)); - }); - sceneView.scene.RemainTime -= 1; - } + System.Threading.Thread.Sleep(1000); Application.RunOnMainThread(() => { - sceneView.SetTimeImage(); + sceneView.SetTimeText(CommonFormResouce.GetTimeString(remainTime)); }); - }) - { IsBackground = true }.Start(); - - break; - } + } + Application.RunOnMainThread(() => + { + sceneView.scene.RemainTime = 0; + sceneView.SetTimeImage(); + }); + }) + { IsBackground = true }.Start(); } + break; } - }); - }) - { IsBackground = true }.Start(); + } + } } /// <summary> diff --git a/ZigbeeApp/Shared/Phone/Device/CommonForm/CategoryFunctionForWinRow.cs b/ZigbeeApp/Shared/Phone/Device/CommonForm/CategoryFunctionForWinRow.cs index 6a94c98..d31b0e0 100644 --- a/ZigbeeApp/Shared/Phone/Device/CommonForm/CategoryFunctionForWinRow.cs +++ b/ZigbeeApp/Shared/Phone/Device/CommonForm/CategoryFunctionForWinRow.cs @@ -111,7 +111,7 @@ { X = Application.GetRealWidth(181), Y = Application.GetRealHeight(14), - Width = Application.GetRealWidth(400), + Width = Application.GetRealWidth(600), Height = Application.GetRealHeight(58), TextColor = ZigbeeColor.Current.GXCTextBlackColor, SelectedTextColor = ZigbeeColor.Current.GXCTextSelectedColor, diff --git a/ZigbeeApp/Shared/Phone/Device/CommonForm/CategoryFunctionRow.cs b/ZigbeeApp/Shared/Phone/Device/CommonForm/CategoryFunctionRow.cs index c86f41d..b73178f 100644 --- a/ZigbeeApp/Shared/Phone/Device/CommonForm/CategoryFunctionRow.cs +++ b/ZigbeeApp/Shared/Phone/Device/CommonForm/CategoryFunctionRow.cs @@ -105,7 +105,7 @@ { X = Application.GetRealWidth(181), Y = Application.GetRealHeight(14), - Width = Application.GetRealWidth(400), + Width = Application.GetRealWidth(600), Height = Application.GetRealHeight(58), TextColor = ZigbeeColor.Current.GXCTextBlackColor, SelectedTextColor = ZigbeeColor.Current.GXCTextSelectedColor, diff --git a/ZigbeeApp/Shared/Phone/Device/DeviceLogic/ReadDeviceAttributeLogic.cs b/ZigbeeApp/Shared/Phone/Device/DeviceLogic/ReadDeviceAttributeLogic.cs index 97bfe44..56b3416 100644 --- a/ZigbeeApp/Shared/Phone/Device/DeviceLogic/ReadDeviceAttributeLogic.cs +++ b/ZigbeeApp/Shared/Phone/Device/DeviceLogic/ReadDeviceAttributeLogic.cs @@ -35,8 +35,15 @@ /// <param name="device">璁惧</param> public void SendACStatuComand(CommonDevice device) { - SendThermostatStatuComand(device); - SendFanStatuComand(device); + new System.Threading.Thread(() => + { + SendFanStatuComand(device); + System.Console.WriteLine("鍙戦�佹椂闂�:" + DateTime.Now.ToString("o")); + System.Threading.Thread.Sleep(500); + SendThermostatStatuComand(device); + System.Console.WriteLine("鎺ユ敹鏃堕棿:" + DateTime.Now.ToString("o")); + }) + { IsBackground = true }.Start(); } /// <summary> @@ -165,8 +172,13 @@ /// <param name="device"></param> public void SendDimmableLightStatuComand(CommonDevice device) { - SendSwitchStatuComand(device); - SendLevelStatuComand(device); + new System.Threading.Thread(() => + { + SendSwitchStatuComand(device); + System.Threading.Thread.Sleep(300); + SendLevelStatuComand(device); + }) + { IsBackground = true }.Start(); } /// <summary> diff --git a/ZigbeeApp/Shared/Phone/Device/Light/AirSwitchControl.cs b/ZigbeeApp/Shared/Phone/Device/Light/AirSwitchControl.cs index 87d0d18..1c0e296 100644 --- a/ZigbeeApp/Shared/Phone/Device/Light/AirSwitchControl.cs +++ b/ZigbeeApp/Shared/Phone/Device/Light/AirSwitchControl.cs @@ -318,7 +318,7 @@ Height = Application.GetRealHeight(60), Gravity = Gravity.CenterHorizontal, TextColor = ZigbeeColor.Current.GXCTextGrayColor, - Text = CommonFormResouce.GetSwitchStatu(device.CommonDevice.IsOnline == 1) + Text = CommonFormResouce.GetSwitchStatu((device.CommonDevice as ZigBee.Device.AirSwitch).OnOffStatus == 1) }; itemView.AddChidren(StatuBtn); diff --git a/ZigbeeApp/Shared/Phone/Device/Light/DimmableLightControl.cs b/ZigbeeApp/Shared/Phone/Device/Light/DimmableLightControl.cs index 6d52a0a..472ec29 100644 --- a/ZigbeeApp/Shared/Phone/Device/Light/DimmableLightControl.cs +++ b/ZigbeeApp/Shared/Phone/Device/Light/DimmableLightControl.cs @@ -126,10 +126,10 @@ } if (deviceUI.CommonDevice.Type == DeviceType.DimmableLight) { - if ((common as DimmableLight).DeviceStatusReport.CluterID == 6) + if (common.DeviceStatusReport.CluterID == 6) { dimmableLight = deviceUI.CommonDevice as DimmableLight; - dimmableLight.DeviceStatusReport = (common as DimmableLight).DeviceStatusReport; + dimmableLight.DeviceStatusReport = common.DeviceStatusReport; //璁板綍銆佹洿鏂扮姸鎬� if (dimmableLight.DeviceStatusReport.AttriBute == null || dimmableLight.DeviceStatusReport.AttriBute.Count == 0) { @@ -142,20 +142,22 @@ { levelSeekBar.IsClickable = true; levelSeekBar.WaveColor = ZigbeeColor.Current.GXCWaveSeekBarColor; + //levelSeekBar.Progress = 100; } else { levelSeekBar.IsClickable = false; levelSeekBar.WaveColor = ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor; + //levelSeekBar.Progress = 0; } //change color dimmableLight.LastDateTime = DateTime.Now; } //浜害 - if ((common as ZigBee.Device.DimmableLight).DeviceStatusReport.CluterID == 8) + if (common.DeviceStatusReport.CluterID == 8) { dimmableLight = deviceUI.CommonDevice as ZigBee.Device.DimmableLight; - dimmableLight.DeviceStatusReport = (common as ZigBee.Device.DimmableLight).DeviceStatusReport; + dimmableLight.DeviceStatusReport = common.DeviceStatusReport; var attriButeList = dimmableLight.DeviceStatusReport.AttriBute; if (attriButeList == null || attriButeList.Count == 0) { @@ -375,7 +377,7 @@ Height = Application.GetRealHeight(60), Gravity = Gravity.CenterHorizontal, TextColor = ZigbeeColor.Current.GXCTextGrayColor, - Text = CommonFormResouce.GetSwitchStatu(device.CommonDevice.IsOnline == 1) + Text = CommonFormResouce.GetSwitchStatu((device.CommonDevice as DimmableLight).OnOffStatus == 1) }; itemView.AddChidren(StatuBtn); @@ -405,7 +407,7 @@ levelSeekBar.OnProgressChangedEvent += (send2, e2) => { - dimmableLight.SetLevel((int)(levelSeekBar.Progress*MaxLevel/100.0)); + dimmableLight.SetLevel((int)(levelSeekBar.Progress * MaxLevel / 100.0)); }; switchBtn = new Button() diff --git a/ZigbeeApp/Shared/Phone/Device/Light/LightControl.cs b/ZigbeeApp/Shared/Phone/Device/Light/LightControl.cs index 076661e..ed3cd89 100644 --- a/ZigbeeApp/Shared/Phone/Device/Light/LightControl.cs +++ b/ZigbeeApp/Shared/Phone/Device/Light/LightControl.cs @@ -166,7 +166,7 @@ return; } deviceUI.CommonDevice.IsOnline = common.IsOnline; - deviceIMG.IsSelected = switchBtn.IsSelected = deviceUI.CommonDevice.IsOnline == 1; + //deviceIMG.IsSelected = switchBtn.IsSelected = deviceUI.CommonDevice.IsOnline == 1; deviceUI.CommonDevice.LastDateTime = DateTime.Now; } catch (Exception ex) @@ -341,7 +341,7 @@ Height = Application.GetRealHeight(60), Gravity = Gravity.CenterHorizontal, TextColor = ZigbeeColor.Current.GXCTextGrayColor, - Text=CommonFormResouce.GetSwitchStatu(device.CommonDevice.IsOnline==1) + Text=CommonFormResouce.GetSwitchStatu((device.CommonDevice as ToggleLight).OnOffStatus == 1) }; itemView.AddChidren(StatuBtn); diff --git a/ZigbeeApp/Shared/Phone/Device/Light/OnOffControl.cs b/ZigbeeApp/Shared/Phone/Device/Light/OnOffControl.cs index 8ce7c2b..047aa8b 100644 --- a/ZigbeeApp/Shared/Phone/Device/Light/OnOffControl.cs +++ b/ZigbeeApp/Shared/Phone/Device/Light/OnOffControl.cs @@ -174,7 +174,7 @@ return; } deviceUI.CommonDevice.IsOnline = common.IsOnline; - OnBtn.IsSelected = OffBtn.IsSelected= deviceUI.CommonDevice.IsOnline == 1; + //OnBtn.IsSelected = OffBtn.IsSelected= deviceUI.CommonDevice.IsOnline == 1; deviceUI.CommonDevice.LastDateTime = DateTime.Now; } catch (Exception ex) @@ -348,7 +348,7 @@ Height = Application.GetRealHeight(60), Gravity = Gravity.CenterHorizontal, TextColor = ZigbeeColor.Current.GXCTextGrayColor, - Text = CommonFormResouce.GetSwitchStatu(device.CommonDevice.IsOnline == 1) + Text = CommonFormResouce.GetSwitchStatu((device.CommonDevice as ToggleLight).OnOffStatus == 1) }; itemView.AddChidren(StatuBtn); diff --git a/ZigbeeApp/Shared/Phone/Device/Light/PlugControl.cs b/ZigbeeApp/Shared/Phone/Device/Light/PlugControl.cs index d8ca61a..0e6a0af 100644 --- a/ZigbeeApp/Shared/Phone/Device/Light/PlugControl.cs +++ b/ZigbeeApp/Shared/Phone/Device/Light/PlugControl.cs @@ -167,7 +167,7 @@ return; } deviceUI.CommonDevice.IsOnline = common.IsOnline; - deviceIMG.IsSelected = switchBtn.IsSelected = deviceUI.CommonDevice.IsOnline == 1; + //deviceIMG.IsSelected = switchBtn.IsSelected = deviceUI.CommonDevice.IsOnline == 1; deviceUI.CommonDevice.LastDateTime = DateTime.Now; } catch (Exception ex) @@ -341,7 +341,7 @@ Height = Application.GetRealHeight(60), Gravity = Gravity.CenterHorizontal, TextColor = ZigbeeColor.Current.GXCTextGrayColor, - Text = CommonFormResouce.GetSwitchStatu(device.CommonDevice.IsOnline == 1) + Text = CommonFormResouce.GetSwitchStatu((device.CommonDevice as ToggleLight).OnOffStatus == 1) }; itemView.AddChidren(StatuBtn); diff --git a/ZigbeeApp/Shared/Phone/UserView/UserHomeView.cs b/ZigbeeApp/Shared/Phone/UserView/UserHomeView.cs index d3163c0..a26095e 100644 --- a/ZigbeeApp/Shared/Phone/UserView/UserHomeView.cs +++ b/ZigbeeApp/Shared/Phone/UserView/UserHomeView.cs @@ -1696,63 +1696,59 @@ /// GetDelayScene /// </summary> /// <param name="scrolViewLayout"></param> - private void GetDelayScene(VerticalScrolViewLayout scrolViewLayout) + private async void GetDelayScene(VerticalScrolViewLayout scrolViewLayout) { - new System.Threading.Thread(async () => - { - var catDelaySceneResponseAllData = await Scene.CatDelaySceneAsync(); - if (catDelaySceneResponseAllData == null) - { - return; - } - var catDelaySceneResponseData = catDelaySceneResponseAllData.catDelaySceneResponseData; - if (catDelaySceneResponseData == null || catDelaySceneResponseData.DelayScenesList.Count == 0) - { - return; - } - var delayList = catDelaySceneResponseData.DelayScenesList; - Application.RunOnMainThread(() => + var catDelaySceneResponseAllData = await Scene.CatDelaySceneAsync(); + if (catDelaySceneResponseAllData == null) + { + return; + } + var catDelaySceneResponseData = catDelaySceneResponseAllData.catDelaySceneResponseData; + if (catDelaySceneResponseData == null || catDelaySceneResponseData.DelayScenesList.Count == 0) + { + return; + } + var delayList = catDelaySceneResponseData.DelayScenesList; + + for (int i = 0; scrolViewLayout != null && i < scrolViewLayout.ChildrenCount; i++) + { + var iView = scrolViewLayout.GetChildren(i) as FrameLayout; + for (int j = 0; iView != null && j < iView.ChildrenCount; j++) { - for (int i = 0; scrolViewLayout != null && i < scrolViewLayout.ChildrenCount; i++) + var sceneView = iView.GetChildren(j) as SceneMainView; + foreach (var delayScenesListResponseInfo in delayList) { - var iView = scrolViewLayout.GetChildren(i) as FrameLayout; - for (int j = 0; iView != null && j < iView.ChildrenCount; j++) + if (delayScenesListResponseInfo.ScenesId == sceneView.scene.Id) { - var sceneView = iView.GetChildren(j) as SceneMainView; - foreach (var delayScenesListResponseInfo in delayList) + var remainTime = delayScenesListResponseInfo.RemainTime; + sceneView.scene.RemainTime = remainTime; + + if (remainTime > 0) { - if (delayScenesListResponseInfo.ScenesId == sceneView.scene.Id) + new System.Threading.Thread(() => { - var times = delayScenesListResponseInfo.RemainTime; - sceneView.scene.RemainTime = times; - new System.Threading.Thread(() => + while (remainTime-- > 0) { - while (times > 0) - { - System.Threading.Thread.Sleep(1000); - Application.RunOnMainThread(() => - { - sceneView.SetTimeText(CommonFormResouce.GetTimeString(times)); - }); - times -= 1; - } + System.Threading.Thread.Sleep(1000); Application.RunOnMainThread(() => { - sceneView.SetTimeImage(); + sceneView.SetTimeText(CommonFormResouce.GetTimeString(remainTime)); }); - }) - { IsBackground = true }.Start(); - - break; - } + } + Application.RunOnMainThread(() => + { + sceneView.scene.RemainTime = 0; + sceneView.SetTimeImage(); + }); + }) + { IsBackground = true }.Start(); } - + break; } } - }); - }) - { IsBackground = true }.Start(); + } + } } #endregion diff --git a/ZigbeeApp/Shared/R.cs b/ZigbeeApp/Shared/R.cs index 1a98a1c..640f080 100644 --- a/ZigbeeApp/Shared/R.cs +++ b/ZigbeeApp/Shared/R.cs @@ -904,7 +904,7 @@ /// </summary> public const int Save = 11021; /// <summary> - /// 鎻愮ず + /// 鎻愰啋 /// </summary> public const int TIP = 11022; /// <summary> @@ -951,6 +951,10 @@ /// 閫夋嫨鍦烘櫙鍥剧墖 /// </summary> public const int SelectScenePic = 11033; + /// <summary> + /// 纭畾鍒犻櫎鍚楋紵 + /// </summary> + public const int DeleteFunction = 11034; #region 璁惧绫诲瀷 /// <summary> -- Gitblit v1.8.0