From da5999ee08de8f6267a4ed491b79b36649c52186 Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期一, 27 十二月 2021 11:52:22 +0800 Subject: [PATCH] 备份 --- HDL-ON_Android/Assets/Phone/FunctionIcon/EnvironmentalScience/HistoryOpionBg3.png | 0 HDL-ON_Android/Properties/AndroidManifest.xml | 2 HDL_ON/UI/UI2/1-HomePage/HomePage.cs | 34 +- HDL-ON_Android/AgreementActivity.cs | 3 HDL-ON_Android/Assets/Language.ini | 6 HDL-ON_iOS/HDL-ON_iOS.csproj | 4 HDL-ON_iOS/Resources/Phone/FunctionIcon/EnvironmentalScience/HistoryOpionBg2.png | 0 HDL_ON/Entity/Function/SecurityAlarm.cs | 14 + HDL_ON/UI/UI2/FuntionControlView/ArmCenter/ArmCenterPage.cs | 16 + HDL_ON/DAL/Mqtt/MqttClient.cs | 1 HDL-ON_Android/HDL-ON_Android.csproj | 4 HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs | 8 HDL-ON_Android/Resources/values/strings.xml | 12 HDL-ON_Android/SplashActivity.cs | 6 HDL-ON_iOS/Info.plist | 4 HDL-ON_iOS/Resources/Language.ini | 6 HDL_ON/UI/UI2/FuntionControlView/Electrical/SocketPage.cs | 9 HDL-ON_Android/Assets/Phone/FunctionIcon/EnvironmentalScience/HistoryOpionBg4.png | 0 HDL_ON/UI/UI0-Public/PublicAssmebly.cs | 4 HDL-ON_iOS/Resources/Phone/FunctionIcon/EnvironmentalScience/HistoryOpionBg1.png | 0 HDL-ON_Android/Assets/Phone/FunctionIcon/EnvironmentalScience/HistoryOpionBg1.png | 0 HDL_ON/DAL/DriverLayer/Control.cs | 11 HDL_ON/UI/MainPage.cs | 2 HDL_ON/UI/UI1-Login/LoginPage.cs | 63 +++-- HDL_ON/UI/UI2/FuntionControlView/ArmCenter/AddInputPage.cs | 8 HDL-ON_iOS/Resources/Phone/FunctionIcon/EnvironmentalScience/HistoryOpionBg4.png | 0 HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs | 2 HDL-ON_Android/Resources/layout/activity_splash.xml | 67 +++-- HDL-ON_Android/Resources/values-zh/strings.xml | 7 HDL_ON/UI/UI2/FuntionControlView/Electrical/SocketPage_CumulativePowerConsumption.cs | 47 +++ HDL_ON/Entity/FunctionList.cs | 30 ++ HDL-ON_iOS/Resources/Phone/FunctionIcon/EnvironmentalScience/HistoryOpionBg3.png | 0 HDL_ON/DAL/Server/HttpUtil.cs | 4 HDL-ON_Android/Assets/Phone/FunctionIcon/EnvironmentalScience/HistoryOpionBg2.png | 0 HDL-ON_Android/Scan.cs | 15 + HDL_ON/Common/R.cs | 13 + HDL_ON/UI/UI2/FuntionControlView/ArmCenter/AddAlarmDeploymentPage.cs | 208 ++++++++++++++---- 37 files changed, 448 insertions(+), 162 deletions(-) diff --git a/HDL-ON_Android/AgreementActivity.cs b/HDL-ON_Android/AgreementActivity.cs index 84a475a..c861be1 100644 --- a/HDL-ON_Android/AgreementActivity.cs +++ b/HDL-ON_Android/AgreementActivity.cs @@ -1,6 +1,7 @@ 锘縰sing System; using Android.App; using Android.Content; +using Android.Content.PM; using Android.Net; using Android.OS; using CN.Jpush.Android.Api; @@ -16,7 +17,7 @@ namespace HDL_ON_Android { - [Activity(Label = "AgreementActivity", Theme = "@style/MyTheme1")] + [Activity(Label = "AgreementActivity", Theme = "@style/MyTheme1", ScreenOrientation = ScreenOrientation.Portrait)] public class AgreementActivity : Activity { protected override void OnCreate(Bundle savedInstanceState) diff --git a/HDL-ON_Android/Assets/Language.ini b/HDL-ON_Android/Assets/Language.ini index f0a5536..b7c1057 100644 --- a/HDL-ON_Android/Assets/Language.ini +++ b/HDL-ON_Android/Assets/Language.ini @@ -508,6 +508,9 @@ 520=Electric Current (A) 521=Power (W) 522=Refresh +523=Delay alarm +524=Bypass +525=Enable 1000=Room Humidity 1001=V-chip @@ -1639,6 +1642,9 @@ 520=鐢垫祦(A) 521=鍔熺巼(W) 522=鍒锋柊 +523=寤舵椂鎶ヨ +524=鍋滅敤 +525=鍚敤 1000=瀹ゅ唴婀垮害 1001=绔ラ攣 diff --git a/HDL-ON_Android/Assets/Phone/FunctionIcon/EnvironmentalScience/HistoryOpionBg1.png b/HDL-ON_Android/Assets/Phone/FunctionIcon/EnvironmentalScience/HistoryOpionBg1.png new file mode 100644 index 0000000..4e4efb9 --- /dev/null +++ b/HDL-ON_Android/Assets/Phone/FunctionIcon/EnvironmentalScience/HistoryOpionBg1.png Binary files differ diff --git a/HDL-ON_Android/Assets/Phone/FunctionIcon/EnvironmentalScience/HistoryOpionBg2.png b/HDL-ON_Android/Assets/Phone/FunctionIcon/EnvironmentalScience/HistoryOpionBg2.png new file mode 100644 index 0000000..93844b4 --- /dev/null +++ b/HDL-ON_Android/Assets/Phone/FunctionIcon/EnvironmentalScience/HistoryOpionBg2.png Binary files differ diff --git a/HDL-ON_Android/Assets/Phone/FunctionIcon/EnvironmentalScience/HistoryOpionBg3.png b/HDL-ON_Android/Assets/Phone/FunctionIcon/EnvironmentalScience/HistoryOpionBg3.png new file mode 100644 index 0000000..33decef --- /dev/null +++ b/HDL-ON_Android/Assets/Phone/FunctionIcon/EnvironmentalScience/HistoryOpionBg3.png Binary files differ diff --git a/HDL-ON_Android/Assets/Phone/FunctionIcon/EnvironmentalScience/HistoryOpionBg4.png b/HDL-ON_Android/Assets/Phone/FunctionIcon/EnvironmentalScience/HistoryOpionBg4.png new file mode 100644 index 0000000..5f870ed --- /dev/null +++ b/HDL-ON_Android/Assets/Phone/FunctionIcon/EnvironmentalScience/HistoryOpionBg4.png Binary files differ diff --git a/HDL-ON_Android/HDL-ON_Android.csproj b/HDL-ON_Android/HDL-ON_Android.csproj index 3b7b8fa..b61af2b 100644 --- a/HDL-ON_Android/HDL-ON_Android.csproj +++ b/HDL-ON_Android/HDL-ON_Android.csproj @@ -212,6 +212,10 @@ <AndroidAsset Include="Assets\Phone\FunctionIcon\AirFresh\btnCloseIcon.png" /> <AndroidAsset Include="Assets\Phone\FunctionIcon\AirFresh\btnInfoIcon.png" /> <AndroidAsset Include="Assets\Phone\FunctionIcon\AirFresh\HumiOnIcon.png" /> + <AndroidAsset Include="Assets\Phone\FunctionIcon\EnvironmentalScience\HistoryOpionBg1.png" /> + <AndroidAsset Include="Assets\Phone\FunctionIcon\EnvironmentalScience\HistoryOpionBg2.png" /> + <AndroidAsset Include="Assets\Phone\FunctionIcon\EnvironmentalScience\HistoryOpionBg3.png" /> + <AndroidAsset Include="Assets\Phone\FunctionIcon\EnvironmentalScience\HistoryOpionBg4.png" /> </ItemGroup> <ItemGroup> <AndroidResource Include="Resources\values\colors.xml" /> diff --git a/HDL-ON_Android/Properties/AndroidManifest.xml b/HDL-ON_Android/Properties/AndroidManifest.xml index 83f0db8..6eaf73c 100644 --- a/HDL-ON_Android/Properties/AndroidManifest.xml +++ b/HDL-ON_Android/Properties/AndroidManifest.xml @@ -1,5 +1,5 @@ 锘�<?xml version="1.0" encoding="utf-8"?> -<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="202112203" android:versionName="1.4.4" package="com.hdl.onpro"> +<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="202112271" android:versionName="1.4.5" package="com.hdl.onpro"> <uses-sdk android:minSdkVersion="23" android:targetSdkVersion="28" /> <!-- 涔愭鍙瀵硅闇�瑕佺殑鏉冮檺 --> <!--<uses-permission android:name="android.permission.INTERNET" />--> diff --git a/HDL-ON_Android/Resources/layout/activity_splash.xml b/HDL-ON_Android/Resources/layout/activity_splash.xml index ccf3aff..937203c 100644 --- a/HDL-ON_Android/Resources/layout/activity_splash.xml +++ b/HDL-ON_Android/Resources/layout/activity_splash.xml @@ -13,21 +13,22 @@ android:orientation="vertical" android:background="#55000000"> - <RelativeLayout + <LinearLayout android:layout_width="280dp" - android:layout_height="417dp" + android:layout_height="wrap_content" android:layout_gravity="center" + android:orientation="vertical" android:background="@drawable/dialog_background2"> <TextView android:layout_width="match_parent" - android:layout_height="25dp" + android:layout_height="wrap_content" android:id="@+id/title_tv" android:text="@string/privacy_policy_and_service_agreement" android:textColor="#bb000000" android:layout_marginTop="15dp" - android:layout_marginLeft="0dp" - android:layout_marginRight="0dp" + android:layout_marginLeft="10dp" + android:layout_marginRight="10dp" android:textSize="18sp" android:gravity="center"/> @@ -36,7 +37,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/msg_content_tv" - android:layout_marginTop="49dp" + android:layout_marginTop="10dp" android:layout_marginLeft="16dp" android:layout_marginRight="16dp" android:text="@string/read_privacy_policy_and_service_agreement_tip" @@ -50,7 +51,7 @@ android:gravity="center" android:text="@string/login_privacy_policy" android:textColor="#E6000000" - android:layout_marginTop="105dp" + android:layout_marginTop="10dp" android:layout_marginLeft="16dp"/> <TextView @@ -59,35 +60,41 @@ android:text="@string/login_user_service_agreement" android:textColor="#E6000000" android:id="@+id/service_agreement_btn" - android:layout_marginTop="140dp" + android:layout_marginTop="10dp" android:layout_marginLeft="16dp" android:gravity="center"/> - - <Button - android:layout_width="120dp" - android:layout_height="52dp" - android:id="@+id/disagree_btn" - android:text="@string/disagree" - android:textColor="#245ec3" - android:layout_marginLeft="16dp" + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginTop="120dp" android:layout_marginBottom="20dp" - android:layout_alignParentBottom="true" - android:background="@drawable/btn_disagree"/> + android:orientation="horizontal"> - <Button - android:layout_width="120dp" - android:layout_height="52dp" - android:id="@+id/agree_btn" - android:text="@string/agree" - android:textColor="@color/color_white" - android:layout_alignParentRight="true" - android:layout_alignParentBottom="true" - android:layout_marginRight="16dp" - android:layout_marginBottom="20dp" - android:background="@drawable/btn_agree"/> + <Button + android:layout_width="120dp" + android:layout_height="52dp" + android:id="@+id/disagree_btn" + android:text="@string/disagree" + android:textColor="#245ec3" + android:layout_marginLeft="13dp" + android:layout_alignParentBottom="true" + android:background="@drawable/btn_disagree"/> + <Button + android:layout_width="120dp" + android:layout_height="52dp" + android:id="@+id/agree_btn" + android:text="@string/agree" + android:textColor="@color/color_white" + android:layout_alignParentRight="true" + android:layout_alignParentBottom="true" + android:layout_marginLeft="14dp" + android:background="@drawable/btn_agree"/> - </RelativeLayout> + </LinearLayout> + + </LinearLayout> </FrameLayout> </LinearLayout> \ No newline at end of file diff --git a/HDL-ON_Android/Resources/values-zh/strings.xml b/HDL-ON_Android/Resources/values-zh/strings.xml index 0d86f4f..8bba32d 100644 --- a/HDL-ON_Android/Resources/values-zh/strings.xml +++ b/HDL-ON_Android/Resources/values-zh/strings.xml @@ -22,4 +22,11 @@ <string name="talk_open_failed">瀵硅鎵撳紑澶辫触</string> <string name="unlock_fail">寮�閿佸け璐�</string> <string name="screenshot_fail">鎴浘澶辫触</string> + + <string name="login_user_service_agreement">銆婄敤鎴锋湇鍔″崗璁��</string> + <string name="login_privacy_policy">銆婇殣绉佹潈鏀跨瓥銆�</string> + <string name="privacy_policy_and_service_agreement">闅愮鏉冩斂绛栧強鏈嶅姟鏉℃</string> + <string name="read_privacy_policy_and_service_agreement_tip">涓轰簡鏇村ソ鐨勪繚闅滄偍鐨勫悎娉曟潈鐩婏紝璇锋偍闃呰骞跺悓鎰忎互涓嬪崗璁�</string> + <string name="disagree">涓嶅悓鎰�</string> + <string name="agree">鍚屾剰</string> </resources> \ No newline at end of file diff --git a/HDL-ON_Android/Resources/values/strings.xml b/HDL-ON_Android/Resources/values/strings.xml index e637aed..75d41c2 100644 --- a/HDL-ON_Android/Resources/values/strings.xml +++ b/HDL-ON_Android/Resources/values/strings.xml @@ -23,10 +23,10 @@ <string name="screenshot_fail">Fail to screenshot</string> - <string name="login_user_service_agreement">銆婄敤鎴锋湇鍔″崗璁��</string> - <string name="login_privacy_policy">銆婇殣绉佹潈鏀跨瓥銆�</string> - <string name="privacy_policy_and_service_agreement">闅愮鏉冩斂绛栧強鏈嶅姟鏉℃</string> - <string name="read_privacy_policy_and_service_agreement_tip">涓轰簡鏇村ソ鐨勪繚闅滄偍鐨勫悎娉曟潈鐩婏紝璇锋偍闃呰骞跺悓鎰忎互涓嬪崗璁�</string> - <string name="disagree">涓嶅悓鎰�</string> - <string name="agree">鍚屾剰</string> + <string name="login_user_service_agreement">銆奤ser service agreement銆�</string> + <string name="login_privacy_policy">銆奝rivacy policy銆�</string> + <string name="privacy_policy_and_service_agreement">Privacy policy and terms of service</string> + <string name="read_privacy_policy_and_service_agreement_tip">In order to better protect your legitimate rights and interests, please read and agree to the following agreement</string> + <string name="disagree">Disagree</string> + <string name="agree">Agree</string> </resources> \ No newline at end of file diff --git a/HDL-ON_Android/Scan.cs b/HDL-ON_Android/Scan.cs index 01cbcb3..c329cd0 100644 --- a/HDL-ON_Android/Scan.cs +++ b/HDL-ON_Android/Scan.cs @@ -1,5 +1,6 @@ 锘縰sing System; using System.IO; +using Android.Content; using Shared; using ZXing.Mobile; @@ -65,6 +66,20 @@ else { action?.Invoke(null); + Action action1 = () => { + Intent intent = new Intent(Android.Provider.Settings.ActionApplicationDetailsSettings); + intent.AddFlags(ActivityFlags.NewTask); + Android.Net.Uri uri = Android.Net.Uri.FromParts("package", Application.Activity.PackageName, null); + intent.SetData(uri); + Application.Activity.StartActivity(intent); + }; + if (Language.CurrentLanguage == "Chinese") + { + new HDL_ON.UI.PublicAssmebly().TipOptionMsg(StringId.Tip, "鐩告満璁块棶鏉冮檺宸茶鎷掔粷锛岃鍓嶅線绯荤粺璁剧疆鎵撳紑鐩稿叧鏉冮檺銆�", action1); + }else + { + new HDL_ON.UI.PublicAssmebly().TipOptionMsg(StringId.Tip, "Camera access has been denied. Please go to system settings to open relevant permissions.",action1); + } } }); } diff --git a/HDL-ON_Android/SplashActivity.cs b/HDL-ON_Android/SplashActivity.cs index 5c1b1c3..8d1511b 100644 --- a/HDL-ON_Android/SplashActivity.cs +++ b/HDL-ON_Android/SplashActivity.cs @@ -1,6 +1,7 @@ 锘縰sing System; using Android.App; using Android.Content; +using Android.Content.PM; using Android.Net; using Android.OS; using CN.Jpush.Android.Api; @@ -15,7 +16,7 @@ namespace HDL_ON_Android { - [Activity(Theme = "@style/SplashTheme", MainLauncher = true, Name = "com.hdl.onpro.SplashActivity")] + [Activity(Theme = "@style/SplashTheme", MainLauncher = true, Name = "com.hdl.onpro.SplashActivity",ScreenOrientation = ScreenOrientation.Portrait) ] [IntentFilter(new string[] { "com.hdl.onpro.SplashActivity", Intent.ActionView })] public class SplashActivity : Activity { @@ -40,6 +41,7 @@ base.OnActivityResult(requestCode, resultVal, data); } + protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); @@ -49,6 +51,8 @@ //OverridePendingTransition(0, 0); //initAll(); + + if (HDL_ON.OnAppConfig.Instance.FirstRunApp) { diff --git a/HDL-ON_iOS/HDL-ON_iOS.csproj b/HDL-ON_iOS/HDL-ON_iOS.csproj index ed01bc0..b91b57c 100644 --- a/HDL-ON_iOS/HDL-ON_iOS.csproj +++ b/HDL-ON_iOS/HDL-ON_iOS.csproj @@ -1380,6 +1380,10 @@ <BundleResource Include="Resources\Phone\FunctionIcon\AirFresh\btnInfoIcon.png" /> <BundleResource Include="Resources\Phone\FunctionIcon\AirFresh\HumiOnIcon.png" /> <BundleResource Include="Resources\Phone\PersonalCenter\SiriIcon.png" /> + <BundleResource Include="Resources\Phone\FunctionIcon\EnvironmentalScience\HistoryOpionBg1.png" /> + <BundleResource Include="Resources\Phone\FunctionIcon\EnvironmentalScience\HistoryOpionBg2.png" /> + <BundleResource Include="Resources\Phone\FunctionIcon\EnvironmentalScience\HistoryOpionBg3.png" /> + <BundleResource Include="Resources\Phone\FunctionIcon\EnvironmentalScience\HistoryOpionBg4.png" /> </ItemGroup> <ItemGroup> <ITunesArtwork Include="iTunesArtwork" /> diff --git a/HDL-ON_iOS/Info.plist b/HDL-ON_iOS/Info.plist index ac88548..a2100e0 100644 --- a/HDL-ON_iOS/Info.plist +++ b/HDL-ON_iOS/Info.plist @@ -100,9 +100,9 @@ <key>UIStatusBarStyle</key> <string>UIStatusBarStyleLightContent</string> <key>CFBundleShortVersionString</key> - <string>1.4.302112201</string> + <string>1.4.302112271</string> <key>CFBundleVersion</key> - <string>1.4.12201</string> + <string>1.4.12271</string> <key>NSLocationWhenInUseUsageDescription</key> <string>Use geographic location to provide services such as weather</string> <key>NSAppleMusicUsageDescription</key> diff --git a/HDL-ON_iOS/Resources/Language.ini b/HDL-ON_iOS/Resources/Language.ini index f0a5536..b7c1057 100644 --- a/HDL-ON_iOS/Resources/Language.ini +++ b/HDL-ON_iOS/Resources/Language.ini @@ -508,6 +508,9 @@ 520=Electric Current (A) 521=Power (W) 522=Refresh +523=Delay alarm +524=Bypass +525=Enable 1000=Room Humidity 1001=V-chip @@ -1639,6 +1642,9 @@ 520=鐢垫祦(A) 521=鍔熺巼(W) 522=鍒锋柊 +523=寤舵椂鎶ヨ +524=鍋滅敤 +525=鍚敤 1000=瀹ゅ唴婀垮害 1001=绔ラ攣 diff --git a/HDL-ON_iOS/Resources/Phone/FunctionIcon/EnvironmentalScience/HistoryOpionBg1.png b/HDL-ON_iOS/Resources/Phone/FunctionIcon/EnvironmentalScience/HistoryOpionBg1.png new file mode 100644 index 0000000..4e4efb9 --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/FunctionIcon/EnvironmentalScience/HistoryOpionBg1.png Binary files differ diff --git a/HDL-ON_iOS/Resources/Phone/FunctionIcon/EnvironmentalScience/HistoryOpionBg2.png b/HDL-ON_iOS/Resources/Phone/FunctionIcon/EnvironmentalScience/HistoryOpionBg2.png new file mode 100644 index 0000000..93844b4 --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/FunctionIcon/EnvironmentalScience/HistoryOpionBg2.png Binary files differ diff --git a/HDL-ON_iOS/Resources/Phone/FunctionIcon/EnvironmentalScience/HistoryOpionBg3.png b/HDL-ON_iOS/Resources/Phone/FunctionIcon/EnvironmentalScience/HistoryOpionBg3.png new file mode 100644 index 0000000..33decef --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/FunctionIcon/EnvironmentalScience/HistoryOpionBg3.png Binary files differ diff --git a/HDL-ON_iOS/Resources/Phone/FunctionIcon/EnvironmentalScience/HistoryOpionBg4.png b/HDL-ON_iOS/Resources/Phone/FunctionIcon/EnvironmentalScience/HistoryOpionBg4.png new file mode 100644 index 0000000..5f870ed --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/FunctionIcon/EnvironmentalScience/HistoryOpionBg4.png Binary files differ diff --git a/HDL_ON/Common/R.cs b/HDL_ON/Common/R.cs index 2178858..67b3828 100644 --- a/HDL_ON/Common/R.cs +++ b/HDL_ON/Common/R.cs @@ -4,7 +4,18 @@ { public static class StringId { - + /// <summary> + /// 鍚敤 + /// </summary> + public const int Enable = 525; + /// <summary> + /// 鍋滅敤 + /// </summary> + public const int Bypass = 524; + /// <summary> + /// 瑙﹀彂鍚庡欢鏃舵姤璀� + /// </summary> + public const int DelayAlarm = 523; /// <summary> /// 鍒锋柊 /// </summary> diff --git a/HDL_ON/DAL/DriverLayer/Control.cs b/HDL_ON/DAL/DriverLayer/Control.cs index 28ef74e..1430b9b 100644 --- a/HDL_ON/DAL/DriverLayer/Control.cs +++ b/HDL_ON/DAL/DriverLayer/Control.cs @@ -503,11 +503,18 @@ { new System.Threading.Thread(() => { - foreach (var temp in functions) + foreach (var function in functions) { Dictionary<string, string> d1 = new Dictionary<string, string>(); d1.Add(FunctionAttributeKey.OnOff, open ? "on" : "off"); - SendWriteCommand(temp, d1); + if (function.spk == SPK.PanelSocket) + { + if (function.attributes.Find((obj) => obj.key == "on_off_usb") != null) + { + d1.Add("on_off_usb", function.trait_on_off.curValue.ToString()); + } + } + SendWriteCommand(function, d1); System.Threading.Thread.Sleep(100); } }) diff --git a/HDL_ON/DAL/Mqtt/MqttClient.cs b/HDL_ON/DAL/Mqtt/MqttClient.cs index c16fd6f..e617b29 100644 --- a/HDL_ON/DAL/Mqtt/MqttClient.cs +++ b/HDL_ON/DAL/Mqtt/MqttClient.cs @@ -458,7 +458,6 @@ if (temp != null) { - Control_Udp.ReceiveRepeatManager(temp.id, null); foreach (var updataSecurity in temp.objects) { var updataLocalSecurity = FunctionList.List.securities.Find((obj) => obj.sid == updataSecurity.sid); diff --git a/HDL_ON/DAL/Server/HttpUtil.cs b/HDL_ON/DAL/Server/HttpUtil.cs index 6c692b6..315e9a2 100644 --- a/HDL_ON/DAL/Server/HttpUtil.cs +++ b/HDL_ON/DAL/Server/HttpUtil.cs @@ -17,8 +17,8 @@ /// 鍥哄畾鍩熷悕,姝e紡鐜 /// 鍏叡鍩熷悕灏辫繎瑙f瀽 /// </summary> - //public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; - public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";//mmmm + public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; + //public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";//mmmm /// <summary> /// RegionMark /// </summary> diff --git a/HDL_ON/Entity/Function/SecurityAlarm.cs b/HDL_ON/Entity/Function/SecurityAlarm.cs index ea29373..fa1a558 100644 --- a/HDL_ON/Entity/Function/SecurityAlarm.cs +++ b/HDL_ON/Entity/Function/SecurityAlarm.cs @@ -33,6 +33,10 @@ /// </summary> public string delay ="0"; /// <summary> + /// 鎶ヨ寤舵椂 + /// </summary> + public string output_delay = "0"; + /// <summary> /// 鐘舵�� /// 甯冮槻:enable /// 鎾掗槻:disable @@ -272,9 +276,9 @@ /// </summary> public string sid; /// <summary> - /// Bypass璁剧疆 true:鍚敤涓�乫alse:涓存椂bypass涓� + /// Bypass璁剧疆 false:鍚敤涓�乼rue:涓存椂bypass涓� /// </summary> - public string bypass; + public string bypass = "false"; /// <summary> /// 瀹夐槻杈撳叆鏉′欢 /// </summary> @@ -457,6 +461,10 @@ /// 鍊� /// </summary> public string value; + /// <summary> + /// Bypass璁剧疆 true:涓存椂bypass涓�乫alse:鍚敤涓� + /// </summary> + public bool bypass = false; } /// <summary> @@ -483,7 +491,7 @@ /// <summary> /// 鏈湴涓嶅瓨鍦ㄦ暟鎹紙鏁版嵁鍙兘琚垹浜嗭級 /// </summary> - public bool NoLocalData () + public bool LocalData () { var function = FunctionList.List.GetLightList().Find((obj) => obj.sid == sid); if (function != null) diff --git a/HDL_ON/Entity/FunctionList.cs b/HDL_ON/Entity/FunctionList.cs index 6dda2d1..c1b1641 100644 --- a/HDL_ON/Entity/FunctionList.cs +++ b/HDL_ON/Entity/FunctionList.cs @@ -139,6 +139,23 @@ var spkList = SPK.ArmSensorSpkList(); return Functions.FindAll((obj) => spkList.Contains(obj.spk)); } + /// <summary> + /// 瀹夐槻涓績鏀寔鐨勪紶鎰熷櫒鍒楄〃 + /// </summary> + public List<Function> GetArmCenterList() + { + var spkList = new List<string>() + { + SPK.SensorPir, + SPK.SensorDoorWindow, + SPK.SensorSmoke, + SPK.SensorWater, + SPK.SensorGas, + }; + + return Functions.FindAll((obj) => spkList.Contains(obj.spk)); + } + /// <summary> /// 鍙瀵硅鍒楄〃,褰撲负null鎴杝ize涓�0鍒欎笉鏄剧ず鍙瀵硅icon @@ -175,6 +192,19 @@ /// </summary> public List<SecurityAlarm> securities = new List<SecurityAlarm>(); + public List<SecurityAlarm> GetOrdinarySecurities() + { + var ordinarySecurities = new List<SecurityAlarm>(); + foreach (var mode in securities) + { + if (mode.type == "all_day" || mode.type == "mute") + { + continue; + } + ordinarySecurities.Add(mode); + } + return ordinarySecurities; + } /// <summary> /// 鍔犺浇鍔熻兘鍒楄〃 diff --git a/HDL_ON/UI/MainPage.cs b/HDL_ON/UI/MainPage.cs index 1c9492c..07b0ef3 100644 --- a/HDL_ON/UI/MainPage.cs +++ b/HDL_ON/UI/MainPage.cs @@ -26,7 +26,7 @@ /// <summary> /// 鐗堟湰鍙� /// </summary> - public static string VersionString = "1.4.4"; + public static string VersionString = "1.4.5"; ///// <summary> ///// 瀹㈡埛绔被鍨� ///// </summary> diff --git a/HDL_ON/UI/UI0-Public/PublicAssmebly.cs b/HDL_ON/UI/UI0-Public/PublicAssmebly.cs index 618425a..7734924 100644 --- a/HDL_ON/UI/UI0-Public/PublicAssmebly.cs +++ b/HDL_ON/UI/UI0-Public/PublicAssmebly.cs @@ -277,7 +277,7 @@ Button btnMsg = new Button() { Gravity = Gravity.CenterHorizontal, - Height = Application.GetRealHeight(25), + Height = Application.GetRealHeight(35), Y = btnTitle.Bottom, Width = Application.GetRealHeight(200), TextAlignment = TextAlignment.Center, @@ -463,7 +463,7 @@ Button btnMsg = new Button() { Gravity = Gravity.CenterHorizontal, - Height = Application.GetRealHeight(25), + Height = Application.GetRealHeight(35), Y = btnTitle.Bottom, Width = Application.GetRealHeight(200), TextAlignment = TextAlignment.Center, diff --git a/HDL_ON/UI/UI1-Login/LoginPage.cs b/HDL_ON/UI/UI1-Login/LoginPage.cs index d1720bf..fcf307c 100644 --- a/HDL_ON/UI/UI1-Login/LoginPage.cs +++ b/HDL_ON/UI/UI1-Login/LoginPage.cs @@ -168,6 +168,9 @@ /// </summary> public void LoadView(UserInfo userInfo = null) { +#if __Android__ + OnAppConfig.Instance.isAgreePrivacyPolicy = false; +#endif var btnIcon = new Button() { X = Application.GetRealWidth(28), @@ -252,7 +255,7 @@ }; #endif - #region 鐧诲綍鏂瑰紡閫夋嫨 +#region 鐧诲綍鏂瑰紡閫夋嫨 btnPhoneLogin = new Button() { X = Application.GetRealWidth(28), @@ -278,9 +281,9 @@ TextSize = CSS_FontSize.TextFontSize, }; bodyView.AddChidren(btnEmailLogin); - #endregion +#endregion - #region 璐﹀彿濉啓 +#region 璐﹀彿濉啓 accountView = new FrameLayout() { X = Application.GetRealWidth(28), @@ -368,9 +371,9 @@ accountView.AddChidren(btnAccountIcon); } - #endregion +#endregion - #region 瀵嗙爜濉啓 +#region 瀵嗙爜濉啓 passwordView = new FrameLayout() { X = Application.GetRealWidth(28), @@ -414,7 +417,7 @@ }; passwordView.AddChidren(etPassword); - #region 瀵嗙爜鐧诲綍-鎺т欢鍔犺浇 +#region 瀵嗙爜鐧诲綍-鎺т欢鍔犺浇 btnVisiblePassword = new Button() { X = Application.GetRealWidth(223), @@ -446,9 +449,9 @@ TextSize = 12, }; passwordView.AddChidren(btnForgetPassword); - #endregion +#endregion - #region 楠岃瘉鐮佺櫥褰�-鎺т欢鍔犺浇 +#region 楠岃瘉鐮佺櫥褰�-鎺т欢鍔犺浇 btnGetVerificationCode = new Button() { X = Application.GetRealWidth(219), @@ -462,7 +465,7 @@ IsSelected = false, }; passwordView.AddChidren(btnGetVerificationCode); - #endregion +#endregion btnPasswordViewBottomLine = new Button() { @@ -473,9 +476,9 @@ }; passwordView.AddChidren(btnPasswordViewBottomLine); - #endregion +#endregion - #region 娉ㄥ唽涓庡揩鎹风櫥褰� +#region 娉ㄥ唽涓庡揩鎹风櫥褰� btnRegister = new Button() { X = Application.GetRealWidth(28), @@ -502,7 +505,7 @@ }; bodyView.AddChidren(btnSwitchLoginMode); - #endregion +#endregion btnLogin = new Button() { @@ -547,7 +550,7 @@ //妤煎眰鎴块棿鍒楄〃 var floor1 = new SpatialInfo("FLOOR") { roomName = "F1", parentId = DB_ResidenceData.Instance.CurrentRegion.id }; floor1.SaveRoomFile(); - #region 鎴块棿涓� -- 瀹㈠巺 +#region 鎴块棿涓� -- 瀹㈠巺 //澶勭悊鎴块棿鍒楄〃 var room1 = new Room() @@ -627,8 +630,8 @@ SpatialInfo.CurrentSpatial.RoomList.Add(room4); - #region 瀹㈠巺 - #region 鍔熻兘 +#region 瀹㈠巺 +#region 鍔熻兘 var lightRgb1 = new Function() { sid = "light1", @@ -754,8 +757,8 @@ }, }; fh.SaveFunctionFile(); - #endregion - #region 鍦烘櫙 +#endregion +#region 鍦烘櫙 var scene1 = new Scene() { sid = "scene1", @@ -907,9 +910,9 @@ }; scene2.SaveSceneFile(); - #endregion - #endregion - #region 椁愬巺 +#endregion +#endregion +#region 椁愬巺 var lightSwitch3 = new Function() { sid = "light6", @@ -1013,8 +1016,8 @@ } }; scene4.SaveSceneFile(); - #endregion - #region 鍗у +#endregion +#region 鍗у var ac = new Function() { sid = "ac1", @@ -1053,7 +1056,7 @@ // collect = false, //}; //scene6.SaveSceneFile(); - #endregion +#endregion var lightSwitch6 = new Function() @@ -1071,7 +1074,7 @@ }; lightSwitch6.SaveFunctionFile(); - #endregion +#endregion var fileList = Common.FileUtlis.Files.ReadFiles(); foreach(var file in fileList) @@ -1090,7 +1093,7 @@ LoadEventList(); account = etAccount.Text.Trim(); - #if DEBUG1211 +#if DEBUG1211 //鏈湴妯″紡 Button btnLocalMode = new Button() { @@ -1112,15 +1115,15 @@ MainPage.Log("etAccount.TextAlignment : " + etAccount.TextAlignment.ToString()); - #endif +#endif - #region 闅愮鏀跨瓥 +#region 闅愮鏀跨瓥 AddServiceAgreementControl(bodyView); - #endregion +#endregion } - #region 鈻� 鏈嶅姟鍗忚___________________________ +#region 鈻� 鏈嶅姟鍗忚___________________________ bool isAgreePrivacyPolicy = false; /// <summary> /// 娣诲姞鏈嶅姟鍗忚鎺т欢 @@ -1263,6 +1266,6 @@ return true; } - #endregion +#endregion } } \ No newline at end of file diff --git a/HDL_ON/UI/UI2/1-HomePage/HomePage.cs b/HDL_ON/UI/UI2/1-HomePage/HomePage.cs index 3804598..5c2fe0f 100644 --- a/HDL_ON/UI/UI2/1-HomePage/HomePage.cs +++ b/HDL_ON/UI/UI2/1-HomePage/HomePage.cs @@ -600,23 +600,23 @@ //}); - FunctionList.List.Functions.Add(new Function() - { - spk = SPK.HvacAirFreshJinmao, - name = "娴嬭瘯閲戣寕鏂伴", - attributes = new List<FunctionAttributes>() - { - new FunctionAttributes(){ key = "on_off",curValue= "on",state = "on" }, - new FunctionAttributes(){ key = "mode",curValue= "humidification",state = "humidification" ,value = new List<string>(){ "humidification", "fan" } }, - new FunctionAttributes(){ key = "energy",curValue= "true",state = "true" ,value = new List<string>(){ "true", "false" } }, - new FunctionAttributes(){ key = "fan",curValue= "level_1",state = "level_1" ,value = new List<string>(){ "level_1", "level_2", "level_3","auto" } }, - new FunctionAttributes(){ key = "humidity",curValue= "0",state = "0" ,value = new List<string>(){ },min = 0,max = 100 }, - new FunctionAttributes(){ key = "indoor_temp",curValue= "26",state = "26" ,value = new List<string>(){ },min = 0,max = 100 }, - new FunctionAttributes(){ key = "indoor_humidity",curValue= "0",state = "0" ,value = new List<string>(){ },min = 0,max = 100 }, - new FunctionAttributes(){ key = "filter_remain",curValue= "0",state = "0" ,value = new List<string>(){ },min = 0,max = 100 }, - new FunctionAttributes(){ key = "filter_timeout",curValue= "false",state = "false" ,value = new List<string>(){ "true", "false" }}, - }, - }); + //FunctionList.List.Functions.Add(new Function() + //{ + // spk = SPK.HvacAirFreshJinmao, + // name = "娴嬭瘯閲戣寕鏂伴", + // attributes = new List<FunctionAttributes>() + // { + // new FunctionAttributes(){ key = "on_off",curValue= "on",state = "on" }, + // new FunctionAttributes(){ key = "mode",curValue= "humidification",state = "humidification" ,value = new List<string>(){ "humidification", "fan" } }, + // new FunctionAttributes(){ key = "energy",curValue= "true",state = "true" ,value = new List<string>(){ "true", "false" } }, + // new FunctionAttributes(){ key = "fan",curValue= "level_1",state = "level_1" ,value = new List<string>(){ "level_1", "level_2", "level_3","auto" } }, + // new FunctionAttributes(){ key = "humidity",curValue= "0",state = "0" ,value = new List<string>(){ },min = 0,max = 100 }, + // new FunctionAttributes(){ key = "indoor_temp",curValue= "26",state = "26" ,value = new List<string>(){ },min = 0,max = 100 }, + // new FunctionAttributes(){ key = "indoor_humidity",curValue= "0",state = "0" ,value = new List<string>(){ },min = 0,max = 100 }, + // new FunctionAttributes(){ key = "filter_remain",curValue= "0",state = "0" ,value = new List<string>(){ },min = 0,max = 100 }, + // new FunctionAttributes(){ key = "filter_timeout",curValue= "false",state = "false" ,value = new List<string>(){ "true", "false" }}, + // }, + //}); //FunctionList.List.Functions.Add(new Function() //{ diff --git a/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs b/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs index 21ac7a8..80793fd 100644 --- a/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs +++ b/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs @@ -493,6 +493,14 @@ d.Add(FunctionAttributeKey.FadeTime, function.GetAttrState(FunctionAttributeKey.FadeTime)); Control.Ins.SendWriteCommand(function, d); } + else if (function.spk == SPK.PanelSocket) + { + if (function.attributes.Find((obj) => obj.key == "on_off_usb") != null) + { + d.Add("on_off_usb", function.trait_on_off.curValue.ToString()); + } + Control.Ins.SendWriteCommand(function, d); + } else { d.Add("on_off", function.trait_on_off.curValue.ToString()); diff --git a/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs b/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs index 56c921d..cbd525d 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs @@ -881,8 +881,10 @@ }; arcBar.OnStopTrackingTouchEvent = (sender, e) => { + temp = arcBar.Progress; device.SetAttrState(FunctionAttributeKey.SetTemp, arcBar.Progress.ToString()); btnTemp.Text = arcBar.Progress.ToString(); + controlTime = DateTime.Now; 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); diff --git a/HDL_ON/UI/UI2/FuntionControlView/ArmCenter/AddAlarmDeploymentPage.cs b/HDL_ON/UI/UI2/FuntionControlView/ArmCenter/AddAlarmDeploymentPage.cs index c3332b1..62856f2 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/ArmCenter/AddAlarmDeploymentPage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/ArmCenter/AddAlarmDeploymentPage.cs @@ -26,15 +26,7 @@ SecurityAlarm securityAlarm; Action refreshAction; - /// <summary> - /// 瀹夐槻杈撳嚭-涓存椂 - /// </summary> - List<SecurityOutput> tempOutput = new List<SecurityOutput>(); - /// <summary> - /// 瀹夐槻杈撳叆-涓存椂 - /// </summary> - List<SecurityInput> tempInput = new List<SecurityInput>(); - + public AddAlarmDeploymentPage(SecurityAlarm alarm, Action action) { @@ -132,7 +124,7 @@ }; delayedRow.AddChidren(btnDelayedTitle); btnDelayedTitle.Text += ":"; - btnDelayedTitle.Width = btnDelayedTitle.GetTextWidth()+Application.GetRealWidth(10); + btnDelayedTitle.Width = btnDelayedTitle.GetTextWidth() + Application.GetRealWidth(10); var btnDelayedText = new Button() { @@ -175,6 +167,7 @@ else { new TopViewDiv(bodyView, title).LoadTopView(); + securityAlarm.status = "enable"; } //甯冮槻鍔熻兘 @@ -341,22 +334,22 @@ tip.Show(MainPage.BaseView); return; } - if (securityAlarm.output.Count == 0) - { - var tipText = "璇烽�夋嫨鍛婅鐩爣"; - if(Language.CurrentLanguage !="Chinese") - { - tipText = "Please select the alarm target"; - } - var tip = new Tip() - { - Text = tipText, - CloseTime = 3, - Direction = AMPopTipDirection.None - }; - tip.Show(MainPage.BaseView); - return; - } + //if (securityAlarm.output.Count == 0) + //{ + // var tipText = "璇烽�夋嫨鍛婅鐩爣"; + // if(Language.CurrentLanguage !="Chinese") + // { + // tipText = "Please select the alarm target"; + // } + // var tip = new Tip() + // { + // Text = tipText, + // CloseTime = 3, + // Direction = AMPopTipDirection.None + // }; + // tip.Show(MainPage.BaseView); + // return; + //} var waitPage = new Loading(); waitPage.Start(); @@ -478,8 +471,15 @@ { if (target.GetFunction() != null) { - inputTargetView.AddChidren(new InputRow(target.GetFunction().name, target.GetFunction().GetRoomListName(), target.StateText())); - inputTargetView.AddChidren(new Button() { Gravity = Gravity.CenterHorizontal, Y = Application.GetRealHeight(49), Height = 1, BackgroundColor = CSS_Color.DividingLineColor }); + var inputView = new InputRow(target); + inputTargetView.AddChidren(inputView); + inputView.InitView(); + EventHandler<MouseEventArgs> eventHandler = (sener, e) => { + securityAlarm.input.Remove(target); + iniInputTargetView(); + }; + inputView.SetDelClickeEvent(eventHandler); + inputTargetView.AddChidren(new Button() { Gravity = Gravity.CenterHorizontal, Y = Application.GetRealHeight(49), Height = 1, BackgroundColor = CSS_Color.DividingLineColor }); } count++; } @@ -564,7 +564,6 @@ }; contentView.AddChidren(outputTargetView); - outputTargetView.Height = Application.GetRealHeight(65 * securityAlarm.output.Count); iniAlarmListView(); #endregion @@ -578,13 +577,79 @@ private void iniAlarmListView() { outputTargetView.RemoveAll(); + if (securityAlarm.output.Count > 0) { + + if (securityAlarm.type == "all_day" || securityAlarm.type == "mute") + { } + else + { + + #region 鍛婅寤舵椂 + var delayedRow = new FrameLayout() + { + Height = Application.GetRealHeight(50), + BackgroundColor = CSS_Color.MainBackgroundColor, + }; + outputTargetView.AddChidren(delayedRow); + + var btnDelayedTitle = new Button() + { + X = Application.GetRealWidth(16), + Width = Application.GetRealWidth(72), + TextAlignment = TextAlignment.CenterLeft, + TextColor = CSS_Color.FirstLevelTitleColor, + TextSize = CSS_FontSize.TextFontSize, + TextID = StringId.DelayAlarm, + }; + delayedRow.AddChidren(btnDelayedTitle); + btnDelayedTitle.Text += ":"; + btnDelayedTitle.Width = btnDelayedTitle.GetTextWidth() + Application.GetRealWidth(10); + + var btnDelayedText = new Button() + { + X = btnDelayedTitle.Right, + Width = Application.GetRealWidth(330), + TextAlignment = TextAlignment.CenterLeft, + TextColor = CSS_Color.TextualColor, + TextSize = CSS_FontSize.TextFontSize, + Text = securityAlarm.output_delay + "s" + }; + delayedRow.AddChidren(btnDelayedText); + btnDelayedText.MouseUpEventHandler = (sender, e) => + { + Action<string> action = (obj) => + { + securityAlarm.output_delay = obj; + btnDelayedText.Text = securityAlarm.output_delay + "s"; + }; + new PublicAssmebly().SetSceneDelayDialog(action, securityAlarm.output_delay); + }; + + var btnDelayedRight = new Button() + { + X = Application.GetRealWidth(343), + Gravity = Gravity.CenterVertical, + Width = Application.GetMinRealAverage(16), + Height = Application.GetMinRealAverage(16), + UnSelectedImagePath = "Public/RightIcon.png", + }; + delayedRow.AddChidren(btnDelayedRight); + + + delayedRow.AddChidren(new Button() { Gravity = Gravity.CenterHorizontal, Y = Application.GetRealHeight(49), Height = 1, BackgroundColor = CSS_Color.DividingLineColor }); + #endregion + } + + foreach (var outTarget in securityAlarm.output) { - if (outTarget.NoLocalData()) + if (outTarget.LocalData()) { - var outputRow = new OutputRow(outTarget.name, outTarget.RoomName, outTarget); + var outputRow = new OutputRow( outTarget); + outputTargetView.AddChidren(outputRow); + outputRow.InitView(outTarget.name, outTarget.RoomName); EventHandler<MouseEventArgs> eventHandler = (sender, e) => { var delTemp = securityAlarm.output.Find((obj) => obj.sid == outTarget.sid); if(delTemp!=null) @@ -594,11 +659,11 @@ outputRow.RemoveFromParent(); outputTargetView.Height = Application.GetRealHeight(65 * securityAlarm.output.Count); }; - outputTargetView.AddChidren(outputRow); + outputRow.SetDelClickeEvent(eventHandler); } outputTargetView.AddChidren(new Button() { Gravity = Gravity.CenterHorizontal, Y = Application.GetRealHeight(49), Height = 1, BackgroundColor = CSS_Color.DividingLineColor }); } - outputTargetView.Height = Application.GetRealHeight(65 * securityAlarm.output.Count); + outputTargetView.Height = Application.GetRealHeight(65 * securityAlarm.output.Count + 50); } else { @@ -658,18 +723,28 @@ Button btnSubTitle; - public InputRow(string title, string subtitle,string state) + Button btnDel; + + Button btnBypass; + + SecurityInput input; + + public InputRow(SecurityInput input) { this.LineColor = 0x00000000; this.Height = Application.GetRealHeight(65); this.BackgroundColor = CSS_Color.MainBackgroundColor; + this.input = input; + } + public void InitView( )//(, , ); + { btnTitle = new Button() { X = Application.GetRealWidth(16), Height = Application.GetRealHeight(44), Width = Application.GetRealWidth(320), - Text = title, + Text = input.GetFunction().name, TextAlignment = TextAlignment.CenterLeft, TextColor = CSS_Color.FirstLevelTitleColor, TextSize = CSS_FontSize.TextFontSize, @@ -682,7 +757,7 @@ Y = Application.GetRealHeight(24), Height = Application.GetRealHeight(44), Width = Application.GetRealWidth(320), - Text = subtitle, + Text = input.GetFunction().GetRoomListName(), TextAlignment = TextAlignment.CenterLeft, TextColor = CSS_Color.PromptingColor1, TextSize = CSS_FontSize.PromptFontSize_FirstLevel, @@ -696,10 +771,46 @@ TextAlignment = TextAlignment.CenterRight, TextSize = CSS_FontSize.TextFontSize, TextColor = CSS_Color.FirstLevelTitleColor, - Text = state + Text = input.StateText() }; this.AddChidren(btnState); + btnBypass = new Button() + { + BackgroundColor = CSS_Color.WarningColor, + TextColor = CSS_Color.MainBackgroundColor, + TextID = StringId.Bypass, + TextAlignment = TextAlignment.Center, + }; + this.AddRightView(btnBypass); + btnBypass.MouseUpEventHandler = (sender, e) => { + if (input.bypass == "true") + { + input.bypass = "false"; + btnBypass.BackgroundColor = CSS_Color.WarningColor; + btnBypass.TextID = StringId.Bypass; + } + else + { + input.bypass = "true"; + btnBypass.BackgroundColor = CSS_Color.MainColor; + btnBypass.TextID = StringId.Enable; + } + }; + if (input.bypass == "true") + { + btnBypass.BackgroundColor = CSS_Color.MainColor; + btnBypass.TextID = StringId.Enable; + } + + btnDel = new Button() + { + BackgroundColor = CSS_Color.TextualColor, + TextColor = CSS_Color.MainBackgroundColor, + TextID = StringId.Del, + TextAlignment = TextAlignment.Center, + }; + this.AddRightView(btnDel); } @@ -708,6 +819,11 @@ this.MouseUpEventHandler = eventHandler; btnTitle.MouseUpEventHandler = eventHandler; btnSubTitle.MouseUpEventHandler = eventHandler; + } + + public void SetDelClickeEvent(EventHandler<MouseEventArgs> eventHandler) + { + btnDel.MouseUpEventHandler = eventHandler; } } @@ -728,13 +844,17 @@ SecurityOutput output; - public OutputRow(string title, string subtitle, SecurityOutput inOutput) + public OutputRow(SecurityOutput inOutput) { output = inOutput; this.LineColor = 0x00000000; this.Height = Application.GetRealHeight(65); this.BackgroundColor = CSS_Color.MainBackgroundColor; + } + + public void InitView(string title, string subtitle ) + { btnTitle = new Button() { @@ -807,17 +927,14 @@ { BackgroundColor = CSS_Color.WarningColor, TextColor = CSS_Color.MainBackgroundColor, + TextAlignment = TextAlignment.Center, TextID = StringId.Del, }; this.AddRightView(btnDel); } - public void SetDelClick(EventHandler<MouseEventArgs> eventHandler) - { - btnDel.MouseUpEventHandler = eventHandler; - } - + public void SetClickEvent(EventHandler<MouseEventArgs> eventHandler) { btnState.MouseUpEventHandler = eventHandler; @@ -825,7 +942,10 @@ btnSubTitle.MouseUpEventHandler = eventHandler; } - + public void SetDelClickeEvent(EventHandler<MouseEventArgs> eventHandler) + { + btnDel.MouseUpEventHandler = eventHandler; + } private void ShowStateDialog() diff --git a/HDL_ON/UI/UI2/FuntionControlView/ArmCenter/AddInputPage.cs b/HDL_ON/UI/UI2/FuntionControlView/ArmCenter/AddInputPage.cs index 3558ece..4f83b31 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/ArmCenter/AddInputPage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/ArmCenter/AddInputPage.cs @@ -66,7 +66,7 @@ btnFloor.MouseUpEventHandler = (sender, e) => { string nowSelectId = null; - var list = FunctionList.List.GetArmSensorList(); + var list = FunctionList.List.GetArmCenterList(); #if DEBUG list.AddRange(FunctionList.List.GetLightList()); @@ -93,7 +93,7 @@ bodyView.AddChidren(functionListView); - var listAllFun = FunctionList.List.GetArmSensorList(); + var listAllFun = FunctionList.List.GetArmCenterList(); #if DEBUG listAllFun.AddRange(FunctionList.List.GetLightList()); #endif @@ -145,7 +145,7 @@ if (functions == null) { //鍒濆鍊� - functions = FunctionList.List.GetArmSensorList(); + functions = FunctionList.List.GetArmCenterList(); } @@ -177,6 +177,8 @@ inValue = "alarm"; break; case SPK.SensorDoorWindow: + case SPK.SensorDryContact: + case SPK.SensorDryContact2: inKey = "contact_status"; inValue = "open"; break; diff --git a/HDL_ON/UI/UI2/FuntionControlView/ArmCenter/ArmCenterPage.cs b/HDL_ON/UI/UI2/FuntionControlView/ArmCenter/ArmCenterPage.cs index 254fdba..fc44e04 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/ArmCenter/ArmCenterPage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/ArmCenter/ArmCenterPage.cs @@ -285,7 +285,7 @@ addDefensePage.LoadPage(Language.StringByID(StringId.BurglarAlarm)); MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; }; - disasterAlarmView.SetClick(disasterAlarmViewClick); + burglarAlarmView.SetClick(burglarAlarmViewClick); fixedDeploymentTypeView.AddChidren(burglarAlarmView); #endregion @@ -329,6 +329,10 @@ armDiyViewList.Clear(); foreach (var mode in FunctionList.List.securities) { + if(mode.type== "all_day"|| mode.type == "mute") + { + continue; + } var armDiyView = new ArmDiyView("FunctionIcon/ArmCenter/AtHomeDefenseIcon.png", "FunctionIcon/ArmCenter/AtHomeDefenseIconOn.png", mode.name,mode.sid); customDeploymentView.AddChidren(armDiyView); @@ -348,7 +352,7 @@ armDiyViewList.Add(armDiyView); } - if (FunctionList.List.securities.Count < 4) + if (FunctionList.List.GetOrdinarySecurities().Count < 4) { var view = new ArmDiyView("FunctionIcon/ArmCenter/AddDefenseIcon.png", "FunctionIcon/ArmCenter/AddDefenseIcon.png", Language.StringByID(StringId.Custom),"customSid"); @@ -428,6 +432,7 @@ TextID = StringId.Cancel, TextColor = CSS_Color.WarningColor, IsBold = true, + TextSize = CSS_FontSize.SubheadingFontSize, }; contentView.AddChidren(btnCancel); @@ -486,6 +491,10 @@ { if (bodyView != null) { + if(updataTemp.type == "all_day"|| updataTemp.type == "mute") + { + return; + } bodyView.refreshAction?.Invoke(); //甯冮槻 @@ -504,8 +513,9 @@ else { //鎾ら槻 - if(bodyView.InDefenseMode.sid == updataTemp.sid) + if (bodyView.InDefenseMode.sid == updataTemp.sid) { + bodyView.InDefenseMode.status = updataTemp.status; foreach (var tempView in bodyView.armDiyViewList) { tempView.LightingView(false); diff --git a/HDL_ON/UI/UI2/FuntionControlView/Electrical/SocketPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Electrical/SocketPage.cs index 72ba698..c255299 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Electrical/SocketPage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Electrical/SocketPage.cs @@ -293,9 +293,11 @@ new System.Threading.Thread(() => { function.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off"; - //Control.Send(CommandType_A.write, this.function); System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); d.Add("on_off", function.trait_on_off.curValue.ToString()); + if (function.attributes.Find((obj) => obj.key == "on_off_usb") != null) { + d.Add("on_off_usb", function.trait_on_off.curValue.ToString()); + } Control.Ins.SendWriteCommand(function, d); }) { IsBackground = true }.Start(); @@ -307,9 +309,12 @@ new System.Threading.Thread(() => { function.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off"; - //Control.Send(CommandType_A.write, this.function); System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); d.Add("on_off", function.trait_on_off.curValue.ToString()); + if (function.attributes.Find((obj) => obj.key == "on_off_usb") != null) + { + d.Add("on_off_usb", function.trait_on_off.curValue.ToString()); + } Control.Ins.SendWriteCommand(function, d); }) { IsBackground = true }.Start(); diff --git a/HDL_ON/UI/UI2/FuntionControlView/Electrical/SocketPage_CumulativePowerConsumption.cs b/HDL_ON/UI/UI2/FuntionControlView/Electrical/SocketPage_CumulativePowerConsumption.cs index 1c5dc5c..e4a7974 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Electrical/SocketPage_CumulativePowerConsumption.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Electrical/SocketPage_CumulativePowerConsumption.cs @@ -174,11 +174,11 @@ #region 閫夋嫨鏁版嵁鏃ユ湡鑼冨洿 var showDataTypeView = new FrameLayout() { - X = Application.GetRealWidth(183), + X = Application.GetRealWidth(136), Y = Application.GetRealHeight(12), - Width = Application.GetRealWidth(144), + Width = Application.GetRealWidth(144+47), Height = Application.GetRealHeight(24), - BackgroundImagePath = "FunctionIcon/EnvironmentalScience/SensorHistoryBg1.png", + BackgroundImagePath = "FunctionIcon/EnvironmentalScience/HistoryOpionBg1.png", }; diagramView.AddChidren(showDataTypeView); @@ -214,41 +214,68 @@ TextColor = CSS_Color.PromptingColor2, SelectedTextColor = CSS_Color.MainColor, TextSize = CSS_FontSize.PromptFontSize_FirstLevel, - Text = Language.StringByID(StringId.month),//DateTime.Now.Month.ToString() + + Text = Language.StringByID(StringId.month) }; showDataTypeView.AddChidren(btnShowHistroyData_Month); + + var btnShowHistroyData_Year = new Button() + { + X = Application.GetRealWidth(48 * 3), + Width = Application.GetRealWidth(48), + TextAlignment = TextAlignment.Center, + TextColor = CSS_Color.PromptingColor2, + SelectedTextColor = CSS_Color.MainColor, + TextSize = CSS_FontSize.PromptFontSize_FirstLevel, + Text = Language.StringByID(StringId.Years), + }; + showDataTypeView.AddChidren(btnShowHistroyData_Year); btnShowHistroyData_Day.MouseUpEventHandler = (sender, e) => { - showDataTypeView.BackgroundImagePath = "FunctionIcon/EnvironmentalScience/SensorHistoryBg1.png"; + showDataTypeView.BackgroundImagePath = "FunctionIcon/EnvironmentalScience/HistoryOpionBg1.png"; btnShowHistroyData_Day.IsSelected = true; btnShowHistroyData_Month.IsSelected = false; btnShowHistroyData_Week.IsSelected = false; + btnShowHistroyData_Year.IsSelected = false; curQueryType = "hour"; brokenLine.YvalueText = ""; - LoadMothed_GetHistoryData(); + LoadMothed_GetHistoryData(); }; btnShowHistroyData_Week.MouseUpEventHandler = (sender, e) => { - showDataTypeView.BackgroundImagePath = "FunctionIcon/EnvironmentalScience/SensorHistoryBg2.png"; + showDataTypeView.BackgroundImagePath = "FunctionIcon/EnvironmentalScience/HistoryOpionBg2.png"; btnShowHistroyData_Day.IsSelected = false; btnShowHistroyData_Month.IsSelected = false; btnShowHistroyData_Week.IsSelected = true; + btnShowHistroyData_Year.IsSelected = false; curQueryType = "week"; brokenLine.YvalueText = ""; - LoadMothed_GetHistoryData(); + LoadMothed_GetHistoryData(); }; btnShowHistroyData_Month.MouseUpEventHandler = (sender, e) => { - showDataTypeView.BackgroundImagePath = "FunctionIcon/EnvironmentalScience/SensorHistoryBg3.png"; + showDataTypeView.BackgroundImagePath = "FunctionIcon/EnvironmentalScience/HistoryOpionBg3.png"; btnShowHistroyData_Day.IsSelected = false; btnShowHistroyData_Month.IsSelected = true; btnShowHistroyData_Week.IsSelected = false; + btnShowHistroyData_Year.IsSelected = false; curQueryType = "month"; brokenLine.YvalueText = ""; - LoadMothed_GetHistoryData(); + LoadMothed_GetHistoryData(); + }; + + btnShowHistroyData_Year.MouseUpEventHandler = (sender, e) => + { + showDataTypeView.BackgroundImagePath = "FunctionIcon/EnvironmentalScience/HistoryOpionBg4.png"; + btnShowHistroyData_Day.IsSelected = false; + btnShowHistroyData_Month.IsSelected = false; + btnShowHistroyData_Year.IsSelected = true; + btnShowHistroyData_Week.IsSelected = false; + curQueryType = "year_month"; + brokenLine.YvalueText = ""; + LoadMothed_GetHistoryData(); }; #endregion -- Gitblit v1.8.0