From af0269cf1d551fb799784df233d8d9c388c6b18b Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期四, 30 六月 2022 16:02:27 +0800 Subject: [PATCH] 合并可视对讲功能 --- SiriIntents/SiriIntents.csproj | 1 HDL-ON_Android/Properties/AndroidManifest.xml | 2 .idea/OnPro.iml | 9 HDL-ON_iOS/HDL-ON_iOS.csproj | 7 HDL-ON_iOS/Resources/Phone/FunctionIcon/Icon/HomeIcon/sensorhelp_white.png | 0 HDL-ON_iOS/Resources/Phone/Public/MsgIcon/CallIcon.png | 0 HDL-ON_iOS/Resources/Phone/Public/MsgIcon/HangUpIcon.png | 0 HDL_ON/UI/UI2/FuntionControlView/Panel/EnvironmentPanelPage.cs | 174 +++ HDL-ON_iOS/Resources/Phone/FunctionIcon/Panel/PanelHelpNormalBgIcon.png | 0 .idea/vcs.xml | 6 .idea/modules.xml | 8 HDL-ON_iOS/Resources/Phone/FunctionIcon/CAC/DataIcon.png | 0 HDL_ON/UI/UI0-Stan/Form/DeviceFunction4CardCommonForm.cs | 452 +++++++ HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPage.cs | 16 HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/CacDayHistoryPage.cs | 199 +++ HDL-ON_iOS/Resources/Phone/FunctionIcon/Icon/screenpanel.png | 0 HDL-ON_iOS/Resources/Phone/FunctionIcon/CAC/JinMaoIcon.png | 0 HDL_ON/UI/UI2/4-PersonalCenter/Visitor/VisitorHistoryPage.cs | 3 HDL-ON_iOS/Resources/Phone/FunctionIcon/Icon/HomeIcon/sensorhelp_blue.png | 0 HDL-ON_iOS/Resources/Phone/Public/MsgIcon/AnswerIcon.png | 0 HDL_APP_Project.sln | 14 HDL_ON/UI/UI2/4-PersonalCenter/Visitor/LpTipDialogCallBack.cs | 13 HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/CacHistoryChoosePage.cs | 108 + HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs | 33 HDL-ON_iOS/Resources/Phone/FunctionIcon/Icon/HomeIcon/hvaccac_blue.png | 0 HDL_ON/UI/UI2/4-PersonalCenter/Visitor/LpTimeDialogCallBak.cs | 14 HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSensorPage.cs | 5 HDL-ON_iOS/Resources/Phone/FunctionIcon/Icon/HomeIcon/hvaccac_white.png | 0 HDL-ON_iOS/Resources/Phone/Public/dialogBg2.png | 0 HDL_ON/Common/ImageUtlis.cs | 51 HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/CacWeekHistoryPage.cs | 424 +++++++ HDL_ON/DAL/Server/NewAPI.cs | 47 HDL_ON/Entity/Function/Function.cs | 10 HDL_ON/UI/UI2/FuntionControlView/ContentView/AcContentView.cs | 1110 +++++++++++++++++++ HDL_ON/UI/UI2/FuntionControlView/ContentView/FhContentView.cs | 540 +++++++++ HDL-ON_iOS/Resources/Phone/FunctionIcon/Panel/PanelHelpAlarmBgIcon.png | 0 HDL_ON/UI/UI2/4-PersonalCenter/Visitor/VisitorQRCodePage.cs | 39 HDL_ON/UI/UI2/FuntionControlView/Panel/PanelHelpPage.cs | 142 ++ HDL_ON/DAL/Server/HttpServerRequest.cs | 46 HDL-ON_iOS/Resources/Phone/FunctionIcon/Icon/hvaccac.png | 0 HDL-ON_iOS/Resources/Phone/FunctionIcon/Panel/PanelEnviBg.png | 0 HDL-ON_iOS/Resources/Phone/FunctionIcon/Icon/sensorhelp.png | 0 HDL_ON/DAL/ThirdPartySdk/ESOnVideo.cs | 2 43 files changed, 3,379 insertions(+), 96 deletions(-) diff --git a/.idea/OnPro.iml b/.idea/OnPro.iml new file mode 100644 index 0000000..d6ebd48 --- /dev/null +++ b/.idea/OnPro.iml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<module type="JAVA_MODULE" version="4"> + <component name="NewModuleRootManager" inherit-compiler-output="true"> + <exclude-output /> + <content url="file://$MODULE_DIR$" /> + <orderEntry type="inheritedJdk" /> + <orderEntry type="sourceFolder" forTests="false" /> + </component> +</module> \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..36ee694 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="ProjectModuleManager"> + <modules> + <module fileurl="file://$PROJECT_DIR$/.idea/OnPro.iml" filepath="$PROJECT_DIR$/.idea/OnPro.iml" /> + </modules> + </component> +</project> \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="VcsDirectoryMappings"> + <mapping directory="" vcs="Git" /> + </component> +</project> \ No newline at end of file diff --git a/HDL-ON_Android/Properties/AndroidManifest.xml b/HDL-ON_Android/Properties/AndroidManifest.xml index fef2fce..d9ae09a 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:versionName="1.5.9" package="com.hdl.onpro" xmlns:tools="http://schemas.android.com/tools" android:versionCode="202206291"> +<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.5.9" package="com.hdl.onpro" xmlns:tools="http://schemas.android.com/tools" android:versionCode="202206301"> <uses-sdk android:minSdkVersion="26" android:targetSdkVersion="29" /> <!--鍙嬬洘--> <!--<uses-sdk android:minSdkVersion="8"></uses-sdk>--> diff --git a/HDL-ON_iOS/HDL-ON_iOS.csproj b/HDL-ON_iOS/HDL-ON_iOS.csproj index 78e6c1e..56e980e 100644 --- a/HDL-ON_iOS/HDL-ON_iOS.csproj +++ b/HDL-ON_iOS/HDL-ON_iOS.csproj @@ -105,11 +105,14 @@ <Reference Include="Shared.IOS.LCVideoOnSDK"> <HintPath>..\DLL\LC\IOS\Shared.IOS.LCVideoOnSDK.dll</HintPath> </Reference> + <Reference Include="Shared.IOS.HDLSceneSiri"> + <HintPath>..\DLL\IOS\Shared.IOS.HDLSceneSiri.dll</HintPath> + </Reference> <Reference Include="Shared.IOS.HDLLinphoneSDK"> <HintPath>..\DLL\Linphone\iOS\Shared.IOS.HDLLinphoneSDK.dll</HintPath> </Reference> - <Reference Include="Shared.IOS.HDLSceneSiri"> - <HintPath>..\DLL\IOS\Shared.IOS.HDLSceneSiri.dll</HintPath> + <Reference Include="Shared.IOS.HDLFVSDK"> + <HintPath>..\DLL\IOS\Shared.IOS.HDLFVSDK.dll</HintPath> </Reference> </ItemGroup> <ItemGroup> diff --git a/HDL-ON_iOS/Resources/Phone/FunctionIcon/CAC/DataIcon.png b/HDL-ON_iOS/Resources/Phone/FunctionIcon/CAC/DataIcon.png new file mode 100644 index 0000000..9832d06 --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/FunctionIcon/CAC/DataIcon.png Binary files differ diff --git a/HDL-ON_iOS/Resources/Phone/FunctionIcon/CAC/JinMaoIcon.png b/HDL-ON_iOS/Resources/Phone/FunctionIcon/CAC/JinMaoIcon.png new file mode 100644 index 0000000..b5e26bf --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/FunctionIcon/CAC/JinMaoIcon.png Binary files differ diff --git a/HDL-ON_iOS/Resources/Phone/FunctionIcon/Icon/HomeIcon/hvaccac_blue.png b/HDL-ON_iOS/Resources/Phone/FunctionIcon/Icon/HomeIcon/hvaccac_blue.png new file mode 100644 index 0000000..addcd70 --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/FunctionIcon/Icon/HomeIcon/hvaccac_blue.png Binary files differ diff --git a/HDL-ON_iOS/Resources/Phone/FunctionIcon/Icon/HomeIcon/hvaccac_white.png b/HDL-ON_iOS/Resources/Phone/FunctionIcon/Icon/HomeIcon/hvaccac_white.png new file mode 100644 index 0000000..c63e9e3 --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/FunctionIcon/Icon/HomeIcon/hvaccac_white.png Binary files differ diff --git a/HDL-ON_iOS/Resources/Phone/FunctionIcon/Icon/HomeIcon/sensorhelp_blue.png b/HDL-ON_iOS/Resources/Phone/FunctionIcon/Icon/HomeIcon/sensorhelp_blue.png new file mode 100644 index 0000000..7e5e4ac --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/FunctionIcon/Icon/HomeIcon/sensorhelp_blue.png Binary files differ diff --git a/HDL-ON_iOS/Resources/Phone/FunctionIcon/Icon/HomeIcon/sensorhelp_white.png b/HDL-ON_iOS/Resources/Phone/FunctionIcon/Icon/HomeIcon/sensorhelp_white.png new file mode 100644 index 0000000..448b3c8 --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/FunctionIcon/Icon/HomeIcon/sensorhelp_white.png Binary files differ diff --git a/HDL-ON_iOS/Resources/Phone/FunctionIcon/Icon/hvaccac.png b/HDL-ON_iOS/Resources/Phone/FunctionIcon/Icon/hvaccac.png new file mode 100644 index 0000000..5b8b9fa --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/FunctionIcon/Icon/hvaccac.png Binary files differ diff --git a/HDL-ON_iOS/Resources/Phone/FunctionIcon/Icon/screenpanel.png b/HDL-ON_iOS/Resources/Phone/FunctionIcon/Icon/screenpanel.png new file mode 100644 index 0000000..56ba0c5 --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/FunctionIcon/Icon/screenpanel.png Binary files differ diff --git a/HDL-ON_iOS/Resources/Phone/FunctionIcon/Icon/sensorhelp.png b/HDL-ON_iOS/Resources/Phone/FunctionIcon/Icon/sensorhelp.png new file mode 100644 index 0000000..cbb1b1c --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/FunctionIcon/Icon/sensorhelp.png Binary files differ diff --git a/HDL-ON_iOS/Resources/Phone/FunctionIcon/Panel/PanelEnviBg.png b/HDL-ON_iOS/Resources/Phone/FunctionIcon/Panel/PanelEnviBg.png new file mode 100644 index 0000000..d6482d3 --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/FunctionIcon/Panel/PanelEnviBg.png Binary files differ diff --git a/HDL-ON_iOS/Resources/Phone/FunctionIcon/Panel/PanelHelpAlarmBgIcon.png b/HDL-ON_iOS/Resources/Phone/FunctionIcon/Panel/PanelHelpAlarmBgIcon.png new file mode 100644 index 0000000..72ece8b --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/FunctionIcon/Panel/PanelHelpAlarmBgIcon.png Binary files differ diff --git a/HDL-ON_iOS/Resources/Phone/FunctionIcon/Panel/PanelHelpNormalBgIcon.png b/HDL-ON_iOS/Resources/Phone/FunctionIcon/Panel/PanelHelpNormalBgIcon.png new file mode 100644 index 0000000..a55c35e --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/FunctionIcon/Panel/PanelHelpNormalBgIcon.png Binary files differ diff --git a/HDL-ON_iOS/Resources/Phone/Public/MsgIcon/AnswerIcon.png b/HDL-ON_iOS/Resources/Phone/Public/MsgIcon/AnswerIcon.png new file mode 100644 index 0000000..89096a9 --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/Public/MsgIcon/AnswerIcon.png Binary files differ diff --git a/HDL-ON_iOS/Resources/Phone/Public/MsgIcon/CallIcon.png b/HDL-ON_iOS/Resources/Phone/Public/MsgIcon/CallIcon.png new file mode 100644 index 0000000..843101e --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/Public/MsgIcon/CallIcon.png Binary files differ diff --git a/HDL-ON_iOS/Resources/Phone/Public/MsgIcon/HangUpIcon.png b/HDL-ON_iOS/Resources/Phone/Public/MsgIcon/HangUpIcon.png new file mode 100644 index 0000000..e516074 --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/Public/MsgIcon/HangUpIcon.png Binary files differ diff --git a/HDL-ON_iOS/Resources/Phone/Public/dialogBg2.png b/HDL-ON_iOS/Resources/Phone/Public/dialogBg2.png new file mode 100644 index 0000000..2c28530 --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/Public/dialogBg2.png Binary files differ diff --git a/HDL_APP_Project.sln b/HDL_APP_Project.sln index c0bd16f..84800828 100644 --- a/HDL_APP_Project.sln +++ b/HDL_APP_Project.sln @@ -18,8 +18,6 @@ EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UMSdk", "UMSdk\UMSdk.csproj", "{5CD1B2DE-1ABD-4B46-8C97-CCB6EA90346A}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Shared.Droid.HDLLinphone", "Shared.Droid.HDLLinphone\Shared.Droid.HDLLinphone.csproj", "{703D29ED-674F-44A8-8AAD-863035899D4B}" -EndProject Global GlobalSection(SharedMSBuildProjectFiles) = preSolution HDL_ON\HDL_ON.projitems*{09712674-2a38-407b-b1e2-560b2c352f9a}*SharedItemsImports = 4 @@ -121,18 +119,6 @@ {5CD1B2DE-1ABD-4B46-8C97-CCB6EA90346A}.Release|iPhone.Build.0 = Release|Any CPU {5CD1B2DE-1ABD-4B46-8C97-CCB6EA90346A}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU {5CD1B2DE-1ABD-4B46-8C97-CCB6EA90346A}.Release|iPhoneSimulator.Build.0 = Release|Any CPU - {703D29ED-674F-44A8-8AAD-863035899D4B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {703D29ED-674F-44A8-8AAD-863035899D4B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {703D29ED-674F-44A8-8AAD-863035899D4B}.Debug|iPhone.ActiveCfg = Debug|Any CPU - {703D29ED-674F-44A8-8AAD-863035899D4B}.Debug|iPhone.Build.0 = Debug|Any CPU - {703D29ED-674F-44A8-8AAD-863035899D4B}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {703D29ED-674F-44A8-8AAD-863035899D4B}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU - {703D29ED-674F-44A8-8AAD-863035899D4B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {703D29ED-674F-44A8-8AAD-863035899D4B}.Release|Any CPU.Build.0 = Release|Any CPU - {703D29ED-674F-44A8-8AAD-863035899D4B}.Release|iPhone.ActiveCfg = Release|Any CPU - {703D29ED-674F-44A8-8AAD-863035899D4B}.Release|iPhone.Build.0 = Release|Any CPU - {703D29ED-674F-44A8-8AAD-863035899D4B}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU - {703D29ED-674F-44A8-8AAD-863035899D4B}.Release|iPhoneSimulator.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/HDL_ON/Common/ImageUtlis.cs b/HDL_ON/Common/ImageUtlis.cs index 918483d..3b3a486 100644 --- a/HDL_ON/Common/ImageUtlis.cs +++ b/HDL_ON/Common/ImageUtlis.cs @@ -147,9 +147,9 @@ { var requestJson = HttpUtil.GetSignRequestJson(uploadImageObj); var revertObj = HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_UploadImage, requestJson); - if(revertObj.Code == StateCode.SUCCESS) + if (revertObj.Code == StateCode.SUCCESS) { - if(revertObj.Data != null) + if (revertObj.Data != null) { return revertObj.Data.ToString(); } @@ -440,7 +440,7 @@ try { if (string.IsNullOrEmpty(imageKey)) return null; - + byte[] imageBytes; if (!ignoreCache && Exists(imageKey)) { @@ -451,12 +451,12 @@ { //浜戠涓嬭浇 imageBytes = GetImageDownloadUrlWithRegionUrl(imageKey, regionUrl); - if(imageBytes != null) + if (imageBytes != null) { //淇濆瓨鍒版湰鍦� WriteFileByBytes(imageKey, imageBytes); } - + } return imageBytes; } @@ -466,6 +466,47 @@ } } + + + /// <summary> + /// 涓嬭浇鐢ㄦ埛澶村儚 + /// </summary> + /// <param name="imageUrl"></param> + /// <param name="ignoreCache">蹇界暐缂撳瓨</param> + /// <param name="regionUrl">鎸囧畾鏈嶅姟鍣ㄥ煙鍚�,浼犵┖涓轰娇鐢ㄥ綋鍓嶇敤鎴峰湴鍧�</param> + /// <returns></returns> + public byte[] DownImageByImageUrl(string imageUrl, bool ignoreCache = false) + { + try + { + if (string.IsNullOrEmpty(imageUrl)) return null; + + byte[] imageBytes; + if (!ignoreCache && Exists(imageUrl)) + { + //鏈湴鏈夌紦瀛� + imageBytes = ReadFile(imageUrl); + } + else + { + //涓嬭浇 + imageBytes = HttpUtil.HttpsDownload(imageUrl); + if (imageBytes != null) + { + //淇濆瓨鍒版湰鍦� + WriteFileByBytes(imageUrl, imageBytes); + } + + } + return imageBytes; + } + catch + { + return null; + } + } + + #endregion } } diff --git a/HDL_ON/DAL/Server/HttpServerRequest.cs b/HDL_ON/DAL/Server/HttpServerRequest.cs index 8efd6e5..bf89109 100644 --- a/HDL_ON/DAL/Server/HttpServerRequest.cs +++ b/HDL_ON/DAL/Server/HttpServerRequest.cs @@ -5,7 +5,6 @@ using System.Text; using HDL_ON.Entity; using Newtonsoft.Json.Linq; -using Shared; namespace HDL_ON.DAL.Server { @@ -46,13 +45,17 @@ /// <param name="deviceId">璁惧ID</param> /// <param name="deviceKey">鍔熻兘鏌ヨ绫诲瀷锛歱m25</param> /// <returns></returns> - public ResponsePackNew GetSensorHistory(string qType, string deviceId, string deviceKey) + public ResponsePackNew GetSensorHistory(string qType, string deviceId, string deviceKey, string time = "") { Dictionary<string, object> d = new Dictionary<string, object>(); d.Add("type", qType); d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); d.Add("deviceId", deviceId); d.Add("key", deviceKey); + if (time != "") + { + d.Add("time", time); + } var requestJson = HttpUtil.GetSignRequestJson(d); return HttpUtil.RequestHttpsPost(NewAPI.Api_Post_EnvironmentalSensorHistoricalData, requestJson); @@ -1030,10 +1033,10 @@ #endif //鏄惁鐢熶骇妯″紡 bool isProduce = true; -#if DEBUG - isProduce = true; -#endif - + if (HttpUtil.GlobalRequestHttpsHost == "https://test-gz.hdlcontrol.com") + { + isProduce = false; + } if (string.IsNullOrEmpty(OnAppConfig.Instance.PushDeviceToken)) { Utlis.WriteLine("PushDeviceToken 涓虹┖"); @@ -1058,15 +1061,9 @@ //var mAddpushinfoJson = Newtonsoft.Json.JsonConvert.SerializeObject(mAddpushinfoObj); var mAddpushinfoJson = HttpUtil.GetSignRequestJson(mAddpushinfoObj); - - Utlis.WriteLine("mAddpushinfoJson: " + mAddpushinfoJson); - - //new Alert("", , "鍙栨秷", "纭畾").Show(); var revertObj = HttpUtil.RequestHttpsPost(NewAPI.API_POST_PushSerivce_AddToken, mAddpushinfoJson); if (revertObj.Code == StateCode.SUCCESS) { - //new Alert("", "鎻愪氦pushToken鎴愬姛" + OnAppConfig.Instance.PushDeviceToken, "鍙栨秷", "纭畾").Show(); - if (revertObj.Data != null) { var pushId = revertObj.Data.ToString(); @@ -1075,7 +1072,7 @@ OnAppConfig.Instance.PushId = pushId; OnAppConfig.Instance.SaveConfig(); Utlis.WriteLine("PushId: " + pushId); - //new Alert("","鎻愪氦pushToken鎴愬姛"+ OnAppConfig.Instance.PushDeviceToken, "鍙栨秷","纭畾").Show(); + return true; } } @@ -1083,7 +1080,7 @@ } else { - Utlis.WriteLine("AddToken 澶辫触"); + //Utlis.WriteLine("AddToken 澶辫触"); } return false; } @@ -1957,7 +1954,7 @@ /// 鑾峰彇璁惧鍒楄〃 /// </summary> /// <returns></returns> - public ResponsePackNew GetDeviceList(string pageSize="",string pageNo ="") + public ResponsePackNew GetDeviceList(string pageSize = "", string pageNo = "") { Dictionary<string, object> d = new Dictionary<string, object>(); d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); @@ -2624,6 +2621,25 @@ var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_FL_Check, requestJson); return pack; } + /// <summary> + /// 鑾峰彇闂ㄥ彛鏈哄緲寰婃姤璀︽暟鎹� + /// </summary> + /// <param name="deviceId"></param> + /// <returns></returns> + public ResponsePackNew GetAlarmRecords(string deviceId, int pageSize, int pageNo, string alarmType = "PROWLER_ALARM") + { + Dictionary<string, object> d = new Dictionary<string, object>(); + d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); + d.Add("deviceId", deviceId); + d.Add("alarmType", alarmType); + d.Add("pageSize", pageSize); + d.Add("pageNo", pageNo); + var requestJson = HttpUtil.GetSignRequestJson(d); + var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_ALARM_RECORDS, requestJson); + return pack; + + } + #endregion #region 鈻� 闂ㄩ攣鐩稿叧____________________________ diff --git a/HDL_ON/DAL/Server/NewAPI.cs b/HDL_ON/DAL/Server/NewAPI.cs index f4ccb6b..875b8b8 100644 --- a/HDL_ON/DAL/Server/NewAPI.cs +++ b/HDL_ON/DAL/Server/NewAPI.cs @@ -17,22 +17,7 @@ /// 鑾峰彇鍏ㄧ悆鍖哄煙鍒楄〃 鍏嶇櫥褰� /// </summary> public const string API_POST_GlobalRegionList = "/smart-footstone/region/globalRegionList"; - #endregion - - #region 璁垮 - /// <summary> - /// 鐢熸垚涓存椂瀵嗙爜 - /// </summary> - public const string API_POST_ADD_TEMP_PASSWORD = "/community-wisdom/app/visitor/freeview/add"; - /// <summary> - /// 鍒犻櫎涓存椂瀵嗙爜 - /// </summary> - public const string API_POST_DEL_TEMP_PASSWORD = "/community-wisdom/app/visitor/freeview/delete"; - /// <summary> - /// 鑾峰彇涓存椂瀵嗙爜 - /// </summary> - public const string API_POST_GET_TEMP_PASSWORD_LIST = "/community-wisdom/app/visitor/freeview/page"; - #endregion + #endregion #region 鈻� AcCluster -- 鐧诲綍鍜屾敞鍐岄儴鍒哶__________________________ /// <summary> @@ -92,6 +77,21 @@ /// 瑙g粦璁よ瘉(鎵嬫満/閭) /// </summary> public const string API_POST_Member_UnbindWithAccount = "/smart-footstone/member/memberInfo/unbindWithAccount"; + #endregion + + #region 璁垮 + /// <summary> + /// 鐢熸垚涓存椂瀵嗙爜 + /// </summary> + public const string API_POST_ADD_TEMP_PASSWORD = "/community-wisdom/app/visitor/freeview/add"; + /// <summary> + /// 鍒犻櫎涓存椂瀵嗙爜 + /// </summary> + public const string API_POST_DEL_TEMP_PASSWORD = "/community-wisdom/app/visitor/freeview/delete"; + /// <summary> + /// 鑾峰彇涓存椂瀵嗙爜 + /// </summary> + public const string API_POST_GET_TEMP_PASSWORD_LIST = "/community-wisdom/app/visitor/freeview/page"; #endregion /// <summary> @@ -683,6 +683,21 @@ /// 鍔ㄦ�佸瘑鐮�/浜岀淮鐮佸紑閿� /// </summary> public const string API_POST_FL_QRcode = "http://112.74.164.111:180/api.php/Device/setdynamicpwd"; + /// <summary> + /// 涓存椂瀵嗙爜 + /// 浜岀淮鐮� + /// </summary> + public const string API_Post_Temporary_Password = "/home-wisdom/app/freeview/temppwd/add"; + /// <summary> + /// 鑾峰彇闂ㄧ浜岀淮鐮� + /// </summary> + public const string API_POST_OwnerQRCode = "/community-wisdom/doorDevice/getOwnerQRCode"; + /// <summary> + /// 寰樺緤鎶ヨ + /// </summary> + public const string API_POST_ALARM_RECORDS = "/home-wisdom/app/device/alarmRecords/listByPage"; + + #endregion diff --git a/HDL_ON/DAL/ThirdPartySdk/ESOnVideo.cs b/HDL_ON/DAL/ThirdPartySdk/ESOnVideo.cs index 37eb371..700f956 100644 --- a/HDL_ON/DAL/ThirdPartySdk/ESOnVideo.cs +++ b/HDL_ON/DAL/ThirdPartySdk/ESOnVideo.cs @@ -109,7 +109,7 @@ }else if (interphoneType == InterphoneType.HDL.ToString()) { //HDLLinphone 鐙勮�愬厠 - HDLLinphone.Current.ShowESVideoMonitor(mESVideoInfo); + HDLLinphone.Current.ShowESVideoMonitor(mESVideoInfo, interphoneType); ////鍏ㄨ閫� //NSDictionary deviceInfo = new NSDictionary("deviceCode","3-1-11-2", "deviceName", mESVideoInfo.DeviceName); //Shared.IOS.HDLFVSDK.Video.Monitor(deviceInfo); diff --git a/HDL_ON/Entity/Function/Function.cs b/HDL_ON/Entity/Function/Function.cs index 747df45..9c31531 100644 --- a/HDL_ON/Entity/Function/Function.cs +++ b/HDL_ON/Entity/Function/Function.cs @@ -380,7 +380,15 @@ /// <summary> /// 鏄惁鍦ㄧ嚎 /// </summary> - public bool online = true; + public bool online { + get + { + return true; + } + set { + + } + } /// <summary> /// 鐜闈㈡澘 缁戝畾鐨� 璁惧鐩爣sid鍒楄〃 diff --git a/HDL_ON/UI/UI0-Stan/Form/DeviceFunction4CardCommonForm.cs b/HDL_ON/UI/UI0-Stan/Form/DeviceFunction4CardCommonForm.cs new file mode 100644 index 0000000..dacaea3 --- /dev/null +++ b/HDL_ON/UI/UI0-Stan/Form/DeviceFunction4CardCommonForm.cs @@ -0,0 +1,452 @@ +锘縰sing HDL_ON.Entity; +using HDL_ON.UI.CSS; +using Shared; +using System; +using System.Collections.Generic; +using System.Text; + +namespace HDL_ON.Stan +{ + /// <summary> + /// 璁惧鍔熻兘鍗$墖鐨勫簳灞傜晫闈� + /// </summary> + public class DeviceFunction4CardCommonForm : EditorCommonForm + { + #region 鈻� 鍙橀噺澹版槑___________________________ + + /// <summary> + /// 褰撳墠鍥炶矾瀵硅薄 + /// </summary> + public Function device = null; + /// <summary> + /// 鍙充笂瑙掗厤缃粨鏉熺殑浜嬩欢 + /// </summary> + public Action SettionFinishEvent = null; + /// <summary> + /// 宸﹀彸缈婚〉鐨勬帶浠剁殑浜嬩欢 + /// </summary> + public Action<int> PageChangeEvent = null; + /// <summary> + /// 宸﹀彸鏁翠釜缈婚〉鐨勬帶浠� + /// </summary> + private PageLayout pageLayout = null; + /// <summary> + /// 璁惧鍚嶅瓧鎺т欢(鍒锋柊鐢ㄥ埌) + /// </summary> + public NormalViewControl btnDeviceName = null; + /// <summary> + /// 鎴块棿鍚嶅瓧鎺т欢(鍒锋柊鐢ㄥ埌) + /// </summary> + public NormalViewControl btnRoomName = null; + /// <summary> + /// 搴曢儴蹇嵎鎸夐挳1 + /// </summary> + private NormalViewControl btnBottomOne = null; + /// <summary> + /// 搴曢儴蹇嵎鎸夐挳2 + /// </summary> + private NormalViewControl btnBottomTwo = null; + private NormalViewControl btnBottom3 = null; + private NormalViewControl btnBottom4 = null; + /// <summary> + /// 绗竴绱㈠紩鐨勭櫧鑹插尯鍩熺殑妗屽竷鎺т欢 + /// </summary> + public NormalFrameLayout FrameWhiteCentet1 = null; + /// <summary> + /// 绗簩绱㈠紩鐨勭櫧鑹插尯鍩熺殑妗屽竷鎺т欢(璇峰厛璋冪敤AddSecondPage鍑芥暟瀹屾垚娣诲姞) + /// </summary> + public NormalFrameLayout FrameWhiteCentet2 = null; + public NormalFrameLayout FrameWhiteCentet3 = null; + public NormalFrameLayout FrameWhiteCentet4 = null; + + /// <summary> + /// 鏄惁鏄剧ず鏀惰棌鎸夐挳 + /// </summary> + public bool ShowColltionButton = true; + #endregion + + #region 鈻� 鍒濆鍖朹____________________________ + + /// <summary> + /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓) + /// </summary> + /// <param name="i_device">璁惧瀵硅薄</param> + /// <param name="btnHigherCollection">涓婁竴绾х晫闈㈢殑鏀惰棌鎺т欢(鍘熸潵on鐨勬鏋跺お鍧�)</param> + /// <param name="btnHigherDeviceName">涓婁竴绾х晫闈㈢殑璁惧鍚嶅瓧鎺т欢(鍘熸潵on鐨勬鏋跺お鍧�)</param> + /// <param name="btnHigherRoom">涓婁竴绾х晫闈㈢殑鎴块棿鍚嶅瓧鎺т欢(鍘熸潵on鐨勬鏋跺お鍧�)</param> + public void ShowForm(Function i_device, Button btnHigherCollection, Button btnHigherDeviceName, Button btnHigherRoom) + { + this.device = i_device; + + //娣诲姞澶撮儴銆愯缃�戝浘鏍� + this.AddTopSettingIcon(btnHigherDeviceName, btnHigherRoom); + + //鍒濆鍖栦腑閮ㄤ俊鎭� + this.InitMiddleFrame(btnHigherCollection); + } + + /// <summary> + /// 鍒濆鍖栦腑閮ㄤ俊鎭� + /// </summary> + /// <param name="btnHigherCollection">涓婁竴绾х晫闈㈢殑鏀惰棌鎺т欢</param> + private void InitMiddleFrame(Button btnHigherCollection) + { + //娓呯┖bodyFrame + this.ClearBodyFrame(); + + //宸﹀彸鏁翠釜缈婚〉鐨勬帶浠� + this.pageLayout = new PageLayout(); + pageLayout.IsShowPoint = false; + pageLayout.ScrollEnabled = false; + bodyFrameLayout.AddChidren(pageLayout); + pageLayout.PageChange += (sender, index) => + { + //璁剧疆搴曢儴涓や釜鎸夐挳鐨勭姸鎬� + this.SetBottomTwoButtonStatu(); + this.PageChangeEvent?.Invoke(index); + }; + + //鍒濆鍖栫涓�涓储寮曠殑妗屽竷 + this.InitFrameWhiteContent1(btnHigherCollection); + //鍒濆鍖栫櫧鑹插唴瀹�(闇�瑕佽嚜涓诲疄鐜�) + this.InitFrameWhiteContent(); + } + + /// <summary> + /// 鍒濆鍖栫涓�涓储寮曠殑妗屽竷 + /// </summary> + /// <param name="btnHigherCollection">涓婁竴绾х晫闈㈢殑鏀惰棌鎺т欢</param> + private void InitFrameWhiteContent1(Button btnHigherCollection) + { + //绗竴涓储寮曟甯冩槸蹇呭畾瀛樺湪鐨� + var frameTable1 = new FrameLayout(); + frameTable1.Width = pageLayout.Width; + frameTable1.Height = pageLayout.Height; + pageLayout.AddChidren(frameTable1); + //绗竴涓储寮曠殑鐧借壊妗屽竷 + this.FrameWhiteCentet1 = new NormalFrameLayout(); + FrameWhiteCentet1.Gravity = Gravity.CenterHorizontal; + FrameWhiteCentet1.Y = Application.GetRealHeight(22); + FrameWhiteCentet1.Width = Application.GetRealWidth(327); + FrameWhiteCentet1.Height = Application.GetRealHeight(526); + FrameWhiteCentet1.BackgroundImagePath = "Public/Fragmentbg.png"; + frameTable1.AddChidren(FrameWhiteCentet1); + //璁惧鍚嶅瓧 + this.btnDeviceName = new NormalViewControl(270, 37, true); + btnDeviceName.X = Application.GetRealWidth(16); + btnDeviceName.Y = Application.GetRealHeight(18); + btnDeviceName.TextColor = CSS_Color.FirstLevelTitleColor; + btnDeviceName.TextSize = CSS_FontSize.EmphasisFontSize_FirstLevel; + btnDeviceName.Text = device.name; + btnDeviceName.Width = btnDeviceName.GetRealWidthByText(); + FrameWhiteCentet1.AddChidren(btnDeviceName); + //鎴块棿鍚嶅瓧 + this.btnRoomName = new NormalViewControl(270, 21, true); + btnRoomName.X = Application.GetRealWidth(16); + btnRoomName.Y = btnDeviceName.Bottom; + btnRoomName.TextColor = CSS_Color.PromptingColor1; + btnRoomName.TextSize = CSS_FontSize.PromptFontSize_FirstLevel; + btnRoomName.Text = device.GetRoomListName(); + btnRoomName.Width = btnRoomName.GetRealWidthByText(); + FrameWhiteCentet1.AddChidren(btnRoomName); + if (ShowColltionButton) + { + var btnCollection = new IconViewControl(40); + btnCollection.X = Application.GetRealWidth(273); + btnCollection.Y = Application.GetRealHeight(16); + btnCollection.SelectedImagePath = "Collection/CollectionIcon.png"; + btnCollection.UnSelectedImagePath = "Collection/CollectionGrayIcon.png"; + btnCollection.IsSelected = device.collect; + FrameWhiteCentet1.AddChidren(btnCollection); + btnCollection.ButtonClickEvent += (sender, e) => + { + btnCollection.IsSelected = !btnCollection.IsSelected; + device.collect = btnCollection.IsSelected; + btnHigherCollection.IsSelected = device.collect; + + device.CollectFunction(); + }; + } + } + + /// <summary> + /// 鍒濆鍖栫浜屼釜绱㈠紩鐨勬甯� + /// </summary> + private void InitFrameWhiteContent2() + { + this.pageLayout.ScrollEnabled = true; + //绗竴涓储寮曟甯冩槸蹇呭畾瀛樺湪鐨� + var frameTable2 = new FrameLayout(); + frameTable2.Width = pageLayout.Width; + frameTable2.Height = pageLayout.Height; + pageLayout.AddChidren(frameTable2); + //绗竴涓储寮曠殑鐧借壊妗屽竷 + this.FrameWhiteCentet2 = new NormalFrameLayout(); + FrameWhiteCentet2.Gravity = Gravity.CenterHorizontal; + FrameWhiteCentet2.Y = Application.GetRealHeight(22); + FrameWhiteCentet2.Width = Application.GetRealWidth(327); + FrameWhiteCentet2.Height = Application.GetRealHeight(526); + FrameWhiteCentet2.BackgroundImagePath = "Public/Fragmentbg.png"; + frameTable2.AddChidren(FrameWhiteCentet2); + } + + /// <summary> + /// 鍒濆鍖栫3涓储寮曠殑妗屽竷 + /// </summary> + private void InitFrameWhiteContent3() + { + var frameTable3 = new FrameLayout(); + frameTable3.Width = pageLayout.Width; + frameTable3.Height = pageLayout.Height; + pageLayout.AddChidren(frameTable3); + //绗竴涓储寮曠殑鐧借壊妗屽竷 + this.FrameWhiteCentet3 = new NormalFrameLayout(); + FrameWhiteCentet3.Gravity = Gravity.CenterHorizontal; + FrameWhiteCentet3.Y = Application.GetRealHeight(22); + FrameWhiteCentet3.Width = Application.GetRealWidth(327); + FrameWhiteCentet3.Height = Application.GetRealHeight(526); + FrameWhiteCentet3.BackgroundImagePath = "Public/Fragmentbg.png"; + frameTable3.AddChidren(FrameWhiteCentet3); + } + /// <summary> + /// 鍒濆鍖栫4涓储寮曠殑妗屽竷 + /// </summary> + private void InitFrameWhiteContent4() + { + var frameTable4 = new FrameLayout(); + frameTable4.Width = pageLayout.Width; + frameTable4.Height = pageLayout.Height; + pageLayout.AddChidren(frameTable4); + //绗竴涓储寮曠殑鐧借壊妗屽竷 + this.FrameWhiteCentet4 = new NormalFrameLayout(); + FrameWhiteCentet4.Gravity = Gravity.CenterHorizontal; + FrameWhiteCentet4.Y = Application.GetRealHeight(22); + FrameWhiteCentet4.Width = Application.GetRealWidth(327); + FrameWhiteCentet4.Height = Application.GetRealHeight(526); + FrameWhiteCentet4.BackgroundImagePath = "Public/Fragmentbg.png"; + frameTable4.AddChidren(FrameWhiteCentet4); + } + + /// <summary> + /// 鍒濆鍖栫櫧鑹插唴瀹�(闇�瑕佽嚜涓诲疄鐜�) + /// </summary> + public virtual void InitFrameWhiteContent() + { + } + + #endregion + + #region 鈻� 娣诲姞绗簩绱㈠紩椤礯____________________ + + /// <summary> + /// 娣诲姞绗簩绱㈠紩椤� + /// </summary> + public void AddSecondPage() + { + //鍒濆鍖栫浜屼釜绱㈠紩鐨勬甯� + this.InitFrameWhiteContent2(); + + //搴曢儴娣诲姞涓や釜鎸夐挳 + this.btnBottomOne = new NormalViewControl(14, 6, true); + btnBottomOne.X = Application.GetRealWidth(170); + btnBottomOne.Y = FrameWhiteCentet1.Bottom + Application.GetRealHeight(30); + btnBottomOne.BackgroundColor = CSS_Color.MainColor; + btnBottomOne.Radius = (uint)Application.GetRealHeight(6) / 2; + bodyFrameLayout.AddChidren(btnBottomOne); + + this.btnBottomTwo = new NormalViewControl(14, 6, true); + btnBottomTwo.X = btnBottomOne.Right + Application.GetRealWidth(8); + btnBottomTwo.Y = btnBottomOne.Y; + btnBottomTwo.BackgroundColor = 0xffadc7f7; + btnBottomTwo.Radius = (uint)Application.GetRealHeight(6) / 2; + bodyFrameLayout.AddChidren(btnBottomTwo); + + } + + /// <summary> + /// 娣诲姞绗�3绱㈠紩椤� + /// </summary> + public void Add3thPage() + { + this.InitFrameWhiteContent2(); + this.InitFrameWhiteContent3(); + + //搴曢儴娣诲姞涓や釜鎸夐挳 + this.btnBottomOne = new NormalViewControl(14, 6, true); + btnBottomOne.X = Application.GetRealWidth(160); + btnBottomOne.Y = FrameWhiteCentet1.Bottom + Application.GetRealHeight(30); + btnBottomOne.BackgroundColor = CSS_Color.MainColor; + btnBottomOne.Radius = (uint)Application.GetRealHeight(6) / 2; + bodyFrameLayout.AddChidren(btnBottomOne); + this.btnBottomTwo = new NormalViewControl(14, 6, true); + btnBottomTwo.X = btnBottomOne.Right + Application.GetRealWidth(8); + btnBottomTwo.Y = btnBottomOne.Y; + btnBottomTwo.BackgroundColor = 0xffadc7f7; + btnBottomTwo.Radius = (uint)Application.GetRealHeight(6) / 2; + bodyFrameLayout.AddChidren(btnBottomTwo); + this.btnBottom3 = new NormalViewControl(14, 6, true); + btnBottom3.X = btnBottomTwo.Right + Application.GetRealWidth(8); + btnBottom3.Y = btnBottomTwo.Y; + btnBottom3.BackgroundColor = 0xffadc7f7; + btnBottom3.Radius = (uint)Application.GetRealHeight(6) / 2; + bodyFrameLayout.AddChidren(btnBottom3); + } + /// <summary> + /// 娣诲姞绗�3绱㈠紩椤� + /// </summary> + public void Add4Page() + { + this.InitFrameWhiteContent2(); + this.InitFrameWhiteContent3(); + this.InitFrameWhiteContent4(); + + //搴曢儴娣诲姞涓や釜鎸夐挳 + this.btnBottomOne = new NormalViewControl(14, 6, true); + btnBottomOne.X = Application.GetRealWidth(150); + btnBottomOne.Y = FrameWhiteCentet1.Bottom + Application.GetRealHeight(30); + btnBottomOne.BackgroundColor = CSS_Color.MainColor; + btnBottomOne.Radius = (uint)Application.GetRealHeight(6) / 2; + bodyFrameLayout.AddChidren(btnBottomOne); + this.btnBottomTwo = new NormalViewControl(14, 6, true); + btnBottomTwo.X = btnBottomOne.Right + Application.GetRealWidth(8); + btnBottomTwo.Y = btnBottomOne.Y; + btnBottomTwo.BackgroundColor = 0xffadc7f7; + btnBottomTwo.Radius = (uint)Application.GetRealHeight(6) / 2; + bodyFrameLayout.AddChidren(btnBottomTwo); + this.btnBottom3 = new NormalViewControl(14, 6, true); + btnBottom3.X = btnBottomTwo.Right + Application.GetRealWidth(8); + btnBottom3.Y = btnBottomTwo.Y; + btnBottom3.BackgroundColor = 0xffadc7f7; + btnBottom3.Radius = (uint)Application.GetRealHeight(6) / 2; + bodyFrameLayout.AddChidren(btnBottom3); + this.btnBottom4 = new NormalViewControl(14, 6, true); + btnBottom4.X = btnBottom3.Right + Application.GetRealWidth(8); + btnBottom4.Y = btnBottom3.Y; + btnBottom4.BackgroundColor = 0xffadc7f7; + btnBottom4.Radius = (uint)Application.GetRealHeight(6) / 2; + bodyFrameLayout.AddChidren(btnBottom4); + } + + + /// <summary> + /// 璁剧疆搴曢儴涓や釜鎸夐挳鐨勭姸鎬� + /// </summary> + private void SetBottomTwoButtonStatu() + { + if (this.btnBottomTwo == null) { return; } + + if (this.pageLayout.PageIndex == 0) + { + this.btnBottomOne.BackgroundColor = CSS_Color.MainColor; + this.btnBottomTwo.BackgroundColor = 0xffadc7f7; + this.btnBottom3.BackgroundColor = 0xffadc7f7; + this.btnBottom4.BackgroundColor = 0xffadc7f7; + } + else if (this.pageLayout.PageIndex == 1) + { + this.btnBottomOne.BackgroundColor = 0xffadc7f7; + this.btnBottomTwo.BackgroundColor = CSS_Color.MainColor; + this.btnBottom3.BackgroundColor = 0xffadc7f7; + this.btnBottom4.BackgroundColor = 0xffadc7f7; + } + else if (this.pageLayout.PageIndex == 2) + { + this.btnBottomOne.BackgroundColor = 0xffadc7f7; + this.btnBottomTwo.BackgroundColor = 0xffadc7f7; + this.btnBottom3.BackgroundColor = CSS_Color.MainColor; + this.btnBottom4.BackgroundColor = 0xffadc7f7; + } + else if (this.pageLayout.PageIndex == 3) + { + this.btnBottomOne.BackgroundColor = 0xffadc7f7; + this.btnBottomTwo.BackgroundColor = 0xffadc7f7; + this.btnBottom4.BackgroundColor = CSS_Color.MainColor; + this.btnBottom3.BackgroundColor = 0xffadc7f7; + } + } + + #endregion + + #region 鈻� 鐣岄潰鍏抽棴___________________________ + + /// <summary> + /// 鐣岄潰鍏抽棴 + /// </summary> + public override void CloseFormBefore() + { + base.CloseFormBefore(); + + this.SettionFinishEvent = null; + this.PageChangeEvent = null; + } + + #endregion + + #region 鈻� 涓�鑸柟娉昣__________________________ + + /// <summary> + /// 鑾峰彇澶撮儴鍙宠竟鐨勩�愯缃�戝浘鏍囨帶浠� + /// </summary> + /// <returns></returns> + public PicViewControl GetTopSettingIcon() + { + for (int i = 0; i < topFrameLayout.ChildrenCount; i++) + { + var myView = topFrameLayout.GetChildren(i); + if (myView == null || myView.Name != "btnSetting") + { + continue; + } + return myView as PicViewControl; + } + return null; + } + + /// <summary> + /// 娣诲姞澶撮儴銆愯缃�戠殑鍥炬爣 + /// </summary> + /// <param name="btnHigherCollection">涓婁竴绾х晫闈㈢殑鏀惰棌鎺т欢(鍘熸潵on鐨勬鏋跺お鍧�)</param> + /// <param name="btnHigherDeviceName">涓婁竴绾х晫闈㈢殑璁惧鍚嶅瓧鎺т欢(鍘熸潵on鐨勬鏋跺お鍧�)</param> + private void AddTopSettingIcon(Button btnHigherDeviceName, Button btnHigherRoom) + { + //璁剧疆鍥炬爣(闂ㄩ攣鐣岄潰闇�瑕佸�熺敤杩欎釜鍥炬爣鐨刋杞村拰Y杞�,鎵�浠ュ姞杩涙潵) + var btnSetting = new PicViewControl(28, 28); + btnSetting.X = Application.GetRealWidth(337); + btnSetting.Y = Application.GetRealHeight(9); + btnSetting.UnSelectedImagePath = "Public/FuncInfoSetIcon.png"; + btnSetting.Name = "btnSetting"; + topFrameLayout.AddChidren(btnSetting); + + //濡傛灉鏄垚鍛樻病鏈夊姛鑳� + if (DB_ResidenceData.Instance.CurrentRegion.isOtherShare == true) + { + btnSetting.Visible = false; + } + + btnSetting.ButtonClickEvent += (sender, e) => + { + var infoView = new UI.FunctionBaseInfoSetPage(this.device, () => + { + //鍒锋柊鏄剧ず + btnHigherDeviceName.Text = this.device.name; + btnHigherRoom.Text = this.device.GetRoomListName(); + + //浠庢柊璁$畻瀹藉害 + this.btnDeviceName.Text = btnHigherDeviceName.Text; + this.btnDeviceName.Width = this.btnDeviceName.GetRealWidthByText(); + + this.btnRoomName.Text = btnHigherRoom.Text; + this.btnRoomName.Width = this.btnRoomName.GetRealWidthByText(); + + //鍥炶皟浜嬩欢 + this.SettionFinishEvent?.Invoke(); + }); + MainPage.BasePageView.AddChidren(infoView); + infoView.LoadPage(); + MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; + }; + } + + #endregion + } +} diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPage.cs index 69edf9b..409580a 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPage.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPage.cs @@ -738,17 +738,19 @@ btnisitorVManagementText.MouseUpEventHandler = (sender, e) => { + + +#if __IOS__ + //鍒锋柊鎺ュ彛璇锋眰鎵�闇�瑕佺殑鍙傛暟 + Foundation.NSDictionary info = new Foundation.NSDictionary("regionUrl", HttpUtil.GlobalRequestHttpsHost, "token", UserInfo.Current.LoginTokenString, "appkey", "HDL-HOME-APP-TEST", "secret", "WeJ8TY88vbakCcnvH8G1tDUqzLWY8yss", "refreshToken", UserInfo.Current.RefreshToken); + Shared.IOS.HDLFVSDK.Video.RefreshInfo(info); + //璺宠浆璁垮绠$悊鐣岄潰 + Shared.IOS.HDLFVSDK.Video.ShowVisitorManager(); +#else var page = new VisitorQRCodePage(); MainPage.BasePageView.AddChidren(page); page.LoadPage(); MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; - -#if __IOS__ - //鍒锋柊鎺ュ彛璇锋眰鎵�闇�瑕佺殑鍙傛暟 - NSDictionary info = new NSDictionary("regionUrl", HttpUtil.GlobalRequestHttpsHost, "token", UserInfo.Current.LoginTokenString, "appkey", "HDL-HOME-APP-TEST", "secret", "WeJ8TY88vbakCcnvH8G1tDUqzLWY8yss", "refreshToken", UserInfo.Current.RefreshToken); - Shared.IOS.HDLFVSDK.Video.RefreshInfo(info); - //璺宠浆璁垮绠$悊鐣岄潰 - Shared.IOS.HDLFVSDK.Video.ShowVisitorManager(); #endif }; } diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/Visitor/LpTimeDialogCallBak.cs b/HDL_ON/UI/UI2/4-PersonalCenter/Visitor/LpTimeDialogCallBak.cs index 272cb66..7ce425a 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/Visitor/LpTimeDialogCallBak.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/Visitor/LpTimeDialogCallBak.cs @@ -1,4 +1,5 @@ -锘縰sing System; +锘�#if __Android__ +using System; using Com.Hdl.Hdllinphonesdk.Dialog; using Java.Interop; @@ -24,4 +25,13 @@ action.Invoke(time); } } -} \ No newline at end of file +} +#else + +namespace HDL_ON.UI.UI2.PersonalCenter.Visitor +{ + public class LpTimeDialogCallBak + { + } +} +#endif \ No newline at end of file diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/Visitor/LpTipDialogCallBack.cs b/HDL_ON/UI/UI2/4-PersonalCenter/Visitor/LpTipDialogCallBack.cs index 798b924..1f123d4 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/Visitor/LpTipDialogCallBack.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/Visitor/LpTipDialogCallBack.cs @@ -1,4 +1,6 @@ -锘縰sing System; +锘� +#if __Android__ +using System; using Com.Hdl.Hdllinphonesdk.Dialog; namespace HDL_ON.UI.UI2.PersonalCenter.Visitor { @@ -22,3 +24,12 @@ } } } + +#else +namespace HDL_ON.UI.UI2.PersonalCenter.Visitor +{ + public class LpTipDialogCallBack + { + } +} +#endif \ No newline at end of file diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/Visitor/VisitorHistoryPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/Visitor/VisitorHistoryPage.cs index 4e1dc4d..1efd6aa 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/Visitor/VisitorHistoryPage.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/Visitor/VisitorHistoryPage.cs @@ -101,10 +101,13 @@ itemLayout.AddChidren(btn);//+= (sender, e) btn.MouseUpEventHandler += (sender, e) => { +#if __IOS__ +#else VisitorQRCodePage page = new VisitorQRCodePage(action, temPwd); MainPage.BasePageView.AddChidren(page); page.LoadPage(); MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; +#endif }; bodyScrolView.AddChidren(itemLayout); } diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/Visitor/VisitorQRCodePage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/Visitor/VisitorQRCodePage.cs index aac3c30..f77d5e6 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/Visitor/VisitorQRCodePage.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/Visitor/VisitorQRCodePage.cs @@ -1,4 +1,6 @@ -锘縰sing System; +锘�#if __Android__ + +using System; using HDL_ON.UI.CSS; using Shared; using HDL_ON.DAL.Server; @@ -45,7 +47,7 @@ public void LoadPage() { - #region 椤堕儴瀵艰埅鏍� +#region 椤堕儴瀵艰埅鏍� if (tempPassword == null || tempPassword.id == null) { tempPassword = new VisitorTempPassword(); @@ -71,7 +73,7 @@ bodyView.BackgroundColor = CSS_Color.BackgroundColor; new TopViewDiv(bodyView, Language.StringByID(StringId.VisitorInvitation)).LoadTopView(); } - #endregion +#endregion bodyScrolView = new VerticalScrolViewLayout() { @@ -93,7 +95,7 @@ Height = Application.GetRealHeight(60), }); - #region 鎵嬫満鍙� +#region 鎵嬫満鍙� bodyScrolView.AddChidren(new Button() { Text = Language.StringByID(StringId.PhoneNumber), @@ -129,9 +131,9 @@ Height = Application.GetRealHeight(1), BackgroundColor = CSS_Color.DividingLineColor, }); - #endregion +#endregion - #region 鍔ㄦ�佸瘑鐮� +#region 鍔ㄦ�佸瘑鐮� bodyScrolView.AddChidren(new Button() { Height = Application.GetRealWidth(10), }); bodyScrolView.AddChidren(new Button() { @@ -182,9 +184,9 @@ Height = Application.GetRealHeight(1), BackgroundColor = CSS_Color.DividingLineColor, }); - #endregion +#endregion - #region 浜岀淮鐮佺敓鏁堟椂闂� +#region 浜岀淮鐮佺敓鏁堟椂闂� FrameLayout startLayout = new FrameLayout() { Height = Application.GetRealHeight(40), @@ -256,9 +258,9 @@ BackgroundColor = CSS_Color.DividingLineColor, }); - #endregion +#endregion - #region 浜岀淮鐮佸け鏁堟椂闂� +#region 浜岀淮鐮佸け鏁堟椂闂� FrameLayout endLayout = new FrameLayout() { Height = Application.GetRealHeight(40), @@ -329,9 +331,9 @@ string error = ex.Message; } }; - #endregion +#endregion - #region 浜岀淮鐮� +#region 浜岀淮鐮� bodyScrolView.AddChidren(new Button() { Height = Application.GetRealWidth(33), }); codeLayout = new FrameLayout() { @@ -360,7 +362,7 @@ Visible = false, }; bodyScrolView.AddChidren(codeSaveTipBtn); - #endregion +#endregion bodyScrolView.AddChidren(new Button() { Height = Application.GetRealWidth(28), }); visitorVoucherBtn = new Button() @@ -664,4 +666,13 @@ return pwd; } } -} \ No newline at end of file +} +#else +using Shared; + +namespace HDL_ON.UI.UI2.PersonalCenter.Visitor +{ + public class VisitorQRCodePage : FrameLayout + { } +} +#endif \ No newline at end of file diff --git a/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs b/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs index ca02d57..1902f71 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs @@ -94,23 +94,24 @@ //鍒锋柊鐣岄潰鐘舵�� this.RefreshFormStatu(); //璇诲彇鐘舵�� - new System.Threading.Thread(() => - { - while (true) - { - if(controlTime == DateTime.MinValue) - { - - } - else if (controlTime.AddSeconds(2)<DateTime.Now) - { Control.Ins.SendReadCommand(device); - controlTime = DateTime.MinValue; - } - System.Threading.Thread.Sleep(1000); - } - }) - { IsBackground = true }.Start(); + //new System.Threading.Thread(() => + //{ + // while (true) + // { + // if(controlTime == DateTime.MinValue) + // { + + // } + // else if (controlTime.AddSeconds(2)<DateTime.Now) + // { + // Control.Ins.SendReadCommand(device); + // controlTime = DateTime.MinValue; + // } + // System.Threading.Thread.Sleep(1000); + // } + //}) + //{ IsBackground = true }.Start(); } /// <summary> diff --git a/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/CacDayHistoryPage.cs b/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/CacDayHistoryPage.cs new file mode 100644 index 0000000..4553294 --- /dev/null +++ b/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/CacDayHistoryPage.cs @@ -0,0 +1,199 @@ +锘縰sing System; +using System.Collections.Generic; +using HDL_ON.DAL.Server; +using HDL_ON.Entity; +using HDL_ON.UI.CSS; +using Shared; + +namespace HDL_ON.UI +{ + public class CacDayHistoryPage : FrameLayout + { + CacDayHistoryPage bodyView; + EchartsOption_BrokenLine brokenLine; + MyEchartsViewOn myEchartsView_Line; + string curQueryType = "hour"; + string queryTime; + string functionId; + string time; + public CacDayHistoryPage(string functionId,string queryType, string time) + { + this.time = time; + this.functionId = functionId; + curQueryType = queryType; + bodyView = this; + queryTime = time; + } + + + /// <summary> + /// + /// </summary> + public void InitView() + { + new TopViewDiv(bodyView, Language.StringByID(StringId.StatisticalChart24Hour)).LoadTopView(); + bodyView.BackgroundColor = CSS_Color.BackgroundColor; + + var contentView = new FrameLayout() + { + Y = Application.GetRealHeight(64), + Height = Application.GetRealHeight(603), + }; + bodyView.AddChidren(contentView); + + var btnTitle = new Button() + { + Height = Application.GetRealHeight(60), + TextAlignment = TextAlignment.Center, + TextSize = CSS_FontSize.SubheadingFontSize, + TextColor = CSS_Color.FirstLevelTitleColor, + }; + if(curQueryType == "room_temp") + { + btnTitle.Text = queryTime + "瀹ゅ唴娓╁害鍘嗗彶鏁版嵁"; + } + else + { + btnTitle.Text = queryTime + "瀹ゅ唴婀垮害鍘嗗彶鏁版嵁"; + } + contentView.AddChidren(btnTitle); + + + var historyDataView = new FrameLayout() + { + Gravity = Gravity.CenterHorizontal, + Y = Application.GetRealWidth(52), + Height = Application.GetRealWidth(350), + }; + contentView.AddChidren(historyDataView); + + + brokenLine = new EchartsOption_BrokenLine(); + + myEchartsView_Line = new MyEchartsViewOn() + { + Y = Application.GetRealWidth(10), + Height = Application.GetRealWidth(338), + }; + historyDataView.AddChidren(myEchartsView_Line); + + +#if DEBUG + + //List<string> vs = new List<string>() { + // "1","2","3","4","5","6","7","8","9","10","11","12","13","14" + // }; + //brokenLine.InitXdataText(vs); + //brokenLine.InitYdataText("yData", new List<EnvironmentalSensorHistor>() { + // new EnvironmentalSensorHistor{ fieldName = "1", fieldValue= "23" }, + // new EnvironmentalSensorHistor{ fieldName = "2", fieldValue= "22" }, + // new EnvironmentalSensorHistor{ fieldName = "3", fieldValue= "-11" }, + // new EnvironmentalSensorHistor{ fieldName = "4", fieldValue= "21" }, + // new EnvironmentalSensorHistor{ fieldName = "5", fieldValue= "-41" }, + // new EnvironmentalSensorHistor{ fieldName = "6", fieldValue= "23" }, + // new EnvironmentalSensorHistor{ fieldName = "7", fieldValue= "-31" }, + // new EnvironmentalSensorHistor{ fieldName = "8", fieldValue= "-23" }, + // new EnvironmentalSensorHistor{ fieldName = "9", fieldValue= "-11" }, + // new EnvironmentalSensorHistor{ fieldName = "10", fieldValue= "-21" }, + // new EnvironmentalSensorHistor{ fieldName = "11", fieldValue= "24" }, + // new EnvironmentalSensorHistor{ fieldName = "12", fieldValue= "41" }, + // new EnvironmentalSensorHistor{ fieldName = "13", fieldValue= "32" }, + // new EnvironmentalSensorHistor{ fieldName = "14", fieldValue= "23" } + //}, "#FF9D54"); + //brokenLine.yTitle = "(鈩�)"; + //brokenLine.xTitle = ""; + ////if (curQueryType != "hour") + ////{ + //// brokenLine.xTitle = Language.StringByID(StringId.Date); + ////} + //var opString = brokenLine.InitOption(); + + // myEchartsView_Line.ShowWithOption(opString); + +#endif + LoadMothed_GetHistoryData(); + } + + /// <summary> + /// 璇诲彇鍘嗗彶鏁版嵁 + /// </summary> + void LoadMothed_GetHistoryData() + { + + var loadPage = new Loading() + { + LodingBackgroundColor = 0x88888888, + }; + bodyView.AddChidren(loadPage); + + new System.Threading.Thread(() => + { + try + { + Application.RunOnMainThread(() => + { + loadPage.Start(Language.StringByID(StringId.PleaseWait)); + }); + + var revertObj = new HttpServerRequest().GetSensorHistory("day_hour", functionId, curQueryType,time); + if (revertObj != null) + { + if (revertObj.Code == StateCode.SUCCESS) + { + var revertData = Newtonsoft.Json.JsonConvert.DeserializeObject<List<EnvironmentalSensorHistor>>(revertObj.Data.ToString()); + + List<string> vs = new List<string>(); + if (brokenLine.YvalueText == "") + { + foreach (var data in revertData) + { + vs.Add(data.fieldName); + } + brokenLine.InitXdataText(vs); + } + //if (sr.GetAttribute("ydata") == null) + //{ + // sr.attributes.Add(new FunctionAttributes() { key = "ydata" }); + //} + //sr.SetAttrState("ydata", + brokenLine.InitYdataText("", revertData, "#FF9D54");// + ","); + } + } + brokenLine.yTitle = Language.StringByID(StringId.Uint); + if(curQueryType == "room_temp") + { + brokenLine.yTitle += ":掳C"; + } + else + { + brokenLine.yTitle += ":%"; + } + brokenLine.xTitle = Language.StringByID(StringId.timeMode); + //if (curQueryType != "hour") + //{ + // brokenLine.xTitle = Language.StringByID(StringId.Date); + //} + var opString = brokenLine.InitOption(); + + Application.RunOnMainThread(() => + { + myEchartsView_Line.ShowWithOption(opString); + }); + } + catch (Exception ex) + { + MainPage.Log($"sensor history error : {ex.Message}"); + } + finally + { + Application.RunOnMainThread(() => + { + loadPage.Hide(); + }); + } + }) + { IsBackground = true }.Start(); + } + + } +} diff --git a/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/CacHistoryChoosePage.cs b/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/CacHistoryChoosePage.cs new file mode 100644 index 0000000..d9514ef --- /dev/null +++ b/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/CacHistoryChoosePage.cs @@ -0,0 +1,108 @@ +锘縰sing System; +using HDL_ON.Entity; +using HDL_ON.UI.CSS; +using Shared; +namespace HDL_ON.UI +{ + /// <summary> + /// 娓╂帶鍣ㄥ巻鍙叉暟鎹樉绀洪�夋嫨鐣岄潰 + /// </summary> + public class CacHistoryChoosePage : FrameLayout + { + FrameLayout bodyView; + Function device; + public CacHistoryChoosePage(Function function) + { + device = function; + bodyView = this; + } + + public void InitView() + { + new TopViewDiv(bodyView, Language.StringByID(StringId.Data)).LoadTopView(); + bodyView.BackgroundColor = CSS_Color.BackgroundColor; + + FrameLayout tempView = new FrameLayout() + { + Y = Application.GetRealHeight(64), + Height = Application.GetRealHeight(50), + BackgroundColor = CSS_Color.MainBackgroundColor, + }; + bodyView.AddChidren(tempView); + + Button btnTempRight = new Button() + { + X = Application.GetRealWidth(339), + Gravity = Gravity.CenterVertical, + Width = Application.GetMinRealAverage(16), + Height = Application.GetMinRealAverage(16), + UnSelectedImagePath = "Public/Right.png", + }; + tempView.AddChidren(btnTempRight); + + Button btnTempLine = new Button() + { + Y = Application.GetRealHeight(49), + Gravity = Gravity.CenterHorizontal, + Width = Application.GetRealWidth(343), + Height = Application.GetRealHeight(1), + BackgroundColor = CSS_Color.DividingLineColor + }; + tempView.AddChidren(btnTempLine); + + Button btnTempName = new Button() + { + X = Application.GetRealWidth(16), + TextAlignment = TextAlignment.CenterLeft, + TextColor = CSS_Color.FirstLevelTitleColor, + TextSize = CSS_FontSize.SubheadingFontSize, + TextID = StringId.TemperatureStatistics + }; + tempView.AddChidren(btnTempName); + btnTempName.MouseUpEventHandler = (sender, e) => { + var page = new CacWeekHistoryPage(device, "room_temp"); + MainPage.BasePageView.AddChidren(page); + page.InitView(); + MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; + }; + + + + FrameLayout humidityView = new FrameLayout() + { + Y = Application.GetRealHeight(64 + 50), + Height = Application.GetRealHeight(50), + BackgroundColor = CSS_Color.MainBackgroundColor, + }; + bodyView.AddChidren(humidityView); + + Button btnHumidityRight = new Button() + { + X = Application.GetRealWidth(339), + Gravity = Gravity.CenterVertical, + Width = Application.GetMinRealAverage(16), + Height = Application.GetMinRealAverage(16), + UnSelectedImagePath = "Public/Right.png", + }; + humidityView.AddChidren(btnHumidityRight); + + Button btnHumidityName = new Button() + { + X = Application.GetRealWidth(16), + TextAlignment = TextAlignment.CenterLeft, + TextColor = CSS_Color.FirstLevelTitleColor, + TextSize = CSS_FontSize.SubheadingFontSize, + TextID = StringId.HumidityStatistics + }; + humidityView.AddChidren(btnHumidityName); + btnHumidityName.MouseUpEventHandler = (sender, e) => { + var page = new CacWeekHistoryPage(device, "room_humidity"); + MainPage.BasePageView.AddChidren(page); + page.InitView(); + MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; + }; + + + } + } +} diff --git a/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/CacWeekHistoryPage.cs b/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/CacWeekHistoryPage.cs new file mode 100644 index 0000000..1f5553b --- /dev/null +++ b/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/CacWeekHistoryPage.cs @@ -0,0 +1,424 @@ +锘縰sing System; +using System.Collections.Generic; +using HDL_ON.DAL.Server; +using HDL_ON.Entity; +using HDL_ON.Stan; +using HDL_ON.UI.CSS; +using Shared; + +namespace HDL_ON.UI +{ + public class CacWeekHistoryPage : FrameLayout + { + + CacWeekHistoryPage bodyView; + HorizontalScrolViewLayout dateHorView; + Function device; + /// <summary> + /// 鏁版嵁鏄剧ず绫诲瀷 + /// room_temp 娓╁害 + /// room_humidity 婀垮害 + /// </summary> + string showType; + Dictionary<string, double> dataDic = new Dictionary<string, double>(); + public CacWeekHistoryPage(Function device,string type) + { + bodyView = this; + this.device = device; + showType = type; + BackgroundColor = CSS_Color.BackgroundColor; + } + + public void InitView() + { + if (showType == "room_temp") + { + new TopViewDiv(bodyView, Language.StringByID(StringId.Temp)).LoadTopView(); + } + else + { + new TopViewDiv(bodyView, Language.StringByID(StringId.Humidity)).LoadTopView(); + } + + + + InitContentView(); + } + + + private void InitContentView() + { + FrameLayout contentView = new FrameLayout() + { + Y = Application.GetRealHeight(80), + Gravity = Gravity.CenterHorizontal, + Width = Application.GetRealWidth(343), + Height = Application.GetRealHeight(482), + BackgroundColor = CSS_Color.MainBackgroundColor, + Radius = (uint)Application.GetRealWidth(5) + }; + bodyView.AddChidren(contentView); + + Button btnTitle = new Button() + { + Height = Application.GetRealHeight(60), + TextColor = CSS_Color.FirstLevelTitleColor, + TextSize = CSS_FontSize.TextFontSize, + TextAlignment = TextAlignment.Center, + }; + if (showType == "room_temp") + { + btnTitle.Text = "鏈�杩�7澶╂瘡澶╁钩鍧囧鍐呮俯搴︾粺璁″浘"; + } + else + { + btnTitle.Text = "鏈�杩�7澶╂瘡澶╁钩鍧囧鍐呮箍搴︾粺璁″浘"; + } + contentView.AddChidren(btnTitle); + + FrameLayout dataView = new FrameLayout() + { + Y = Application.GetRealHeight(39), + Gravity = Gravity.CenterHorizontal, + Width = Application.GetRealWidth(293), + Height = Application.GetRealHeight(345 + 30), + }; + contentView.AddChidren(dataView); + + Button btnUnit = new Button() + { + Height = Application.GetRealHeight(15 + 30), + TextAlignment = TextAlignment.CenterLeft, + TextColor = 0xFF43425D, + TextSize = 8, + }; + if (showType == "room_temp") + { + btnUnit.Text = Language.StringByID(StringId.Uint) + "锛氣剝"; + } + else + { + btnUnit.Text = Language.StringByID(StringId.Uint) + "%"; + } + dataView.AddChidren(btnUnit); + +#if DEBUG + //dataDic.Add("0201", 49); + //dataDic.Add("0202", 20); + //dataDic.Add("0203", 10); + //dataDic.Add("0204", 49); + //dataDic.Add("0205", 20); + //dataDic.Add("0206", 20); + //dataDic.Add("0207", 48); + + //dataDic.Add("0201", -20); + //dataDic.Add("0202", -20); + //dataDic.Add("0203", -20); + //dataDic.Add("0204", -48); + //dataDic.Add("0205", -20); + //dataDic.Add("0206", -20); + //dataDic.Add("0207", -20); +#endif + + DataItemView dataShowView = new DataItemView("0",360); + //dataShowView.Height = Application.GetRealHeight(360); + dataShowView.Y = Application.GetRealHeight(30); + + List<string> items = new List<string>() + { + "100","90","80","70","60","50","40","30","20","10","0" + }; + if (showType == "room_temp") + { + items = new List<string>() + { + "50","40","30","20","10","0","-10","-20","-30","-40","-50" + }; + } + int index = 0; + foreach (var item in items) + { + DataItemView dataItemView; + if (item == "0" ) + { + dataItemView = dataShowView; + index++; + } + else + { + dataItemView = new DataItemView(item,30); + dataItemView.Y = ++index * Application.GetRealHeight(30) + Application.GetRealHeight(15); + } + dataItemView.InitView(showType == "room_temp"); + dataView.AddChidren(dataItemView); + } + dateHorView = new HorizontalScrolViewLayout() + { + X = Application.GetRealWidth(48), + Y = dataView.Bottom,// - Application.GetRealHeight(19), + Width = Application.GetRealWidth(267), + Height = Application.GetRealHeight(26), + }; + contentView.AddChidren(dateHorView); + + Button btnTip = new Button() + { + Y = contentView.Bottom + Application.GetRealHeight(28), + Height = Application.GetRealHeight(20), + TextColor = CSS_Color.FirstLevelTitleColor, + TextSize = CSS_FontSize.PromptFontSize_SecondaryLevel, + TextAlignment = TextAlignment.Center, + Text = "*鍙�氳繃鐐瑰嚮鏌卞舰鍥炬煡鐪嬪綋澶�24灏忔椂娓╁害缁熻" + }; + bodyView.AddChidren(btnTip); + + + new System.Threading.Thread(() => + { + + var revertObj = new HttpServerRequest().GetSensorHistory("week", device.deviceId, showType); + if (revertObj.Code == StateCode.SUCCESS) + { + var revertData = Newtonsoft.Json.JsonConvert.DeserializeObject<List<EnvironmentalSensorHistor>>(revertObj.Data.ToString()); + foreach (var reObj in revertData) + { + double value = 0; + try + { + value = Convert.ToDouble(reObj.fieldValue); + } + catch { } + dataDic.Add(reObj.time, value); + } + Application.RunOnMainThread(() => + { + RefrshDataView(dataDic, dataShowView); + RefreshXtext(); + }); + + } + }) + { IsBackground = true }.Start(); + } + + void RefreshXtext() + { + dateHorView.RemoveAll(); + + foreach (var dic in dataDic) + { + FrameLayout dateView = new FrameLayout() + { + Width = Application.GetRealWidth(39), + Height = Application.GetRealHeight(26), + }; + dateHorView.AddChidren(dateView); + + Button btnLineh = new Button() + { + Width = 1, + Height = Application.GetRealHeight(4), + Gravity = Gravity.CenterHorizontal, + BackgroundColor = 0xFFDBDBDB + }; + dateView.AddChidren(btnLineh); + + Button btnDate = new Button() + { + Y = Application.GetRealHeight(12), + Height = Application.GetRealHeight(14), + TextColor = 0xFF43425D, + TextSize = 10, + Text = dic.Key, + }; + try + { + string[] strs = dic.Key.Split(@"/"); + btnDate.Text = strs[1] + "/" + strs[2]; + } + catch { } + dateView.AddChidren(btnDate); + } + + } + + + void RefrshDataView(Dictionary<string,double> dataDic, FrameLayout dataShowView) + { + int valueIndex = 0; + foreach (var data in dataDic) + { + ColumnarView cv = new ColumnarView(device.deviceId,showType, data.Key, data.Value); + cv.X = Application.GetRealWidth(valueIndex * 38 + 25); + cv.InitView(); + dataShowView.AddChidren(cv); + cv.Clicker(); + + + valueIndex++; + } + } + + + + } + + class DataItemView : FrameLayout + { + string value; + Button btnLine; + int height; + public DataItemView(string value,int height) + { + this.value = value; + Width = Application.GetRealWidth(293); + this.height = height; + Height = Application.GetRealHeight(height); + } + + public void InitView(bool isTemp) { + + Button btnValue = new Button() + { + Width = Application.GetRealWidth(18), + Height = Application.GetRealHeight(30), + TextAlignment = TextAlignment.CenterRight, + TextColor = 0xFF43425D, + TextSize = 8, + Text = value + }; + AddChidren(btnValue); + + btnLine = new Button() + { + X = Application.GetRealWidth(26), + Width = Application.GetRealWidth(267), + Height = 1, + BackgroundColor = CSS_Color.DividingLineColor, + }; + if (isTemp) + { + btnLine.Gravity = Gravity.CenterVertical; + btnValue.Gravity = Gravity.CenterVertical; + } + else + { + if (height == 360) + { + btnValue.Y = Application.GetRealHeight(height - 45); + } + else + { + btnLine.Gravity = Gravity.CenterVertical; + } + btnLine.Y = Application.GetRealHeight(height - 30); + } + AddChidren(btnLine); + + + + + + } + + } + + class ColumnarView : VerticalScrolViewLayout + { + string functionId; + string time; + string type; + double value; + string valueText; + /// <summary> + /// 鏂瑰悜锛氬悜涓娿�佸悜涓� + /// </summary> + bool isUpward; + Button btnValue; + Button btnValueText; + + + public ColumnarView(string functionId,string type, string key, double value) + { + this.functionId = functionId; + this.type = type; + time = key; + this.isUpward = value >= 0; + valueText = value.ToString(); + if (isUpward) + { + this.value = value; + } + else + { + this.value = value * -1; + } + Width = Application.GetRealWidth(39); + Height = Application.GetRealHeight((int)(value * 3 + 30)); + } + + public void InitView() + { + int yValue = 0; + btnValue = new Button() + { + Gravity = Gravity.CenterHorizontal, + Height = Application.GetRealHeight((int)(value * 3)), + Width = Application.GetRealWidth(16), + BackgroundColor = 0xFFFF9D54, + }; + + btnValueText = new Button() + { + Height = Application.GetRealHeight(30), + TextSize = CSS_FontSize.PromptFontSize_FirstLevel, + TextColor = 0xFF43425D, + Text = valueText, + }; + if(type == "room_temp") + { + btnValueText.Text += "鈩�"; + if (isUpward) + { + yValue = (int)(150 - value * 3); + yValue = yValue > 0 ? yValue : 0; + Y = Application.GetRealHeight(yValue+1); + AddChidren(btnValueText); + AddChidren(btnValue); + } + else + { + Y = Application.GetRealHeight(180); + AddChidren(btnValue); + AddChidren(btnValueText); + } + } + else + { + yValue = (int)(360 -30- 30 - value * 3); + Y = Application.GetRealHeight(yValue+1); + AddChidren(btnValueText); + AddChidren(btnValue); + btnValueText.Text += "%"; + } + } + + public void Clicker() + { + btnValue.MouseUpEventHandler = (sender, e) => + { + var page = new CacDayHistoryPage(functionId,type, time); + MainPage.BasePageView.AddChidren(page); + page.InitView(); + MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; + }; + btnValueText.MouseUpEventHandler = (sender, e) => + { + var page = new CacDayHistoryPage(functionId,type, time); + MainPage.BasePageView.AddChidren(page); + page.InitView(); + MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; + }; + } + } +} diff --git a/HDL_ON/UI/UI2/FuntionControlView/ContentView/AcContentView.cs b/HDL_ON/UI/UI2/FuntionControlView/ContentView/AcContentView.cs new file mode 100644 index 0000000..1bb8cbf --- /dev/null +++ b/HDL_ON/UI/UI2/FuntionControlView/ContentView/AcContentView.cs @@ -0,0 +1,1110 @@ +锘縰sing System; +using System.Collections.Generic; +using HDL_ON.DriverLayer; +using HDL_ON.Entity; +using HDL_ON.Stan; +using HDL_ON.UI.CSS; +using Shared; + +namespace HDL_ON.UI.UI2.FuntionControlView.Panel +{ + public class AcContentView : FrameLayout + { + + #region 鈻� 鍙橀噺澹版槑___________________________ + /// <summary> + /// 绌鸿皟娓╁害鎺у埗鎺т欢 + /// </summary> + DiyArcSeekBar arcBar; + /// <summary> + /// 鍑忓彿鎸夐挳 + /// </summary> + Button btnMinus; + /// <summary> + /// 鍔犲彿鎸夐挳 + /// </summary> + Button btnPlus; + /// <summary> + /// 娓╁害鎸夐挳 + /// </summary> + Button btnTemp; + Button btnTempUint; + /// <summary> + /// 瀹ゅ唴娓╁害鎸夐挳 + /// </summary> + Button btnIndoorTemp; + /// <summary> + /// 妯″紡鎸夐挳 + /// </summary> + Button btnMode; + /// <summary> + /// 鎵鎸夐挳 + /// </summary> + Button btnSwing; + /// <summary> + /// 椋庨�熸寜閽� + /// </summary> + Button btnWindSpeed; + /// <summary> + /// 寮�鍏虫寜閽� + /// </summary> + Button btnSwitch; + + AC acFunction = new AC(); + + /// <summary> + /// 鎺у埗鏃堕棿 + /// </summary> + DateTime controlTime = DateTime.MinValue.AddDays(10); + /// <summary> + /// 鎺у埗娓╁害 + /// </summary> + int temp = 16; + + #endregion + Function device; + public AcContentView(Function function) + { + device = function; + + var sk = device.GetAttribute(FunctionAttributeKey.SetTemp); + if (sk != null) + { + if (sk.min == 0) + { + sk.min = 16; + } + if (sk.max == 0) + { + sk.max = 32; + } + } + + } + #region 鈻� 鍒濆鍖朹____________________________ + + /// <summary> + /// 鍒濆鍖栫櫧鑹插尯鍩熺殑鍐呭 + /// </summary> + public void InitContent(bool initStandard = true) + { + if (initStandard) + { + //璁惧鍚嶅瓧 + var btnDeviceName = new NormalViewControl(270, 37, true); + btnDeviceName.X = Application.GetRealWidth(16); + btnDeviceName.Y = Application.GetRealHeight(18); + btnDeviceName.TextColor = CSS_Color.FirstLevelTitleColor; + btnDeviceName.TextSize = CSS_FontSize.EmphasisFontSize_FirstLevel; + btnDeviceName.Text = device.name; + btnDeviceName.Width = btnDeviceName.GetRealWidthByText(); + AddChidren(btnDeviceName); + //鎴块棿鍚嶅瓧 + var btnRoomName = new NormalViewControl(270, 21, true); + btnRoomName.X = Application.GetRealWidth(16); + btnRoomName.Y = btnDeviceName.Bottom; + btnRoomName.TextColor = CSS_Color.PromptingColor1; + btnRoomName.TextSize = CSS_FontSize.PromptFontSize_FirstLevel; + btnRoomName.Text = device.GetRoomListName(); + btnRoomName.Width = btnRoomName.GetRealWidthByText(); + AddChidren(btnRoomName); + + } + + //鍒濆鍖栫涓�涓储寮曢〉鐨勫唴瀹� + this.InitFrameWhiteContent(); + + //鍒锋柊鐣岄潰鐘舵�� + this.RefreshFormStatu(); + //璇诲彇鐘舵�� + new System.Threading.Thread(() => + { + while (true) + { + if (controlTime == DateTime.MinValue) + { + + } + else if (controlTime.AddSeconds(2) < DateTime.Now) + { + Control.Ins.SendReadCommand(device); + controlTime = DateTime.MinValue; + } + System.Threading.Thread.Sleep(1000); + } + }) + { IsBackground = true }.Start(); + } + + /// <summary> + /// 鍒濆鍖栫涓�涓储寮曢〉鐨勫唴瀹� + /// </summary> + private void InitFrameWhiteContent() + { + temp = (int)Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.SetTemp).Replace(",", ".")); + arcBar = new DiyArcSeekBar() + { + Gravity = Gravity.CenterHorizontal, + OpenAngle = 160, + ThumbImageHeight = Application.GetRealWidth(50), + ProgressBarColor = CSS_Color.MainColor, + OfflineProgressBarColor = CSS_Color.PromptingColor2, + ArcColor = CSS_Color.BackgroundColor, +#if __IOS__ + Y = Application.GetRealHeight(120 + 25), + Width = Application.GetRealWidth(260 - 40), + Height = Application.GetRealWidth(260 - 40), + SeekBarPadding = Application.GetRealWidth(8), +#else + Y = Application.GetRealHeight(120 + 40), + Width = Application.GetRealWidth(260 - 40), + Height = Application.GetRealWidth(260 - 40), + SeekBarPadding = Application.GetRealWidth(7), +#endif + + }; + this.AddChidren(arcBar); + + + arcBar.ThumbImagePath = device.GetAttrState(FunctionAttributeKey.OnOff) == "on" ? "FunctionIcon/AC/DiyThumbIconOn.png" : "FunctionIcon/AC/DiyThumbIcon.png"; + arcBar.IsOffline = device.GetAttrState(FunctionAttributeKey.OnOff) == "off"; + arcBar.MinValue = device.GetAttribute(FunctionAttributeKey.SetTemp).min; + arcBar.MaxValue = device.GetAttribute(FunctionAttributeKey.SetTemp).max; + arcBar.Progress = (int)Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.SetTemp).Replace(",", ".")); + + btnTemp = new Button() + { + Gravity = Gravity.CenterHorizontal, + Y = Application.GetRealHeight(206), + Width = Application.GetRealWidth(71), + Height = Application.GetRealWidth(60), + TextColor = CSS_Color.FirstLevelTitleColor, + TextSize = 50, + IsBold = true, + Text = Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.SetTemp).Replace(",", ".")).ToString(), + TextAlignment = TextAlignment.Center, + }; + this.AddChidren(btnTemp); + + btnTempUint = new Button() + { + X = btnTemp.Right, + Y = btnTemp.Y, + Width = Application.GetRealWidth(30), + Height = Application.GetRealHeight(30), + TextColor = CSS_Color.FirstLevelTitleColor, + TextSize = CSS_FontSize.EmphasisFontSize_Secondary, + IsBold = true, + TextAlignment = TextAlignment.CenterLeft, + Text = "掳C", + }; + this.AddChidren(btnTempUint); + + btnIndoorTemp = new Button() + { + Gravity = Gravity.CenterHorizontal, + Y = btnTemp.Bottom, + Width = Application.GetRealWidth(120), + Height = Application.GetRealHeight(20), + Text = Language.StringByID(StringId.IndoorTemp) + "20掳C", + TextColor = CSS_Color.PromptingColor1, + TextSize = CSS_FontSize.PromptFontSize_FirstLevel, + }; + this.AddChidren(btnIndoorTemp); + + btnMinus = new Button() + { + X = Application.GetRealWidth(21), + Y = Application.GetRealHeight(263), + Width = Application.GetRealWidth(32), + Height = Application.GetRealWidth(32), + UnSelectedImagePath = "Public/MinusSignIcon.png", + }; + this.AddChidren(btnMinus); + + btnPlus = new Button() + { + X = Application.GetRealWidth(275), + Y = Application.GetRealHeight(263), + Width = Application.GetRealWidth(32), + Height = Application.GetRealWidth(32), + UnSelectedImagePath = "Public/PlusSignIcon.png", + }; + this.AddChidren(btnPlus); + + btnMode = new Button() + { + X = Application.GetRealWidth(60), + Y = Application.GetRealHeight(334), + Width = Application.GetRealWidth(30), + Height = Application.GetRealWidth(30), + UnSelectedImagePath = acFunction.GetModeIconPath(device.GetAttrState(FunctionAttributeKey.Mode)), + }; + this.AddChidren(btnMode); + + + btnSwing = new Button() + { + Gravity = Gravity.CenterHorizontal, + Y = Application.GetRealHeight(330), + Width = Application.GetRealWidth(40), + Height = Application.GetRealWidth(40), + UnSelectedImagePath = "FunctionIcon/AC/SweepIconNullOn.png", + }; + if (device.GetAttribute(FunctionAttributeKey.Swing) != null) + { + this.AddChidren(btnSwing); + } + + + btnWindSpeed = new Button() + { + X = Application.GetRealWidth(235), + Y = Application.GetRealHeight(337), + Width = Application.GetRealWidth(30), + Height = Application.GetRealWidth(30), + UnSelectedImagePath = acFunction.GetFanIconPath(device.GetAttrState(FunctionAttributeKey.FanSpeed)), + }; + this.AddChidren(btnWindSpeed); + + btnSwitch = new Button() + { + Gravity = Gravity.CenterHorizontal, + Y = Application.GetRealHeight(466), + Width = Application.GetRealWidth(32), + Height = Application.GetRealWidth(32), + UnSelectedImagePath = "Public/PowerClose.png", + SelectedImagePath = "Public/PowerOpen.png", + IsSelected = device.GetAttrState(FunctionAttributeKey.OnOff) == "on" + }; + this.AddChidren(btnSwitch); + + LoadEvent_TempChange(); + LoadEvent_AcStatesChange(); + + LoadDiv_IrView(); + } + + /// <summary> + /// 鍔犺浇淇敼妯″紡鍖哄煙 + /// </summary> + void LoadDiv_ChangeModeView() + { + Dialog dialog = new Dialog(); + + FrameLayout dialogView = new FrameLayout() + { + BackgroundColor = CSS_Color.DialogTransparentColor1, + }; + dialog.AddChidren(dialogView); + + FrameLayout modeChangeView; + modeChangeView = new FrameLayout() + { + X = Application.GetRealWidth(30), + Y = Application.GetRealHeight(128), + Width = Application.GetRealWidth(160), + Height = Application.GetRealHeight(287), + BackgroundImagePath = "FunctionIcon/AC/DivBg1.png", + }; + dialogView.AddChidren(modeChangeView); + + Button btnTitle; + btnTitle = new Button() + { + X = Application.GetRealWidth(8 + 16), + Y = Application.GetRealHeight(8), + Width = Application.GetRealWidth(112), + Height = Application.GetRealHeight(44), + TextID = StringId.ChooseMode, + TextAlignment = TextAlignment.CenterLeft, + TextColor = CSS_Color.FirstLevelTitleColor, + TextSize = CSS_FontSize.EmphasisFontSize_Secondary, + }; + modeChangeView.AddChidren(btnTitle); + + Button btnLine = new Button() + { + X = btnTitle.X, + Y = btnTitle.Bottom, + Width = Application.GetRealWidth(112), + Height = Application.GetRealHeight(1), + BackgroundColor = CSS_Color.BackgroundColor, + }; + modeChangeView.AddChidren(btnLine); + + var modeList = device.GetAttribute(FunctionAttributeKey.Mode).value; + foreach (var m in modeList) + { + Button btnModeIcon = new Button() + { + X = btnTitle.X, + Y = Application.GetRealHeight(44 * (modeList.IndexOf(m) + 1) + 10 + 8), + Width = Application.GetRealWidth(24), + Height = Application.GetRealWidth(24), + IsSelected = device.GetAttrState(FunctionAttributeKey.Mode) == m, + }; + modeChangeView.AddChidren(btnModeIcon); + + Button btnModeText = new Button() + { + X = Application.GetRealWidth(12) + btnModeIcon.Right, + Y = Application.GetRealHeight(44 * (modeList.IndexOf(m) + 1) + 8), + Height = Application.GetRealHeight(44), + Width = Application.GetRealWidth(90), + TextAlignment = TextAlignment.CenterLeft, + TextColor = CSS_Color.FirstLevelTitleColor, + SelectedTextColor = CSS_Color.MainColor, + IsSelected = device.GetAttrState(FunctionAttributeKey.Mode) == m, + TextSize = CSS_FontSize.TextFontSize, + }; + modeChangeView.AddChidren(btnModeText); + + btnModeIcon.UnSelectedImagePath = acFunction.GetModeIconPath(m, false); + btnModeIcon.SelectedImagePath = acFunction.GetModeIconPath(m); + btnModeText.Text = acFunction.GetModeAttrText(m); + + if (modeList.IndexOf(m) < modeList.Count - 1) + { + modeChangeView.AddChidren(new Button() + { + X = btnTitle.X, + Y = btnModeText.Bottom, + Width = Application.GetRealWidth(112), + Height = Application.GetRealHeight(1), + BackgroundColor = CSS_Color.BackgroundColor, + }); + } + EventHandler<MouseEventArgs> eventHandler = (sender, e) => + { + dialog.Close(); + }; + EventHandler<MouseEventArgs> eventHandler1 = (sender, e) => + { + //if (!device.online) + //{ + // new Tip() + // { + // CloseTime = 1, + // Text = Language.StringByID(StringId.DeviceOfflineCannotOption), + // Direction = AMPopTipDirection.None, + // }.Show(MainPage.BaseView); + //} + btnModeIcon.IsSelected = btnModeText.IsSelected = true; + device.SetAttrState(FunctionAttributeKey.Mode, m); + btnMode.UnSelectedImagePath = acFunction.GetModeIconPath(m); + Dictionary<string, string> d = new Dictionary<string, string>(); + d.Add(FunctionAttributeKey.Mode, m); + Control.Ins.SendWriteCommand(device, d); + dialog.Close(); + if (device.GetAttrState(FunctionAttributeKey.Mode) == "fan") + { + arcBar.IsClickable = false; + arcBar.IsOffline = true; + } + else + { + arcBar.IsOffline = false; + arcBar.IsClickable = true; + } + }; + btnModeIcon.MouseUpEventHandler = eventHandler1; + btnModeText.MouseUpEventHandler = eventHandler1; + dialogView.MouseUpEventHandler = eventHandler; + + } + + dialogView.MouseUpEventHandler = (sender, e) => { + dialog.Close(); + }; + dialog.Show(); + } + + /// <summary> + /// 鍔犺浇淇敼鎵妯″紡鍖哄煙 + /// </summary> + void LoadDiv_ChangeSwingView() + { + Dialog dialog = new Dialog(); + + FrameLayout dialogView = new FrameLayout() + { + BackgroundColor = CSS_Color.DialogTransparentColor1, + }; + dialog.AddChidren(dialogView); + + FrameLayout modeChangeView; + modeChangeView = new FrameLayout() + { + Gravity = Gravity.CenterHorizontal, + Y = Application.GetRealHeight(128), + Width = Application.GetRealWidth(160), + Height = Application.GetRealHeight(287), + BackgroundImagePath = "FunctionIcon/AC/DivBg2.png", + }; + dialogView.AddChidren(modeChangeView); + + Button btnTitle; + btnTitle = new Button() + { + X = Application.GetRealWidth(8 + 16), + Y = Application.GetRealHeight(8), + Width = Application.GetRealWidth(112), + Height = Application.GetRealHeight(44), + TextID = StringId.Swing, + TextAlignment = TextAlignment.CenterLeft, + TextColor = CSS_Color.FirstLevelTitleColor, + TextSize = CSS_FontSize.EmphasisFontSize_Secondary, + }; + modeChangeView.AddChidren(btnTitle); + + Button btnLine = new Button() + { + X = btnTitle.X, + Y = btnTitle.Bottom, + Width = Application.GetRealWidth(112), + Height = Application.GetRealHeight(1), + BackgroundColor = CSS_Color.BackgroundColor, + }; + modeChangeView.AddChidren(btnLine); + + var modeList = device.GetAttribute(FunctionAttributeKey.Swing).value; + foreach (var m in modeList) + { + Button btnModeIcon = new Button() + { + X = btnTitle.X, + Y = Application.GetRealHeight(44 * (modeList.IndexOf(m) + 1) + 10 + 8), + Width = Application.GetRealWidth(24), + Height = Application.GetRealWidth(24), + IsSelected = device.GetAttrState(FunctionAttributeKey.Swing) == m, + }; + modeChangeView.AddChidren(btnModeIcon); + + Button btnModeText = new Button() + { + X = Application.GetRealWidth(12) + btnModeIcon.Right, + Y = Application.GetRealHeight(44 * (modeList.IndexOf(m) + 1) + 8), + Height = Application.GetRealHeight(44), + Width = Application.GetRealWidth(90), + TextAlignment = TextAlignment.CenterLeft, + TextColor = CSS_Color.FirstLevelTitleColor, + SelectedTextColor = CSS_Color.MainColor, + IsSelected = device.GetAttrState(FunctionAttributeKey.Swing) == m, + TextSize = CSS_FontSize.TextFontSize, + }; + modeChangeView.AddChidren(btnModeText); + + if (modeList.IndexOf(m) < modeList.Count - 1) + { + modeChangeView.AddChidren(new Button() + { + X = btnTitle.X, + Y = btnModeText.Bottom, + Width = Application.GetRealWidth(112), + Height = Application.GetRealHeight(1), + BackgroundColor = CSS_Color.BackgroundColor, + }); + } + + btnModeIcon.UnSelectedImagePath = acFunction.GetSwingIconPath(m, false); + btnModeIcon.SelectedImagePath = acFunction.GetSwingIconPath(m); + btnModeText.Text = acFunction.GetSwingAttrText(m); + + EventHandler<MouseEventArgs> eventHandler = (sender, e) => + { + dialog.Close(); + }; + EventHandler<MouseEventArgs> eventHandler1 = (sender, e) => + { + //if (!device.online) + //{ + // new Tip() + // { + // CloseTime = 1, + // Text = Language.StringByID(StringId.DeviceOfflineCannotOption), + // Direction = AMPopTipDirection.None, + // }.Show(MainPage.BaseView); + //} + btnModeIcon.IsSelected = btnModeText.IsSelected = true; + device.SetAttrState(FunctionAttributeKey.Swing, m); + btnSwing.UnSelectedImagePath = acFunction.GetSwingIconPath(m); + Dictionary<string, string> d = new Dictionary<string, string>(); + d.Add(FunctionAttributeKey.Swing, m); + Control.Ins.SendWriteCommand(device, d); + dialog.Close(); + }; + btnModeIcon.MouseUpEventHandler = eventHandler1; + btnModeText.MouseUpEventHandler = eventHandler1; + dialogView.MouseUpEventHandler = eventHandler; + + } + + dialogView.MouseUpEventHandler = (sender, e) => { + dialog.Close(); + }; + dialog.Show(); + } + /// <summary> + /// 鍔犺浇淇敼妯″紡鍖哄煙 + /// </summary> + void LoadDiv_ChangeFanView() + { + Dialog dialog = new Dialog(); + + FrameLayout dialogView = new FrameLayout() + { + BackgroundColor = CSS_Color.DialogTransparentColor1, + }; + dialog.AddChidren(dialogView); + + FrameLayout modeChangeView; + modeChangeView = new FrameLayout() + { + X = Application.GetRealWidth(185), + Y = Application.GetRealHeight(172), + Width = Application.GetRealWidth(160), + Height = Application.GetRealHeight(243), + BackgroundImagePath = "FunctionIcon/AC/DivBg2.png", + }; + dialogView.AddChidren(modeChangeView); + + Button btnTitle; + btnTitle = new Button() + { + X = Application.GetRealWidth(8 + 16), + Y = Application.GetRealHeight(8), + Width = Application.GetRealWidth(112), + Height = Application.GetRealHeight(44), + TextID = StringId.ChooseFan, + TextAlignment = TextAlignment.CenterLeft, + TextColor = CSS_Color.FirstLevelTitleColor, + TextSize = CSS_FontSize.EmphasisFontSize_Secondary, + }; + modeChangeView.AddChidren(btnTitle); + + Button btnLine = new Button() + { + X = btnTitle.X, + Y = btnTitle.Bottom, + Width = Application.GetRealWidth(112), + Height = Application.GetRealHeight(1), + BackgroundColor = CSS_Color.BackgroundColor, + }; + modeChangeView.AddChidren(btnLine); + + var modeList = device.GetAttribute(FunctionAttributeKey.FanSpeed).value; + foreach (var m in modeList) + { + Button btnFanIcon = new Button() + { + X = btnTitle.X, + Y = Application.GetRealHeight(44 * (modeList.IndexOf(m) + 1) + 10 + 8), + Width = Application.GetRealWidth(24), + Height = Application.GetRealWidth(24), + IsSelected = device.GetAttrState(FunctionAttributeKey.FanSpeed) == m, + }; + modeChangeView.AddChidren(btnFanIcon); + + Button btnFanText = new Button() + { + X = Application.GetRealWidth(12) + btnFanIcon.Right, + Y = Application.GetRealHeight(44 * (modeList.IndexOf(m) + 1) + 8), + Height = Application.GetRealHeight(44), + Width = Application.GetRealWidth(70), + TextAlignment = TextAlignment.CenterLeft, + TextColor = CSS_Color.FirstLevelTitleColor, + SelectedTextColor = CSS_Color.MainColor, + IsSelected = device.GetAttrState(FunctionAttributeKey.FanSpeed) == m, + TextSize = CSS_FontSize.TextFontSize, + }; + modeChangeView.AddChidren(btnFanText); + btnFanIcon.UnSelectedImagePath = acFunction.GetFanIconPath(m, false); + btnFanIcon.SelectedImagePath = acFunction.GetFanIconPath(m); + btnFanText.Text = acFunction.GetFanAttrText(m); + + if (modeList.IndexOf(m) < modeList.Count - 1) + { + modeChangeView.AddChidren(new Button() + { + X = btnTitle.X, + Y = btnFanText.Bottom, + Width = Application.GetRealWidth(112), + Height = Application.GetRealHeight(1), + BackgroundColor = CSS_Color.BackgroundColor, + }); + } + + EventHandler<MouseEventArgs> closeDialogEvent = (sender, e) => + { + dialog.Close(); + }; + EventHandler<MouseEventArgs> eventHandler1 = (sender, e) => + { + //if (!device.online) + //{ + // new Tip() + // { + // CloseTime = 1, + // Text = Language.StringByID(StringId.DeviceOfflineCannotOption), + // Direction = AMPopTipDirection.None, + // }.Show(MainPage.BaseView); + //} + btnFanIcon.IsSelected = btnFanText.IsSelected = true; + device.SetAttrState(FunctionAttributeKey.FanSpeed, m); + btnWindSpeed.UnSelectedImagePath = acFunction.GetFanIconPath(m); + System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); + d.Add(FunctionAttributeKey.FanSpeed, m); + Control.Ins.SendWriteCommand(device, d); + //btnWindSpeed.UnSelectedImagePath = btnFanIcon.UnSelectedImagePath; + dialog.Close(); + }; + btnFanIcon.MouseUpEventHandler = eventHandler1; + btnFanText.MouseUpEventHandler = eventHandler1; + dialogView.MouseUpEventHandler = closeDialogEvent; + } + + dialog.Show(); + } + + /// <summary> + /// 鍔犺浇绾㈠閬ユ帶鍣紝棰濆鎸夐挳 + /// </summary> + void LoadDiv_IrView() + { + if (device.spk == SPK.AcIr) + { + var btnMore = new Button() + { + Gravity = Gravity.CenterHorizontal, + Y = Application.GetRealHeight(334 + 80), + Width = Application.GetRealWidth(35), + Height = Application.GetRealWidth(35), + UnSelectedImagePath = "FunctionIcon/AC/More.png", + }; + this.AddChidren(btnMore); + + btnMore.MouseUpEventHandler = (sender, e) => { + LoadDialog_IrMoreView(); + }; + } + } + + /// <summary> + /// 鍔犺浇棰濆瀵圭孩澶栨寜閽晫闈� + /// </summary> + void LoadDialog_IrMoreView() + { + Dialog dialog = new Dialog(); + + var div = new FrameLayout(); + dialog.AddChidren(div); + div.MouseUpEventHandler = (sender, e) => { + dialog.Close(); + }; + + var bodyView = new FrameLayout() + { + Y = Application.GetRealHeight(427),//667 + Height = Application.GetRealHeight(240), + BackgroundColor = CSS_Color.MainBackgroundColor, + }; + div.AddChidren(bodyView); + + var contentView = new VerticalScrolViewLayout() + { + Y = Application.GetRealHeight(16), + Gravity = Gravity.CenterHorizontal, + Width = Application.GetRealWidth(296 + 200), + }; + bodyView.AddChidren(contentView); + + + var row = new FrameLayout() + { + Height = Application.GetRealHeight(60), + Width = Application.GetRealWidth(296), + Gravity = Gravity.CenterHorizontal, + }; + contentView.AddChidren(row); + + int index = 0; + List<FunctionAttributes> attrList = new List<FunctionAttributes>(); + attrList.AddRange(device.attributes); + attrList.Add(new FunctionAttributes() + { + key = "+", + }); + + foreach (var attr in attrList) + { + if (attr.key == FunctionAttributeKey.Mode + || attr.key == FunctionAttributeKey.OnOff + || attr.key == FunctionAttributeKey.SetTemp + || attr.key == FunctionAttributeKey.SetTempStep + || attr.key == FunctionAttributeKey.FanSpeed + || attr.key == FunctionAttributeKey.FanManual + || attr.key == FunctionAttributeKey.FanAuto + ) + { + continue; + } + if (index != 0 && index % 3 == 0) + { + row = new FrameLayout() + { + Height = Application.GetRealHeight(56), + Width = Application.GetRealWidth(296), + Gravity = Gravity.CenterHorizontal, + }; + contentView.AddChidren(row); + } + if (attr.key == "+") + { + var addView = new FrameLayout() + { + Gravity = Gravity.CenterVertical, + Width = Application.GetRealWidth(88), + Height = Application.GetRealHeight(40), + Radius = (uint)Application.GetRealHeight(18), + BorderColor = CSS_Color.PromptingColor1, + BorderWidth = (uint)Application.GetRealWidth(2), + }; + + + if (index % 3 == 1) + { + addView.Gravity = Gravity.Center; + } + else if (index % 3 == 2) + { + addView.X = Application.GetRealWidth(208); + } + row.AddChidren(addView); + + var btnAdd = new Button() + { + Gravity = Gravity.Center, + UnSelectedImagePath = "Public/PlusSignIcon.png", + Width = Application.GetRealWidth(32), + Height = Application.GetRealWidth(32), + }; + addView.AddChidren(btnAdd); + + btnAdd.MouseUpEventHandler = (sender, e) => + { + dialog.Close(); + Action action = () => { + LoadDialog_IrMoreView(); + }; + var addButton = new AcControlPage_AddIrButton(action); + MainPage.BasePageView.AddChidren(addButton); + addButton.Show(device); + MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; + }; + + + } + else + { + + var btn = new Button() + { + Gravity = Gravity.CenterVertical, + Width = Application.GetRealWidth(88), + Height = Application.GetRealHeight(40), + Radius = (uint)Application.GetRealHeight(18), + BorderColor = CSS_Color.PromptingColor1, + BorderWidth = (uint)Application.GetRealWidth(2), + TextAlignment = TextAlignment.Center, + TextSize = CSS_FontSize.TextFontSize, + TextColor = CSS_Color.FirstLevelTitleColor, + SelectedTextColor = CSS_Color.MainBackgroundColor, + SelectedBackgroundColor = CSS_Color.MainColor, + }; + if (attr.value.Count > 0) + { + btn.Text = attr.value[0]; + } + if (index % 3 == 1) + { + btn.Gravity = Gravity.Center; + } + else if (index % 3 == 2) + { + btn.X = Application.GetRealWidth(208); + } + row.AddChidren(btn); + + btn.MouseUpEventHandler = (sender, e) => + { + //if (!device.online) + //{ + // new Tip() + // { + // CloseTime = 1, + // Text = Language.StringByID(StringId.DeviceOfflineCannotOption), + // Direction = AMPopTipDirection.None, + // }.Show(MainPage.BaseView); + //} + Dictionary<string, string> d = new Dictionary<string, string>(); + d.Add(attr.key, ""); + Control.Ins.SendWriteCommand(device, d); + + new System.Threading.Thread(() => + { + System.Threading.Thread.Sleep(2000); + Application.RunOnMainThread(() => + { + btn.IsSelected = false; + }); + }) + { IsBackground = true }.Start(); + }; + + } + + index++; + } + + dialog.Show(); + } + + + #endregion + + #region 鈻� 鍙戦�佸悇绉嶅懡浠______________________ + + /// <summary> + /// 娓╁害鏀瑰彉妯″紡 + /// </summary> + void LoadEvent_TempChange() + { + btnMinus.MouseUpEventHandler = (sender, e) => + { + //if (!device.online) + //{ + // new Tip() + // { + // CloseTime = 1, + // Text = Language.StringByID(StringId.DeviceOfflineCannotOption), + // Direction = AMPopTipDirection.None, + // }.Show(MainPage.BaseView); + //} + if (device.trait_on_off.curValue.ToString() == "off" || device.GetAttrState(FunctionAttributeKey.Mode) == "fan") + { + return; + } + + if (temp <= device.GetAttribute(FunctionAttributeKey.SetTemp).min) + { + return; + } + --temp; + Console.WriteLine($"temp == {temp}"); + controlTime = DateTime.Now; + arcBar.Progress = temp; + btnTemp.Text = temp.ToString(); + device.SetAttrState(FunctionAttributeKey.SetTemp, temp.ToString()); + System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); + d.Add(FunctionAttributeKey.SetTemp, temp.ToString()); + Control.Ins.SendWriteCommand(device, d); + }; + btnPlus.MouseUpEventHandler = (sender, e) => + { + //if (!device.online) + //{ + // new Tip() + // { + // CloseTime = 1, + // Text = Language.StringByID(StringId.DeviceOfflineCannotOption), + // Direction = AMPopTipDirection.None, + // }.Show(MainPage.BaseView); + //} + if (device.trait_on_off.curValue.ToString() == "off" || device.GetAttrState(FunctionAttributeKey.Mode) == "fan") + { + return; + } + if (temp >= device.GetAttribute(FunctionAttributeKey.SetTemp).max) + { + return; + } + ++temp; + controlTime = DateTime.Now; + arcBar.Progress = temp; + btnTemp.Text = temp.ToString(); + device.SetAttrState(FunctionAttributeKey.SetTemp, temp.ToString()); + System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); + d.Add(FunctionAttributeKey.SetTemp, temp.ToString()); + Control.Ins.SendWriteCommand(device, d); + }; + //if (device.online) + { + arcBar.OnStopTrackingTouchEvent = (sender, e) => + { + temp = arcBar.Progress; + device.SetAttrState(FunctionAttributeKey.SetTemp, arcBar.Progress.ToString()); + btnTemp.Text = arcBar.Progress.ToString(); + controlTime = DateTime.Now; + Dictionary<string, string> d = new Dictionary<string, string>(); + d.Add(FunctionAttributeKey.SetTemp, arcBar.Progress.ToString()); + Control.Ins.SendWriteCommand(device, d); + }; + arcBar.OnProgressChangedEvent = (sender, e) => + { + device.SetAttrState(FunctionAttributeKey.SetTemp, e.ToString()); + btnTemp.Text = e.ToString(); + }; + //arcBar.MouseDownEventHandler = (sender, e) => { + // Console.WriteLine("ddd"); + // MainPage.BasePageView.ScrollEnabled =false; + //}; + //arcBar.MouseUpEventHandler = (sender, e) => { + // Console.WriteLine("ddd2"); + // MainPage.BasePageView.ScrollEnabled = true; + //}; + } + } + + /// <summary> + /// 鎺у埗妯″紡浜嬩欢 + /// </summary> + void LoadEvent_AcStatesChange() + { + btnMode.MouseUpEventHandler = (sender, e) => + { + if (device.trait_on_off.curValue.ToString() == "off") + { + return; + } + LoadDiv_ChangeModeView(); + }; + //鎵鏀瑰彉妯″紡 + btnSwing.MouseUpEventHandler = (sender, e) => + { + if (device.trait_on_off.curValue.ToString() == "off") + { + return; + } + LoadDiv_ChangeSwingView(); + }; + btnWindSpeed.MouseUpEventHandler = (sender, e) => + { + if (device.trait_on_off.curValue.ToString() == "off") + { + return; + } + LoadDiv_ChangeFanView(); + }; + + btnSwitch.MouseUpEventHandler = (sender, e) => + { + //if (!device.online) + //{ + // new Tip() + // { + // CloseTime = 1, + // Text = Language.StringByID(StringId.DeviceOfflineCannotOption), + // Direction = AMPopTipDirection.None, + // }.Show(MainPage.BaseView); + //} + btnSwitch.IsSelected = !btnSwitch.IsSelected; + device.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off"; + if (device.trait_on_off.curValue.ToString() == "on") + { + arcBar.ThumbImagePath = "FunctionIcon/AC/DiyThumbIconOn.png"; + btnSwitch.IsSelected = true; + arcBar.IsOffline = false; + } + else + { + arcBar.ThumbImagePath = "FunctionIcon/AC/DiyThumbIcon.png"; + btnSwitch.IsBold = false; + arcBar.IsOffline = true; + } + System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); + d.Add(FunctionAttributeKey.OnOff, device.trait_on_off.curValue.ToString()); + Control.Ins.SendWriteCommand(device, d); + }; + } + + #endregion + + #region 鈻� 鍒锋柊鐣岄潰鐘舵�乢______________________ + + /// <summary> + /// 鍒锋柊鐣岄潰鐘舵�� + /// </summary> + public void RefreshFormStatu() + { + Application.RunOnMainThread(() => + { + //app鑷繁鎺у埗鐨勪笉鐢ㄦ洿鏂帮紝浼氶�犳垚璺冲姩 + if (controlTime.AddSeconds(2) > DateTime.Now) + { + return; + } + else + { + btnIndoorTemp.Text = Language.StringByID(StringId.IndoorTemp) + Convert.ToInt32(Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.RoomTemp).Replace(",", "."))) + "掳C"; + btnMode.SelectedImagePath = acFunction.GetModeIconPath(device.GetAttrState(FunctionAttributeKey.Mode)); + btnSwing.SelectedImagePath = acFunction.GetSwingIconPath(device.GetAttrState(FunctionAttributeKey.Swing)); + btnWindSpeed.SelectedImagePath = acFunction.GetFanIconPath(device.GetAttrState(FunctionAttributeKey.FanSpeed)); + btnMode.UnSelectedImagePath = acFunction.GetModeIconPath(device.GetAttrState(FunctionAttributeKey.Mode), false); + btnSwing.UnSelectedImagePath = acFunction.GetSwingIconPath(device.GetAttrState(FunctionAttributeKey.Swing), false); + btnWindSpeed.UnSelectedImagePath = acFunction.GetFanIconPath(device.GetAttrState(FunctionAttributeKey.FanSpeed), false); + temp = Convert.ToInt32(Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.SetTemp).Replace(",", "."))); + + + arcBar.Progress = temp; + btnTemp.Text = temp.ToString(); + + if (device.trait_on_off.curValue.ToString() == "on") + { + btnMode.IsSelected = btnSwing.IsSelected = btnWindSpeed.IsSelected = true; + arcBar.IsOffline = false; + btnSwitch.IsSelected = true; + arcBar.ThumbImagePath = "FunctionIcon/AC/DiyThumbIconOn.png"; + if (device.GetAttrState(FunctionAttributeKey.Mode) == "fan") + { + arcBar.IsClickable = false; + } + else + { + arcBar.IsClickable = true; + } + } + else + { + btnMode.IsSelected = btnSwing.IsSelected = btnWindSpeed.IsSelected = false; + arcBar.IsOffline = true; + btnSwitch.IsSelected = false; + arcBar.IsClickable = false; + arcBar.ThumbImagePath = "FunctionIcon/AC/DiyThumbIcon.png"; + } + + if (device.GetAttrState(FunctionAttributeKey.Mode) == "dry") + { + arcBar.IsOffline = true; + arcBar.IsClickable = false; + + } + } + + }); + } + + #endregion + + #region 鈻� 涓�鑸柟娉昣__________________________ + + /// <summary> + /// 鍒锋柊褰撳墠璁惧鐨勭姸鎬佺紦瀛� + /// </summary> + private void RefreshNowDeviceStatuMemory(Function i_LocalDevice) + { + } + + #endregion + } +} \ No newline at end of file diff --git a/HDL_ON/UI/UI2/FuntionControlView/ContentView/FhContentView.cs b/HDL_ON/UI/UI2/FuntionControlView/ContentView/FhContentView.cs new file mode 100644 index 0000000..a4134a9 --- /dev/null +++ b/HDL_ON/UI/UI2/FuntionControlView/ContentView/FhContentView.cs @@ -0,0 +1,540 @@ +锘縰sing System; +using HDL_ON.DriverLayer; +using HDL_ON.Entity; +using HDL_ON.Stan; +using HDL_ON.UI.CSS; +using Shared; +namespace HDL_ON.UI +{ + public class FhContentView : FrameLayout + { + #region 鈻� 鍙橀噺澹版槑___________________________ + /// <summary> + /// 绌鸿皟娓╁害鎺у埗鎺т欢 + /// </summary> + DiyArcSeekBar arcBar; + /// <summary> + /// 鍑忓彿鎸夐挳 + /// </summary> + Button btnMinus; + /// <summary> + /// 鍔犲彿鎸夐挳 + /// </summary> + Button btnPlus; + /// <summary> + /// 娓╁害鎸夐挳 + /// </summary> + Button btnTemp; + Button btnTempUint; + /// <summary> + /// 瀹ゅ唴娓╁害鎸夐挳 + /// </summary> + Button btnIndoorTemp; + /// <summary> + /// 妯″紡鎸夐挳 + /// </summary> + Button btnMode; + /// <summary> + /// 寮�鍏虫寜閽� + /// </summary> + Button btnSwitch; + + FloorHeating fhTemp = new FloorHeating(); + + Function device; + + #endregion + + public FhContentView(Function function) + { + device = function; + } + + #region 鈻� 鍒濆鍖朹____________________________ + + /// <summary> + /// 鍒濆鍖栫櫧鑹插尯鍩熺殑鍐呭 + /// </summary> + public void InitContentView(bool initStandard) + { + + if (initStandard) + { + //璁惧鍚嶅瓧 + var btnDeviceName = new NormalViewControl(270, 37, true); + btnDeviceName.X = Application.GetRealWidth(16); + btnDeviceName.Y = Application.GetRealHeight(18); + btnDeviceName.TextColor = CSS_Color.FirstLevelTitleColor; + btnDeviceName.TextSize = CSS_FontSize.EmphasisFontSize_FirstLevel; + btnDeviceName.Text = device.name; + btnDeviceName.Width = btnDeviceName.GetRealWidthByText(); + AddChidren(btnDeviceName); + //鎴块棿鍚嶅瓧 + var btnRoomName = new NormalViewControl(270, 21, true); + btnRoomName.X = Application.GetRealWidth(16); + btnRoomName.Y = btnDeviceName.Bottom; + btnRoomName.TextColor = CSS_Color.PromptingColor1; + btnRoomName.TextSize = CSS_FontSize.PromptFontSize_FirstLevel; + btnRoomName.Text = device.GetRoomListName(); + btnRoomName.Width = btnRoomName.GetRealWidthByText(); + AddChidren(btnRoomName); + + } + //鍒濆鍖栫涓�涓储寮曢〉鐨勫唴瀹� + this.InitFrameWhiteContent1(); + + //鍒锋柊鐣岄潰鐘舵�� + this.RefreshFormStatu(); + //璇诲彇鐘舵�� + new System.Threading.Thread(() => + { + Control.Ins.SendReadCommand(device); + }) + { IsBackground = true }.Start(); + } + + /// <summary> + /// 鍒濆鍖栫涓�涓储寮曢〉鐨勫唴瀹� + /// </summary> + private void InitFrameWhiteContent1() + { + + arcBar = new DiyArcSeekBar() + { + Gravity = Gravity.CenterHorizontal, + OpenAngle = 160, + //ThumbImagePath = device.trait_on_off.curValue.ToString() == "on" ? "FunctionIcon/FloorHeating/DiyThumbIconOn.png" : "FunctionIcon/AC/DiyThumbIcon.png", + ThumbImageHeight = Application.GetRealWidth(50), + ProgressBarColor = CSS_Color.AuxiliaryColor1, // 0xFFFC9C04, + OfflineProgressBarColor = CSS_Color.PromptingColor2, + MinValue = device.GetAttribute(FunctionAttributeKey.SetTemp).min, + MaxValue = device.GetAttribute(FunctionAttributeKey.SetTemp).max, + ArcColor = CSS_Color.BackgroundColor, + Progress = Convert.ToInt32(device.GetAttrState(FunctionAttributeKey.SetTemp)), +#if __IOS__ + Y = Application.GetRealHeight(120 + 25), + Width = Application.GetRealWidth(260 - 40), + Height = Application.GetRealWidth(260 - 40), + SeekBarPadding = Application.GetRealWidth(8), +#else + Y = Application.GetRealHeight(120 + 40), + Width = Application.GetRealWidth(260 - 40), + Height = Application.GetRealWidth(260 - 40), + SeekBarPadding = Application.GetRealWidth(7), +#endif + + }; + AddChidren(arcBar); + + + arcBar.ThumbImagePath = device.GetAttrState(FunctionAttributeKey.OnOff) == "on" ? "FunctionIcon/AC/DiyThumbIconOn.png" : "FunctionIcon/AC/DiyThumbIcon.png"; + arcBar.IsOffline = device.GetAttrState(FunctionAttributeKey.OnOff) == "off"; + arcBar.MinValue = device.GetAttribute(FunctionAttributeKey.SetTemp).min; + arcBar.MaxValue = device.GetAttribute(FunctionAttributeKey.SetTemp).max; + arcBar.Progress = Convert.ToInt32(device.GetAttrState(FunctionAttributeKey.SetTemp)); + + + + btnTemp = new Button() + { + Gravity = Gravity.CenterHorizontal, + Y = Application.GetRealHeight(200), + Width = Application.GetRealWidth(80), + Height = Application.GetRealWidth(60), + TextColor = CSS_Color.FirstLevelTitleColor, + TextSize = 56, + IsBold = true, + Text = device.GetAttrState(FunctionAttributeKey.SetTemp), + TextAlignment = TextAlignment.Center, + }; + AddChidren(btnTemp); + + btnTempUint = new Button() + { + X = btnTemp.Right, + Y = btnTemp.Y, + Width = Application.GetRealWidth(30), + Height = Application.GetRealWidth(25), + TextColor = CSS_Color.FirstLevelTitleColor, + TextSize = CSS_FontSize.EmphasisFontSize_Secondary, + IsBold = true, + TextAlignment = TextAlignment.CenterLeft, + Text = fhTemp.GetTempUnitString(device) + }; + AddChidren(btnTempUint); + + btnIndoorTemp = new Button() + { + Gravity = Gravity.CenterHorizontal, + Y = btnTemp.Bottom + Application.GetRealWidth(10), + Width = Application.GetRealWidth(100), + Height = Application.GetRealHeight(20), + Text = Language.StringByID(StringId.IndoorTemp) + "20掳C", + TextColor = CSS_Color.PromptingColor1, + TextSize = CSS_FontSize.PromptFontSize_FirstLevel, + }; + AddChidren(btnIndoorTemp); + + btnMinus = new Button() + { + X = Application.GetRealWidth(21), + Y = Application.GetRealHeight(263), + Width = Application.GetRealWidth(32), + Height = Application.GetRealWidth(32), + UnSelectedImagePath = "Public/MinusSignIcon.png", + }; + AddChidren(btnMinus); + + btnPlus = new Button() + { + X = Application.GetRealWidth(275), + Y = Application.GetRealHeight(263), + Width = Application.GetRealWidth(32), + Height = Application.GetRealWidth(32), + UnSelectedImagePath = "Public/PlusSignIcon.png", + }; + AddChidren(btnPlus); + + if (device.GetAttribute(FunctionAttributeKey.Mode) != null) + { + btnMode = new Button() + { + X = Application.GetRealWidth(235), + Y = Application.GetRealHeight(337), + Width = Application.GetRealWidth(30), + Height = Application.GetRealWidth(30), + UnSelectedImagePath = fhTemp.GetModeIconPath(device.GetAttrState(FunctionAttributeKey.Mode)) + }; + AddChidren(btnMode); + if (device.GetAttribute(FunctionAttributeKey.Mode).value.Count > 1) + { + btnMode.MouseUpEventHandler = (sender, e) => + { + LoadDiv_ChangeModeView(); + }; + } + } + + btnSwitch = new Button() + { + Gravity = Gravity.CenterHorizontal, + Y = Application.GetRealHeight(466), + Width = Application.GetRealWidth(32), + Height = Application.GetRealWidth(32), + UnSelectedImagePath = "Public/PowerClose.png", + SelectedImagePath = "Public/PowerOpen.png", + IsSelected = device.trait_on_off.curValue.ToString() == "on" + }; + AddChidren(btnSwitch); + + LoadEvent_TempChange(); + LoadEvent_AcStatesChange(); + + } + + /// <summary> + /// 鍔犺浇淇敼妯″紡鍖哄煙 + /// </summary> + void LoadDiv_ChangeModeView() + { + Dialog dialog = new Dialog(); + + FrameLayout dialogView = new FrameLayout() + { + BackgroundColor = CSS_Color.DialogTransparentColor1, + }; + dialog.AddChidren(dialogView); + + FrameLayout modeChangeView; + modeChangeView = new FrameLayout() + { + X = Application.GetRealWidth(30), + Y = Application.GetRealHeight(128), + Width = Application.GetRealWidth(160), + Height = Application.GetRealHeight(287), + BackgroundImagePath = "FunctionIcon/AC/DivBg1.png", + }; + dialogView.AddChidren(modeChangeView); + + Button btnTitle; + btnTitle = new Button() + { + X = Application.GetRealWidth(8 + 16), + Y = Application.GetRealHeight(8), + Width = Application.GetRealWidth(112), + Height = Application.GetRealHeight(44), + TextID = StringId.ChooseMode, + TextAlignment = TextAlignment.CenterLeft, + TextColor = CSS_Color.FirstLevelTitleColor, + TextSize = CSS_FontSize.EmphasisFontSize_Secondary, + }; + modeChangeView.AddChidren(btnTitle); + + Button btnLine = new Button() + { + X = btnTitle.X, + Y = btnTitle.Bottom, + Width = Application.GetRealWidth(112), + Height = Application.GetRealHeight(1), + BackgroundColor = CSS_Color.BackgroundColor, + }; + modeChangeView.AddChidren(btnLine); + + var modeList = device.GetAttribute(FunctionAttributeKey.Mode).value; + foreach (var m in modeList) + { + Button btnModeIcon = new Button() + { + X = btnTitle.X, + Y = Application.GetRealHeight(44 * (modeList.IndexOf(m) + 1) + 10 + 8), + Width = Application.GetRealWidth(24), + Height = Application.GetRealWidth(24), + IsSelected = device.GetAttrState(FunctionAttributeKey.Mode) == m, + }; + modeChangeView.AddChidren(btnModeIcon); + + Button btnModeText = new Button() + { + X = Application.GetRealWidth(12) + btnModeIcon.Right, + Y = Application.GetRealHeight(44 * (modeList.IndexOf(m) + 1) + 8), + Height = Application.GetRealHeight(44), + Width = Application.GetRealWidth(90), + TextAlignment = TextAlignment.CenterLeft, + TextColor = CSS_Color.FirstLevelTitleColor, + SelectedTextColor = CSS_Color.MainColor, + IsSelected = device.GetAttrState(FunctionAttributeKey.Mode) == m, + TextSize = CSS_FontSize.TextFontSize, + }; + modeChangeView.AddChidren(btnModeText); + + btnModeIcon.UnSelectedImagePath = fhTemp.GetModeIconPath(m, false); + btnModeIcon.SelectedImagePath = fhTemp.GetModeIconPath(m); + btnModeText.Text = fhTemp.GetModeAttrText(m); + + if (modeList.IndexOf(m) < modeList.Count - 1) + { + modeChangeView.AddChidren(new Button() + { + X = btnTitle.X, + Y = btnModeText.Bottom, + Width = Application.GetRealWidth(112), + Height = Application.GetRealHeight(1), + BackgroundColor = CSS_Color.BackgroundColor, + }); + } + EventHandler<MouseEventArgs> eventHandler = (sender, e) => + { + dialog.Close(); + }; + EventHandler<MouseEventArgs> eventHandler1 = (sender, e) => + { + //if (!device.online) + //{ + // new Tip() + // { + // CloseTime = 1, + // Text = Language.StringByID(StringId.DeviceOfflineCannotOption), + // Direction = AMPopTipDirection.None, + // }.Show(MainPage.BaseView); + //} + btnModeIcon.IsSelected = btnModeText.IsSelected = true; + device.SetAttrState(FunctionAttributeKey.Mode, m); + btnMode.UnSelectedImagePath = fhTemp.GetModeIconPath(m); + System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); + btnMode.UnSelectedImagePath = btnModeIcon.UnSelectedImagePath; + d.Add(FunctionAttributeKey.Mode, m); + Control.Ins.SendWriteCommand(device, d); + dialog.Close(); + if (device.GetAttrState(FunctionAttributeKey.Mode) == "fan") + { + arcBar.IsClickable = false; + } + else + { + arcBar.IsClickable = true; + } + }; + btnModeIcon.MouseUpEventHandler = eventHandler1; + btnModeText.MouseUpEventHandler = eventHandler1; + dialogView.MouseUpEventHandler = eventHandler; + + } + + dialogView.MouseUpEventHandler = (sender, e) => { + dialog.Close(); + }; + dialog.Show(); + } + + #endregion + + + #region 鈻� 鍙戦�佸悇绉嶅懡浠______________________ + + /// <summary> + /// 娓╁害鏀瑰彉妯″紡 + /// </summary> + void LoadEvent_TempChange() + { + btnMinus.MouseUpEventHandler = (sender, e) => + { + //if (!device.online) + //{ + // new Tip() + // { + // CloseTime = 1, + // Text = Language.StringByID(StringId.DeviceOfflineCannotOption), + // Direction = AMPopTipDirection.None, + // }.Show(MainPage.BaseView); + // return; + //} + if (device.trait_on_off.curValue.ToString() == "off" || device.GetAttrState(FunctionAttributeKey.Mode) == "fan") + { + return; + } + var temp = Convert.ToInt32(device.GetAttrState(FunctionAttributeKey.SetTemp)); + if (temp <= device.GetAttribute(FunctionAttributeKey.Mode).min) + { + return; + } + temp--; + arcBar.Progress = temp; + btnTemp.Text = temp.ToString(); + device.SetAttrState(FunctionAttributeKey.SetTemp, temp.ToString()); + System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); + d.Add(FunctionAttributeKey.SetTemp, temp.ToString()); + Control.Ins.SendWriteCommand(device, d); + }; + btnPlus.MouseUpEventHandler = (sender, e) => + { + //if (!device.online) + //{ + // new Tip() + // { + // CloseTime = 1, + // Text = Language.StringByID(StringId.DeviceOfflineCannotOption), + // Direction = AMPopTipDirection.None, + // }.Show(MainPage.BaseView); + // return; + //} + if (device.trait_on_off.curValue.ToString() == "off" || device.GetAttrState(FunctionAttributeKey.Mode) == "fan") + { + return; + } + var temp = Convert.ToInt32(device.GetAttrState(FunctionAttributeKey.SetTemp)); + if (temp >= device.GetAttribute(FunctionAttributeKey.SetTemp).max) + { + return; + } + temp++; + arcBar.Progress = temp; + btnTemp.Text = temp.ToString(); + device.SetAttrState(FunctionAttributeKey.SetTemp, temp.ToString()); + System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); + d.Add(FunctionAttributeKey.SetTemp, temp.ToString()); + Control.Ins.SendWriteCommand(device, d); + }; + + //if (device.online) + { + arcBar.OnStopTrackingTouchEvent = (sender, e) => + { + device.SetAttrState(FunctionAttributeKey.SetTemp, arcBar.Progress.ToString()); + btnTemp.Text = arcBar.Progress.ToString(); + System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); + d.Add(FunctionAttributeKey.SetTemp, arcBar.Progress.ToString()); + Control.Ins.SendWriteCommand(device, d); + }; + arcBar.OnProgressChangedEvent = (sender, e) => + { + device.SetAttrState(FunctionAttributeKey.SetTemp, e.ToString()); + btnTemp.Text = e.ToString(); + }; + } + } + /// <summary> + /// 鎺у埗妯″紡浜嬩欢 + /// </summary> + void LoadEvent_AcStatesChange() + { + btnMode.MouseUpEventHandler = (sender, e) => + { + if (device.trait_on_off.curValue.ToString() == "off") + { + return; + } + LoadDiv_ChangeModeView(); + }; + + btnSwitch.MouseUpEventHandler = (sender, e) => + { + btnSwitch.IsSelected = !btnSwitch.IsSelected; + device.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off"; + if (device.trait_on_off.curValue.ToString() == "on") + { + arcBar.ThumbImagePath = "FunctionIcon/AC/DiyThumbIconOn.png"; + btnSwitch.IsSelected = true; + arcBar.IsOffline = false; + } + else + { + arcBar.ThumbImagePath = "FunctionIcon/AC/DiyThumbIcon.png"; + btnSwitch.IsBold = false; + arcBar.IsOffline = true; + } + System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); + d.Add(FunctionAttributeKey.OnOff, device.trait_on_off.curValue.ToString()); + Control.Ins.SendWriteCommand(device, d); + }; + } + + #endregion + + #region 鈻� 鍒锋柊鐣岄潰鐘舵�乢______________________ + + /// <summary> + /// 鍒锋柊鐣岄潰鐘舵�� + /// </summary> + private void RefreshFormStatu() + { + Application.RunOnMainThread(() => + { + btnTemp.Text = device.GetAttrState(FunctionAttributeKey.SetTemp); + btnIndoorTemp.Text = Language.StringByID(StringId.IndoorTemp) + Convert.ToInt32(Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.RoomTemp).Replace(",", "."))) + "掳C"; + btnMode.UnSelectedImagePath = fhTemp.GetModeIconPath(device.GetAttrState(FunctionAttributeKey.Mode)); + arcBar.Progress = Convert.ToInt32(Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.SetTemp).Replace(",", "."))); + if (device.trait_on_off.curValue.ToString() == "on") + { + arcBar.IsOffline = false; + btnSwitch.IsSelected = true; + arcBar.ThumbImagePath = "FunctionIcon/AC/DiyThumbIconOn.png"; + if (device.GetAttrState(FunctionAttributeKey.Mode) == "fan") + { + arcBar.IsClickable = false; + } + else + { + arcBar.IsClickable = true; + } + } + else + { + arcBar.IsOffline = true; + btnSwitch.IsSelected = false; + arcBar.IsClickable = false; + arcBar.ThumbImagePath = "FunctionIcon/AC/DiyThumbIcon.png"; + } + //鑷姩妯″紡涓嶅厑璁歌皟娓╁害 2021-10-27 09:41:35 wxr 闄堢惓鍙嶉 + if (device.GetAttrState(FunctionAttributeKey.Mode) == "auto") + { + btnPlus.Enable = false; + btnMinus.Enable = false; + arcBar.IsClickable = false; + arcBar.IsOffline = true; + } + }); + } + + #endregion + } +} \ No newline at end of file diff --git a/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSensorPage.cs b/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSensorPage.cs index 2d25afd..75388ce 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSensorPage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSensorPage.cs @@ -955,5 +955,10 @@ /// <summary> /// </summary> public string fieldValue { get; set; } + + /// <summary> + /// 鏃堕棿 + /// </summary> + public string time { get; set; } } } \ No newline at end of file diff --git a/HDL_ON/UI/UI2/FuntionControlView/Panel/EnvironmentPanelPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Panel/EnvironmentPanelPage.cs new file mode 100644 index 0000000..abb5549 --- /dev/null +++ b/HDL_ON/UI/UI2/FuntionControlView/Panel/EnvironmentPanelPage.cs @@ -0,0 +1,174 @@ +锘縰sing System; +using HDL_ON.Entity; +using HDL_ON.Stan; +using HDL_ON.UI.CSS; +using Shared; + +namespace HDL_ON.UI +{ + public class EnvironmentPanelPage : DeviceFunction4CardCommonForm + { + #region 鈻� 鍙橀噺澹版槑___________________________ + + /// <summary> + /// 鍥炬爣 + /// </summary> + private IconViewControl btnIcon = null; + /// <summary> + /// 鏂囨湰鎺т欢 + /// </summary> + private NormalViewControl btnSuctionView = null; + + Function acDevice; + Function fhDevice; + Function airFreshDevice; + #endregion + + #region 鈻� 鍒濆鍖朹____________________________ + + /// <summary> + /// 鍒濆鍖栫櫧鑹插尯鍩熺殑鍐呭 + /// </summary> + public override void InitFrameWhiteContent() + { + base.ShowColltionButton = false; + base.SetTitleText(Language.StringByID(StringId.SmartPanel)); + foreach (var sid in device.targetSids) + { + var targetObj = FunctionList.List.Functions.Find((obj) => sid == obj.sid); + if (targetObj == null) + { + continue; + } + if (SPK.AcSpkList().Contains(targetObj.spk)) + { + acDevice = targetObj; + } + else if (SPK.FhSpkList().Contains(targetObj.spk)) + { + fhDevice = targetObj; + } + else if (SPK.AirFreshSpkList().Contains(targetObj.spk)) + { + airFreshDevice = targetObj; + } + } + + //娣诲姞绗簩绱㈠紩椤� + this.Add4Page(); + //鍒濆鍖栫涓�涓储寮曢〉鐨勫唴瀹� + this.InitFrameWhiteContent1(); + //鍒濆鍖栫浜屼釜绱㈠紩椤电殑鍐呭 + this.InitFrameWhiteContent2(); + this.InitFrameWhiteContent3(); + //鍒锋柊鐣岄潰鐘舵�� + //this.RefreshFormStatu(); + //璇诲彇鐘舵�� + //new System.Threading.Thread(() => + //{ + // DriverLayer.Control.Ins.SendReadCommand(device); + //}) + //{ IsBackground = true }.Start(); + } + + /// <summary> + /// 鍒濆鍖栫涓�涓储寮曢〉鐨勫唴瀹� + /// </summary> + private void InitFrameWhiteContent1() + { + btnIcon = new IconViewControl(198) + { + Gravity = Gravity.CenterHorizontal, + Y = Application.GetRealWidth(146), + UnSelectedImagePath = "FunctionIcon/Panel/PanelHelpNormalBgIcon.png", + SelectedImagePath = "FunctionIcon/Panel/PanelHelpAlarmBgIcon.png", + }; + FrameWhiteCentet1.AddChidren(btnIcon); + + btnSuctionView = new NormalViewControl(300, 84, true) + { + Gravity = Gravity.CenterHorizontal, + Y = btnIcon.Bottom, + TextAlignment = TextAlignment.Center, + TextSize = CSS_FontSize.TextFontSize, + TextColor = CSS_Color.MainColor, + SelectedTextColor = CSS_Color.AuxiliaryColor2, + //BackgroundColor = 0xFFFF0000 + }; + FrameWhiteCentet1.AddChidren(btnSuctionView); + } + + /// <summary> + /// 鍒濆鍖栫浜屼釜绱㈠紩椤电殑鍐呭 + /// </summary> + private void InitFrameWhiteContent2() + { + var acPage = new UI2.FuntionControlView.Panel.AcContentView(acDevice); + FrameWhiteCentet2.AddChidren(acPage); + acPage.InitContent(); + } + + private void InitFrameWhiteContent3() + { + var fhPage = new FhContentView(fhDevice); + FrameWhiteCentet3.AddChidren(fhPage); + fhPage.InitContentView(true); + } + + #endregion + + #region 鈻� 璁惧鐘舵�佸弽棣坃______________________ + + /// <summary> + /// 璁惧鐘舵�佸弽棣� + /// </summary> + /// <param name="i_LocalDevice"></param> + public override void DeviceStatuPush(Function i_LocalDevice) + { + //涓嶆槸鍚屼竴涓笢瑗� + if (this.device.sid != i_LocalDevice.sid) { return; } + + //鍒锋柊鐣岄潰鐘舵�� + this.RefreshFormStatu(); + } + + #endregion + + #region 鈻� 鍙戦�佸悇绉嶅懡浠______________________ + + #endregion + + #region 鈻� 鍒锋柊鐣岄潰鐘舵�乢______________________ + + /// <summary> + /// 鍒锋柊鐣岄潰鐘舵�� + /// </summary> + private void RefreshFormStatu() + { + Application.RunOnMainThread(() => { + var temp = device.attributes.Find((sta) => sta.key == "alarm_status"); + if (temp != null) + { + if (temp.state == "alarm") + { + btnIcon.IsSelected = true; + btnSuctionView.TextID = StringId.InAlarm; + btnSuctionView.IsSelected = true; + } + else + { + btnIcon.IsSelected = false; + btnSuctionView.TextID = StringId.SensorNormalState; + btnSuctionView.IsSelected = false; + } + } + }); + } + + #endregion + + #region 鈻� 涓�鑸柟娉昣__________________________ + + #endregion + } +} diff --git a/HDL_ON/UI/UI2/FuntionControlView/Panel/PanelHelpPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Panel/PanelHelpPage.cs new file mode 100644 index 0000000..1350a45 --- /dev/null +++ b/HDL_ON/UI/UI2/FuntionControlView/Panel/PanelHelpPage.cs @@ -0,0 +1,142 @@ +锘縰sing System; +using HDL_ON.Entity; +using HDL_ON.Stan; +using HDL_ON.UI.CSS; +using Shared; + +namespace HDL_ON.UI.UI2.FuntionControlView.Panel +{ + public class PanelHelpPage : DeviceFunctionCardCommonForm + { + #region 鈻� 鍙橀噺澹版槑___________________________ + + /// <summary> + /// 鍥炬爣 + /// </summary> + private IconViewControl btnIcon = null; + /// <summary> + /// 鏂囨湰鎺т欢 + /// </summary> + private NormalViewControl btnSuctionView = null; + + #endregion + + #region 鈻� 鍒濆鍖朹____________________________ + + /// <summary> + /// 鍒濆鍖栫櫧鑹插尯鍩熺殑鍐呭 + /// </summary> + public override void InitFrameWhiteContent() + { + base.ShowColltionButton = false; + base.SetTitleText(Language.StringByID(StringId.SmartPanel)); + + //娣诲姞绗簩绱㈠紩椤� + this.AddSecondPage(); + //鍒濆鍖栫涓�涓储寮曢〉鐨勫唴瀹� + this.InitFrameWhiteContent1(); + //鍒濆鍖栫浜屼釜绱㈠紩椤电殑鍐呭 + this.InitFrameWhiteContent2(); + //鍒锋柊鐣岄潰鐘舵�� + this.RefreshFormStatu(); + //璇诲彇鐘舵�� + new System.Threading.Thread(() => + { + DriverLayer.Control.Ins.SendReadCommand(device); + }) + { IsBackground = true }.Start(); + } + + /// <summary> + /// 鍒濆鍖栫涓�涓储寮曢〉鐨勫唴瀹� + /// </summary> + private void InitFrameWhiteContent1() + { + btnIcon = new IconViewControl(198) + { + Gravity = Gravity.CenterHorizontal, + Y = Application.GetRealWidth(146), + UnSelectedImagePath = "FunctionIcon/Panel/PanelHelpNormalBgIcon.png", + SelectedImagePath = "FunctionIcon/Panel/PanelHelpAlarmBgIcon.png", + }; + FrameWhiteCentet1.AddChidren(btnIcon); + + btnSuctionView = new NormalViewControl(300, 84, true) + { + Gravity = Gravity.CenterHorizontal, + Y = btnIcon.Bottom, + TextAlignment = TextAlignment.Center, + TextSize = CSS_FontSize.TextFontSize, + TextColor = CSS_Color.MainColor, + SelectedTextColor = CSS_Color.AuxiliaryColor2, + //BackgroundColor = 0xFFFF0000 + }; + FrameWhiteCentet1.AddChidren(btnSuctionView); + } + + /// <summary> + /// 鍒濆鍖栫浜屼釜绱㈠紩椤电殑鍐呭 + /// </summary> + private void InitFrameWhiteContent2() + { + var paging = new ArmSensorHistroyPaging(device); + paging.InitFrame(FrameWhiteCentet2); + } + + #endregion + + #region 鈻� 璁惧鐘舵�佸弽棣坃______________________ + + /// <summary> + /// 璁惧鐘舵�佸弽棣� + /// </summary> + /// <param name="i_LocalDevice"></param> + public override void DeviceStatuPush(Function i_LocalDevice) + { + //涓嶆槸鍚屼竴涓笢瑗� + if (this.device.sid != i_LocalDevice.sid) { return; } + + //鍒锋柊鐣岄潰鐘舵�� + this.RefreshFormStatu(); + } + + #endregion + + #region 鈻� 鍙戦�佸悇绉嶅懡浠______________________ + + #endregion + + #region 鈻� 鍒锋柊鐣岄潰鐘舵�乢______________________ + + /// <summary> + /// 鍒锋柊鐣岄潰鐘舵�� + /// </summary> + private void RefreshFormStatu() + { + Application.RunOnMainThread(() => { + var temp = device.attributes.Find((sta) => sta.key == "alarm_status"); + if (temp != null) + { + if (temp.state == "alarm") + { + btnIcon.IsSelected = true; + btnSuctionView.TextID = StringId.InAlarming; + btnSuctionView.IsSelected = true; + } + else + { + btnIcon.IsSelected = false; + btnSuctionView.TextID = StringId.Monitoring; + btnSuctionView.IsSelected = false; + } + } + }); + } + + #endregion + + #region 鈻� 涓�鑸柟娉昣__________________________ + + #endregion + } +} diff --git a/SiriIntents/SiriIntents.csproj b/SiriIntents/SiriIntents.csproj index 45c6d61..a36210c 100644 --- a/SiriIntents/SiriIntents.csproj +++ b/SiriIntents/SiriIntents.csproj @@ -44,7 +44,6 @@ <MtouchArch>ARM64</MtouchArch> <MtouchHttpClientHandler>NSUrlSessionHandler</MtouchHttpClientHandler> <MtouchVerbosity></MtouchVerbosity> - <CodesignProvision>OnProSiri220307-1-Hoc</CodesignProvision> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' "> <DebugType>pdbonly</DebugType> -- Gitblit v1.8.0