From 9ca2281d589fbd4b35177d1846974f17d12095ae Mon Sep 17 00:00:00 2001 From: JLChen <551775569@qq.com> Date: 星期四, 16 四月 2020 15:12:02 +0800 Subject: [PATCH] 2020-04-16 1.更新 --- Crabtree/SmartHome/HDL/Operation/UserConfig.cs | 2 Crabtree/.vs/SmartHome/xs/sqlite3/storage.ide | 0 Crabtree/SmartHome/HDL/Operation/.DS_Store | 0 Crabtree/SmartHome/UI/SimpleControl/MainPage.cs | 6 Crabtree/SmartHome/UI/SimpleControl/Phone/UniversalDevice/UserUniversalPage.cs | 4 Crabtree/SmartHome/UI/SimpleControl/CommonPage.cs | 1 Crabtree/SmartHome/dll/Android/Shared.Droid.dll | 0 Crabtree/ON.Ios/Info.plist | 4 Crabtree/SmartHome/dll/Android/Shared.Droid.HDLWidget.dll | 0 Crabtree/SmartHome/UI/SimpleControl/Phone/Light/UserDeviceToLight.cs | 2 Crabtree/ON/Properties/AndroidManifest.xml | 55 -- Crabtree/SmartHome/UI/SimpleControl/MqttCommon.cs | 310 ++++++++++-------- Crabtree/SmartHome/UI/SimpleControl/Phone/Room/UserRoom.cs | 51 +- Crabtree/.DS_Store | 0 Crabtree/ON/MyReceiver.cs | 114 +++--- Crabtree/SmartHome/UI/SimpleControl/Phone/User/UserSettingView.cs | 157 ++++---- Crabtree/SmartHome/UI/SimpleControl/EquipmentPublicClass.cs | 2 Crabtree/ON/Application.cs | 40 + Crabtree/SmartHome.sln | 28 - Crabtree/SmartHome/HDL/Operation/Device/Room.cs | 163 ++++----- Crabtree/SmartHome/dll/IOS/Shared.IOS.dll | 0 Crabtree/SmartHome/HDL/Operation/Utlis.cs | 2 Crabtree/CrabtreeOnCertificates:ProvisioningProfile/2020/CrabtreeOn_Distribution11DEC2019.mobileprovision | 0 /dev/null | 0 Crabtree/CrabtreeOnCertificates:ProvisioningProfile/2020/Distribution_Certificate_iTunes.p12 | 0 Crabtree/.vs/SmartHome/xs/UserPrefs.xml | 30 - Crabtree/SmartHome/dll/IOS/Shared.IOS.TBL.dll | 0 Crabtree/ON.Ios/ON.Ios.csproj | 3 28 files changed, 469 insertions(+), 505 deletions(-) diff --git a/Crabtree/.DS_Store b/Crabtree/.DS_Store index c1532f0..5f13089 100644 --- a/Crabtree/.DS_Store +++ b/Crabtree/.DS_Store Binary files differ diff --git a/Crabtree/.vs/SmartHome/xs/UserPrefs.xml b/Crabtree/.vs/SmartHome/xs/UserPrefs.xml index eb8cd5a..d99fe14 100644 --- a/Crabtree/.vs/SmartHome/xs/UserPrefs.xml +++ b/Crabtree/.vs/SmartHome/xs/UserPrefs.xml @@ -1,35 +1,15 @@ 锘�<Properties StartupConfiguration="{9D9EF20B-6E65-4A65-92BF-567EBF1E1443}|Default"> - <MonoDevelop.Ide.ItemProperties.ON.Droid AndroidDesignerPreferredDevice="Nexus 4" PreferredExecutionTarget="Android.4b65c46595" /> + <MonoDevelop.Ide.ItemProperties.ON.Droid AndroidDesignerPreferredDevice="Nexus 4" PreferredExecutionTarget="Android.Android_Accelerated_Oreo" /> <MonoDevelop.Ide.Workbench> <Files> - <File FileName="SmartHome/UI/SimpleControl/Phone/System/SystemRemote.cs" Line="181" Column="112" /> - <File FileName="ON/Properties/AndroidManifest.xml" /> + <File FileName="SmartHome/UI/SimpleControl/MqttCommon.cs" Line="293" Column="37" /> + <File FileName="SmartHome/UI/SimpleControl/R.cs" /> </Files> <Pads> <Pad Id="ProjectPad"> <State name="__root__"> <Node name="SmartHome" expanded="True"> - <Node name="ON.Droid" expanded="True" selected="True"> - <Node name="Properties" expanded="True" /> - </Node> - <Node name="Shared" expanded="True"> - <Node name="DLL" expanded="True" /> - <Node name="HDL" expanded="True"> - <Node name="Operation" expanded="True" /> - </Node> - <Node name="IO" expanded="True" /> - <Node name="Net" expanded="True" /> - <Node name="UI" expanded="True"> - <Node name="SimpleControl" expanded="True"> - <Node name="Phone" expanded="True"> - <Node name="Light" expanded="True" /> - <Node name="Register" expanded="True" /> - <Node name="Room" expanded="True" /> - <Node name="System" expanded="True" /> - </Node> - </Node> - </Node> - </Node> + <Node name="ON.Droid" selected="True" /> </Node> </State> </Pad> @@ -43,7 +23,7 @@ <String>Shared.IOS/Shared.IOS.csproj</String> </DisabledProjects> <MonoDevelop.Ide.Workspace ActiveConfiguration="Release" /> - <MonoDevelop.Ide.ItemProperties.ON.Ios automaticSigning="False" PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneDeviceTarget.254b82433419c7ca1850b1dfb524c79b7aeb0640" /> + <MonoDevelop.Ide.ItemProperties.ON.Ios automaticSigning="False" PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneSimulatorTarget.446FF651-C1E0-4C68-805D-F62274849738" /> <MonoDevelop.Ide.DebuggingService.Breakpoints> <BreakpointStore /> </MonoDevelop.Ide.DebuggingService.Breakpoints> diff --git a/Crabtree/.vs/SmartHome/xs/sqlite3/storage.ide b/Crabtree/.vs/SmartHome/xs/sqlite3/storage.ide index 36a6bb2..38de1ac 100644 --- a/Crabtree/.vs/SmartHome/xs/sqlite3/storage.ide +++ b/Crabtree/.vs/SmartHome/xs/sqlite3/storage.ide Binary files differ diff --git a/Crabtree/CrabtreeOnCertificates:ProvisioningProfile/2020/CrabtreeOn_Distribution11DEC2019.mobileprovision b/Crabtree/CrabtreeOnCertificates:ProvisioningProfile/2020/CrabtreeOn_Distribution11DEC2019.mobileprovision new file mode 100644 index 0000000..9998b13 --- /dev/null +++ b/Crabtree/CrabtreeOnCertificates:ProvisioningProfile/2020/CrabtreeOn_Distribution11DEC2019.mobileprovision Binary files differ diff --git a/Crabtree/CrabtreeOnCertificates:ProvisioningProfile/2020/Distribution_Certificate_iTunes.p12 b/Crabtree/CrabtreeOnCertificates:ProvisioningProfile/2020/Distribution_Certificate_iTunes.p12 new file mode 100644 index 0000000..77907b1 --- /dev/null +++ b/Crabtree/CrabtreeOnCertificates:ProvisioningProfile/2020/Distribution_Certificate_iTunes.p12 Binary files differ diff --git a/Crabtree/CrabtreeOnCertificates:ProvisioningProfile/CertificatesDevlopment.p12 b/Crabtree/CrabtreeOnCertificates:ProvisioningProfile/CertificatesDevlopment.p12 deleted file mode 100644 index 9c5a763..0000000 --- a/Crabtree/CrabtreeOnCertificates:ProvisioningProfile/CertificatesDevlopment.p12 +++ /dev/null Binary files differ diff --git a/Crabtree/CrabtreeOnCertificates:ProvisioningProfile/CertificatesDistribution.p12 b/Crabtree/CrabtreeOnCertificates:ProvisioningProfile/CertificatesDistribution.p12 deleted file mode 100644 index 48b0058..0000000 --- a/Crabtree/CrabtreeOnCertificates:ProvisioningProfile/CertificatesDistribution.p12 +++ /dev/null Binary files differ diff --git a/Crabtree/CrabtreeOnCertificates:ProvisioningProfile/CrabtreeOn_Development.mobileprovision b/Crabtree/CrabtreeOnCertificates:ProvisioningProfile/CrabtreeOn_Development.mobileprovision deleted file mode 100644 index 29bfc49..0000000 --- a/Crabtree/CrabtreeOnCertificates:ProvisioningProfile/CrabtreeOn_Development.mobileprovision +++ /dev/null Binary files differ diff --git a/Crabtree/CrabtreeOnCertificates:ProvisioningProfile/CrabtreeOn_Distribution.mobileprovision b/Crabtree/CrabtreeOnCertificates:ProvisioningProfile/CrabtreeOn_Distribution.mobileprovision deleted file mode 100644 index 4df9dd5..0000000 --- a/Crabtree/CrabtreeOnCertificates:ProvisioningProfile/CrabtreeOn_Distribution.mobileprovision +++ /dev/null Binary files differ diff --git a/Crabtree/ON.Ios/Info.plist b/Crabtree/ON.Ios/Info.plist index 6839cf8..745bf3d 100755 --- a/Crabtree/ON.Ios/Info.plist +++ b/Crabtree/ON.Ios/Info.plist @@ -17,9 +17,9 @@ <key>CFBundleIdentifier</key> <string>com.hdl.SimpleControl</string> <key>CFBundleShortVersionString</key> - <string>2.5200203</string> + <string>2.5200408</string> <key>CFBundleVersion</key> - <string>2.50203</string> + <string>2.50408</string> <key>LSRequiresIPhoneOS</key> <true/> <key>MinimumOSVersion</key> diff --git a/Crabtree/ON.Ios/ON.Ios.csproj b/Crabtree/ON.Ios/ON.Ios.csproj index ee4a8de..77aa90e 100644 --- a/Crabtree/ON.Ios/ON.Ios.csproj +++ b/Crabtree/ON.Ios/ON.Ios.csproj @@ -77,7 +77,7 @@ <WarningLevel>4</WarningLevel> <TreatWarningsAsErrors>false</TreatWarningsAsErrors> <DocumentationFile></DocumentationFile> - <CodesignKey>iPhone Developer</CodesignKey> + <CodesignKey>iPhone Developer: xuebiao huang (4P32GXQWWK)</CodesignKey> <MtouchFastDev>true</MtouchFastDev> <MtouchFastDev>true</MtouchFastDev> <MtouchProfiling>false</MtouchProfiling> @@ -107,6 +107,7 @@ <WarningsNotAsErrors></WarningsNotAsErrors> <OnDemandResourcesInitialInstallTags></OnDemandResourcesInitialInstallTags> <OnDemandResourcesPrefetchOrder></OnDemandResourcesPrefetchOrder> +<CodesignProvision>Test</CodesignProvision> </PropertyGroup> <ItemGroup> <Reference Include="System" /> diff --git a/Crabtree/ON/Application.cs b/Crabtree/ON/Application.cs index a79c574..dbcbd0a 100644 --- a/Crabtree/ON/Application.cs +++ b/Crabtree/ON/Application.cs @@ -3,8 +3,8 @@ using Android.Content; using Android.Net; using Android.OS; -using CN.Jpush.Android.Api; -using CN.Jpush.Android.Service; +//using CN.Jpush.Android.Api; +//using CN.Jpush.Android.Service; using Java.Lang; using Java.Util; using Java.Util.Zip; @@ -42,12 +42,26 @@ [Android.App.Application] public class Application : Android.App.Application { + static void reStartApp (Android.App.Application application) + { + var intent = new Intent (application, typeof (BaseActivity)); + intent.AddFlags (ActivityFlags.NewTask); + application.StartActivity (intent); + Android.OS.Process.KillProcess (Android.OS.Process.MyPid ()); + } + public Application (IntPtr handle, Android.Runtime.JniHandleOwnership ownerShip) : base (handle, ownerShip) { } public override void OnCreate () { - initAll (); + if (Shared.Application.Activity != null) { + reStartApp (this); + return; + } + //Shared.Application.IsGpsEnable = false; base.OnCreate (); + + initAll (); } /// <summary> @@ -113,12 +127,12 @@ init (); BaseActivity.OnCreateActoin += (activity, application) => { Microsoft.AppCenter.AppCenter.Start ("d0f0f0c5-88af-494b-93af-9a667801b7a3", typeof (Microsoft.AppCenter.Analytics.Analytics), typeof (Microsoft.AppCenter.Crashes.Crashes)); - //淇濆瓨鑾峰彇鐨勬瀬鍏夋湇鍔″櫒涓婄殑娉ㄥ唽ID鍒版湰鍦版枃浠� - var tokenID = JPushInterface.GetRegistrationID (activity); - if (!string.IsNullOrEmpty (tokenID) && UserConfig.Instance.tokenID != tokenID) { - UserConfig.Instance.tokenID = tokenID; - UserConfig.Instance.SaveUserConfig (); - } + ////淇濆瓨鑾峰彇鐨勬瀬鍏夋湇鍔″櫒涓婄殑娉ㄥ唽ID鍒版湰鍦版枃浠� + //var tokenID = JPushInterface.GetRegistrationID (activity); + //if (!string.IsNullOrEmpty (tokenID) && UserConfig.Instance.tokenID != tokenID) { + // UserConfig.Instance.tokenID = tokenID; + // UserConfig.Instance.SaveUserConfig (); + //} BaseActivity.NetworkStateChanged += (int obj) => { Utlis.WriteLine ("NetworkStateChanged " + obj); UserConfig.Instance.internetStatus = obj; @@ -153,9 +167,9 @@ Shared.Application.Skin = UserConfig.Instance.CurrentSkinName; SkinStyle.Current.ChangeColor (); UserConfig.Instance.phoneName = Android.OS.Build.Manufacturer; - //璁剧疆鏋佸厜璋冭瘯妯″紡锛屼负false鏃跺彧鎵撳嵃璀﹀憡淇℃伅 - JPushInterface.SetDebugMode (false); - JPushInterface.Init (this);//淇濆瓨鎵嬫満鍚嶇О鍒版湰鍦版枃浠� + ////璁剧疆鏋佸厜璋冭瘯妯″紡锛屼负false鏃跺彧鎵撳嵃璀﹀憡淇℃伅 + //JPushInterface.SetDebugMode (false); + //JPushInterface.Init (this);//淇濆瓨鎵嬫満鍚嶇О鍒版湰鍦版枃浠� //鑾峰彇缁忕含搴� Shared.Application.LocationAction = (arg1, arg2) => { @@ -183,7 +197,7 @@ void checkSomeInfo () { RemoteInfo.Current.ReadMsgList (UserConfig.Instance.tokenID, IsShowTip); - JPushInterface.ClearAllNotifications (this); + //JPushInterface.ClearAllNotifications (this); IsShowTip = true; var status = isNetworkAvailable (this); diff --git a/Crabtree/ON/MyReceiver.cs b/Crabtree/ON/MyReceiver.cs index 72f8c3f..a299a0c 100644 --- a/Crabtree/ON/MyReceiver.cs +++ b/Crabtree/ON/MyReceiver.cs @@ -1,61 +1,61 @@ -锘縰sing System; -using Android.Content; -using Android.OS; -using CN.Jpush.Android.Api; -using CN.Jpush.Android.Service; +锘�//using System; +//using Android.Content; +//using Android.OS; +//using CN.Jpush.Android.Api; +//using CN.Jpush.Android.Service; -namespace com.hdl.on -{ - //<receiver android:name="com.hdl.on.MyReceiver" android:exported="false" android:enabled="true" android:permission="android.permission.RECEIVE_BOOT_COMPLETED"> - // <intent-filter> - // <action android:name="cn.jpush.android.intent.REGISTRATION" /> - // <action android:name="cn.jpush.android.intent.MESSAGE_RECEIVED" /> - // <action android:name="cn.jpush.android.intent.NOTIFICATION_RECEIVED" /> - // <action android:name="cn.jpush.android.intent.NOTIFICATION_OPENED" /> - // <action android:name="cn.jpush.android.intent.CONNECTION" /> - // <category android:name="com.hdl.on" /> - // <action android:name="android.intent.action.BOOT_COMPLETED"></action> - // <category android:name="android.intent.category.LAUNCHER" /> - // <action android:name="android.intent.action.USER_PRESENT" /> - // <action android:name="android.media.RINGER_MODE_CHANGED" /> - // </intent-filter> - //</receiver> - /* - *鍒涘缓涓�涓箍鎾� - * 鑷畾涔夋帴鏀跺櫒 - * 濡傛灉涓嶅畾涔夎繖涓� Receiver锛屽垯锛� - * 1) 榛樿鐢ㄦ埛浼氭墦寮�涓荤晫闈� - * 2) 鎺ユ敹涓嶅埌鑷畾涔夋秷鎭� - */ - //[BroadcastReceiver] - //[IntentFilter(new string []{"cn.jpush.android.intent.REGISTRATION", "cn.jpush.android.intent.MESSAGE_RECEIVED","cn.jpush.android.intent.NOTIFICATION_RECEIVED","cn.jpush.android.intent.NOTIFICATION_OPENED","cn.jpush.android.intent.CONNECTION"})] - public class MyReceiver : BroadcastReceiver - { - static string ACTION = "android.intent.action.BOOT_COMPLETED"; +//namespace com.hdl.on +//{ +// //<receiver android:name="com.hdl.on.MyReceiver" android:exported="false" android:enabled="true" android:permission="android.permission.RECEIVE_BOOT_COMPLETED"> +// // <intent-filter> +// // <action android:name="cn.jpush.android.intent.REGISTRATION" /> +// // <action android:name="cn.jpush.android.intent.MESSAGE_RECEIVED" /> +// // <action android:name="cn.jpush.android.intent.NOTIFICATION_RECEIVED" /> +// // <action android:name="cn.jpush.android.intent.NOTIFICATION_OPENED" /> +// // <action android:name="cn.jpush.android.intent.CONNECTION" /> +// // <category android:name="com.hdl.on" /> +// // <action android:name="android.intent.action.BOOT_COMPLETED"></action> +// // <category android:name="android.intent.category.LAUNCHER" /> +// // <action android:name="android.intent.action.USER_PRESENT" /> +// // <action android:name="android.media.RINGER_MODE_CHANGED" /> +// // </intent-filter> +// //</receiver> +// /* +// *鍒涘缓涓�涓箍鎾� +// * 鑷畾涔夋帴鏀跺櫒 +// * 濡傛灉涓嶅畾涔夎繖涓� Receiver锛屽垯锛� +// * 1) 榛樿鐢ㄦ埛浼氭墦寮�涓荤晫闈� +// * 2) 鎺ユ敹涓嶅埌鑷畾涔夋秷鎭� +// */ +// //[BroadcastReceiver] +// //[IntentFilter(new string []{"cn.jpush.android.intent.REGISTRATION", "cn.jpush.android.intent.MESSAGE_RECEIVED","cn.jpush.android.intent.NOTIFICATION_RECEIVED","cn.jpush.android.intent.NOTIFICATION_OPENED","cn.jpush.android.intent.CONNECTION"})] +// public class MyReceiver : BroadcastReceiver +// { +// static string ACTION = "android.intent.action.BOOT_COMPLETED"; - public override void OnReceive (Context context, Intent intent) - { - Bundle bundle = intent.Extras; +// public override void OnReceive (Context context, Intent intent) +// { +// Bundle bundle = intent.Extras; - if (intent.Action == ACTION) { - //寮�鏈鸿嚜鍔ㄦ湇鍔¤嚜鍔ㄥ惎鍔�,PushService鏄鍚姩鐨勬湇鍔� - Intent service = new Intent (context, typeof (PushService)); - context.StartService (service); - } +// if (intent.Action == ACTION) { +// //寮�鏈鸿嚜鍔ㄦ湇鍔¤嚜鍔ㄥ惎鍔�,PushService鏄鍚姩鐨勬湇鍔� +// Intent service = new Intent (context, typeof (PushService)); +// context.StartService (service); +// } - //鎺ユ敹Registration Id - if (JPushInterface.ActionRegistrationId == intent.Action) { - string regId = bundle.GetString (JPushInterface.ExtraRegistrationId); - } - //鐢ㄦ埛鐐瑰嚮鎵撳紑浜嗛�氱煡 - else if (JPushInterface.ActionNotificationOpened == intent.Action) { - Application.IsShowTip = false; - Intent i = new Intent (context, typeof (Shared.BaseActivity));//Intent intent=new Intent( 璧峰缁勪欢瀵硅薄 , 鐩爣 Service.class); - i.PutExtras (bundle); - i.SetFlags (ActivityFlags.NewTask); - context.StartActivity (i); - } else { - } - } - } -} +// //鎺ユ敹Registration Id +// if (JPushInterface.ActionRegistrationId == intent.Action) { +// string regId = bundle.GetString (JPushInterface.ExtraRegistrationId); +// } +// //鐢ㄦ埛鐐瑰嚮鎵撳紑浜嗛�氱煡 +// else if (JPushInterface.ActionNotificationOpened == intent.Action) { +// Application.IsShowTip = false; +// Intent i = new Intent (context, typeof (Shared.BaseActivity));//Intent intent=new Intent( 璧峰缁勪欢瀵硅薄 , 鐩爣 Service.class); +// i.PutExtras (bundle); +// i.SetFlags (ActivityFlags.NewTask); +// context.StartActivity (i); +// } else { +// } +// } +// } +//} diff --git a/Crabtree/ON/Properties/AndroidManifest.xml b/Crabtree/ON/Properties/AndroidManifest.xml index 624a9a7..eec43eb 100644 --- a/Crabtree/ON/Properties/AndroidManifest.xml +++ b/Crabtree/ON/Properties/AndroidManifest.xml @@ -1,9 +1,11 @@ 锘�<?xml version="1.0" encoding="utf-8"?> -<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.hdl.crabtreenew" android:versionName="2.504021" android:versionCode="202004021"> - <uses-sdk android:minSdkVersion="23" android:targetSdkVersion="26" /> - <!-- Required 涓�浜涚郴缁熻姹傜殑鏉冮檺锛屾澶勬槸鏋佸厜鎺ㄩ�侀渶姹傜殑鏉冮檺锛屽璁块棶缃戠粶绛�--> +<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.hdl.crabtreenew" android:versionName="2.504142" android:versionCode="202004142"> + <uses-sdk android:minSdkVersion="23" android:targetSdkVersion="28" /> + <!-- 鍦ㄥ畨鍗揚鐗堟湰涔嬪悗锛屽繀椤昏鎺堜簣FOREGROUND_SERVICE鏉冮檺锛屾墠鑳藉浣跨敤鍓嶅彴鏈嶅姟 --> + <uses-permission android:name="android.permission.FOREGROUND_SERVICE" /> + <!-- Required 涓�浜涚郴缁熻姹傜殑鏉冮檺锛屾澶勬槸鏋佸厜鎺ㄩ�侀渶姹傜殑鏉冮檺锛屽璁块棶缃戠粶绛� <permission android:name="com.hdl.crabtreenew.permission.JPUSH_MESSAGE" android:protectionLevel="signature" /> - <uses-permission android:name="com.hdl.crabtreenew.permission.JPUSH_MESSAGE" /> + <uses-permission android:name="com.hdl.crabtreenew.permission.JPUSH_MESSAGE" /> --> <uses-permission android:name="android.permission.RECEIVE_USER_PRESENT" /> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.WRITE_SETTINGS" /> @@ -74,7 +76,7 @@ <uses-feature android:name="android.hardware.wifi" android:required="false" /> <uses-feature android:name="android.hardware.bluetooth" android:required="false" /> <application android:allowBackup="true" android:icon="@drawable/Icon" android:largeHeap="true" android:label="Crabtree-ON"> - <activity android:name="com.videogo.UiKitActivity" android:configChanges="orientation|keyboardHidden" android:screenOrientation="portrait" android:theme="@android:style/Theme.NoTitleBar.Fullscreen" /> + <!-- <activity android:name="com.videogo.UiKitActivity" android:configChanges="orientation|keyboardHidden" android:screenOrientation="portrait" android:theme="@android:style/Theme.NoTitleBar.Fullscreen" /> <activity android:name="com.videogo.LoginSelectActivity" android:configChanges="orientation|keyboardHidden" android:screenOrientation="portrait" android:theme="@android:style/Theme.NoTitleBar.Fullscreen" /> <activity android:name="com.videogo.main.EzvizWebViewActivity" android:configChanges="orientation|keyboardHidden" android:screenOrientation="portrait" android:theme="@android:style/Theme.NoTitleBar.Fullscreen" /> <activity android:name="com.videogo.remoteplayback.list.PlayBackListActivity" android:configChanges="orientation|keyboardHidden|screenSize" android:screenOrientation="nosensor" android:theme="@android:style/Theme.NoTitleBar.Fullscreen" /> @@ -104,51 +106,10 @@ <action android:name="com.videogo.action.OAUTH_SUCCESS_ACTION" /> <action android:name="android.net.conn.CONNECTIVITY_CHANGE" /> </intent-filter> - </receiver> + </receiver> --> <!-- 鑷姩鏇存柊 --> <provider android:name="android.support.v4.content.FileProvider" android:authorities="com.hdl.crabtreenew.fileProvider" android:grantUriPermissions="true" android:exported="false"> <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/file_paths" /> </provider> - <activity android:name="cn.jpush.android.ui.PushActivity" android:configChanges="orientation|keyboardHidden" android:theme="@android:style/Theme.NoTitleBar" android:exported="false"> - <intent-filter> - <action android:name="cn.jpush.android.ui.PushActivity" /> - <category android:name="android.intent.category.DEFAULT" /> - <category android:name="com.hdl.crabtreenew" /> - </intent-filter> - </activity> - <service android:name="cn.jpush.android.service.PushService" android:process=":mult"> - <intent-filter> - <action android:name="cn.jpush.android.intent.REGISTER" /> - <action android:name="cn.jpush.android.intent.REPORT" /> - <action android:name="cn.jpush.android.intent.PushService" /> - <action android:name="cn.jpush.android.intent.PUSH_TIME" /> - </intent-filter> - </service> - <service android:name="cn.jpush.android.service.DaemonService" android:enabled="true" android:exported="true"> - <intent-filter> - <action android:name="cn.jpush.android.intent.DaemonService" /> - <category android:name="com.hdl.crabtreenew" /> - </intent-filter> - </service> - <receiver android:name="cn.jpush.android.service.PushReceiver" android:enabled="true"> - <intent-filter android:priority="1000"> - <action android:name="cn.jpush.android.intent.NOTIFICATION_RECEIVED_PROXY" /> - <category android:name="com.hdl.crabtreenew" /> - </intent-filter> - <intent-filter> - <action android:name="android.intent.action.USER_PRESENT" /> - <action android:name="android.net.conn.CONNECTIVITY_CHANGE" /> - </intent-filter> - <!-- Optional --> - <intent-filter> - <action android:name="android.intent.action.PACKAGE_ADDED" /> - <action android:name="android.intent.action.PACKAGE_REMOVED" /> - <data android:scheme="package" /> - </intent-filter> - </receiver> - <activity android:name="cn.jpush.android.ui.PopWinActivity" android:exported="false" /> - <receiver android:name="cn.jpush.android.service.AlarmReceiver" android:exported="false" /> - <meta-data android:name="JPUSH_CHANNEL" android:value="developer-default" /> - <meta-data android:name="JPUSH_APPKEY" android:value="bcb35a1721fb9edfe9756329" /> </application> </manifest> \ No newline at end of file diff --git a/Crabtree/SmartHome.sln b/Crabtree/SmartHome.sln index d88eba6..7a2e29d 100644 --- a/Crabtree/SmartHome.sln +++ b/Crabtree/SmartHome.sln @@ -13,10 +13,6 @@ EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ON.Ios", "ON.Ios\ON.Ios.csproj", "{1D83BF28-BA88-4152-BA41-D7EFE90A5437}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Shared.IOS", "Shared.IOS\Shared.IOS.csproj", "{0048AB87-2130-4437-8F01-8CADAB787004}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Shared.Droid", "Shared.Droid\Shared.Droid.csproj", "{B7B2BB29-2DF1-4235-A67B-E09C2EC1EBAF}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|iPhoneSimulator = Debug|iPhoneSimulator @@ -87,30 +83,6 @@ {1D83BF28-BA88-4152-BA41-D7EFE90A5437}.Debug|Any CPU.Build.0 = Debug|iPhoneSimulator {1D83BF28-BA88-4152-BA41-D7EFE90A5437}.Release|Any CPU.ActiveCfg = Release|iPhone {1D83BF28-BA88-4152-BA41-D7EFE90A5437}.Release|Any CPU.Build.0 = Release|iPhone - {0048AB87-2130-4437-8F01-8CADAB787004}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {0048AB87-2130-4437-8F01-8CADAB787004}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU - {0048AB87-2130-4437-8F01-8CADAB787004}.Release|iPhone.ActiveCfg = Release|Any CPU - {0048AB87-2130-4437-8F01-8CADAB787004}.Release|iPhone.Build.0 = Release|Any CPU - {0048AB87-2130-4437-8F01-8CADAB787004}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU - {0048AB87-2130-4437-8F01-8CADAB787004}.Release|iPhoneSimulator.Build.0 = Release|Any CPU - {0048AB87-2130-4437-8F01-8CADAB787004}.Debug|iPhone.ActiveCfg = Debug|Any CPU - {0048AB87-2130-4437-8F01-8CADAB787004}.Debug|iPhone.Build.0 = Debug|Any CPU - {0048AB87-2130-4437-8F01-8CADAB787004}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0048AB87-2130-4437-8F01-8CADAB787004}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0048AB87-2130-4437-8F01-8CADAB787004}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0048AB87-2130-4437-8F01-8CADAB787004}.Release|Any CPU.Build.0 = Release|Any CPU - {B7B2BB29-2DF1-4235-A67B-E09C2EC1EBAF}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {B7B2BB29-2DF1-4235-A67B-E09C2EC1EBAF}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU - {B7B2BB29-2DF1-4235-A67B-E09C2EC1EBAF}.Release|iPhone.ActiveCfg = Release|Any CPU - {B7B2BB29-2DF1-4235-A67B-E09C2EC1EBAF}.Release|iPhone.Build.0 = Release|Any CPU - {B7B2BB29-2DF1-4235-A67B-E09C2EC1EBAF}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU - {B7B2BB29-2DF1-4235-A67B-E09C2EC1EBAF}.Release|iPhoneSimulator.Build.0 = Release|Any CPU - {B7B2BB29-2DF1-4235-A67B-E09C2EC1EBAF}.Debug|iPhone.ActiveCfg = Debug|Any CPU - {B7B2BB29-2DF1-4235-A67B-E09C2EC1EBAF}.Debug|iPhone.Build.0 = Debug|Any CPU - {B7B2BB29-2DF1-4235-A67B-E09C2EC1EBAF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B7B2BB29-2DF1-4235-A67B-E09C2EC1EBAF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B7B2BB29-2DF1-4235-A67B-E09C2EC1EBAF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B7B2BB29-2DF1-4235-A67B-E09C2EC1EBAF}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(MonoDevelopProperties) = preSolution Policies = $0 diff --git a/Crabtree/SmartHome/HDL/Operation/.DS_Store b/Crabtree/SmartHome/HDL/Operation/.DS_Store index ad95d9c..705629b 100644 --- a/Crabtree/SmartHome/HDL/Operation/.DS_Store +++ b/Crabtree/SmartHome/HDL/Operation/.DS_Store Binary files differ diff --git a/Crabtree/SmartHome/HDL/Operation/Device/Room.cs b/Crabtree/SmartHome/HDL/Operation/Device/Room.cs index dd209fd..a713894 100644 --- a/Crabtree/SmartHome/HDL/Operation/Device/Room.cs +++ b/Crabtree/SmartHome/HDL/Operation/Device/Room.cs @@ -11,7 +11,7 @@ /// <summary> /// 鎴块棿瀵硅薄 /// </summary> - public class Room + public class Room { public static string FavoriteRoom = "FavoriteRoom"; @@ -24,6 +24,8 @@ { GetRoomByFilePath (roomFilePath); } + + // 鎴块棿鍛藉悕瑙勫垯 typeof (Room).Name + "_" + etNameBox.Text.Trim (); /// <summary> @@ -84,6 +86,12 @@ break; } } + //if( IO.FileUtils.ReadFiles ().FindAll ((obj) => obj.Split ('_').Length == 5 && obj.Split ('_') [0] == "Equipment" && obj.Split ('_') [1] == DeviceType.SuperWireless.ToString ()).Count > 0) { + // UserConfig.Instance.HideDeviceTypes.Remove (SimpleControl.R.MyInternationalizationString.SuperWireless); + // UserConfig.Instance.HideDeviceTypes.Remove (SimpleControl.R.MyInternationalizationString.Sonos); + // UserConfig.Instance.SaveUserConfig (); + //} + return nowRoom; } catch { return null; @@ -159,13 +167,16 @@ } else if (deviceType == DeviceType.LightSwitch.ToString ()){ var common = Newtonsoft.Json.JsonConvert.DeserializeObject<LightSwitch> (jsonInfo); room.DeviceList.Add (common); - } else if (deviceType == DeviceType.LightMixSwitch.ToString () ){ + } + else if (deviceType == DeviceType.LogicModule.ToString()) + { + var common = Newtonsoft.Json.JsonConvert.DeserializeObject<LogicModule>(jsonInfo); + room.DeviceList.Add(common); + } + else if (deviceType == DeviceType.LightMixSwitch.ToString () ){ var common = Newtonsoft.Json.JsonConvert.DeserializeObject<LightMixSwitch> (jsonInfo); room.DeviceList.Add (common); - } else if ( deviceType == DeviceType.LightEnergySocket.ToString ()) { - var common = Newtonsoft.Json.JsonConvert.DeserializeObject<LightEnergySocket> (jsonInfo); - room.DeviceList.Add (common); - } else if (deviceType == DeviceType.LightEnergySwitch.ToString ()) { + } else if ( deviceType == DeviceType.LightEnergySwitch.ToString ()) { var common = Newtonsoft.Json.JsonConvert.DeserializeObject<LightEnergySwitch> (jsonInfo); room.DeviceList.Add (common); } else if (deviceType == DeviceType.CurtainModel.ToString ()) { @@ -210,7 +221,16 @@ room.DeviceList.Add (Newtonsoft.Json.JsonConvert.DeserializeObject<SensorHumidity> (jsonInfo)); } else if (deviceType == DeviceType.FreshAir.ToString ()) { room.DeviceList.Add (Newtonsoft.Json.JsonConvert.DeserializeObject<FreshAir> (jsonInfo)); - } + } + //else if (deviceType == DeviceType.Thermostat.ToString ()) { + // room.DeviceList.Add (Newtonsoft.Json.JsonConvert.DeserializeObject<Thermostat> (jsonInfo)); + //} + //else if (deviceType == DeviceType.ACMerrill.ToString ()) {//2020-03-10 鏂板缇庢灄绌鸿皟绯荤粺鏀寔 + // room.DeviceList.Add (Newtonsoft.Json.JsonConvert.DeserializeObject<ACMerrill> (jsonInfo)); + //} + //else if (deviceType == DeviceType.DoorLockRelay.ToString ()) { //灞忚斀缁х數鍣ㄩ棬閿� + // room.DeviceList.Add (Newtonsoft.Json.JsonConvert.DeserializeObject<LightDoorLock> (jsonInfo)); + //} for (int i = UserConfig.Instance.HideDeviceTypes.Count - 1; i >= 0; i--) { var hideType = UserConfig.Instance.HideDeviceTypes [i]; @@ -228,7 +248,10 @@ /// <summary> /// 鎴块棿鍚� /// </summary> - public string Name { get; set; } + public string Name { + get; + set; + } public string RoomFilePath { get { @@ -238,42 +261,7 @@ } } - /// <summary> - /// 涓嶉�夋嫨鍒版埧闂存椂鍊欑殑鑳屾櫙鍥� - /// </summary> - public string UnSelectedBackgroundImage { - get; - set; - } - /// <summary> - /// 閫夋嫨鍒版埧闂寸殑鏃跺�欒儗鏅浘 - /// </summary> - public string SelectedBackgroundImage { - get; - set; - } - - /// <summary> - /// 涓嶉�夋嫨鍒版埧闂翠笅鎷夊垪琛ㄦ椂鍊欑殑鑳屾櫙鍥� - /// </summary> - public string UnSelectedListBackgroundImage { - get; - set; - } - - /// <summary> - /// 閫夋嫨鍒版埧闂寸殑涓嬫媺鍒楄〃鏃跺�欒儗鏅浘 - /// </summary> - public string SelectedListBackgroundImage { - get; - set; - } - - /// <summary> - /// 鍥炬爣 - /// </summary> - public string IconPath = "DefaultRoomIcon.png"; /// <summary> /// 鎴块棿鑳屾櫙 /// </summary> @@ -350,6 +338,9 @@ { roomFilePathList = new List<string> (); } + + if (roomFilePathList.Contains (roomFilePath)) return; + roomFilePathList.Add (roomFilePath); //var sssddsa = IO.FileUtils.ReadFiles ().FindAll ((obj) => obj.Contains ("Room_")); @@ -427,26 +418,16 @@ Save (newRoomFilePath); } + /// <summary> /// 鎵�鏈夌殑鎴块棿鍒楄〃璺緞 /// </summary> /// <value>The room file path list.</value> public static System.Collections.Generic.List<string> FilePathList { get { - var roomBytes = IO.FileUtils.ReadFile (roomListFilePath); - string roombyteString = System.Text.Encoding.UTF8.GetString (roomBytes); - var ddds = Newtonsoft.Json.JsonConvert.DeserializeObject<System.Collections.Generic.List<string>> (roombyteString); - if (ddds == null) - ddds = new List<string> (); - if (!ddds.Contains (FavoriteRoom)) { - ddds.Add (FavoriteRoom); - if (!IO.FileUtils.Exists (FavoriteRoom)) { - //榛樿娣诲姞瀵瑰簲鐨勬埧闂� - new Room () { Name = "" }.Save (FavoriteRoom); - } - IO.FileUtils.WriteFileByBytes (roomListFilePath, System.Text.Encoding.UTF8.GetBytes (Newtonsoft.Json.JsonConvert.SerializeObject (ddds))); - } - return ddds; + var rommBytes = IO.FileUtils.ReadFile (roomListFilePath); + string rommbyteString = System.Text.Encoding.UTF8.GetString (rommBytes); + return Newtonsoft.Json.JsonConvert.DeserializeObject<System.Collections.Generic.List<string>> (rommbyteString); } } @@ -456,44 +437,50 @@ public static void InitAllRoom () { Lists.Clear (); - if (null == Newtonsoft.Json.JsonConvert.DeserializeObject<System.Collections.Generic.List<string>> (System.Text.Encoding.UTF8.GetString (IO.FileUtils.ReadFile (roomListFilePath)))) { - //鍒濆鍖栨埧闂村垪琛� - Shared.IO.FileUtils.WriteFileByBytes (roomListFilePath, System.Text.Encoding.UTF8.GetBytes (Newtonsoft.Json.JsonConvert.SerializeObject (new System.Collections.Generic.List<string> ()))); - } - var roomFilePathList = Newtonsoft.Json.JsonConvert.DeserializeObject<System.Collections.Generic.List<string>> (System.Text.Encoding.UTF8.GetString (IO.FileUtils.ReadFile (roomListFilePath))); - if (!roomFilePathList.Contains (FavoriteRoom)) { - roomFilePathList.Add (FavoriteRoom); - if (!IO.FileUtils.Exists (FavoriteRoom)) { - //榛樿娣诲姞瀵瑰簲鐨勬埧闂� - new Room () { Name = "" }.Save (FavoriteRoom); + try { + if (null == Newtonsoft.Json.JsonConvert.DeserializeObject<System.Collections.Generic.List<string>> (System.Text.Encoding.UTF8.GetString (IO.FileUtils.ReadFile (roomListFilePath)))) { + //鍒濆鍖栨埧闂村垪琛� + Shared.IO.FileUtils.WriteFileByBytes (roomListFilePath, System.Text.Encoding.UTF8.GetBytes (Newtonsoft.Json.JsonConvert.SerializeObject (new System.Collections.Generic.List<string> ()))); + } + var roomFilePathList = Newtonsoft.Json.JsonConvert.DeserializeObject<System.Collections.Generic.List<string>> (System.Text.Encoding.UTF8.GetString (IO.FileUtils.ReadFile (roomListFilePath))); + if (!roomFilePathList.Contains (FavoriteRoom)) { + roomFilePathList.Add (FavoriteRoom); + if (!IO.FileUtils.Exists (FavoriteRoom)) { + //榛樿娣诲姞瀵瑰簲鐨勬埧闂� + new Room () { Name = "" }.Save (FavoriteRoom); + } + IO.FileUtils.WriteFileByBytes (roomListFilePath, System.Text.Encoding.UTF8.GetBytes (Newtonsoft.Json.JsonConvert.SerializeObject (roomFilePathList))); } - IO.FileUtils.WriteFileByBytes (roomListFilePath, System.Text.Encoding.UTF8.GetBytes (Newtonsoft.Json.JsonConvert.SerializeObject (roomFilePathList))); - - } - - foreach (var roomFilePath in roomFilePathList) { - var room = GetRoomByFilePath (roomFilePath); - if (null != room) { - Lists.Add (room); - } - } - - for (int i = UserConfig.Instance.HideDeviceTypes.Count - 1; i >= 0; i--) { - var hideType = UserConfig.Instance.HideDeviceTypes [i]; - foreach (var room in Room.Lists) { - var devices = room.DeviceList.Find ((obj) => { - return obj.DeviceTextID == hideType; - }); - if (devices != null) { - UserConfig.Instance.HideDeviceTypes.Remove (hideType); - UserConfig.Instance.SaveUserConfig (); - break; + foreach (var roomFilePath in roomFilePathList) { + var room = GetRoomByFilePath (roomFilePath); + if (null != room) { + Lists.Add (room); } } + + for (int i = UserConfig.Instance.HideDeviceTypes.Count - 1; i >= 0; i--) { + var hideType = UserConfig.Instance.HideDeviceTypes [i]; + foreach (var room in Room.Lists) { + var devices = room.DeviceList.Find ((obj) => { + return obj.DeviceTextID == hideType; + }); + if (devices != null) { + UserConfig.Instance.HideDeviceTypes.Remove (hideType); + UserConfig.Instance.SaveUserConfig (); + break; + } + } + } + + + } catch { + Utlis.WriteLine ("瑙f瀽鎴块棿鍒楄〃寮傚父"); } } + + public void SaveLightScene (string roomFilePath, string SceneRemark, Scene scene) { IO.FileUtils.WriteFileByBytes (roomFilePath + "_" + SceneRemark, Encoding.UTF8.GetBytes (Newtonsoft.Json.JsonConvert.SerializeObject (scene))); diff --git a/Crabtree/SmartHome/HDL/Operation/UserConfig.cs b/Crabtree/SmartHome/HDL/Operation/UserConfig.cs index 0a8f065..79ff8c0 100644 --- a/Crabtree/SmartHome/HDL/Operation/UserConfig.cs +++ b/Crabtree/SmartHome/HDL/Operation/UserConfig.cs @@ -28,7 +28,7 @@ instance.HideDeviceTypes.Add (SimpleControl.R.MyInternationalizationString.Sensor); instance.HideDeviceTypes.Add (SimpleControl.R.MyInternationalizationString.Environmental); instance.HideDeviceTypes.Add (SimpleControl.R.MyInternationalizationString.MusicModel); - instance.HideDeviceTypes.Add (SimpleControl.R.MyInternationalizationString.UniversalDevice); + //instance.HideDeviceTypes.Add (SimpleControl.R.MyInternationalizationString.UniversalDevice); } else { instance = temp; } diff --git a/Crabtree/SmartHome/HDL/Operation/Utlis.cs b/Crabtree/SmartHome/HDL/Operation/Utlis.cs index 51d9132..8b972ea 100644 --- a/Crabtree/SmartHome/HDL/Operation/Utlis.cs +++ b/Crabtree/SmartHome/HDL/Operation/Utlis.cs @@ -45,7 +45,7 @@ public static void WriteLine (object mes) { #if DEBUG - Utlis.WriteLine (mes); + System.Console.WriteLine (mes); #endif } diff --git a/Crabtree/SmartHome/UI/SimpleControl/CommonPage.cs b/Crabtree/SmartHome/UI/SimpleControl/CommonPage.cs index 188fc31..3d6bd2c 100644 --- a/Crabtree/SmartHome/UI/SimpleControl/CommonPage.cs +++ b/Crabtree/SmartHome/UI/SimpleControl/CommonPage.cs @@ -2174,6 +2174,7 @@ IO.FileUtils.WriteFileByBytes (Scene.GlobalSceneFilePath, CommonPage.MyEncodingUTF8.GetBytes (Newtonsoft.Json.JsonConvert.SerializeObject (sceneFileList))); } } + //Utlis.WriteLine ("鎺ユ敹"+path); FileUtils.WriteFileByInputStream (path, inputStream); Common common = Newtonsoft.Json.JsonConvert.DeserializeObject<Common> (CommonPage.MyEncodingUTF8.GetString (IO.FileUtils.ReadFile (path))); if (common.DeviceTextID == R.MyInternationalizationString.ElectricalControl) { diff --git a/Crabtree/SmartHome/UI/SimpleControl/EquipmentPublicClass.cs b/Crabtree/SmartHome/UI/SimpleControl/EquipmentPublicClass.cs index c96c1ab..5946475 100644 --- a/Crabtree/SmartHome/UI/SimpleControl/EquipmentPublicClass.cs +++ b/Crabtree/SmartHome/UI/SimpleControl/EquipmentPublicClass.cs @@ -153,6 +153,8 @@ if (UserConfig.Instance.CheckHomeGateways ()) { if (!string.IsNullOrEmpty (UserConfig.Instance.CurrentRegion.HomeGateways [0].GatewayUniqueId)) { // 5.1鑳借繙绋�,鏄剧ずCloudUnlink鐘舵�侊紝IsRemote璁句负true寮�濮嬭繙绋� + MainPage.AddTip ("Starting remote connection mode..."); + Utlis.ShowAppLinkStatus (AppLinkStatus.CloudUnlink); CommonPage.IsRemote = true; SmartHome.MqttCommon.IsGatewayOnline = false; diff --git a/Crabtree/SmartHome/UI/SimpleControl/MainPage.cs b/Crabtree/SmartHome/UI/SimpleControl/MainPage.cs index 1c03c83..972fc55 100644 --- a/Crabtree/SmartHome/UI/SimpleControl/MainPage.cs +++ b/Crabtree/SmartHome/UI/SimpleControl/MainPage.cs @@ -37,7 +37,7 @@ //public static Button LogoButton = new Button (); - public static string RequestVersion = "20200402"; + public static string RequestVersion = "20200414"; public static UserInfo LoginUser; /// <summary> /// 鏄惁鏄鐞嗗憳鏉冮檺(鍙樻洿浜�,鎴愬憳鐨勬椂鍊�,杩欎釜涔熶负ture銆備负浠�涔堜細澹版槑杩欐牱鍙橀噺,鍥犱负鏈変簺鎺ュ彛蹇呴』浣跨敤鍘熸潵鐨凾oken) @@ -166,11 +166,13 @@ Gravity = Gravity.Center, Width = Application.GetRealWidth (560), Height = Application.GetRealHeight (126), - BackgroundColor = SkinStyle.Current.AddTipButtonColor, + //BackgroundColor = SkinStyle.Current.AddTipButtonColor, + BackgroundColor = SkinStyle.Current.MainColor, Radius = 10, IsMoreLines = true, Text = tip, TextSize = 16, + TextColor = 0xFF000000 }; MainFrameLayout.AddChidren (button); button.MouseUpEventHandler += (sender, e) => { diff --git a/Crabtree/SmartHome/UI/SimpleControl/MqttCommon.cs b/Crabtree/SmartHome/UI/SimpleControl/MqttCommon.cs index 0d6fb64..f580d57 100644 --- a/Crabtree/SmartHome/UI/SimpleControl/MqttCommon.cs +++ b/Crabtree/SmartHome/UI/SimpleControl/MqttCommon.cs @@ -45,7 +45,7 @@ static MqttCommon () { InitMqtt (); - InitCheckGateway (); + //InitCheckGateway (); } /// <summary> @@ -177,161 +177,176 @@ await System.Threading.Tasks.Task.Factory.StartNew (async () => { try { //lock (RemoteMqttClient) { - //琛ㄧず鍚庨潰灏嗚繘琛岃繛鎺� + //琛ㄧず鍚庨潰灏嗚繘琛岃繛鎺� - #region 鍒濆鍖栬繙绋婱qtt - //(3)褰揫杩炴帴浜戠鐨凪qtt鎴愬姛鍚嶿鎴栬�匸浠ュ強鍚庨潰App閫氳繃浜戠Mqtt杞彂鏁版嵁缁欑綉鍏虫垚鍔熷悗],澶勭悊鎺ユ敹鍒颁簯绔暟鎹寘鍝嶅簲鏃跺湪mqttServerClient_ApplicationMessageReceived杩欎釜鏂规硶澶勭悊 - if (RemoteMqttClient.ApplicationMessageReceivedHandler == null) { - RemoteMqttClient.UseApplicationMessageReceivedHandler (async (e) => { - try { - if (!RemoteMqttClient.IsConnected || !CommonPage.IsRemote) { - return; + #region 鍒濆鍖栬繙绋婱qtt + //(3)褰揫杩炴帴浜戠鐨凪qtt鎴愬姛鍚嶿鎴栬�匸浠ュ強鍚庨潰App閫氳繃浜戠Mqtt杞彂鏁版嵁缁欑綉鍏虫垚鍔熷悗],澶勭悊鎺ユ敹鍒颁簯绔暟鎹寘鍝嶅簲鏃跺湪mqttServerClient_ApplicationMessageReceived杩欎釜鏂规硶澶勭悊 + if (RemoteMqttClient.ApplicationMessageReceivedHandler == null) { + RemoteMqttClient.UseApplicationMessageReceivedHandler (async (e) => { + try { + if (!RemoteMqttClient.IsConnected || !CommonPage.IsRemote) { + return; + } + var aesDecryptTopic = e.ApplicationMessage.Topic; + var aesDecryptPayload = e.ApplicationMessage.Payload; + //Utlis.WriteLine ("Topic={0}", aesDecryptTopic); + + //if (aesDecryptTopic == $"NotifyBusGateWayInfoChagne/{CurRemoteMACInfo.md5_mac_string}") {//缃戝叧涓婄嚎锛岄渶瑕佹洿鏂癮eskey + //2020-01-11 淇敼璁㈤槄涓婚鍦板潃 + if (aesDecryptTopic == $"/BusGateWayToClient/{CurRemoteMACInfo.macMark}/NotifyBusGateWayInfoChange") {//缃戝叧涓婄嚎锛岄渶瑕佹洿鏂癮eskey //----绗簩姝ワ細璇诲彇璐﹀彿涓嬮潰鐨勭綉鍏冲垪琛� + await ReceiveNotifyBusGateWayInfoChange (); + } else if (aesDecryptTopic == $"/BusGateWayToClient/{CurRemoteMACInfo.macMark}/NotifyGateWayOffline") {//缃戝叧鎺夌嚎 //----绗簩姝ワ細璇诲彇璐﹀彿涓嬮潰鐨勭綉鍏冲垪琛� + ReceiveNotifyGateWayOffline (); + } else if (aesDecryptTopic == $"/BusGateWayToClient/{mMqttInfo.connEmqClientId}/Push/NotifySqueeze") {//璁㈤槄鎸や笅绾块棶棰� + await ReceiveNotifySqueezeAsync (aesDecryptPayload); + } else if (aesDecryptTopic == $"/BusGateWayToClient/{CurRemoteMACInfo.macMark}/Common/CheckGateway") { + ReceiveCheckGatewayTopic (); + } else { + SetGatewayOnlineResetCheck (); + + if (!string.IsNullOrEmpty (mqttEncryptKey)) { + aesDecryptPayload = Shared.Securitys.EncryptionService.AesDecryptPayload (e.ApplicationMessage.Payload, mqttEncryptKey); } - var aesDecryptTopic = e.ApplicationMessage.Topic; - var aesDecryptPayload = e.ApplicationMessage.Payload; - //Utlis.WriteLine ("Topic={0}", aesDecryptTopic); - //if (aesDecryptTopic == $"NotifyBusGateWayInfoChagne/{CurRemoteMACInfo.md5_mac_string}") {//缃戝叧涓婄嚎锛岄渶瑕佹洿鏂癮eskey - //2020-01-11 淇敼璁㈤槄涓婚鍦板潃 - if (aesDecryptTopic == $"/BusGateWayToClient/{CurRemoteMACInfo.macMark}/NotifyBusGateWayInfoChange") {//缃戝叧涓婄嚎锛岄渶瑕佹洿鏂癮eskey //----绗簩姝ワ細璇诲彇璐﹀彿涓嬮潰鐨勭綉鍏冲垪琛� - await ReceiveNotifyBusGateWayInfoChange (); - } else if (aesDecryptTopic == $"/BusGateWayToClient/{CurRemoteMACInfo.macMark}/NotifyGateWayOffline") {//缃戝叧鎺夌嚎 //----绗簩姝ワ細璇诲彇璐﹀彿涓嬮潰鐨勭綉鍏冲垪琛� - ReceiveNotifyGateWayOffline (); - } else if (aesDecryptTopic == $"/BusGateWayToClient/{mMqttInfo.connEmqClientId}/Push/NotifySqueeze") {//璁㈤槄鎸や笅绾块棶棰� - await ReceiveNotifySqueezeAsync (aesDecryptPayload); - }else if (aesDecryptTopic == $"/BusGateWayToClient/{CurRemoteMACInfo.macMark}/Common/CheckGateway") { - ReceiveCheckGatewayTopic (); - } else { - SetGatewayOnlineResetCheck (); + var packet = new Packet (); + packet.IsLocal = false; + packet.Bytes = aesDecryptPayload; + packet.Manager (); - if (!string.IsNullOrEmpty (mqttEncryptKey)) { - aesDecryptPayload = Shared.Securitys.EncryptionService.AesDecryptPayload (e.ApplicationMessage.Payload, mqttEncryptKey); - } + } - var packet = new Packet (); - packet.IsLocal = false; - packet.Bytes = aesDecryptPayload; - packet.Manager (); + } catch { } + }); + } + if (RemoteMqttClient.DisconnectedHandler == null) { + RemoteMqttClient.UseDisconnectedHandler (async (e) => { + Utlis.WriteLine ($"============>Mqtt杩滅▼杩炴帴鏂紑"); + isSubscribeTopicSuccess = false; + await DisConnectRemoteMqttClient ("StartRemoteMqtt.DisconnectedHandler"); + //await StartRemoteMqtt(); + //if (thisShowTip) { + // if (CommonPage.IsRemote) { + // Application.RunOnMainThread (() => { + // MainPage.Loading.Hide (); + // }); + // } + //} else { + // thisShowTip = true; + //} + }); + } + if (RemoteMqttClient.ConnectedHandler == null) { + RemoteMqttClient.UseConnectedHandler (async (e) => { + IfNeedReadAllDeviceStatus = true; + mCheckGatewayTime = DateTime.Now; + CheckGatewayCount = 0; + bNeedStartTip = true; + + Utlis.WriteLine ($"============>Mqtt杩滅▼杩炴帴鎴愬姛"); + if (CommonPage.IsRemote) { + Utlis.ShowAppLinkStatus (AppLinkStatus.CloudLink); + } + + if (CurRemoteMACInfo != null) { + IsGatewayOnline = CurRemoteMACInfo.isValid != "InValid"; + if (!IsGatewayOnline) { + //缃戝叧涓嶅湪绾� + if (CommonPage.IsRemote) { + Utlis.ShowAppLinkStatus (AppLinkStatus.CloudOffline); } - - } catch { } - }); - } + MainPage.AddTip ("Remote failed,gateway offline"); + } else { + //Remote Connection Succeeded - if (RemoteMqttClient.DisconnectedHandler == null) { - RemoteMqttClient.UseDisconnectedHandler (async (e) => { - Utlis.WriteLine ($"============>Mqtt杩滅▼杩炴帴鏂紑"); - isSubscribeTopicSuccess = false; - await DisConnectRemoteMqttClient ("StartRemoteMqtt.DisconnectedHandler"); - //await StartRemoteMqtt(); - //if (thisShowTip) { - // if (CommonPage.IsRemote) { - // Application.RunOnMainThread (() => { - // MainPage.Loading.Hide (); - // }); - // } + //缃戝叧鍦ㄧ嚎 + + //閲嶆柊涓�娆℃墍鏈夎澶囩姸鎬� + IfNeedReadAllDeviceStatus = false; + Shared.SimpleControl.Phone.UserMiddle.ReadAllDeviceStatus (); + // + MqttRemoteSend (new byte [] { 0 }, 3); + + if (CommonPage.IsRemote) { + MainPage.AddTip (Language.StringByID (Shared.SimpleControl.R.MyInternationalizationString.LinkSuccess)); + } + } + + //if (CurRemoteMACInfo.isValid == "InValid") { + // MainPage.AddTip ("Remote failed,gateway offline"); //} else { - // thisShowTip = true; + // MqttRemoteSend (new byte [] { 0 }, 3); //} - }); - } - if (RemoteMqttClient.ConnectedHandler == null) { - RemoteMqttClient.UseConnectedHandler (async (e) => { - IfNeedReadAllDeviceStatus = true; - - Utlis.WriteLine ($"============>Mqtt杩滅▼杩炴帴鎴愬姛"); - if (CommonPage.IsRemote) { - Utlis.ShowAppLinkStatus (AppLinkStatus.CloudLink); - } - - if (CurRemoteMACInfo != null) { - IsGatewayOnline = CurRemoteMACInfo.isValid != "InValid"; - if (!IsGatewayOnline) { - //缃戝叧涓嶅湪绾� - if (CommonPage.IsRemote) { - Utlis.ShowAppLinkStatus (AppLinkStatus.CloudOffline); - } - MainPage.AddTip ("Remote failed,gateway offline"); - } else { - //缃戝叧鍦ㄧ嚎 - - //閲嶆柊涓�娆℃墍鏈夎澶囩姸鎬� - IfNeedReadAllDeviceStatus = false; - Shared.SimpleControl.Phone.UserMiddle.ReadAllDeviceStatus (); - // - MqttRemoteSend (new byte [] { 0 }, 3); - } - - //if (CurRemoteMACInfo.isValid == "InValid") { - // MainPage.AddTip ("Remote failed,gateway offline"); - //} else { - // MqttRemoteSend (new byte [] { 0 }, 3); - //} - } + } - }); - } - #endregion + }); + } + #endregion //} + //姝e湪鑾峰彇杩炴帴鍙傛暟..." + ShowStartTip (); - mqttRequestParToken = MainPage.LoginUser.LoginTokenString; - //--绗竴姝ワ細鑾峰彇mqtt閾炬帴鍙傛暟 - var mqttInfoRequestResult = new ResponsePack () { StateCode = "" }; - //--鍒ゆ柇鏄綋鍓嶆槸鍚﹀垎浜殑浣忓畢 - if (!UserConfig.Instance.CurrentRegion.IsOthreShare) { - var mqttInfoUrl = $"{MainPage.RequestHttpsHost}/EmqMqtt/GetConnMqttInfo";//鑾峰彇杩炴帴杩滅▼浜戠Emq Mqtt 鏈嶅姟鍣ㄨ繛鎺ヤ俊鎭� - var mqttInfoRequestPar = new GetConnMqttInfoObj () { - LoginAccessToken = mqttRequestParToken, - PlatformStr = "L1", - PublishPayloadJsonStr = PushSignStr, - }; - mqttInfoRequestResult = MainPage.RequestHttps ("", Newtonsoft.Json.JsonConvert.SerializeObject (mqttInfoRequestPar), mqttInfoUrl); - if (mqttInfoRequestResult != null && mqttInfoRequestResult.ResponseData != null) { - var mqttInfoRequestResult_info = Newtonsoft.Json.JsonConvert.DeserializeObject<MqttInfo> (mqttInfoRequestResult.ResponseData.ToString ()); - if (mqttInfoRequestResult_info != null) { - mMqttInfo = mqttInfoRequestResult_info; - //----绗簩姝ワ細璇诲彇璐﹀彿涓嬮潰鐨勭綉鍏冲垪琛� - var gatewayListUrl = $"{MainPage.RequestHttpsHostMqtt}/Center/Center/GetGatewayPagger"; //App銆丅uspro杞欢鐧诲綍鍚庤幏鍙栫綉鍏冲垪琛� http 璇锋眰 - var gatewayListRequestPar = new RemoteRequestParameters () { LoginAccessToken = mqttRequestParToken, RequestVersion = "RequestVersion1", RequestProtocolType = 0, RequestSource = 1 }; - var gatewayListRequestResult = MainPage.RequestHttps ("", Newtonsoft.Json.JsonConvert.SerializeObject (gatewayListRequestPar), gatewayListUrl); - var gatewayListRequestResult_Obj = Newtonsoft.Json.JsonConvert.DeserializeObject<MqttRemoteInfo> (gatewayListRequestResult.ResponseData.ToString ()); - //--鎵惧嚭鏄惁瀛樺湪鍖归厤褰撳墠浣忓畢鐨刴ac锛屽瓨鍦ㄥ啀杩涜杩滅▼銆� - if (UserConfig.Instance.CheckHomeGatewaysNotEmpty ()) { - CurRemoteMACInfo = gatewayListRequestResult_Obj.pageData.Find ((obj) => obj.mac == UserConfig.Instance.CurrentRegion.HomeGateways [0].GatewayUniqueId); - //CurRemoteMACInfo = gatewayListRequestResult_Obj.pageData [0]; - await MQTTConnectAsync (); + mqttRequestParToken = MainPage.LoginUser.LoginTokenString; + //--绗竴姝ワ細鑾峰彇mqtt閾炬帴鍙傛暟 + var mqttInfoRequestResult = new ResponsePack () { StateCode = "" }; + //--鍒ゆ柇鏄綋鍓嶆槸鍚﹀垎浜殑浣忓畢 + if (!UserConfig.Instance.CurrentRegion.IsOthreShare) { + var mqttInfoUrl = $"{MainPage.RequestHttpsHost}/EmqMqtt/GetConnMqttInfo";//鑾峰彇杩炴帴杩滅▼浜戠Emq Mqtt 鏈嶅姟鍣ㄨ繛鎺ヤ俊鎭� + var mqttInfoRequestPar = new GetConnMqttInfoObj () { + LoginAccessToken = mqttRequestParToken, + PlatformStr = "L1", + PublishPayloadJsonStr = PushSignStr, + }; + mqttInfoRequestResult = MainPage.RequestHttps ("", Newtonsoft.Json.JsonConvert.SerializeObject (mqttInfoRequestPar), mqttInfoUrl); + if (mqttInfoRequestResult != null && mqttInfoRequestResult.ResponseData != null) { + var mqttInfoRequestResult_info = Newtonsoft.Json.JsonConvert.DeserializeObject<MqttInfo> (mqttInfoRequestResult.ResponseData.ToString ()); + if (mqttInfoRequestResult_info != null) { + mMqttInfo = mqttInfoRequestResult_info; + //----绗簩姝ワ細璇诲彇璐﹀彿涓嬮潰鐨勭綉鍏冲垪琛� + var gatewayListUrl = $"{MainPage.RequestHttpsHostMqtt}/Center/Center/GetGatewayPagger"; //App銆丅uspro杞欢鐧诲綍鍚庤幏鍙栫綉鍏冲垪琛� http 璇锋眰 + var gatewayListRequestPar = new RemoteRequestParameters () { LoginAccessToken = mqttRequestParToken, RequestVersion = "RequestVersion1", RequestProtocolType = 0, RequestSource = 1 }; + var gatewayListRequestResult = MainPage.RequestHttps ("", Newtonsoft.Json.JsonConvert.SerializeObject (gatewayListRequestPar), gatewayListUrl); + var gatewayListRequestResult_Obj = Newtonsoft.Json.JsonConvert.DeserializeObject<MqttRemoteInfo> (gatewayListRequestResult.ResponseData.ToString ()); + //--鎵惧嚭鏄惁瀛樺湪鍖归厤褰撳墠浣忓畢鐨刴ac锛屽瓨鍦ㄥ啀杩涜杩滅▼銆� + if (UserConfig.Instance.CheckHomeGatewaysNotEmpty ()) { + CurRemoteMACInfo = gatewayListRequestResult_Obj.pageData.Find ((obj) => obj.mac == UserConfig.Instance.CurrentRegion.HomeGateways [0].GatewayUniqueId); + //CurRemoteMACInfo = gatewayListRequestResult_Obj.pageData [0]; + await MQTTConnectAsync (); - } else { - Utlis.WriteLine ("============>Mqtt 鍙栨秷杩炴帴锛屽綋鍓嶄綇瀹呮病缁戝畾缃戝叧"); - } - + } else { + Utlis.WriteLine ("============>Mqtt 鍙栨秷杩炴帴锛屽綋鍓嶄綇瀹呮病缁戝畾缃戝叧"); } + } else { + Utlis.WriteLine ("============>Mqtt GetGatewayPagger 澶辫触"); } + } else { - //濡傛灉鏄垎浜繃鏉ョ殑浣忓畢 璧颁笅闈㈡祦绋� - var mqttInfoRequestPar = new ShareMemberConnMqttInfoObj () { - LoginAccessToken = mqttRequestParToken, - PlatformStr = "L1", - PublishPayloadJsonStr = PushSignStr, - MainUserDistributedMark = UserConfig.Instance.CurrentRegion.MainUserDistributedMark, - HomeId = UserConfig.Instance.CurrentRegion.Id - }; - mqttInfoRequestResult = MainPage.RequestHttps (API.ShareMemberConnMqttInfo, Newtonsoft.Json.JsonConvert.SerializeObject (mqttInfoRequestPar)); - //--绗竴姝ワ細鑾峰彇mqtt閾炬帴鍙傛暟 - if (mqttInfoRequestResult != null && mqttInfoRequestResult.ResponseData != null) { - var mqttInfoRequestResult_info = Newtonsoft.Json.JsonConvert.DeserializeObject<MqttInfo> (mqttInfoRequestResult.ResponseData.ToString ()); - if (mqttInfoRequestResult_info != null) { - mMqttInfo = mqttInfoRequestResult_info; - //--绗簩姝ワ細鑾峰彇褰撳墠浣忓垎浜畢缃戝叧淇℃伅骞惰繛鎺QTT - await GetSingleHomeGatewayPaggerAndMQTTConnectAsync (); - - } + Utlis.WriteLine ("============>Mqtt GetInfo 澶辫触"); + } + } else { + //濡傛灉鏄垎浜繃鏉ョ殑浣忓畢 璧颁笅闈㈡祦绋� + var mqttInfoRequestPar = new ShareMemberConnMqttInfoObj () { + LoginAccessToken = mqttRequestParToken, + PlatformStr = "L1", + PublishPayloadJsonStr = PushSignStr, + MainUserDistributedMark = UserConfig.Instance.CurrentRegion.MainUserDistributedMark, + HomeId = UserConfig.Instance.CurrentRegion.Id + }; + mqttInfoRequestResult = MainPage.RequestHttps (API.ShareMemberConnMqttInfo, Newtonsoft.Json.JsonConvert.SerializeObject (mqttInfoRequestPar)); + //--绗竴姝ワ細鑾峰彇mqtt閾炬帴鍙傛暟 + if (mqttInfoRequestResult != null && mqttInfoRequestResult.ResponseData != null) { + var mqttInfoRequestResult_info = Newtonsoft.Json.JsonConvert.DeserializeObject<MqttInfo> (mqttInfoRequestResult.ResponseData.ToString ()); + if (mqttInfoRequestResult_info != null) { + mMqttInfo = mqttInfoRequestResult_info; + //--绗簩姝ワ細鑾峰彇褰撳墠浣忓垎浜畢缃戝叧淇℃伅骞惰繛鎺QTT + await GetSingleHomeGatewayPaggerAndMQTTConnectAsync (); } + } + } } catch (Exception ex) { Utlis.WriteLine ($"============>Mqtt 杩滅▼杩炴帴閫氳杩炴帴鍑哄紓甯�:{ex.Message}"); @@ -349,6 +364,9 @@ { if (CurRemoteMACInfo != null && mMqttInfo != null) { + MainPage.AddTip ("Successfully obtained parameters, starting to connect..."); + + var url = mMqttInfo.connEmqDomainPort; var clientId = mMqttInfo.connEmqClientId; var username = mMqttInfo.connEmqUserName; @@ -375,6 +393,27 @@ } } + +// 571=Starting remote connection mode... +//572=Getting remote connection parameters... +//573=Successfully obtained parameters, starting to connect... + /// <summary> + /// 浠庡紑濮嬪埌杩炴帴鎴愬姛锛屽彧鎻愮ず1娆� + /// </summary> + static bool bNeedStartTip = true; + /// <summary> + /// 姝e湪鑾峰彇杩炴帴鍙傛暟... + /// </summary> + static void ShowStartTip () + { + if (bNeedStartTip) { + bNeedStartTip = false; + if (CommonPage.IsRemote) { + MainPage.AddTip ("Getting remote connection parameters..."); + } + } + + } ///// <summary> ///// @@ -638,7 +677,7 @@ if (CheckGatewayCount >= 3) { //杩炵画3娆℃病鍥炲锛屽垽瀹氱綉鍏宠秴鏃� if (MainPage.WiFiStatus == "CrabtreeAdd/CloudLink.png") { - IsGatewayOnline = false; + //IsGatewayOnline = false; Utlis.ShowAppLinkStatus (AppLinkStatus.CloudOffline); MainPage.AddTip ("Gateway offline!"); } @@ -672,7 +711,6 @@ //Utlis.WriteLine ("============>Mqtt CheckGateway缃戝叧鍥炲"); SetGatewayOnlineResetCheck (); - //鏃х綉鍏虫柟娉� //MainPage.WiFiStatus = "CrabtreeAdd/CloudUnlink.png"; diff --git a/Crabtree/SmartHome/UI/SimpleControl/Phone/Light/UserDeviceToLight.cs b/Crabtree/SmartHome/UI/SimpleControl/Phone/Light/UserDeviceToLight.cs index 714c35c..c17cf22 100644 --- a/Crabtree/SmartHome/UI/SimpleControl/Phone/Light/UserDeviceToLight.cs +++ b/Crabtree/SmartHome/UI/SimpleControl/Phone/Light/UserDeviceToLight.cs @@ -92,7 +92,7 @@ if (light.Type == DeviceType.LightDimming || light.Type == DeviceType.LightMixDimming || light.Type == DeviceType.LightDALI) { if ((light as LightDimming).CurrentBrightness > 0) brighingCount++; - } else if (light.Type == DeviceType.LightSwitch || light.Type == DeviceType.LightMixSwitch) + } else if (light.Type == DeviceType.LightSwitch || light.Type == DeviceType.LightMixSwitch || light.Type == DeviceType.LightEnergySwitch) if ((light as LightSwitch).CurrentBrightness == 100) brighingCount++; if (light.Type == DeviceType.LightRGB) diff --git a/Crabtree/SmartHome/UI/SimpleControl/Phone/Room/UserRoom.cs b/Crabtree/SmartHome/UI/SimpleControl/Phone/Room/UserRoom.cs index 5cfda16..1257744 100644 --- a/Crabtree/SmartHome/UI/SimpleControl/Phone/Room/UserRoom.cs +++ b/Crabtree/SmartHome/UI/SimpleControl/Phone/Room/UserRoom.cs @@ -1821,7 +1821,7 @@ } }; #endregion - } else if (devcieCommon.Type == DeviceType.LightSwitch || + } else if (devcieCommon.Type == DeviceType.LightSwitch || devcieCommon.Type == DeviceType.LightEnergySocket || devcieCommon.Type == DeviceType.LightEnergySwitch || devcieCommon.Type == DeviceType.LightSwitchSocket) { #region 缁х數鍣� @@ -2049,14 +2049,14 @@ }; DeviceRowView.AddChidren (tempSwitch); if (udDevice.ActionType == 0) { - tempSwitch.Text = udDevice.ON_Text; - //tempSwitch.TextID = R.MyInternationalizationString.ON; + //tempSwitch.Text = udDevice.ON_Text; + tempSwitch.TextID = R.MyInternationalizationString.ON; } else if (udDevice.ActionType == 1) { - tempSwitch.Text = udDevice.OFF_Text; - //tempSwitch.TextID = R.MyInternationalizationString.OFF; + //tempSwitch.Text = udDevice.OFF_Text; + tempSwitch.TextID = R.MyInternationalizationString.OFF; } else if (udDevice.ActionType == 2) { - tempSwitch.Text = udDevice.OFF_Text; - //tempSwitch.TextID = R.MyInternationalizationString.OFF; + //tempSwitch.Text = udDevice.OFF_Text; + tempSwitch.TextID = R.MyInternationalizationString.OFF; Button tempON = new Button () { Width = Application.GetRealWidth (110), @@ -2082,25 +2082,26 @@ DeviceRowView.BorderColor = SkinStyle.Current.SelectedColor; tempON.BorderColor = SkinStyle.Current.SelectedColor; }; - tempSwitch.MouseUpEventHandler += (sender3, e3) => { - if (udDevice.UniversalType == 0xE01C) { - if (udDevice.ActionType == 0) { - //2020-02-10 寰呬慨鏀� - Control.ControlBytesSend (Command.SetCommonSwitch, udDevice.SubnetID, udDevice.DeviceID, new byte [] { udDevice.SendBytes [0], 255 }, SendCount.Zero); - } else if (udDevice.ActionType == 1) { - Control.ControlBytesSend (Command.SetCommonSwitch, udDevice.SubnetID, udDevice.DeviceID, new byte [] { udDevice.SendBytes [0], 0 }, SendCount.Zero); - } else if (udDevice.ActionType == 2) { - Control.ControlBytesSend (Command.SetCommonSwitch, udDevice.SubnetID, udDevice.DeviceID, new byte [] { udDevice.SendBytes [0], 0 }, SendCount.Zero); - } - } - DeviceRowView.BorderColor = SkinStyle.Current.Transparent; - tempSwitch.BorderColor = SkinStyle.Current.BorderColor; - }; - tempSwitch.MouseDownEventHandler += (sende3r, e3) => { - DeviceRowView.BorderColor = SkinStyle.Current.SelectedColor; - tempSwitch.BorderColor = SkinStyle.Current.SelectedColor; - }; } + tempSwitch.MouseUpEventHandler += (sender3, e3) => { + if (udDevice.UniversalType == 0xE01C) { + if (udDevice.ActionType == 0) { + //2020-02-10 寰呬慨鏀� + Control.ControlBytesSend (Command.SetCommonSwitch, udDevice.SubnetID, udDevice.DeviceID, new byte [] { udDevice.SendBytes [0], 255 }, SendCount.Zero); + } else if (udDevice.ActionType == 1) { + Control.ControlBytesSend (Command.SetCommonSwitch, udDevice.SubnetID, udDevice.DeviceID, new byte [] { udDevice.SendBytes [0], 0 }, SendCount.Zero); + } else if (udDevice.ActionType == 2) { + Control.ControlBytesSend (Command.SetCommonSwitch, udDevice.SubnetID, udDevice.DeviceID, new byte [] { udDevice.SendBytes [0], 0 }, SendCount.Zero); + } + } + DeviceRowView.BorderColor = SkinStyle.Current.Transparent; + tempSwitch.BorderColor = SkinStyle.Current.BorderColor; + }; + tempSwitch.MouseDownEventHandler += (sende3r, e3) => { + DeviceRowView.BorderColor = SkinStyle.Current.SelectedColor; + tempSwitch.BorderColor = SkinStyle.Current.SelectedColor; + }; + #endregion } else if (devcieCommon.Type.ToString ().Contains ("Sensor")) { #region 浼犳劅鍣� diff --git a/Crabtree/SmartHome/UI/SimpleControl/Phone/UniversalDevice/UserUniversalPage.cs b/Crabtree/SmartHome/UI/SimpleControl/Phone/UniversalDevice/UserUniversalPage.cs index 8b93c6b..6be01b0 100644 --- a/Crabtree/SmartHome/UI/SimpleControl/Phone/UniversalDevice/UserUniversalPage.cs +++ b/Crabtree/SmartHome/UI/SimpleControl/Phone/UniversalDevice/UserUniversalPage.cs @@ -164,9 +164,11 @@ Control.ControlBytesSend (Command.SetCommonSwitch, udDevice.SubnetID, udDevice.DeviceID, new byte [] { udDevice.SendBytes [0], 255 },SendCount.Zero); } lightView.BorderColor = SkinStyle.Current.Transparent; + tempON.BorderColor = SkinStyle.Current.BorderColor; }; tempON.MouseDownEventHandler += (sende3r, e3) => { lightView.BorderColor = SkinStyle.Current.SelectedColor; + tempON.BorderColor = SkinStyle.Current.SelectedColor; }; } tempSiwtch.MouseUpEventHandler += (sender3, e3) => { @@ -180,9 +182,11 @@ } } lightView.BorderColor = SkinStyle.Current.Transparent; + tempSiwtch.BorderColor = SkinStyle.Current.BorderColor; }; tempSiwtch.MouseDownEventHandler += (sende3r, e3) => { lightView.BorderColor = SkinStyle.Current.SelectedColor; + tempSiwtch.BorderColor = SkinStyle.Current.SelectedColor; }; } } diff --git a/Crabtree/SmartHome/UI/SimpleControl/Phone/User/UserSettingView.cs b/Crabtree/SmartHome/UI/SimpleControl/Phone/User/UserSettingView.cs index 4a3177a..a98af5c 100644 --- a/Crabtree/SmartHome/UI/SimpleControl/Phone/User/UserSettingView.cs +++ b/Crabtree/SmartHome/UI/SimpleControl/Phone/User/UserSettingView.cs @@ -211,89 +211,90 @@ #region ---鏁版嵁鎺ユ敹--- //if (MainPage.LoginUser.AccountType == 2 || MainPage.LoginUser.AccountString == @"464027401@qq.com") { - // var DataReceptionView = new FrameLayout () { - // Width = Application.GetRealWidth (640), - // Height = Application.GetRealHeight (100), - // BackgroundColor = SkinStyle.Current.ViewColor - // }; - // UserMiddle.SettingView.AddChidren (DataReceptionView); - // var btnDataReceptionIcon = new Button () { - // X = Application.GetRealWidth (30), - // Gravity = Gravity.CenterVertical, - // Width = Application.GetRealWidth (75), - // Height = Application.GetRealHeight (75), - // UnSelectedImagePath = "AccountSettings/DataShared.png" - // }; - // DataReceptionView.AddChidren (btnDataReceptionIcon); - // var btnDataReceptionTitle = new Button () { - // X = Application.GetRealWidth (125), - // TextAlignment = TextAlignment.CenterLeft, - // TextID = R.MyInternationalizationString.DataReception, - // TextColor = SkinStyle.Current.TextColor1, - // }; - // DataReceptionView.AddChidren (btnDataReceptionTitle); - // EventHandler<MouseEventArgs> DataReceptionEventHandler = (sender, e) => { - // GoData (); - // }; - // DataReceptionView.MouseUpEventHandler += DataReceptionEventHandler; - // btnDataReceptionIcon.MouseUpEventHandler += DataReceptionEventHandler; - // btnDataReceptionTitle.MouseUpEventHandler += DataReceptionEventHandler; - // Button btnNull3 = new Button () { - // BackgroundColor = SkinStyle.Current.MainColor, - // Height = Application.GetRealHeight (5) - // }; - // UserMiddle.SettingView.AddChidren (btnNull3); - //} - #endregion + if (true) { + var DataReceptionView = new FrameLayout () { + Width = Application.GetRealWidth (640), + Height = Application.GetRealHeight (100), + BackgroundColor = SkinStyle.Current.ViewColor + }; + UserMiddle.SettingView.AddChidren (DataReceptionView); + var btnDataReceptionIcon = new Button () { + X = Application.GetRealWidth (30), + Gravity = Gravity.CenterVertical, + Width = Application.GetRealWidth (75), + Height = Application.GetRealHeight (75), + UnSelectedImagePath = "AccountSettings/DataShared.png" + }; + DataReceptionView.AddChidren (btnDataReceptionIcon); + var btnDataReceptionTitle = new Button () { + X = Application.GetRealWidth (125), + TextAlignment = TextAlignment.CenterLeft, + TextID = R.MyInternationalizationString.DataReception, + TextColor = SkinStyle.Current.TextColor1, + }; + DataReceptionView.AddChidren (btnDataReceptionTitle); + EventHandler<MouseEventArgs> DataReceptionEventHandler = (sender, e) => { + GoData (); + }; + DataReceptionView.MouseUpEventHandler += DataReceptionEventHandler; + btnDataReceptionIcon.MouseUpEventHandler += DataReceptionEventHandler; + btnDataReceptionTitle.MouseUpEventHandler += DataReceptionEventHandler; + Button btnNull3 = new Button () { + BackgroundColor = SkinStyle.Current.MainColor, + Height = Application.GetRealHeight (5) + }; + UserMiddle.SettingView.AddChidren (btnNull3); + } + #endregion - #region ---msg--- - //FrameLayout WarningMsgView = new FrameLayout () { - // Width = Application.GetRealWidth (640), - // Height = Application.GetRealHeight (100), - // BackgroundColor = SkinStyle.Current.ViewColor - //}; - //UserMiddle.SettingView.AddChidren (WarningMsgView); - //Button btnWarningMsgIcon = new Button () { - // X = Application.GetRealWidth (30), - // Gravity = Gravity.CenterVertical, - // Width = Application.GetRealWidth (75), - // Height = Application.GetRealHeight (75), - // UnSelectedImagePath = "RemoteMsg/RemoteIcon.png", - // SelectedImagePath = "RemoteMsg/RemoteIconOn.png" - //}; - //WarningMsgView.AddChidren (btnWarningMsgIcon); + #region ---msg--- + //FrameLayout WarningMsgView = new FrameLayout () { + // Width = Application.GetRealWidth (640), + // Height = Application.GetRealHeight (100), + // BackgroundColor = SkinStyle.Current.ViewColor + //}; + //UserMiddle.SettingView.AddChidren (WarningMsgView); + //Button btnWarningMsgIcon = new Button () { + // X = Application.GetRealWidth (30), + // Gravity = Gravity.CenterVertical, + // Width = Application.GetRealWidth (75), + // Height = Application.GetRealHeight (75), + // UnSelectedImagePath = "RemoteMsg/RemoteIcon.png", + // SelectedImagePath = "RemoteMsg/RemoteIconOn.png" + //}; + //WarningMsgView.AddChidren (btnWarningMsgIcon); - //Button btnWarningMsgTitle = new Button () { - // X = btnWarningMsgIcon.Right + Application.GetRealWidth (20), - // TextAlignment = TextAlignment.CenterLeft, - // TextID = R.MyInternationalizationString.MessageAlert, - // TextColor = SkinStyle.Current.TextColor1, - //}; - //WarningMsgView.AddChidren (btnWarningMsgTitle); - //btnWarningMsgTitle.MouseLongEventHandler += (sd, ds) => { - // //var uc = UserConfig.Instance.RometoUserInfoKeys.Find ((obj) => obj.Contains ("HiddenJson")); - // //new Alert ("", uc, "close").Show (); - //}; + //Button btnWarningMsgTitle = new Button () { + // X = btnWarningMsgIcon.Right + Application.GetRealWidth (20), + // TextAlignment = TextAlignment.CenterLeft, + // TextID = R.MyInternationalizationString.MessageAlert, + // TextColor = SkinStyle.Current.TextColor1, + //}; + //WarningMsgView.AddChidren (btnWarningMsgTitle); + //btnWarningMsgTitle.MouseLongEventHandler += (sd, ds) => { + // //var uc = UserConfig.Instance.RometoUserInfoKeys.Find ((obj) => obj.Contains ("HiddenJson")); + // //new Alert ("", uc, "close").Show (); + //}; - //EventHandler<MouseEventArgs> WarningMsgEventHandler = (sender, e) => { - // var msgView = new WarningList (); - // UserMiddle.SettingPageView.AddChidren (msgView); - // msgView.ShowWarningListPage (); - // UserMiddle.SettingPageView.PageIndex = 1; - //}; - //WarningMsgView.MouseUpEventHandler += WarningMsgEventHandler; - //btnWarningMsgIcon.MouseUpEventHandler += WarningMsgEventHandler; - //btnWarningMsgTitle.MouseUpEventHandler += WarningMsgEventHandler; - //Button btnNullWarningMsg = new Button () { - // Height = Application.GetRealHeight (5), - // BackgroundColor = SkinStyle.Current.MainColor - //}; - //UserMiddle.SettingView.AddChidren (btnNullWarningMsg); - #endregion + //EventHandler<MouseEventArgs> WarningMsgEventHandler = (sender, e) => { + // var msgView = new WarningList (); + // UserMiddle.SettingPageView.AddChidren (msgView); + // msgView.ShowWarningListPage (); + // UserMiddle.SettingPageView.PageIndex = 1; + //}; + //WarningMsgView.MouseUpEventHandler += WarningMsgEventHandler; + //btnWarningMsgIcon.MouseUpEventHandler += WarningMsgEventHandler; + //btnWarningMsgTitle.MouseUpEventHandler += WarningMsgEventHandler; + //Button btnNullWarningMsg = new Button () { + // Height = Application.GetRealHeight (5), + // BackgroundColor = SkinStyle.Current.MainColor + //}; + //UserMiddle.SettingView.AddChidren (btnNullWarningMsg); + #endregion - #region ---Schedule--- - FrameLayout ScheduleView = new FrameLayout () { + #region ---Schedule--- + FrameLayout ScheduleView = new FrameLayout () { Width = Application.GetRealWidth (640), Height = Application.GetRealHeight (100), BackgroundColor = SkinStyle.Current.ViewColor diff --git a/Crabtree/SmartHome/dll/Android/Shared.Droid.HDLWidget.dll b/Crabtree/SmartHome/dll/Android/Shared.Droid.HDLWidget.dll index 59151ac..8dea30b 100644 --- a/Crabtree/SmartHome/dll/Android/Shared.Droid.HDLWidget.dll +++ b/Crabtree/SmartHome/dll/Android/Shared.Droid.HDLWidget.dll Binary files differ diff --git a/Crabtree/SmartHome/dll/Android/Shared.Droid.dll b/Crabtree/SmartHome/dll/Android/Shared.Droid.dll index 2088717..47451d3 100644 --- a/Crabtree/SmartHome/dll/Android/Shared.Droid.dll +++ b/Crabtree/SmartHome/dll/Android/Shared.Droid.dll Binary files differ diff --git a/Crabtree/SmartHome/dll/IOS/Shared.IOS.TBL.dll b/Crabtree/SmartHome/dll/IOS/Shared.IOS.TBL.dll index bda1120..3f1be92 100644 --- a/Crabtree/SmartHome/dll/IOS/Shared.IOS.TBL.dll +++ b/Crabtree/SmartHome/dll/IOS/Shared.IOS.TBL.dll Binary files differ diff --git a/Crabtree/SmartHome/dll/IOS/Shared.IOS.dll b/Crabtree/SmartHome/dll/IOS/Shared.IOS.dll index be75fb5..200d102 100644 --- a/Crabtree/SmartHome/dll/IOS/Shared.IOS.dll +++ b/Crabtree/SmartHome/dll/IOS/Shared.IOS.dll Binary files differ -- Gitblit v1.8.0