From 24dce73df68f96c4e7ae4ef82658d5fc89f31e0b Mon Sep 17 00:00:00 2001 From: wei <kaede@kaededeMacBook-Air.local> Date: 星期一, 23 八月 2021 09:58:33 +0800 Subject: [PATCH] 1 --- HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs | 18 +- HDL-ON_Android/Properties/AndroidManifest.xml | 2 HDL-ON_iOS/Info.plist | 4 HDL-ON_Android/Assets/Language.ini | 36 ++++ HDL_ON/UI/UI2/3-Intelligence/IntelligencePage.cs | 158 +++++++------------ HDL_ON/Entity/Function/SecurityAlarm.cs | 87 ++++++++++ HDL_ON/UI/UI2/FuntionControlView/ArmCenter/ArmCenterPage.cs | 60 ++++++- .vs/HDL_APP_Project/xs/UserPrefs.xml | 51 ++---- HDL_ON/DAL/DriverLayer/Control.cs | 2 HDL_ON/UI/MainPage.cs | 2 HDL_ON/DAL/Mqtt/MqttClient.cs | 3 HDL_ON/UI/UI1-Login/LoginPage.cs | 4 12 files changed, 266 insertions(+), 161 deletions(-) diff --git a/.vs/HDL_APP_Project/xs/UserPrefs.xml b/.vs/HDL_APP_Project/xs/UserPrefs.xml index 25016f6..30143c6 100644 --- a/.vs/HDL_APP_Project/xs/UserPrefs.xml +++ b/.vs/HDL_APP_Project/xs/UserPrefs.xml @@ -1,63 +1,42 @@ 锘�<Properties StartupConfiguration="{D998E133-F0DD-4760-BE3C-461632F54DA4}|Default"> - <MonoDevelop.Ide.ItemProperties.HDL-ON__iOS PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneDeviceTarget.6242be7109c740c6cb8999a8904b6e0ea8d45192" /> - <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs"> + <MonoDevelop.Ide.ItemProperties.HDL-ON__iOS PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneDeviceTarget.00008020-000404163432002E" /> + <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/UI/UI2/FuntionControlView/ArmCenter/ArmCenterPage.cs"> <Files> - <File FileName="HDL_ON/UI/UI2/3-Intelligence/Scene/SceneEditPage.cs" /> - <File FileName="HDL_ON/DAL/DriverLayer/UdpSocket.cs" /> - <File FileName="HDL_ON/Entity/FunctionList.cs" Line="435" Column="32" /> - <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPage.cs" Line="459" Column="40" /> - <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPageBLL.cs" Line="295" Column="67" /> - <File FileName="HDL_ON/UI/UI2/FuntionControlView/ArmCenter/ArmCenterPage.cs" Line="234" Column="1" /> - <File FileName="HDL_ON/UI/UI2/FuntionControlView/ArmCenter/ArmDeploymentSettingPage.cs" Line="29" Column="16" /> - <File FileName="HDL_ON/UI/UI2/1-HomePage/HomePage.cs" Line="390" Column="52" /> - <File FileName="HDL_ON/UI/UI2/FuntionControlView/ArmCenter/AddAlarmDeploymentPage.cs" Line="154" Column="15" /> - <File FileName="HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs" Line="705" Column="5" /> + <File FileName="HDL_ON/UI/UI2/FuntionControlView/ArmCenter/ArmCenterPage.cs" Line="88" Column="66" /> + <File FileName="HDL_ON/DAL/Mqtt/MqttClient.cs" /> + <File FileName="HDL_ON/Common/ApiUtlis.cs" /> + <File FileName="HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs" /> + <File FileName="HDL_ON/DAL/DriverLayer/Control.cs" /> </Files> <Pads> <Pad Id="ProjectPad"> <State name="__root__"> <Node name="HDL_APP_Project" expanded="True"> <Node name="HDL_ON" expanded="True"> - <Node name="Common" expanded="True"> - <Node name="Utlis" expanded="True" /> - </Node> + <Node name="Common" expanded="True" /> <Node name="DAL" expanded="True"> <Node name="DriverLayer" expanded="True" /> <Node name="Mqtt" expanded="True" /> <Node name="Server" expanded="True" /> + <Node name="ThirdPartySdk" expanded="True" /> </Node> <Node name="Entity" expanded="True"> <Node name="Function" expanded="True" /> </Node> <Node name="UI" expanded="True"> - <Node name="UI0-Public" expanded="True" /> <Node name="UI2" expanded="True"> <Node name="1-HomePage" expanded="True" /> - <Node name="2-Classification" expanded="True"> - <Node name="ClassificationPage.cs" selected="True" /> - </Node> - <Node name="4-PersonalCenter" expanded="True" /> + <Node name="3-Intelligence" expanded="True" /> <Node name="FuntionControlView" expanded="True"> - <Node name="ArmCenter" expanded="True" /> + <Node name="ArmCenter" expanded="True"> + <Node name="ArmCenterPage.cs" selected="True" /> + </Node> </Node> - </Node> - </Node> - </Node> - <Node name="HDL-ON_Android" expanded="True"> - <Node name="Assets" expanded="True"> - <Node name="Phone" expanded="True"> - <Node name="PersonalCenter" expanded="True" /> </Node> </Node> </Node> <Node name="HDL-ON_iOS" expanded="True"> - <Node name="Resources" expanded="True"> - <Node name="Phone" expanded="True"> - <Node name="FunctionIcon" expanded="True"> - <Node name="ArmCenter" expanded="True" /> - </Node> - </Node> - </Node> + <Node name="Resources" expanded="True" /> </Node> </Node> </State> @@ -81,6 +60,8 @@ <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalPage.cs" relfile="HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalPage.cs" line="348" column="1" /> <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/AddDevciePage.cs" relfile="HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/AddDevciePage.cs" line="54" column="1" /> <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/FuntionControlView/Light/RGBPageBLL.cs" relfile="HDL_ON/UI/UI2/FuntionControlView/Light/RGBPageBLL.cs" line="168" column="1" /> + <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/Common/ApiUtlis.cs" relfile="HDL_ON/Common/ApiUtlis.cs" line="391" column="1" /> + <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/FuntionControlView/ArmCenter/ArmCenterPage.cs" relfile="HDL_ON/UI/UI2/FuntionControlView/ArmCenter/ArmCenterPage.cs" line="91" column="1" /> </BreakpointStore> </MonoDevelop.Ide.DebuggingService.Breakpoints> <MultiItemStartupConfigurations /> diff --git a/HDL-ON_Android/Assets/Language.ini b/HDL-ON_Android/Assets/Language.ini index b23332d..853795f 100644 --- a/HDL-ON_Android/Assets/Language.ini +++ b/HDL-ON_Android/Assets/Language.ini @@ -400,7 +400,7 @@ 414=Controller on 415=Someone 416=Log -417=Water Leakage +417=Water leakage 418=In Alarm 419=Normal 420=Hot dry @@ -473,6 +473,20 @@ 485=Check/Modify 486=Defense function / Alarm status 487=Alarm target after triggering +488=Face passage +489=Apply face ID to: +490=Community access control +491=About face ID and privacy +492=Erase data +493=Reset face ID +494=Set face ID +495=Face passage settings +496=There is no associated task deployment status +497=Custom +498=Trigger delay +499=Add defense function +500=Add alarm target +501=Security alarm: {0} is triggered. 1000=Room Humidity @@ -978,7 +992,8 @@ 7144=excellence 7145=Security 7146=Add security -7146=娣诲姞瀹夐槻 + + 9000=Please sign in with new cell phone number. 9001=Please sign in with new email address. @@ -1559,7 +1574,20 @@ 485=鏌ョ湅/淇敼 486=甯冮槻鍔熻兘/鎶ヨ鐘舵�� 487=瑙﹀彂鍚庡憡璀︾洰鏍� - +488=浜鸿劯閫氳 +489=灏嗛潰瀹笽D搴旂敤浜�: +490=绀惧尯闂ㄧ閫氳 +491=鍏充簬闈㈠ID涓庨殣绉� +492=鎶规帀鏁版嵁 +493=閲嶇疆闈㈠ +494=璁剧疆闈㈠ +495=浜鸿劯閫氳璁剧疆 +496=杩樻病鏈夊叧鑱斾换浣曞竷闃茬姸鎬� +497=鑷畾涔� +498=瑙﹀彂寤舵椂 +499=娣诲姞甯冮槻鍔熻兘 +500=娣诲姞鍛婅鐩爣 +501=瀹夐槻鎶ヨ锛歿0}琚Е鍙戙�� 1000=瀹ゅ唴婀垮害 1001=绔ラ攣 @@ -2046,6 +2074,8 @@ 7143=鍋忛珮 7144=浼樼 7145=瀹夐槻 +7146=娣诲姞瀹夐槻 + 9000=璇蜂娇鐢ㄦ柊鐨勬墜鏈鸿处鍙风櫥褰旳PP 9001=璇蜂娇鐢ㄦ柊鐨勯偖绠辫处鍙风櫥褰旳PP diff --git a/HDL-ON_Android/Properties/AndroidManifest.xml b/HDL-ON_Android/Properties/AndroidManifest.xml index 907983d..4ed5671 100644 --- a/HDL-ON_Android/Properties/AndroidManifest.xml +++ b/HDL-ON_Android/Properties/AndroidManifest.xml @@ -1,5 +1,5 @@ 锘�<?xml version="1.0" encoding="utf-8"?> -<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="202108201" android:versionName="1.2.202108201" package="com.hdl.onpro"> +<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="202108211" android:versionName="1.2.202108211" package="com.hdl.onpro"> <uses-sdk android:minSdkVersion="26" android:targetSdkVersion="29" /> <!-- 涔愭鍙瀵硅闇�瑕佺殑鏉冮檺 --> <!--<uses-permission android:name="android.permission.INTERNET" />--> diff --git a/HDL-ON_iOS/Info.plist b/HDL-ON_iOS/Info.plist index 4edb95c..43ba8de 100644 --- a/HDL-ON_iOS/Info.plist +++ b/HDL-ON_iOS/Info.plist @@ -100,9 +100,9 @@ <key>UIStatusBarStyle</key> <string>UIStatusBarStyleLightContent</string> <key>CFBundleShortVersionString</key> - <string>1.2.202108171</string> + <string>1.2.202108211</string> <key>CFBundleVersion</key> - <string>1.2.08171</string> + <string>1.2.08211</string> <key>NSLocationWhenInUseUsageDescription</key> <string>Use geographic location to provide services such as weather</string> <key>NSAppleMusicUsageDescription</key> diff --git a/HDL_ON/DAL/DriverLayer/Control.cs b/HDL_ON/DAL/DriverLayer/Control.cs index bdbbe68..e3d0166 100644 --- a/HDL_ON/DAL/DriverLayer/Control.cs +++ b/HDL_ON/DAL/DriverLayer/Control.cs @@ -639,6 +639,7 @@ Dictionary<string, string> keys = new Dictionary<string, string>(); keys.Add("sid", securityAlarm.sid); keys.Add("status", state); + keys.Add("alarm", securityAlarm.alarm.ToString()); var aLinkData = new AlinkReadFunctionStatusObj() { id = Ins.msg_id.ToString(), @@ -793,6 +794,7 @@ if (updataLocalSecurity != null) { updataLocalSecurity.status = updataSecurity.status; + updataLocalSecurity.alarm = updataSecurity.alarm; } } HomePage.LoadEvent_RefreshSecurityStatus(); diff --git a/HDL_ON/DAL/Mqtt/MqttClient.cs b/HDL_ON/DAL/Mqtt/MqttClient.cs index 1a46ca6..559725c 100644 --- a/HDL_ON/DAL/Mqtt/MqttClient.cs +++ b/HDL_ON/DAL/Mqtt/MqttClient.cs @@ -446,12 +446,12 @@ //瀹夐槻鐘舵�佸彉鍖� else if (topic == $"/user/{MqttInfoConfig.Current.HomeGatewayInfo.gatewayId}/custom/security/status/up") { - MainPage.Log($"瀹夐槻鐘舵�佸彉鍖�"); if (!string.IsNullOrEmpty(DB_ResidenceData.Instance.HomeGateway.aesKey)) { var securityBytes = Securitys.EncryptionService.AesDecryptPayload(e.ApplicationMessage.Payload, DB_ResidenceData.Instance.HomeGateway.aesKey); var securityString = Encoding.UTF8.GetString(securityBytes); var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<SecurityStatusObj>(securityString); + MainPage.Log($"瀹夐槻鐘舵�佸彉鍖栵細{securityString}"); if (temp != null) { @@ -462,6 +462,7 @@ if (updataLocalSecurity != null) { updataLocalSecurity.status = updataSecurity.status; + updataLocalSecurity.alarm = updataSecurity.alarm; } } HomePage.LoadEvent_RefreshSecurityStatus(); diff --git a/HDL_ON/Entity/Function/SecurityAlarm.cs b/HDL_ON/Entity/Function/SecurityAlarm.cs index b226d7e..1ebe9f8 100644 --- a/HDL_ON/Entity/Function/SecurityAlarm.cs +++ b/HDL_ON/Entity/Function/SecurityAlarm.cs @@ -6,6 +6,87 @@ namespace HDL_ON.Entity { + + public class SecurityCenter + { + static SecurityCenter _securityCenter; + + public static SecurityCenter Ins + { + get + { + if (_securityCenter == null) + { + _securityCenter = new SecurityCenter(); + } + return _securityCenter; + } + } + + /// <summary> + /// 甯冮槻涓� + /// </summary> + public bool InDefense + { + get + { + foreach (var temp in FunctionList.List.securities) + { + if (temp.status == "enable") + { + return true; + } + } + return false; + } + } + + /// <summary> + /// 鎶ヨ涓� + /// </summary> + public bool InAlarm + { + get + { + foreach (var temp in FunctionList.List.securities) + { + if (temp.alarm) + { + return true; + } + } + return false; + } + } + + SecurityAlarm _inDefenseMode; + /// <summary> + /// 褰撳墠甯冮槻妯″紡 + /// </summary> + public SecurityAlarm InDefenseMode + { + get + { + if (_inDefenseMode == null) + { + foreach (var temp in FunctionList.List.securities) + { + if (temp.status == "enable") + { + _inDefenseMode = temp; + return _inDefenseMode; + } + } + } + return _inDefenseMode; + } + } + + + } + + + public class SecurityAlarm { public SecurityAlarm() @@ -39,6 +120,10 @@ /// 鎾掗槻:disable /// </summary> public string status = "disable"; + /// <summary> + /// 鎶ヨ鐘舵�� + /// </summary> + public bool alarm = false; /// <summary> /// 绫诲瀷 /// "all"--鍏ㄥ畢甯冮槻锛� @@ -572,6 +657,6 @@ { public string sid; public string status ="disable" ; - public string alarm ="false"; + public bool alarm = false; } } diff --git a/HDL_ON/UI/MainPage.cs b/HDL_ON/UI/MainPage.cs index 1a51f05..2061e25 100644 --- a/HDL_ON/UI/MainPage.cs +++ b/HDL_ON/UI/MainPage.cs @@ -25,7 +25,7 @@ /// <summary> /// 鐗堟湰鍙� /// </summary> - public static string VersionString = "1.2.0820"; + public static string VersionString = "1.2.0821"; ///// <summary> ///// 瀹㈡埛绔被鍨� ///// </summary> diff --git a/HDL_ON/UI/UI1-Login/LoginPage.cs b/HDL_ON/UI/UI1-Login/LoginPage.cs index d3350be..e16d57b 100644 --- a/HDL_ON/UI/UI1-Login/LoginPage.cs +++ b/HDL_ON/UI/UI1-Login/LoginPage.cs @@ -227,10 +227,10 @@ //etAccount.Text = "13415629083"; //etAccount.Text = "13676202754";//宸存灄鏈嶅姟鍣� //etAccount.Text = "13602944661";//kx - //etAccount.Text = "551775569@qq.com";//wcf + etAccount.Text = "551775569@qq.com";//wcf //etAccount.Text = "18666455392";//13375012446//13602944661//tzy 18778381374 //etAccount.Text = "15971583093";//楂樿儨 - etAccount.Text = "15217626103";//鏄嗘槑閲戣寕椤圭洰 + //etAccount.Text = "15217626103";//鏄嗘槑閲戣寕椤圭洰 //etAccount.Text = "18598273624"; } b = !b; diff --git a/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs b/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs index c88f248..4a678e3 100644 --- a/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs +++ b/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs @@ -34,15 +34,15 @@ { if (bodyView != null) { - foreach(var temp in FunctionList.List.securities) - { - if(temp.status == "enable") - { - bodyView.btnSecurityStatus.IsSelected = true; - return; - } - } - bodyView.btnSecurityStatus.IsSelected = false; + //foreach(var temp in FunctionList.List.securities) + //{ + // if(temp.status == "enable") + // { + // bodyView.btnSecurityStatus.IsSelected = true; + // return; + // } + //} + bodyView.btnSecurityStatus.IsSelected = SecurityCenter.Ins.InDefense; } }); } diff --git a/HDL_ON/UI/UI2/3-Intelligence/IntelligencePage.cs b/HDL_ON/UI/UI2/3-Intelligence/IntelligencePage.cs index 6754818..663d170 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/IntelligencePage.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/IntelligencePage.cs @@ -130,20 +130,14 @@ Height = Application.GetMinRealAverage(28), UnSelectedImagePath = "Public/AddIcon.png", }; - //if (!DB_ResidenceData.Instance.CurrentRegion.isOtherShare) - { - topView.AddChidren(btnAddIconBg); - } + topView.AddChidren(btnAddIconBg); btnAddIcon = new Button() { X = Application.GetRealWidth(337 - 20), Width = Application.GetMinRealAverage(28 + 30), Height = Application.GetMinRealAverage(28 + 29), }; - //if (!DB_ResidenceData.Instance.CurrentRegion.isOtherShare) - { - topView.AddChidren(btnAddIcon); - } + topView.AddChidren(btnAddIcon); #endregion contentPageView = new PageLayout() @@ -242,10 +236,7 @@ /// </summary> void LoadSceneFunctionControlZone(List<Scene> listScene) { - //topView.AddChidren(btnAddIcon); - sceneFunctionView.RemoveAll(); - var rowView = new FrameLayout(); try { int index = 0; @@ -260,44 +251,7 @@ } listScene = this.floorRoomSelectView.GetCanShowListScene(); } - foreach (var scene in listScene) - { - //if (scene.roomIds.Count == 0)//濡備綍鍦ㄦ埧闂村凡缁忕Щ闄や簡杩欎釜鍔熻兘锛屽垯鏀惰棌鐣岄潰涔熶笉浼氬啀鏄剧ず - //{ - // scene.collect = false; - // continue; - //} - if (index % 2 == 0) - { - rowView = new FrameLayout() - { - Height = Application.GetRealWidth(122), - }; - sceneFunctionView.AddChidren(rowView); - sceneFunctionView.AddChidren(new Button() - { - Height = Application.GetRealHeight(7 + 7), - }); - } - var functionView_X = Application.GetRealWidth((16 + 164) * (index % 2) + 16); - - var functionView = new FrameLayout() - { - X = functionView_X, - Width = Application.GetRealWidth(164), - Height = Application.GetRealWidth(122), - Tag = scene.sid, - //BackgroundImagePath = (scene as Scene).ImagePath, - }; - rowView.AddChidren(functionView); - //2020-12-03 淇敼鍥剧墖鍔犺浇鏂规硶 - ImageUtlis.Current.LoadLocalOrNetworkImages((scene as Scene).ImagePath, functionView); - - LoadSceneFunctionDiv(functionView, scene); - index++; - } - - if (index == 0) + if (listScene.Count == 0) { var view = new FrameLayout(); sceneFunctionView.AddChidren(view); @@ -323,6 +277,38 @@ }; view.AddChidren(btnNoCollectionTip); } + else + { + var rowView = new FrameLayout(); + new System.Threading.Thread(() => + { + foreach (var scene in listScene) + { + System.Threading.Thread.Sleep(10); + Application.RunOnMainThread(() => + { + if (index % 2 == 0) + { + rowView = new FrameLayout() + { + Height = Application.GetRealWidth(122), + }; + sceneFunctionView.AddChidren(rowView); + sceneFunctionView.AddChidren(new Button() + { + Height = Application.GetRealHeight(7 + 7), + }); + } + var functionView_X = Application.GetRealWidth((16 + 164) * (index % 2) + 16); + + var functionView = LoadSceneFunctionDiv(functionView_X, scene); + rowView.AddChidren(functionView); + index++; + }); + } + }) + { IsBackground = true }.Start(); + } } catch (Exception ex) { @@ -335,8 +321,19 @@ /// <summary> /// 鍔犺浇鍦烘櫙鎺у埗鍗$墖 /// </summary> - void LoadSceneFunctionDiv(FrameLayout view, Scene scene) + //FrameLayout LoadSceneFunctionDiv(FrameLayout view, Scene scene) + FrameLayout LoadSceneFunctionDiv(int functionView_X, Scene scene) { + var view = new FrameLayout() + { + X = functionView_X, + Width = Application.GetRealWidth(164), + Height = Application.GetRealWidth(122), + Tag = scene.sid, + }; + //2020-12-03 淇敼鍥剧墖鍔犺浇鏂规硶 + ImageUtlis.Current.LoadLocalOrNetworkImages(scene.ImagePath, view); + try { Button btnCoverd = new Button() @@ -413,16 +410,20 @@ IsSelected = scene.collect, }; view.AddChidren(btnCollection); - btnCollection.MouseUpEventHandler = (sender, e) => { + btnCollection.MouseUpEventHandler = (sender, e) => + { scene.collect = btnCollection.IsSelected = !btnCollection.IsSelected; scene.CollectScene(); }; LoadEvent_ControlScene(btnCoverd, btnName, btnZone, btnShowDelay, scene); - btnSettingIcon.MouseUpEventHandler = (sender, e) => { - Action backAction = () => { + btnSettingIcon.MouseUpEventHandler = (sender, e) => + { + Action backAction = () => + { LoadSceneFunctionControlZone(null); }; - Action refreshAction = () => { + Action refreshAction = () => + { btnName.Text = scene.name; btnZone.Text = scene.GetRoomListName(); //2020-12-03 淇敼鍥剧墖鍔犺浇鏂规硶 @@ -436,54 +437,15 @@ //鍦烘櫙姝e湪鍊掕鏃舵墽琛屼腑 scene.SceneCountDown(btnShowDelay); - //if (scene.LastExecutionTime == "" || Convert.ToDouble(scene.LastExecutionTime) + Convert.ToDouble(scene.delay) < Convert.ToDouble(Utlis.GetTimestamp(false))) - //{ - // int time = 0; - // int.TryParse(Convert.ToInt32( - // Convert.ToDouble(scene.LastExecutionTime) + Convert.ToDouble(scene.delay) - Convert.ToDouble(Utlis.GetTimestamp(false)) - // ).ToString(),out time); - // if (time > 0) - // { - // new System.Threading.Thread(() => - // { - // //int time = Convert.ToInt32(scene.delay); - // if (time > 0) - // { - // while (time > 0) - // { - // Application.RunOnMainThread(() => - // { - // if (time / 60 > 1) - // { - // btnShowDelay.Text = (time / 60).ToString() + "min"; - // } - // else - // { - // btnShowDelay.Text = (time--).ToString() + "s"; - // } - // }); - // if (time / 60 > 1) - // { - // System.Threading.Thread.Sleep(time / 60 * 60000); - // } - // else - // { - // System.Threading.Thread.Sleep(1000); - // } - // } - // Application.RunOnMainThread(() => - // { - // btnShowDelay.Text = ""; - // }); - // } - // }) - // { IsBackground = true, Priority = System.Threading.ThreadPriority.BelowNormal }.Start(); - // } - //} + return view; } catch (Exception ex) { MainPage.Log("homepage LoadControlView error : " + ex.Message); + return view; + } + finally + { } } #endregion diff --git a/HDL_ON/UI/UI2/FuntionControlView/ArmCenter/ArmCenterPage.cs b/HDL_ON/UI/UI2/FuntionControlView/ArmCenter/ArmCenterPage.cs index 0e7b6ff..6f1d164 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/ArmCenter/ArmCenterPage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/ArmCenter/ArmCenterPage.cs @@ -15,9 +15,16 @@ /// 鑷畾涔夊竷闃插尯鍩� /// </summary> HorizontalScrolViewLayout customDeploymentView; - + /// <summary> + /// + /// </summary> + FrameLayout alarmIconBgView; //瀹夐槻鐘舵�佽儗鏅浘 Button btnArmTipIcon; + /// <summary> + /// 瀹夐槻璀︽姤鍥炬爣 + /// </summary> + Button btnInalarmIcon; /// <summary> /// 褰撳墠甯冮槻鍚嶇О /// </summary> @@ -55,7 +62,7 @@ Height =Application.GetRealWidth(32), }); - FrameLayout alarmIconBgView = new FrameLayout() + alarmIconBgView = new FrameLayout() { Gravity = Gravity.CenterHorizontal, Width = Application.GetRealWidth(198), @@ -72,6 +79,21 @@ SelectedImagePath = "FunctionIcon/ArmCenter/InDefenseBigIcon.png", }; alarmIconBgView.AddChidren(btnArmTipIcon); + + btnInalarmIcon = new Button() + { + Width = Application.GetRealWidth(198), + Height = Application.GetRealWidth(198), + }; + btnInalarmIcon.MouseUpEventHandler = (sender, e) => { + if(SecurityCenter.Ins.InDefenseMode!= null) + { + SecurityCenter.Ins.InDefenseMode.alarm = false; + Control.Ins.ControlSecurity(SecurityCenter.Ins.InDefenseMode, "enable"); + } + }; + InitAlarmStatus(SecurityCenter.Ins.InAlarm); + btnDefenseName = new Button() { @@ -111,13 +133,17 @@ }; disarmView.AddChidren(btnDisarm); btnDisarm.MouseUpEventHandler = (sender, e) => { - foreach (var temp in FunctionList.List.securities) + //foreach (var temp in FunctionList.List.securities) + //{ + // if (temp.status == "enable") + // { + // Control.Ins.ControlSecurity(temp, "disable"); + // break; + // } + //} + if(SecurityCenter.Ins.InDefenseMode!= null) { - if (temp.status == "enable") - { - Control.Ins.ControlSecurity(temp, "disable"); - break; - } + Control.Ins.ControlSecurity(SecurityCenter.Ins.InDefenseMode, "disable"); } }; @@ -222,6 +248,22 @@ ///鍒锋柊鐣岄潰 LoadEvent_RefreshSecurityStatus(); + } + + public void InitAlarmStatus(bool inAlarm) + { + try + { + if (inAlarm) + { + alarmIconBgView.AddChidren(btnInalarmIcon); + } + else + { + btnInalarmIcon.RemoveFromParent(); + } + } + catch { } } /// <summary> @@ -386,6 +428,8 @@ bodyView.disarmView.Height = Application.GetRealHeight(68); bodyView.btnArmTipIcon.IsSelected = true; bodyView.btnDefenseName.Text = temp.name; + + bodyView.InitAlarmStatus(temp.alarm); break; } } -- Gitblit v1.8.0