9个文件已添加
62个文件已修改
45 文件已重命名
old mode 100755
new mode 100644
| | |
| | | 333=不绑定任何目标 |
| | | 334= 睡眠时间 |
| | | 335=警告!数据出错,必须刷新列表,否则控制现象错乱 |
| | | 336=同步 |
| | | 337=同步失败 |
| | | |
| | | 5097=取消 |
| | | 5098=确定 |
| | |
| | | 5411=暗{\r\n} 0lux |
| | | 5412=亮{\r\n} 100lux |
| | | 5413=在室内条件下,黑暗照度值约为0.02lux,黄昏照度值{\r\n}约为10lux,阴天照度值约为5~50lux,请根据实际{\r\n}需要进行调节 |
| | | 5414=可视对讲 |
| | | 5415=栋 |
| | | 5416=单元 |
| | | 5417=室外机 |
| | | |
| | | |
| | | |
| | |
| | | 16134=设置设备功能类型失败 |
| | | 16135=获取场景列表失败,网关回复超时 |
| | | 16136=需重新绑定 |
| | | 16137=出现意外情况,数据丢失 |
| | | |
| | | ;★★★★下面这些是接口的返回信息翻译,从18000开始★★★★
|
| | | 18004=指定网关已经被绑定
|
| | |
| | | <ItemGroup>
|
| | | <AndroidAsset Include="Assets\Phone\Item\BatterySelected.png" />
|
| | | </ItemGroup>
|
| | | <ItemGroup>
|
| | | <AndroidAsset Include="Assets\Phone\Item\videoIntercom.png" />
|
| | | </ItemGroup>
|
| | | <ItemGroup>
|
| | | <AndroidAsset Include="Assets\Phone\Item\videoIntercomNext.png" />
|
| | | </ItemGroup>
|
| | | <ItemGroup>
|
| | | <AndroidAsset Include="Assets\Phone\Item\SynchronizationSelected.png" />
|
| | | </ItemGroup>
|
| | | <Import Project="..\Shared\Shared.projitems" Label="Shared" Condition="Exists('..\Shared\Shared.projitems')" />
|
| | | <Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
|
| | | <Import Project="..\packages\Xamarin.Android.Support.Annotations.26.0.2\build\MonoAndroid80\Xamarin.Android.Support.Annotations.targets" Condition="Exists('..\packages\Xamarin.Android.Support.Annotations.26.0.2\build\MonoAndroid80\Xamarin.Android.Support.Annotations.targets')" />
|
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.hdl.home" android:versionCode="0120070901" android:installLocation="auto" android:versionName="1.1.0120070901"> |
| | | <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.hdl.home" android:versionCode="0120071301" android:installLocation="auto" android:versionName="1.1.0120071301"> |
| | | <uses-sdk android:minSdkVersion="23" android:targetSdkVersion="26" /> |
| | | <permission android:name="com.hdl.home.permission.JPUSH_MESSAGE" android:protectionLevel="signature" /> |
| | | <uses-permission android:name="android.permission.WAKE_LOCK" /> |
old mode 100644
new mode 100755
| | |
| | | NSString key_hiddenJson = new NSString("HiddenJson"); |
| | | if (userInfo.ContainsKey(key_hiddenJson)) |
| | | { |
| | | NSDictionary hiddenJsonDic = userInfo["HiddenJson"] as NSDictionary; |
| | | if (hiddenJsonDic != null) |
| | | { |
| | | NSString key_Offline = new NSString("Offline"); |
| | | if (hiddenJsonDic.ContainsKey(key_Offline)) |
| | | { |
| | | string signOut = hiddenJsonDic["Offline"].ToString(); |
| | | |
| | | if (signOut == "0") |
| | | var hiddenJson = userInfo["HiddenJson"].ToString();
|
| | | if (!string.IsNullOrEmpty(hiddenJson))
|
| | | {
|
| | | if (hiddenJson.Contains("cmtID"))
|
| | | {
|
| | | |
| | | ///目前根据这个判断是否是可视对讲数据
|
| | | // VideoMethod(hiddenJson);
|
| | | }
|
| | | else
|
| | | {
|
| | |
|
| | | NSDictionary hiddenJsonDic = userInfo["HiddenJson"] as NSDictionary; |
| | | if (hiddenJsonDic != null) |
| | | { |
| | | //不下线 |
| | | } |
| | | else |
| | | { |
| | | //标记下线 |
| | | haveToSignOut = true; |
| | | } |
| | | } |
| | | NSString key_Offline = new NSString("Offline"); |
| | | if (hiddenJsonDic.ContainsKey(key_Offline)) |
| | | { |
| | | string signOut = hiddenJsonDic["Offline"].ToString(); |
| | | |
| | | if (signOut == "0") |
| | | { |
| | | //不下线 |
| | | } |
| | | else |
| | | { |
| | | //标记下线 |
| | | haveToSignOut = true; |
| | | } |
| | | } |
| | | |
| | | }
|
| | | }
|
| | | } |
| | |
|
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | NSString key_hiddenJson = new NSString("HiddenJson"); |
| | | if (userInfo.ContainsKey(key_hiddenJson)) |
| | | { |
| | | NSDictionary hiddenJsonDic = userInfo["HiddenJson"] as NSDictionary; |
| | | if (hiddenJsonDic == null) |
| | | { |
| | | return; |
| | | } |
| | | NSString key_Offline = new NSString("Offline"); |
| | | if (hiddenJsonDic.ContainsKey(key_Offline)) |
| | | { |
| | | string signOut = hiddenJsonDic["Offline"].ToString(); |
| | | |
| | | if (signOut == "0") |
| | | var hiddenJson = userInfo["HiddenJson"].ToString();
|
| | | if (string.IsNullOrEmpty(hiddenJson))
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | if (hiddenJson.Contains("cmtID"))
|
| | | {
|
| | |
|
| | | ///目前根据这个判断是否是可视对讲数据
|
| | | VideoMethod(hiddenJson);
|
| | | }
|
| | | else
|
| | | {
|
| | |
|
| | | NSDictionary hiddenJsonDic = userInfo["HiddenJson"] as NSDictionary; |
| | | if (hiddenJsonDic == null) |
| | | { |
| | | //不下线 |
| | | return; |
| | | } |
| | | else |
| | | NSString key_Offline = new NSString("Offline"); |
| | | if (hiddenJsonDic.ContainsKey(key_Offline)) |
| | | { |
| | | //强制下线 |
| | | CommonPage.Instance.SingOut(); |
| | | CommonPage.Instance.ShowErrorInfoAlert(Shared.R.MyInternationalizationString.uHadBeenLoginAndOffLine); |
| | | string signOut = hiddenJsonDic["Offline"].ToString(); |
| | | |
| | | if (signOut == "0") |
| | | { |
| | | //不下线 |
| | | } |
| | | else |
| | | { |
| | | //强制下线 |
| | | CommonPage.Instance.SingOut(); |
| | | CommonPage.Instance.ShowErrorInfoAlert(Shared.R.MyInternationalizationString.uHadBeenLoginAndOffLine); |
| | | }
|
| | | } |
| | | } |
| | | } |
| | |
| | | NSString key_hiddenJson = new NSString("HiddenJson"); |
| | | if (userInfo.ContainsKey(key_hiddenJson)) |
| | | { |
| | | NSDictionary hiddenJsonDic = userInfo["HiddenJson"] as NSDictionary; |
| | | if (hiddenJsonDic == null) |
| | | { |
| | | return; |
| | | } |
| | | NSString key_Offline = new NSString("Offline"); |
| | | if (hiddenJsonDic.ContainsKey(key_Offline)) |
| | | { |
| | | string signOut = hiddenJsonDic["Offline"].ToString(); |
| | | |
| | | if (signOut == "0") |
| | |
|
| | | var hiddenJson = userInfo["HiddenJson"].ToString();
|
| | | if (string.IsNullOrEmpty(hiddenJson)) {
|
| | | return;
|
| | | }
|
| | |
|
| | | if (hiddenJson.Contains("cmtID"))
|
| | | {
|
| | | ///目前根据这个判断是否是可视对讲数据
|
| | | VideoMethod(hiddenJson);
|
| | | }
|
| | | else
|
| | | {
|
| | |
|
| | | NSDictionary hiddenJsonDic = userInfo["HiddenJson"] as NSDictionary; |
| | | if (hiddenJsonDic == null) |
| | | { |
| | | //不下线 |
| | | return; |
| | | } |
| | | else |
| | | NSString key_Offline = new NSString("Offline"); |
| | | if (hiddenJsonDic.ContainsKey(key_Offline)) |
| | | { |
| | | //标记下线 |
| | | haveToSignOut = true; |
| | | string signOut = hiddenJsonDic["Offline"].ToString(); |
| | | |
| | | if (signOut == "0") |
| | | { |
| | | //不下线 |
| | | } |
| | | else |
| | | { |
| | | //标记下线 |
| | | haveToSignOut = true; |
| | | }
|
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | completionHandler(UIBackgroundFetchResult.NewData); |
| | | }
|
| | | /// <summary>
|
| | | /// ios通知栏点击打开可视对讲的方法
|
| | | /// </summary>
|
| | | /// <param name="hiddenJson">云端推过来的数据</param>
|
| | | private void VideoMethod(string hiddenJson)
|
| | | {
|
| | |
|
| | | var json = Newtonsoft.Json.Linq.JObject.Parse(hiddenJson);
|
| | | if (json == null)
|
| | | {
|
| | | return;
|
| | | }
|
| | | GateWay.Ios.ESVideoInfo eSVideoInfo = new GateWay.Ios.ESVideoInfo();
|
| | | if (json["uuid"].ToString().Contains(","))
|
| | | {
|
| | | var uuid = json["uuid"].ToString().Split(',');
|
| | | eSVideoInfo.ESVideoUUID = uuid[0];
|
| | | }
|
| | | else
|
| | | {
|
| | | eSVideoInfo.ESVideoUUID = json["uuid"].ToString();
|
| | | }
|
| | |
|
| | | eSVideoInfo.DeviceName = Language.StringByID(Shared.R.MyInternationalizationString.theOutdoorUnit);
|
| | | eSVideoInfo.ESRoomID = int.Parse(json["roomno"].ToString());
|
| | | if (!string.IsNullOrEmpty(json["unitno"].ToString()))
|
| | | {
|
| | | string str = json["unitno"].ToString();
|
| | | string str1 = str.Substring(0, 2).TrimStart('0');
|
| | | string str2 = str.Substring(2, 2).TrimStart('0');
|
| | | eSVideoInfo.RoomName = str1 + Language.StringByID(Shared.R.MyInternationalizationString.dong) + str2 + Language.StringByID(Shared.R.MyInternationalizationString.unit);
|
| | | }
|
| | | GateWay.Ios.ESVideo.ShowESvideoVideoIntercom(eSVideoInfo);
|
| | |
|
| | | //var url = "https://global.hdlcontrol.com/HangZhouHdlCloudApi/VideoIntercom/Answer";
|
| | | //var dd=await Shared.Phone.Device.Logic.Send.HttpWebRequest(url, json.ToString(), "POST", 3, true);
|
| | | } |
| | | |
| | | public override void ReceivedRemoteNotification(UIApplication application, NSDictionary userInfo) |
New file |
| | |
| | | using System; |
| | | using Shared.IOS.ESVideoPhoneSDK; |
| | | |
| | | namespace GateWay.Ios |
| | | { |
| | | public static class ESVideo |
| | | { |
| | | //public ESVideo() |
| | | //{ |
| | | |
| | | //} |
| | | |
| | | public static void InitESVideoSDK() |
| | | { |
| | | ESVideo.InitESVideoSDK(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 监控页面 |
| | | /// </summary> |
| | | /// <param name="mESVideoInfo"></param> |
| | | public static void ShowESVideoMonitor(ESVideoInfo mESVideoInfo) |
| | | { |
| | | ESVideoMonitorViewController mESVideoMonitorViewController = new ESVideoMonitorViewController(); |
| | | |
| | | mESVideoMonitorViewController.MESVideoID = mESVideoInfo.ESVideoUUID; |
| | | mESVideoMonitorViewController.MESRoomID = mESVideoInfo.ESRoomID; |
| | | mESVideoMonitorViewController.DeviceName = mESVideoInfo.DeviceName; |
| | | mESVideoMonitorViewController.RoomName = mESVideoInfo.RoomName; |
| | | mESVideoMonitorViewController.IsCollect = mESVideoInfo.IsCollect; |
| | | |
| | | Shared.Application.currentVC.NavigationController.PushViewController(mESVideoMonitorViewController, true); |
| | | } |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 被呼叫页面 |
| | | /// </summary> |
| | | /// <param name="mESVideoInfo"></param> |
| | | public static void ShowESvideoVideoIntercom(ESVideoInfo mESVideoInfo) |
| | | { |
| | | ESvideoVideoIntercomViewController mESvideoVideoIntercomViewController = new ESvideoVideoIntercomViewController(); |
| | | mESvideoVideoIntercomViewController.MESVideoID = mESVideoInfo.ESVideoUUID; |
| | | mESvideoVideoIntercomViewController.MESRoomID = mESVideoInfo.ESRoomID; |
| | | mESvideoVideoIntercomViewController.DeviceName = mESVideoInfo.DeviceName; |
| | | mESvideoVideoIntercomViewController.RoomName = mESVideoInfo.RoomName; |
| | | mESvideoVideoIntercomViewController.IsCollect = mESVideoInfo.IsCollect; |
| | | |
| | | Shared.Application.currentVC.NavigationController.PushViewController(mESvideoVideoIntercomViewController, true); |
| | | } |
| | | } |
| | | |
| | | public class ESVideoInfo |
| | | { |
| | | /// <summary> |
| | | /// 室外机的UUID |
| | | /// 例:JJY000007FSEYX |
| | | /// </summary> |
| | | public string ESVideoUUID=string.Empty; |
| | | /// <summary> |
| | | /// 当前用户的房间ID |
| | | /// 例:0801 |
| | | /// </summary> |
| | | public int ESRoomID; |
| | | /// <summary> |
| | | /// 室外机的名称 |
| | | /// 例:室外机 |
| | | /// </summary> |
| | | public string DeviceName = string.Empty; |
| | | /// <summary> |
| | | /// 房间命名 |
| | | /// 例:8栋1单元0801 |
| | | /// </summary> |
| | | public string RoomName = string.Empty; |
| | | /// <summary> |
| | | /// 是否收藏 |
| | | /// </summary> |
| | | public bool IsCollect; |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | <HintPath>..\packages\BouncyCastle.Crypto.dll.1.8.1\lib\BouncyCastle.Crypto.dll</HintPath> |
| | | </Reference> |
| | | <Reference Include="System.Net.Http" /> |
| | | <Reference Include="Shared.IOS.ESVideoPhoneSDK"> |
| | | <HintPath>..\Shared\DLL\IOS\Shared.IOS.ESVideoPhoneSDK.dll</HintPath> |
| | | </Reference> |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | | <PackageReference Include="Xamarin.Essentials" Version="1.2.0" /> |
| | |
| | | <Compile Include="ViewControllerBase.cs" /> |
| | | <Compile Include="Reachability.cs" /> |
| | | <Compile Include="ZXingOverlayView.cs" /> |
| | | <Compile Include="ESVideo.cs" /> |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | | <ProjectReference Include="..\Elian.iOS\Elian.iOS.csproj"> |
| | |
| | | <BundleResource Include="Resources\Phone\Item\ShardMenu.png" /> |
| | | <BundleResource Include="Resources\Phone\Item\UnLockFail.png" /> |
| | | <BundleResource Include="Resources\Phone\Item\ProgressMsg.png" /> |
| | | <BundleResource Include="Resources\Phone\Item\SynchronizationSelected.png" /> |
| | | <BundleResource Include="Resources\Phone\Item\BottomButtonGround.png" /> |
| | | <BundleResource Include="Resources\Phone\Item\AutoBackup.png" /> |
| | | <BundleResource Include="Resources\Phone\Item\BatterySelected.png" /> |
| | |
| | | <BundleResource Include="Resources\Phone\Item\GwSwitchIcon.png" /> |
| | | <BundleResource Include="Resources\Phone\Item\DeleteIcon1.png" /> |
| | | <BundleResource Include="Resources\Phone\Item\HouseSelected.png" /> |
| | | <BundleResource Include="Resources\Phone\Item\videoIntercomNext.png" /> |
| | | <BundleResource Include="Resources\Phone\Item\Floor.png" /> |
| | | <BundleResource Include="Resources\Phone\Item\videoIntercom.png" /> |
| | | <BundleResource Include="Resources\Phone\Item\MinusSign2.png" /> |
| | | <BundleResource Include="Resources\Phone\Item\NotAuthority.png" /> |
| | | <BundleResource Include="Resources\Phone\Item\IndoorUnitGround.png" /> |
| | |
| | | <string>location</string> |
| | | <string>remote-notification</string> |
| | | </array> |
| | | <key>NSMicrophoneUsageDescription</key> |
| | | <string>需要使用麦克风,用于可视对讲</string> |
| | | </dict> |
| | | </plist> |
| | |
| | | internetStatus = Reachability.InternetConnectionStatus(); |
| | | if (internetStatus == NetworkStatus.NotReachable)//没有网络连接 0 |
| | | { |
| | | Shared.Common.CommonPage.nowNetworkMode = 0; |
| | | //Shared.Common.CommonPage.nowNetworkMode = 0; |
| | | } |
| | | else if (internetStatus == NetworkStatus.ReachableViaCarrierDataNetwork)//3,4G的网络连接 1 |
| | | { |
| | | Shared.Common.CommonPage.nowNetworkMode = 1; |
| | | //Shared.Common.CommonPage.nowNetworkMode = 1; |
| | | } |
| | | else if (internetStatus == NetworkStatus.ReachableViaWiFiNetwork) |
| | | { //wifi的网络连接 2 |
| | | Shared.Common.CommonPage.nowNetworkMode = 2; |
| | | //Shared.Common.CommonPage.nowNetworkMode = 2; |
| | | } |
| | | } |
| | | } |
| | |
| | | 333=不绑定任何目标 |
| | | 334= 睡眠时间 |
| | | 335=警告!数据出错,必须刷新列表,否则控制现象错乱 |
| | | 336=同步 |
| | | 337=同步失败 |
| | | |
| | | 5097=取消 |
| | | 5098=确定 |
| | |
| | | 5411=暗{\r\n} 0lux |
| | | 5412=亮{\r\n} 100lux |
| | | 5413=在室内条件下,黑暗照度值约为0.02lux,黄昏照度值{\r\n}约为10lux,阴天照度值约为5~50lux,请根据实际{\r\n}需要进行调节 |
| | | 5414=可视对讲 |
| | | 5415=栋 |
| | | 5416=单元 |
| | | 5417=室外机 |
| | | |
| | | |
| | | |
| | |
| | | "suspend" : "hybrid" |
| | | }, |
| | | "memory" : { |
| | | "Resident Size" : "156639232", |
| | | "Virtual Size" : "4818821120", |
| | | "minor_gc_time" : "3344349", |
| | | "major_gc_time" : "1878887", |
| | | "minor_gc_count" : "4", |
| | | "major_gc_count" : "8", |
| | | "major_gc_time_concurrent" : "0" |
| | | "Resident Size" : "181604352", |
| | | "Virtual Size" : "4929044480", |
| | | "minor_gc_time" : "2036527", |
| | | "major_gc_time" : "156293362", |
| | | "minor_gc_count" : "13", |
| | | "major_gc_count" : "873", |
| | | "major_gc_time_concurrent" : "3505547" |
| | | }, |
| | | "threads" : [ |
| | | { |
| | |
| | | "offset_free_hash" : "0x0", |
| | | "offset_rich_hash" : "0x0", |
| | | "crashed" : false, |
| | | "native_thread_id" : "0x70000685a000", |
| | | "thread_info_addr" : "0x7fea5c83bc00", |
| | | "native_thread_id" : "0x700003271000", |
| | | "thread_info_addr" : "0x7f98c903a000", |
| | | "thread_name" : "Finalizer", |
| | | "ctx" : { |
| | | "IP" : "0x7fff61571266", |
| | | "SP" : "0x700006859da8", |
| | | "BP" : "0x700006859e50" |
| | | "IP" : "0x7fff77af4266", |
| | | "SP" : "0x700003270da8", |
| | | "BP" : "0x700003270e50" |
| | | }, |
| | | "unmanaged_frames" : [ |
| | | { |
| | | "is_managed" : "false", |
| | | "native_address" : "0x10ff50156", |
| | | "native_address" : "0x10c9d2156", |
| | | "native_offset" : "0x00000" |
| | | } |
| | | , |
| | | { |
| | | "is_managed" : "false", |
| | | "native_address" : "0x1100f6775", |
| | | "native_address" : "0x10cb78775", |
| | | "native_offset" : "0x00000" |
| | | } |
| | | , |
| | | { |
| | | "is_managed" : "false", |
| | | "native_address" : "0x1100f64a7", |
| | | "native_address" : "0x10cb784a7", |
| | | "native_offset" : "0x00000" |
| | | } |
| | | , |
| | | { |
| | | "is_managed" : "false", |
| | | "native_address" : "0x10ffbaf3c", |
| | | "native_address" : "0x10ca3cf3c", |
| | | "native_offset" : "0x00000" |
| | | } |
| | | , |
| | | { |
| | | "is_managed" : "false", |
| | | "native_address" : "0x7fff61627b5d", |
| | | "native_address" : "0x7fff77baab5d", |
| | | "native_offset" : "0x00000" |
| | | } |
| | | , |
| | | { |
| | | "is_managed" : "false", |
| | | "native_address" : "0x7fea5be0c040", |
| | | "native_address" : "0x30", |
| | | "native_offset" : "0x00000" |
| | | } |
| | | , |
| | | { |
| | | "is_managed" : "false", |
| | | "native_address" : "0x1100f7373", |
| | | "native_address" : "0x10cb79373", |
| | | "native_offset" : "0x00000" |
| | | } |
| | | , |
| | | { |
| | | "is_managed" : "false", |
| | | "native_address" : "0x7fff616302eb", |
| | | "native_address" : "0x7fff77bb32eb", |
| | | "native_offset" : "0x00000" |
| | | } |
| | | , |
| | | { |
| | | "is_managed" : "false", |
| | | "native_address" : "0x7fff61633249", |
| | | "native_address" : "0x7fff77bb6249", |
| | | "native_offset" : "0x00000" |
| | | } |
| | | , |
| | | { |
| | | "is_managed" : "false", |
| | | "native_address" : "0x7fff6162f40d", |
| | | "native_address" : "0x7fff77bb240d", |
| | | "native_offset" : "0x00000" |
| | | } |
| | | |
| | |
| | | "offset_free_hash" : "0x0", |
| | | "offset_rich_hash" : "0x0", |
| | | "crashed" : false, |
| | | "native_thread_id" : "0x11281b5c0", |
| | | "thread_info_addr" : "0x7fea5c801800", |
| | | "native_thread_id" : "0x110e995c0", |
| | | "thread_info_addr" : "0x7f98c9006000", |
| | | "thread_name" : "tid_307", |
| | | "ctx" : { |
| | | "IP" : "0x7fff6157486a", |
| | | "SP" : "0x7ffedfd62c98", |
| | | "BP" : "0x7ffedfd62d20" |
| | | "IP" : "0x7fff77af786a", |
| | | "SP" : "0x7ffee32e0c98", |
| | | "BP" : "0x7ffee32e0d20" |
| | | }, |
| | | "unmanaged_frames" : [ |
| | | { |
| | | "is_managed" : "false", |
| | | "native_address" : "0x10ff50156", |
| | | "native_address" : "0x10c9d2156", |
| | | "native_offset" : "0x00000" |
| | | } |
| | | , |
| | | { |
| | | "is_managed" : "false", |
| | | "native_address" : "0x1100f6775", |
| | | "native_address" : "0x10cb78775", |
| | | "native_offset" : "0x00000" |
| | | } |
| | | , |
| | | { |
| | | "is_managed" : "false", |
| | | "native_address" : "0x1100f64a7", |
| | | "native_address" : "0x10cb784a7", |
| | | "native_offset" : "0x00000" |
| | | } |
| | | , |
| | | { |
| | | "is_managed" : "false", |
| | | "native_address" : "0x10ffbaf3c", |
| | | "native_address" : "0x10ca3cf3c", |
| | | "native_offset" : "0x00000" |
| | | } |
| | | , |
| | | { |
| | | "is_managed" : "false", |
| | | "native_address" : "0x7fff61627b5d", |
| | | "native_address" : "0x7fff77baab5d", |
| | | "native_offset" : "0x00000" |
| | | } |
| | | , |
| | | { |
| | | "is_managed" : "false", |
| | | "native_address" : "0x10ff525b6", |
| | | "native_address" : "0x10c9d45b6", |
| | | "native_offset" : "0x00000" |
| | | } |
| | | , |
| | | { |
| | | "is_managed" : "false", |
| | | "native_address" : "0x1101a07c0", |
| | | "native_address" : "0x10cc227c0", |
| | | "native_offset" : "0x00000" |
| | | } |
| | | , |
| | | { |
| | | "is_managed" : "false", |
| | | "native_address" : "0x1101bb2e1", |
| | | "native_address" : "0x10cc3d2e1", |
| | | "native_offset" : "0x00000" |
| | | } |
| | | , |
| | | { |
| | | "is_managed" : "false", |
| | | "native_address" : "0x1100f3774", |
| | | "native_address" : "0x10cb75774", |
| | | "native_offset" : "0x00000" |
| | | } |
| | | , |
| | | { |
| | | "is_managed" : "false", |
| | | "native_address" : "0x1100f358a", |
| | | "native_address" : "0x10cb7558a", |
| | | "native_offset" : "0x00000" |
| | | } |
| | | , |
| | | { |
| | | "is_managed" : "false", |
| | | "native_address" : "0x10ff156c2", |
| | | "native_address" : "0x10c9976c2", |
| | | "native_offset" : "0x00000" |
| | | } |
| | | , |
| | | { |
| | | "is_managed" : "false", |
| | | "native_address" : "0x10fe9f848", |
| | | "native_address" : "0x10c921848", |
| | | "native_offset" : "0x00000" |
| | | } |
| | | , |
| | | { |
| | | "is_managed" : "false", |
| | | "native_address" : "0x7fff6143c3d5", |
| | | "native_address" : "0x7fff779bf3d5", |
| | | "native_offset" : "0x00000" |
| | | } |
| | | |
| | |
| | | "offset_free_hash" : "0x115869ea88", |
| | | "offset_rich_hash" : "0x115869ee42", |
| | | "crashed" : true, |
| | | "native_thread_id" : "0x700006fec000", |
| | | "thread_info_addr" : "0x7fea5c45ac00", |
| | | "native_thread_id" : "0x700003980000", |
| | | "thread_info_addr" : "0x7f98c94d5600", |
| | | "thread_name" : "Thread Pool Worker", |
| | | "ctx" : { |
| | | "IP" : "0x7fff615772c6", |
| | | "SP" : "0x700006fea548", |
| | | "BP" : "0x700006fea580" |
| | | "IP" : "0x7fff77afa2c6", |
| | | "SP" : "0x70000397e548", |
| | | "BP" : "0x70000397e580" |
| | | }, |
| | | "managed_frames" : [ |
| | | { |
| | |
| | | "unmanaged_frames" : [ |
| | | { |
| | | "is_managed" : "false", |
| | | "native_address" : "0x10ff50156", |
| | | "native_address" : "0x10c9d2156", |
| | | "native_offset" : "0x00000" |
| | | } |
| | | , |
| | | { |
| | | "is_managed" : "false", |
| | | "native_address" : "0x1100f6775", |
| | | "native_address" : "0x10cb78775", |
| | | "native_offset" : "0x00000" |
| | | } |
| | | , |
| | | { |
| | | "is_managed" : "false", |
| | | "native_address" : "0x1100f6dfa", |
| | | "native_address" : "0x10cb78dfa", |
| | | "native_offset" : "0x00000" |
| | | } |
| | | , |
| | | { |
| | | "is_managed" : "false", |
| | | "native_address" : "0x10ffbbf46", |
| | | "native_address" : "0x10ca3df46", |
| | | "native_offset" : "0x00000" |
| | | } |
| | | , |
| | | { |
| | | "is_managed" : "false", |
| | | "native_address" : "0x10ff54c65", |
| | | "native_address" : "0x10c9d6c65", |
| | | "native_offset" : "0x00000" |
| | | } |
| | | , |
| | | { |
| | | "is_managed" : "false", |
| | | "native_address" : "0x10ffbb2db", |
| | | "native_address" : "0x10ca3d2db", |
| | | "native_offset" : "0x00000" |
| | | } |
| | | , |
| | | { |
| | | "is_managed" : "false", |
| | | "native_address" : "0x7fff61627b5d", |
| | | "native_address" : "0x7fff77baab5d", |
| | | "native_offset" : "0x00000" |
| | | } |
| | | , |
| | | { |
| | | "is_managed" : "false", |
| | | "native_address" : "0x110221439", |
| | | "native_address" : "0x10cca3439", |
| | | "native_offset" : "0x00000" |
| | | } |
| | | , |
| | | { |
| | | "is_managed" : "false", |
| | | "native_address" : "0x7fff614e16a6", |
| | | "native_address" : "0x7fff77a646a6", |
| | | "native_offset" : "0x00000" |
| | | } |
| | | , |
| | | { |
| | | "is_managed" : "false", |
| | | "native_address" : "0x1101c5cb7", |
| | | "native_address" : "0x10cc47cb7", |
| | | "native_offset" : "0x00000" |
| | | } |
| | | , |
| | | { |
| | | "is_managed" : "false", |
| | | "native_address" : "0x1101a6b2f", |
| | | "native_address" : "0x10cc28b2f", |
| | | "native_offset" : "0x00000" |
| | | } |
| | | , |
| | | { |
| | | "is_managed" : "false", |
| | | "native_address" : "0x1101c603e", |
| | | "native_address" : "0x10cc4803e", |
| | | "native_offset" : "0x00000" |
| | | } |
| | | , |
| | | { |
| | | "is_managed" : "false", |
| | | "native_address" : "0x1101c61bf", |
| | | "native_address" : "0x10cc481bf", |
| | | "native_offset" : "0x00000" |
| | | } |
| | | , |
| | | { |
| | | "is_managed" : "false", |
| | | "native_address" : "0x110060e76", |
| | | "native_address" : "0x10cae2e76", |
| | | "native_offset" : "0x00000" |
| | | } |
| | | , |
| | | { |
| | | "is_managed" : "false", |
| | | "native_address" : "0x110061478", |
| | | "native_address" : "0x10cae3478", |
| | | "native_offset" : "0x00000" |
| | | } |
| | | , |
| | | { |
| | | "is_managed" : "false", |
| | | "native_address" : "0x1101b419f", |
| | | "native_address" : "0x10cc3619f", |
| | | "native_offset" : "0x00000" |
| | | } |
| | | , |
| | | { |
| | | "is_managed" : "false", |
| | | "native_address" : "0x1101b44b0", |
| | | "native_address" : "0x10cc364b0", |
| | | "native_offset" : "0x00000" |
| | | } |
| | | , |
| | | { |
| | | "is_managed" : "false", |
| | | "native_address" : "0x1100637ab", |
| | | "native_address" : "0x10cae57ab", |
| | | "native_offset" : "0x00000" |
| | | } |
| | | , |
| | | { |
| | | "is_managed" : "false", |
| | | "native_address" : "0x110086675", |
| | | "native_address" : "0x10cb08675", |
| | | "native_offset" : "0x00000" |
| | | } |
| | | , |
| | |
| | | , |
| | | { |
| | | "is_managed" : "false", |
| | | "native_address" : "0x10feb062d", |
| | | "native_address" : "0x10c93262d", |
| | | "native_offset" : "0x00000" |
| | | } |
| | | , |
| | | { |
| | | "is_managed" : "false", |
| | | "native_address" : "0x1100cffa4", |
| | | "native_address" : "0x10cb51fa4", |
| | | "native_offset" : "0x00000" |
| | | } |
| | | , |
| | | { |
| | | "is_managed" : "false", |
| | | "native_address" : "0x1100d43a6", |
| | | "native_address" : "0x10cb563a6", |
| | | "native_offset" : "0x00000" |
| | | } |
| | | , |
| | | { |
| | | "is_managed" : "false", |
| | | "native_address" : "0x11006b6f4", |
| | | "native_address" : "0x10caed6f4", |
| | | "native_offset" : "0x00000" |
| | | } |
| | | , |
| | |
| | | , |
| | | { |
| | | "is_managed" : "false", |
| | | "native_address" : "0x10feb062d", |
| | | "native_address" : "0x10c93262d", |
| | | "native_offset" : "0x00000" |
| | | } |
| | | , |
| | | { |
| | | "is_managed" : "false", |
| | | "native_address" : "0x1100cffa4", |
| | | "native_address" : "0x10cb51fa4", |
| | | "native_offset" : "0x00000" |
| | | } |
| | | , |
| | | { |
| | | "is_managed" : "false", |
| | | "native_address" : "0x1100f9ec0", |
| | | "native_address" : "0x10cb7bec0", |
| | | "native_offset" : "0x00000" |
| | | } |
| | | , |
| | | { |
| | | "is_managed" : "false", |
| | | "native_address" : "0x11002c28c", |
| | | "native_address" : "0x10caae28c", |
| | | "native_offset" : "0x00000" |
| | | } |
| | | , |
| | | { |
| | | "is_managed" : "false", |
| | | "native_address" : "0x1100f7373", |
| | | "native_address" : "0x10cb79373", |
| | | "native_offset" : "0x00000" |
| | | } |
| | | , |
| | | { |
| | | "is_managed" : "false", |
| | | "native_address" : "0x7fff616302eb", |
| | | "native_address" : "0x7fff77bb32eb", |
| | | "native_offset" : "0x00000" |
| | | } |
| | | , |
| | | { |
| | | "is_managed" : "false", |
| | | "native_address" : "0x7fff61633249", |
| | | "native_address" : "0x7fff77bb6249", |
| | | "native_offset" : "0x00000" |
| | | } |
| | | , |
| | | { |
| | | "is_managed" : "false", |
| | | "native_address" : "0x7fff6162f40d", |
| | | "native_address" : "0x7fff77bb240d", |
| | | "native_offset" : "0x00000" |
| | | } |
| | | |
| | |
| | | /// <summary> |
| | | /// 版本号 |
| | | /// </summary> |
| | | public static string CodeIDString = "1.1.0120070901"; |
| | | public static string CodeIDString = "1.1.0120071301"; |
| | | /// <summary> |
| | | /// 注册来源(0:HDL On 1:Zigbee) |
| | | /// </summary> |
| | |
| | | if (Common.Config.Instance.Home.IsVirtually == true)
|
| | | {
|
| | | //修改设备名字的话,主页需要重新刷新
|
| | | Phone.UserView.UserPage.Instance.RefreshForm = true;
|
| | | Phone.UserView.UserPage.Instance.RefreshAllForm = true;
|
| | | return true;
|
| | | }
|
| | |
|
| | |
| | | }
|
| | | }
|
| | | //修改设备名字的话,主页需要重新刷新
|
| | | Phone.UserView.UserPage.Instance.RefreshForm = true;
|
| | | Phone.UserView.UserPage.Instance.RefreshAllForm = true;
|
| | | return true;
|
| | | }
|
| | |
|
| | |
| | | public void DeleteMemmoryDevice(CommonDevice device, bool deleteRoom = true)
|
| | | {
|
| | | //删除缓存设备的话,主页需要重新刷新
|
| | | Phone.UserView.UserPage.Instance.RefreshForm = true;
|
| | | Phone.UserView.UserPage.Instance.RefreshAllForm = true;
|
| | |
|
| | | if (deleteRoom == true)
|
| | | {
|
| | |
| | |
|
| | | #endregion
|
| | |
|
| | | #region ■ 同步设备___________________________
|
| | | /// <summary>
|
| | | /// 同步设备并且刷新缓存(同步失败时,会显示信息)
|
| | | /// </summary>
|
| | | /// <param name="litdevice">设备对象(MAC地址必须要相同)</param>
|
| | | public async Task<bool> SynchronizationDevice(List<CommonDevice> listdevice)
|
| | | {
|
| | | //虚拟住宅的话,不需要删除网关的设备
|
| | | if (Config.Instance.Home.IsVirtually == false)
|
| | | {
|
| | | //同步
|
| | | var result = await listdevice[0].SyncMsgToBindSource(listdevice[0].DeviceAddr, listdevice[0].DeviceEpoint);
|
| | | if (result == null || result.result != 0)
|
| | | {
|
| | | //同步删除失败
|
| | | string msg = Language.StringByID(R.MyInternationalizationString.SynchronizationFailed);
|
| | | //拼接上【网关回复超时】的Msg
|
| | | msg = UserCenterLogic.CombineGatewayTimeOutMsg(msg, result);
|
| | |
|
| | | this.ShowErrorMsg(msg);
|
| | | return false;
|
| | | }
|
| | | }
|
| | | return true;
|
| | | }
|
| | | #endregion
|
| | |
|
| | |
|
| | |
|
| | | #region ■ 测试设备___________________________
|
| | |
|
| | | /// <summary>
|
| | |
| | | //传感器除了Pir都没有定位功能
|
| | | return true;
|
| | | }
|
| | | else if (myTypeInfo.ConcreteType == DeviceConcreteType.Sensor_SphericalMotion)
|
| | | {
|
| | | //球型移动传感器虽然是电池设备,但是它有定位功能
|
| | | return true;
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | |
| | | {
|
| | | return true;
|
| | | }
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 检测设备是否拥有一键同步功能
|
| | | /// </summary>
|
| | | /// <param name="device"></param>
|
| | | /// <returns></returns>
|
| | | public bool DeviceIsCanSynchronization(CommonDevice device)
|
| | | {
|
| | | //获取设备类型的
|
| | | var deviceEnumInfo = Common.LocalDevice.Current.GetMyDeviceEnumInfo(new List<CommonDevice>() { device });
|
| | | if (deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_SimpleMultifunction)
|
| | | {
|
| | | return true;
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
| | | if (sort == false)
|
| | | {
|
| | | return list;
|
| | | } |
| | | list.Sort((obj1, obj2) => {
|
| | | }
|
| | | list.Sort((obj1, obj2) =>
|
| | | {
|
| | |
|
| | | if (obj1.DeviceEpoint > obj2.DeviceEpoint)
|
| | | {
|
| | |
| | | public List<string> GetAllDeviceFile()
|
| | | {
|
| | | List<string> listDeviceFile = new List<string>();
|
| | | List<string> listAllFile = Global.FileListByHomeId(); |
| | | List<string> listAllFile = HdlFileLogic.Current.GetRootPathListFile(); |
| | | |
| | | foreach (string file in listAllFile)
|
| | | {
|
| | |
| | | return false;
|
| | | }
|
| | | }
|
| | | //如果是新风面板的新风设备,则不显示
|
| | | else if (i_device.Type == DeviceType.FreshAir)
|
| | | {
|
| | | var myInfoType = LocalDevice.Current.GetMyDeviceEnumInfo(new List<CommonDevice>() { i_device });
|
| | | if (myInfoType.ConcreteType == DeviceConcreteType.ButtonPanel_FangyueFreshAir)
|
| | | {
|
| | | return false;
|
| | | }
|
| | | }
|
| | | //2020.03.30追加式样:如果是面板的温度探头,不显示
|
| | | else if (i_device.Type == DeviceType.TemperatureSensor && ((TemperatureSensor)i_device).SensorDiv == 1)
|
| | | {
|
| | |
| | | //新风的湿度传感器不显示
|
| | | return false;
|
| | | }
|
| | |
|
| | | //如果是新风面板或环境面板,则都不显示任何回路
|
| | | var myInfoTypeTemp = LocalDevice.Current.GetMyDeviceEnumInfo(new List<CommonDevice>() { i_device });
|
| | | if (myInfoTypeTemp.ConcreteType == DeviceConcreteType.ButtonPanel_FangyueFreshAir || myInfoTypeTemp.ConcreteType == DeviceConcreteType.ButtonPanel_SimpleEnvironment)
|
| | | {
|
| | | return false;
|
| | | }
|
| | | else if (myInfoTypeTemp.ConcreteType == DeviceConcreteType.ButtonPanel_SimpleMultifunction)
|
| | | {
|
| | | if (i_device.Type != DeviceType.OnOffOutput)
|
| | | {
|
| | | return false;
|
| | | }
|
| | | }
|
| | | return true;
|
| | | }
|
| | |
|
| | |
| | | /// value:FloorName |
| | | /// </summary> |
| | | public Dictionary<string,string> FloorDics = new Dictionary<string,string> { }; |
| | | /// <summary> |
| | | /// 当前楼层Id |
| | | /// </summary> |
| | | public string CurrentFloorId = string.Empty; |
| | | |
| | | #endregion |
| | | |
| | |
| | | public string GetCurrentFloorName |
| | | { |
| | | get |
| | | { |
| | | {
|
| | | return HdlResidenceLogic.Current.GetFloorNameById(CurrentFloorId); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 设置当前楼层的ID |
| | | }
|
| | | /// <summary>
|
| | | /// 当前楼层ID
|
| | | /// </summary> |
| | | public void SetCurrentFloorId() |
| | | { |
| | | if (Config.Instance.Home.FloorDics.Count > 0 && string.IsNullOrEmpty(CurrentFloorId)) |
| | | { |
| | | foreach (var floor in Config.Instance.Home.FloorDics) |
| | | { |
| | | CurrentFloorId = floor.Key; |
| | | Save(false); |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | [Newtonsoft.Json.JsonIgnore] |
| | | public string CurrentFloorId = string.Empty; |
| | | |
| | | #endregion |
| | | |
| | |
| | | this.editorScene.Save();
|
| | |
|
| | | //新建场景,主页需要重新刷新
|
| | | UserView.UserPage.Instance.RefreshForm = true;
|
| | | UserView.UserPage.Instance.RefreshAllForm = true;
|
| | |
|
| | | HdlThreadLogic.Current.RunMain(() =>
|
| | | {
|
| | |
| | | this.editorScene.Save();
|
| | |
|
| | | //编辑场景,主页需要重新刷新
|
| | | UserView.UserPage.Instance.RefreshForm = true;
|
| | | UserView.UserPage.Instance.RefreshAllForm = true;
|
| | |
|
| | | HdlThreadLogic.Current.RunMain(() =>
|
| | | {
|
| | |
| | | /// 设备列表控件
|
| | | /// </summary>
|
| | | private VerticalListControl listDeviceView = null;
|
| | | /// <summary>
|
| | | /// 当前选择的楼层
|
| | | /// </summary>
|
| | | private string nowSelectFloorId = string.Empty;
|
| | |
|
| | | #endregion
|
| | |
|
| | |
| | |
|
| | | //设置头部信息
|
| | | base.SetTitleText(Language.StringByID(R.MyInternationalizationString.AddFunction));
|
| | | //初始化右上角的控件
|
| | | this.InitTopRightMenuControl();
|
| | | //初始化中部信息
|
| | | this.InitMiddleFrame();
|
| | | }
|
| | |
| | | /// </summary>
|
| | | private void InitMiddleFrame()
|
| | | {
|
| | | //清空body
|
| | | this.ClearBodyFrame();
|
| | | //初始化房间菜单控件
|
| | | this.InitRoomMenuControl();
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 初始化右上角的控件
|
| | | /// </summary>
|
| | | private void InitTopRightMenuControl()
|
| | | {
|
| | | //获取楼层
|
| | | var dicFloor = HdlRoomLogic.Current.GetFloorSortList();
|
| | | if (dicFloor.Count == 0)
|
| | | {
|
| | | return;
|
| | | }
|
| | | var btnIconContr = new MostRightIconControl(69, 69);
|
| | | btnIconContr.UnSelectedImagePath = "Item/Drop_Down.png";
|
| | | topFrameLayout.AddChidren(btnIconContr);
|
| | | btnIconContr.InitControl();
|
| | |
|
| | | var btnFloor = new NormalViewControl(300, 69, true);
|
| | | btnFloor.Gravity = Gravity.CenterVertical;
|
| | | btnFloor.X = btnIconContr.X + btnIconContr.btnIcon.X - Application.GetRealWidth(300);
|
| | | btnFloor.TextAlignment = TextAlignment.CenterRight;
|
| | | topFrameLayout.AddChidren(btnFloor);
|
| | |
|
| | | foreach (var floorId in dicFloor.Keys)
|
| | | {
|
| | | //第一个楼层
|
| | | this.nowSelectFloorId = floorId;
|
| | | btnFloor.Text = dicFloor[floorId];
|
| | | break;
|
| | | }
|
| | |
|
| | | btnIconContr.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | //楼层菜单
|
| | | var contr = new TopRightFloorMenuControl(dicFloor.Count, 2, this.nowSelectFloorId, Language.StringByID(R.MyInternationalizationString.SelectFloor));
|
| | | foreach (var floorId in dicFloor.Keys)
|
| | | {
|
| | | contr.AddRowMenu(floorId, () =>
|
| | | {
|
| | | //记录起选择的ID
|
| | | this.nowSelectFloorId = floorId;
|
| | | btnFloor.Text = dicFloor[this.nowSelectFloorId];
|
| | | //初始化中部信息
|
| | | this.InitMiddleFrame();
|
| | | });
|
| | | }
|
| | | };
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
| | | roomSwitchContr.SelectRoomEvent += (selectRoom) =>
|
| | | {
|
| | | //在外面清空(特效的问题)
|
| | | this.deviceFunctionMenuContr?.RemoveAll();
|
| | | if (this.deviceFunctionMenuContr != null && this.deviceFunctionMenuContr.Parent != null)
|
| | | {
|
| | | this.deviceFunctionMenuContr.RemoveAll();
|
| | | }
|
| | | this.listDeviceView?.RemoveAll();
|
| | |
|
| | | HdlThreadLogic.Current.RunMainInThread(() =>
|
| | |
| | | this.btnFinishControl = new BottomClickButton();
|
| | | btnFinishControl.TextID = R.MyInternationalizationString.uFinish;
|
| | | bodyFrameLayout.AddChidren(btnFinishControl);
|
| | | btnFinishControl.Visible = false;
|
| | | if (this.dicNewListTask == null || this.dicNewListTask.Count == 0)
|
| | | {
|
| | | btnFinishControl.Visible = false;
|
| | | }
|
| | | btnFinishControl.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | //回调函数
|
| | |
| | | /// <returns></returns>
|
| | | private List<Room> GetCanShowRoomList()
|
| | | {
|
| | | //先将列表Dictionary化
|
| | | this.dicNewListTask = new Dictionary<string, List<Safeguard.TaskListInfo>>();
|
| | | this.dicOldListTask = new Dictionary<string, List<Safeguard.TaskListInfo>>();
|
| | | foreach (var data in this.listAdjustTarget)
|
| | | if (this.dicNewListTask == null)
|
| | | {
|
| | | if (data.Type == 0)
|
| | | //先将列表Dictionary化
|
| | | this.dicNewListTask = new Dictionary<string, List<Safeguard.TaskListInfo>>();
|
| | | this.dicOldListTask = new Dictionary<string, List<Safeguard.TaskListInfo>>();
|
| | | foreach (var data in this.listAdjustTarget)
|
| | | {
|
| | | //只要设备
|
| | | string mainkey = LocalDevice.Current.GetDeviceMainKeys(data.DeviceAddr, data.Epoint);
|
| | | dicOldListTask[mainkey] = data.TaskList;
|
| | | if (data.Type == 0)
|
| | | {
|
| | | //只要设备
|
| | | string mainkey = LocalDevice.Current.GetDeviceMainKeys(data.DeviceAddr, data.Epoint);
|
| | | dicOldListTask[mainkey] = data.TaskList;
|
| | | }
|
| | | }
|
| | | }
|
| | | |
| | | //当前楼层的全部房间
|
| | | var lisrRoom = HdlRoomLogic.Current.GetRoomsByCurrentFloorIdAppendLoveRoom();
|
| | | var lisrRoom = HdlRoomLogic.Current.GetRoomsByFloorIdAppendLoveRoom(this.nowSelectFloorId);
|
| | | var listShowRoom = new List<Room>();
|
| | | foreach (var room in lisrRoom)
|
| | | {
|
| | |
| | | var dicGroupDevice = this.GetAllGroupDevice(room);
|
| | |
|
| | | //只初始化一次
|
| | | if (this.deviceFunctionMenuContr == null)
|
| | | if (this.deviceFunctionMenuContr == null || this.deviceFunctionMenuContr.Parent == null)
|
| | | {
|
| | | //设备菜单的白色背景
|
| | | var functionBack1 = new FrameLayout();
|
| | |
| | | HdlThreadLogic.Current.RunMainInThread(() =>
|
| | | {
|
| | | //初始化设备列表控件
|
| | | this.InitListDeviceControls(listDeviceView, rowInfo, room);
|
| | | this.InitListDeviceControls(listDeviceView, rowInfo);
|
| | | });
|
| | | }
|
| | | };
|
| | |
| | | if (nowSelectDeviceInfo != null)
|
| | | {
|
| | | //初始化默认的设备列表控件
|
| | | this.InitListDeviceControls(listDeviceView, nowSelectDeviceInfo, room);
|
| | | this.InitListDeviceControls(listDeviceView, nowSelectDeviceInfo);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | /// </summary>
|
| | | /// <param name="listView"></param>
|
| | | /// <param name="rowInfo"></param>
|
| | | private void InitListDeviceControls(VerticalListControl listView, DeviceRowInfo rowInfo, Room i_room)
|
| | | private void InitListDeviceControls(VerticalListControl listView, DeviceRowInfo rowInfo)
|
| | | {
|
| | | //先清空
|
| | | listView.RemoveAll();
|
| | |
| | | /// 场景列表控件
|
| | | /// </summary>
|
| | | private VerticalListControl listSceneView = null;
|
| | | /// <summary>
|
| | | /// 当前选择的楼层
|
| | | /// </summary>
|
| | | private string nowSelectFloorId = string.Empty;
|
| | |
|
| | | #endregion
|
| | |
|
| | |
| | |
|
| | | //设置头部信息
|
| | | base.SetTitleText(Language.StringByID(R.MyInternationalizationString.AddScence));
|
| | |
|
| | | //初始化右上角的控件
|
| | | this.InitTopRightMenuControl();
|
| | | //初始化中部信息
|
| | | this.InitMiddleFrame();
|
| | | }
|
| | |
| | | /// </summary>
|
| | | private void InitMiddleFrame()
|
| | | {
|
| | | //清空body
|
| | | this.ClearBodyFrame();
|
| | |
|
| | | //获取能够显示的房间列表
|
| | | var listRoom = this.GetCanShowRoomList();
|
| | | if (listRoom.Count == 0)
|
| | |
| | | this.btnFinishControl = new BottomClickButton();
|
| | | btnFinishControl.TextID = R.MyInternationalizationString.uFinish;
|
| | | bodyFrameLayout.AddChidren(btnFinishControl);
|
| | | btnFinishControl.Visible = false;
|
| | | if (this.listNewScene == null || this.listNewScene.Count == 0)
|
| | | {
|
| | | btnFinishControl.Visible = false;
|
| | | }
|
| | | btnFinishControl.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | //回调函数
|
| | |
| | |
|
| | | //执行初始化(会自动触发SelectRoomEvent事件)
|
| | | roomSwitchContr.InitControl();
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 初始化右上角的控件
|
| | | /// </summary>
|
| | | private void InitTopRightMenuControl()
|
| | | {
|
| | | //获取楼层
|
| | | var dicFloor = HdlRoomLogic.Current.GetFloorSortList();
|
| | | if (dicFloor.Count == 0)
|
| | | {
|
| | | return;
|
| | | }
|
| | | var btnIconContr = new MostRightIconControl(69, 69);
|
| | | btnIconContr.UnSelectedImagePath = "Item/Drop_Down.png";
|
| | | topFrameLayout.AddChidren(btnIconContr);
|
| | | btnIconContr.InitControl();
|
| | |
|
| | | var btnFloor = new NormalViewControl(300, 69, true);
|
| | | btnFloor.Gravity = Gravity.CenterVertical;
|
| | | btnFloor.X = btnIconContr.X + btnIconContr.btnIcon.X - Application.GetRealWidth(300);
|
| | | btnFloor.TextAlignment = TextAlignment.CenterRight;
|
| | | topFrameLayout.AddChidren(btnFloor);
|
| | |
|
| | | foreach (var floorId in dicFloor.Keys)
|
| | | {
|
| | | //第一个楼层
|
| | | this.nowSelectFloorId = floorId;
|
| | | btnFloor.Text = dicFloor[floorId];
|
| | | break;
|
| | | }
|
| | |
|
| | | btnIconContr.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | //楼层菜单
|
| | | var contr = new TopRightFloorMenuControl(dicFloor.Count, 2, this.nowSelectFloorId, Language.StringByID(R.MyInternationalizationString.SelectFloor));
|
| | | foreach (var floorId in dicFloor.Keys)
|
| | | {
|
| | | contr.AddRowMenu(floorId, () =>
|
| | | {
|
| | | //记录起选择的ID
|
| | | this.nowSelectFloorId = floorId;
|
| | | btnFloor.Text = dicFloor[this.nowSelectFloorId];
|
| | | //初始化中部信息
|
| | | this.InitMiddleFrame();
|
| | | });
|
| | | }
|
| | | };
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
| | | /// <returns></returns>
|
| | | private List<Room> GetCanShowRoomList()
|
| | | {
|
| | | //先列表化
|
| | | this.listOldSceneId = new List<int>();
|
| | | this.listNewScene = new List<int>();
|
| | | foreach (var data in this.listAdjustTarget)
|
| | | if (this.listNewScene == null)
|
| | | {
|
| | | if (data.Type == 1)
|
| | | //先列表化
|
| | | this.listOldSceneId = new List<int>();
|
| | | this.listNewScene = new List<int>();
|
| | | foreach (var data in this.listAdjustTarget)
|
| | | {
|
| | | //只要场景
|
| | | listOldSceneId.Add(data.ElseScenesId);
|
| | | if (data.Type == 1)
|
| | | {
|
| | | //只要场景
|
| | | listOldSceneId.Add(data.ElseScenesId);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | //当前楼层的全部房间
|
| | | var lisrRoom = HdlRoomLogic.Current.GetRoomsByCurrentFloorIdAppendLoveRoom();
|
| | | var lisrRoom = HdlRoomLogic.Current.GetRoomsByFloorIdAppendLoveRoom(this.nowSelectFloorId);
|
| | | var listShowRoom = new List<Room>();
|
| | | foreach (var room in lisrRoom)
|
| | | {
|
| | |
| | | btnFloorName.Y = Application.GetRealHeight(17);
|
| | | btnFloorName.TextAlignment = TextAlignment.CenterRight;
|
| | | btnFloorName.IsBold = true;
|
| | | btnFloorName.Text = HdlResidenceLogic.Current.GetFloorNameById(Config.Instance.Home.CurrentFloorId);
|
| | | btnFloorName.Text = Common.Config.Instance.Home.GetCurrentFloorName;
|
| | | frameSwitchBack.AddChidren(btnFloorName);
|
| | | btnFloorName.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | var floors = new SelectFloorForm();
|
| | | floors.CurFloorId = Config.Instance.Home.CurrentFloorId;
|
| | | AddChidren(floors);
|
| | | floors.Init(580, 330, Direction.Right);
|
| | | floors.changeFloor = true;
|
| | | floors.FloorAction += (floorId) =>
|
| | | {
|
| | | btnFloorName.Text = HdlResidenceLogic.Current.GetFloorNameById(floorId);
|
| | | Config.Instance.Home.CurrentFloorId = floorId;
|
| | | HdlRoomLogic.Current.NowCategoryRoom = HdlRoomLogic.Current.GetLoveRoom();
|
| | | //这个时候需要刷新主页
|
| | | UserPage.Instance.RefreshMainPageForm = true;
|
| | | //刷新bodyView
|
| | | this.RefreshBodyView();
|
| | | };
|
| | |
| | | private void InitRoomMenuControl()
|
| | | {
|
| | | //当前楼层的全部房间
|
| | | var lisrRoom = HdlRoomLogic.Current.GetRoomsByCurrentFloorIdAppendLoveRoom();
|
| | | var lisrRoom = HdlRoomLogic.Current.GetRoomsByFloorIdAppendLoveRoom(Config.Instance.Home.CurrentFloorId);
|
| | | if (HdlRoomLogic.Current.NowCategoryRoom == null)
|
| | | {
|
| | | //设置第一个为初始房间
|
| | |
| | | HdlThreadLogic.Current.RunMain(() =>
|
| | | {
|
| | | listview1.EndHeaderRefreshing();
|
| | | if (result == true)
|
| | | //listview1.Parent为null代表它切换房间了
|
| | | if (result == true && listview1.Parent != null)
|
| | | {
|
| | | //在外面清空(特效的问题)
|
| | | this.functionSceneBodyView.RemoveAll();
|
| | | //刷新场景的时候,关闭左划菜单的未分配界面
|
| | | MainPage.LeftListRoomViewFrom.Instance?.CloseUnallocatedRoomForm();
|
| | | //在外面清空(特效的问题)
|
| | | this.functionSceneBodyView.RemoveAll();
|
| | |
|
| | | HdlThreadLogic.Current.RunMainInThread(() =>
|
| | | {
|
| | |
| | | //已经接收到网关的反馈 2020.05.09:删除Ack主题
|
| | | this.dicDeviceRowControl[mainKeys].SetHadGetResponeResultStatu();
|
| | | //刷新控件
|
| | | this.dicDeviceRowControl[mainKeys].RefreshControlInfo(locadevice);
|
| | | if (locadevice.Type != DeviceType.IASZone)
|
| | | {
|
| | | //传感器不需要属性上报(但是那个球型传感器居然会属性上报)
|
| | | this.dicDeviceRowControl[mainKeys].RefreshControlInfo(locadevice);
|
| | | }
|
| | | }
|
| | | }, ShowErrorMode.NO);
|
| | | });
|
| | |
| | | |
| | | public Action<string> FloorAction; |
| | | /// <summary> |
| | | /// 是否切换为当前楼层 |
| | | /// </summary> |
| | | public bool changeFloor = true; |
| | | /// <summary> |
| | | /// 当前传过来的floorid |
| | | /// </summary> |
| | | public string CurFloorId = string.Empty; |
| | |
| | | frow.Width = this.GetPictrueRealSize(449); |
| | | frow.Height = this.GetPictrueRealSize(150); |
| | | frow.Init("Floor/Floor.png", "Floor/FloorSelected.png", floorName); |
| | | verticalScrolView.AddChidren(frow); |
| | | |
| | | if (string.IsNullOrEmpty(CurFloorId)) |
| | | { |
| | | if (Config.Instance.Home.CurrentFloorId == floorId) |
| | | { |
| | | frow.IsSelected = true; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (CurFloorId == floorId) |
| | | { |
| | | frow.IsSelected = true; |
| | | } |
| | | } |
| | | verticalScrolView.AddChidren(frow);
|
| | | frow.IsSelected = floorId == this.CurFloorId; |
| | | |
| | | frow.ButtonClickEvent += (sender, e) => |
| | | { |
| | | frow.IsSelected = true; |
| | | if (changeFloor) |
| | | { |
| | | Config.Instance.Home.CurrentFloorId = floorId; |
| | | Config.Instance.Home.Save(false); |
| | | UserCenter.HdlRoomLogic.Current.RefreshRoomListView(); |
| | | } |
| | | RemoveView(); |
| | | FloorAction?.Invoke(floorId); |
| | | }; |
| | |
| | | //场景点击
|
| | | sceneContr.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | this.SceneUpHandler();
|
| | | //不能反复点击
|
| | | sceneContr.CanClick = false;
|
| | | this.SceneUpHandler(sceneContr);
|
| | | };
|
| | |
|
| | | //收藏
|
| | |
| | | {
|
| | | //隐藏右划菜单
|
| | | this.HideMenu();
|
| | | scene.SceneDelayTime = t;
|
| | | btnDelayTime.Text = CommonFormResouce.GetTimeString(t);
|
| | | if (t != 0)
|
| | | {
|
| | | scene.SceneDelayTime = t;
|
| | | btnDelayTime.Text = CommonFormResouce.GetTimeString(t);
|
| | | //编辑延时时,需要刷新主页
|
| | | UserView.UserPage.Instance.RefreshAllForm = true;
|
| | | }
|
| | | };
|
| | | };
|
| | | }
|
| | |
| | | /// <summary>
|
| | | ///
|
| | | /// </summary>
|
| | | /// <param name="btnScenePic"></param>
|
| | | /// <param name="btnSceneName"></param>
|
| | | private async void SceneUpHandler()
|
| | | /// <param name="sceneContr"></param>
|
| | | private async void SceneUpHandler(ScenePictrueControl sceneContr)
|
| | | {
|
| | | if (scene.SceneDelayTime <= 0 && scene.RemainTime <= 0)
|
| | | {
|
| | |
| | | var result = await HdlSceneLogic.Current.ControlScene(scene);
|
| | | if (result == false)
|
| | | {
|
| | | sceneContr.CanClick = true;
|
| | | return;
|
| | | }
|
| | |
|
| | |
| | | scene.SceneDelayTime = 0;
|
| | | if (scene.RemainTime <= 0)
|
| | | {
|
| | | sceneContr.CanClick = true;
|
| | | return;
|
| | | }
|
| | | //调用有延时的场景,需要刷新主页
|
| | | UserView.UserPage.Instance.RefreshAllForm = true;
|
| | |
|
| | | int myRemainTime = scene.RemainTime;
|
| | | //开启内部延时时间线程(旨在全部地方的同一场景时间同步)
|
| | | HdlSceneLogic.Current.StartDelayTimeThread(scene);
|
| | |
| | | SetTimeImage();
|
| | | //直接开启Loading特效
|
| | | this.StartLoadingApreal();
|
| | | sceneContr.CanClick = true;
|
| | | }
|
| | | });
|
| | | })
|
| | |
| | | /// <param name="method">请求方式为POST/GET</param> |
| | | /// <param name="second">超时时间</param> |
| | | /// <returns></returns> |
| | | public static async System.Threading.Tasks.Task<string> HttpWebRequest(string getUrl, string str, string method, int second = 3) |
| | | public static async System.Threading.Tasks.Task<string> HttpWebRequest(string getUrl, string str, string method, int second = 3, bool _bool = false) |
| | | { |
| | | HttpWebRequest request = WebRequest.Create(getUrl) as HttpWebRequest; //创建请求 |
| | | request.Method = method; //请求方式为POST/GET |
| | | request.ContentType = "application/json"; |
| | | request.ContentType = "application/json"; |
| | | request.Timeout = second * 1000;//超时时间 |
| | | if (_bool) { |
| | | //用于高胜可视对讲接口 |
| | | request.Headers.Add("Authorization", Config.Instance.Token); |
| | | } |
| | | if (method == "POST") |
| | | { |
| | | byte[] jsonbyte = System.Text.Encoding.UTF8.GetBytes(str); |
| | |
| | | |
| | | } |
| | | #region ◆ 自动化__________________________ |
| | | |
| | | static bool If_once = true; |
| | | public static bool If_once = true;//进来只读一次标识; |
| | | /// <summary> |
| | | /// 自动化功能代码入口 |
| | | /// </summary> |
| | |
| | | { |
| | | if (If_once)
|
| | | {
|
| | | If_once = false;
|
| | | if (Common.Logic.LogicList.Count == 0)
|
| | | {
|
| | | If_once = false; |
| | | var Idlist1 = await Send.GetLogicId(0);//
|
| | | var Idlist2 = await Send.GetLogicId(2);//门锁常开模式
|
| | | if (Idlist1.Count != 0)
|
New file |
| | |
| | | using System; |
| | | using Newtonsoft.Json.Linq; |
| | | using Shared.Common; |
| | | using System.Collections.Generic; |
| | | using Shared.Phone.Device.Logic; |
| | | |
| | | namespace Shared.Phone.Device.VideoIntercom |
| | | { |
| | | public class VideoMachine : FrameLayout |
| | | { |
| | | public VideoMachine() |
| | | { |
| | | } |
| | | public void Show(List<VideoCalss> videoInfosLists) |
| | | { |
| | | TopView view = new TopView(); |
| | | this.AddChidren(view.TopRowView()); |
| | | view.toptitleNameBtn.TextID = R.MyInternationalizationString.videoIntercom; |
| | | view.clickBtn.MouseDownEventHandler += (sender, e) => { RemoveFromParent(); }; |
| | | |
| | | var middle = new VerticalRefreshLayout |
| | | { |
| | | Y = view.topRowLayout.Bottom, |
| | | Height = Application.GetRealHeight(Method.H - 184), |
| | | BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor, |
| | | }; |
| | | this.AddChidren(middle); |
| | | |
| | | for (int i = 0; i < videoInfosLists.Count; i++) |
| | | { |
| | | var videoInfos = videoInfosLists[i]; |
| | | var fLayout = new FrameLayout |
| | | { |
| | | Height = Application.GetRealHeight(160), |
| | | BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor, |
| | | }; |
| | | middle.AddChidren(fLayout); |
| | | var iconBtn = new Button |
| | | { |
| | | Width = Application.GetMinRealAverage(81), |
| | | Height = Application.GetMinRealAverage(81), |
| | | X = Application.GetRealWidth(58), |
| | | Y = Application.GetRealHeight(55), |
| | | UnSelectedImagePath = "Item/videoIntercom.png", |
| | | }; |
| | | fLayout.AddChidren(iconBtn); |
| | | var nameBtn = new Button |
| | | { |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = ZigbeeColor.Current.LogicTextBlackColor, |
| | | TextSize = 15, |
| | | Y = Application.GetRealHeight(30), |
| | | X = Application.GetRealWidth(176), |
| | | Height = Application.GetRealHeight(60), |
| | | Width = Application.GetRealWidth(400), |
| | | Text = videoInfos.DeviceName, |
| | | }; |
| | | fLayout.AddChidren(nameBtn); |
| | | |
| | | var name1Btn = new Button |
| | | { |
| | | Text = videoInfos.RoomName, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = ZigbeeColor.Current.LogicBtnCancelColor, |
| | | TextSize = 12, |
| | | Y = nameBtn.Bottom + Application.GetRealHeight(3), |
| | | X = Application.GetRealWidth(176), |
| | | Height = Application.GetRealHeight(60), |
| | | Width = Application.GetRealWidth(400), |
| | | }; |
| | | fLayout.AddChidren(name1Btn); |
| | | |
| | | var nextBtn = new Button |
| | | { |
| | | Width = Application.GetMinRealAverage(104), |
| | | Height = Application.GetMinRealAverage(104), |
| | | UnSelectedImagePath = "Item/videoIntercomNext.png", |
| | | X = Application.GetRealWidth(743 + 176), |
| | | Y = Application.GetRealHeight(30), |
| | | }; |
| | | fLayout.AddChidren(nextBtn); |
| | | |
| | | var lineBtn = new Button |
| | | { |
| | | Width = Application.GetRealWidth(845), |
| | | Height = 1, |
| | | Y = fLayout.Height - 1, |
| | | X = Application.GetRealWidth(176), |
| | | BackgroundColor = ZigbeeColor.Current.LogicRowLayoutLineColor, |
| | | }; |
| | | fLayout.AddChidren(lineBtn); |
| | | var clickBtn = new Button |
| | | { |
| | | Height = Application.GetRealHeight(160), |
| | | }; |
| | | fLayout.AddChidren(clickBtn); |
| | | |
| | | clickBtn.MouseUpEventHandler += (sen, e) => |
| | | { |
| | | #if iOS
|
| | | GateWay.Ios.ESVideoInfo eSVideoInfo = new GateWay.Ios.ESVideoInfo(); |
| | | eSVideoInfo.DeviceName = videoInfos.DeviceName; |
| | | eSVideoInfo.ESVideoUUID = videoInfos.ESVideoUUID; |
| | | eSVideoInfo.ESRoomID = videoInfos.ESRoomID; |
| | | eSVideoInfo.RoomName = videoInfos.RoomName; |
| | | GateWay.Ios.ESVideo.ShowESVideoMonitor(eSVideoInfo); |
| | | #elif Android
|
| | | |
| | | #endif |
| | | }; |
| | | |
| | | } |
| | | |
| | | } |
| | | /// <summary> |
| | | /// 判断账号是否支持可视对讲 |
| | | /// </summary> |
| | | /// <param name="topFrameLayout"></param> |
| | | public async static void AccountSupportVideo(FrameLayout topFrameLayout) |
| | | { |
| | | var jobject = new JObject(); |
| | | jobject.Add("RequestVersion", CommonPage.RequestVersion); |
| | | jobject.Add("RequestSource", "0"); |
| | | jobject.Add("HomeID", Config.Instance.HomeId); |
| | | var url = "https://developer.hdlcontrol.com/ProposedProductionApi/VideoIntercom/CheckBindRecord"; |
| | | var str = await Send.HttpWebRequest(url, jobject.ToString(), "POST", 3, true); |
| | | if (!string.IsNullOrEmpty(str)) |
| | | { |
| | | try |
| | | { |
| | | var json = JObject.Parse(str); |
| | | if (json != null) |
| | | { |
| | | var stateCode = json["StateCode"].ToString(); |
| | | //可视对讲快捷方式 |
| | | var videoIntercomBtn = new Button(); |
| | | videoIntercomBtn.Gravity = Gravity.CenterVertical; |
| | | videoIntercomBtn.UnSelectedImagePath = "Item/videoIntercom.png"; |
| | | videoIntercomBtn.Width = Application.GetMinRealAverage(69); |
| | | videoIntercomBtn.Height = Application.GetMinRealAverage(69); |
| | | List<VideoCalss> videoList= new List<VideoCalss>(); |
| | | if (stateCode == "Success") |
| | | {//判断这个账号是否绑定; |
| | | topFrameLayout.AddChidren(videoIntercomBtn); |
| | | CloudsVideo cloudsVideo = Newtonsoft.Json.JsonConvert.DeserializeObject<CloudsVideo>(json["ResponseData"].ToString()); |
| | | videoList = await GetVideoInfoList(cloudsVideo); |
| | | } |
| | | if (UserCenter.UserCenterResourse.ResidenceOption.SafetyShortcut) |
| | | { |
| | | videoIntercomBtn.X = Application.GetRealWidth(746 + 10); |
| | | } |
| | | else |
| | | { |
| | | videoIntercomBtn.X = Application.GetRealWidth(850 + 10); |
| | | } |
| | | videoIntercomBtn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | |
| | | var videoMachine = new Device.VideoIntercom.VideoMachine(); |
| | | UserView.HomePage.Instance.AddChidren(videoMachine); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | videoMachine.Show(videoList); |
| | | |
| | | }; |
| | | } |
| | | } |
| | | catch { } |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | /// <summary> |
| | | /// 获取可视对讲列表 |
| | | /// </summary> |
| | | static async System.Threading.Tasks.Task<List<VideoCalss>> GetVideoInfoList(CloudsVideo clouds) |
| | | { |
| | | List<VideoCalss> eSVideoInfosList = new List<VideoCalss>(); |
| | | var jobject = new JObject(); |
| | | jobject.Add("cmtID", clouds.FLCommunityID); |
| | | jobject.Add("unitno", clouds.FLBuildingID); |
| | | jobject.Add("method", "getUUIDList"); |
| | | var url = " http://112.74.164.111:180/api.php/Device/getmonitorUUID"; |
| | | var str = await Send.HttpWebRequest(url, jobject.ToString(), "POST"); |
| | | if (string.IsNullOrEmpty(str)) |
| | | { |
| | | return eSVideoInfosList; |
| | | } |
| | | var json = JObject.Parse(str); |
| | | if (json == null) |
| | | { |
| | | return eSVideoInfosList; |
| | | } |
| | | if (json["resCode"].ToString() != "0") |
| | | { |
| | | return eSVideoInfosList; |
| | | } |
| | | var list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Dictionary<string, string>>>(json["list"].ToString()); |
| | | if (list.Count == 0) |
| | | { |
| | | return eSVideoInfosList; |
| | | } |
| | | foreach (var videoInfo in list) |
| | | { |
| | | VideoCalss eSVideoInfo = new VideoCalss(); |
| | | eSVideoInfo.ESRoomID = int.Parse(clouds.FLRoomID); |
| | | string str1 = clouds.FLBuildingID.Substring(0, 2).TrimStart('0'); |
| | | string str2 = clouds.FLBuildingID.Substring(2, 2).TrimStart('0'); |
| | | eSVideoInfo.RoomName = str1 +Language.StringByID( R.MyInternationalizationString.dong) + str2 + Language.StringByID(R.MyInternationalizationString.unit); |
| | | eSVideoInfo.DeviceName = videoInfo["aliasName"]; |
| | | if (videoInfo["uuid"].Contains(",")) |
| | | { |
| | | var uuid = videoInfo["uuid"].Split(','); |
| | | eSVideoInfo.ESVideoUUID = uuid[0]; |
| | | } |
| | | else |
| | | { |
| | | eSVideoInfo.ESVideoUUID = videoInfo["uuid"]; |
| | | } |
| | | eSVideoInfosList.Add(eSVideoInfo); |
| | | } |
| | | return eSVideoInfosList; |
| | | } |
| | | } |
| | | public class VideoCalss |
| | | { |
| | | /// <summary> |
| | | /// 室外机的UUID |
| | | /// 例:JJY000007FSEYX |
| | | /// </summary> |
| | | public string ESVideoUUID = string.Empty; |
| | | /// <summary> |
| | | /// 当前用户的房间ID |
| | | /// 例:0801 |
| | | /// </summary> |
| | | public int ESRoomID; |
| | | /// <summary> |
| | | /// 室外机的名称 |
| | | /// 例:室外机 |
| | | /// </summary> |
| | | public string DeviceName = string.Empty; |
| | | /// <summary> |
| | | /// 房间命名 |
| | | /// 例:8栋1单元0801 |
| | | /// </summary> |
| | | public string RoomName = string.Empty; |
| | | |
| | | } |
| | | public class CloudsVideo |
| | | { |
| | | /// <summary> |
| | | /// 栋楼单元号 |
| | | /// </summary> |
| | | public string FLBuildingID = string.Empty; |
| | | /// <summary> |
| | | /// 那栋楼的名称 |
| | | /// </summary> |
| | | public string FLBuildingName = string.Empty; |
| | | /// <summary> |
| | | /// 小区ID |
| | | /// </summary> |
| | | public string FLCommunityID = string.Empty; |
| | | /// <summary> |
| | | /// 房间ID |
| | | /// </summary> |
| | | public string FLRoomID = string.Empty; |
| | | /// <summary> |
| | | /// 住宅ID |
| | | /// </summary> |
| | | public string HomeID = string.Empty; |
| | | |
| | | public string FLSecretKey = string.Empty; |
| | | |
| | | } |
| | | } |
| | |
| | | this.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | //调用场景
|
| | | this.CanClick = false;
|
| | | this.SetSceneAction();
|
| | | };
|
| | | }
|
| | |
| | | timeSelect.Init();
|
| | | timeSelect.TimeAction = (time) =>
|
| | | {
|
| | | //选择的是不开启
|
| | | if (time == 0) { return; }
|
| | |
|
| | | i_scene.SceneDelayTime = time;
|
| | |
|
| | | //时间图标不显示
|
| | | this.btnTimeIcon.Visible = false;
|
| | | //显示剩余的时间
|
| | | this.btnTimeView.Text = this.GetTimeString(time, hourText, minuText, secondText);
|
| | | //选择延时时,需要刷新主页
|
| | | UserView.UserPage.Instance.RefreshAllForm = true;
|
| | | };
|
| | | };
|
| | |
|
| | |
| | | var result = await HdlSceneLogic.Current.ControlScene(scene);
|
| | | if (result == false)
|
| | | {
|
| | | this.CanClick = true;
|
| | | return;
|
| | | }
|
| | | if (scene.SceneDelayTime > 0)
|
| | | {
|
| | | //调用有延时的场景,需要刷新主页
|
| | | UserView.UserPage.Instance.RefreshAllForm = true;
|
| | | }
|
| | | //修改时间
|
| | | scene.RemainTime = scene.SceneDelayTime;
|
| | |
| | | }
|
| | |
|
| | | //开启延时倒计时特效
|
| | | this.CanClick = false;
|
| | | this.StartRemainTimeApreal(i_scene);
|
| | | }
|
| | |
|
| | |
| | | {
|
| | | if (i_scene.RemainTime <= 0)
|
| | | {
|
| | | this.CanClick = true;
|
| | | return;
|
| | | }
|
| | | int remainTine = i_scene.RemainTime;
|
| | |
| | | this.btnTimeView.Text = string.Empty;
|
| | | //直接开启Loading特效
|
| | | this.StartLoadingApreal();
|
| | | this.CanClick = true;
|
| | | });
|
| | | })
|
| | | { IsBackground = true }.Start();
|
| | |
| | | listBodyContr.RecoverTableHeight();
|
| | | }
|
| | |
|
| | | //初始化默认楼层ID
|
| | | this.InitDefultFloorId();
|
| | |
|
| | | //初始化头部控件
|
| | | this.InitTopFrameLayoutControl();
|
| | | //初始化中间控件
|
| | |
| | | this.ShowSelectFloorForm(btnFloorName);
|
| | | };
|
| | | }
|
| | |
|
| | | //可视对讲快捷方式
|
| | | Shared.Phone.Device.VideoIntercom.VideoMachine.AccountSupportVideo(topFrameLayout);
|
| | | //安防快捷方式
|
| | | if (UserCenterResourse.ResidenceOption.SafetyShortcut)
|
| | | {
|
| | |
| | | roomPageView.SetLeftAndRightImageView(mLeftImageView, mRightImageView);
|
| | |
|
| | | //当前房间
|
| | | var listRoom = HdlRoomLogic.Current.GetRoomsByCurrentFloorIdAppendLoveRoom();
|
| | | var listRoom = HdlRoomLogic.Current.GetRoomsByFloorIdAppendLoveRoom(Config.Instance.Home.CurrentFloorId);
|
| | | if (HdlRoomLogic.Current.NowMainPageRoom == null)
|
| | | {
|
| | | //设置第一个为初始房间
|
| | | HdlRoomLogic.Current.NowMainPageRoom = listRoom[0];
|
| | | }
|
| | | var curIndex = 0;
|
| | |
| | | //当没有绑定有网关,左滑时,点击房间列表,则不鸟它
|
| | | return;
|
| | | }
|
| | | var listRoom = HdlRoomLogic.Current.GetRoomsByCurrentFloorIdAppendLoveRoom();
|
| | | var listRoom = HdlRoomLogic.Current.GetRoomsByFloorIdAppendLoveRoom(Config.Instance.Home.CurrentFloorId);
|
| | | for (int i = 0; i < listRoom.Count; i++)
|
| | | {
|
| | | if (room.Id == listRoom[i].Id)
|
| | |
| | | //重置一下楼层名字
|
| | | if (this.btnFloorName != null)
|
| | | {
|
| | | btnFloorName.Text = HdlResidenceLogic.Current.GetFloorNameById(Config.Instance.Home.CurrentFloorId);
|
| | | btnFloorName.Text = Config.Instance.Home.GetCurrentFloorName;
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | //已经接收到网关的反馈 2020.05.09:删除Ack主题
|
| | | this.dicDeviceCardControl[mainKeys].SetHadGetResponeResultStatu();
|
| | | //刷新控件
|
| | | this.dicDeviceCardControl[mainKeys].RefreshControlInfo(locadevice);
|
| | | if (locadevice.Type != DeviceType.IASZone)
|
| | | {
|
| | | //传感器不需要属性上报(但是那个球型传感器居然会属性上报)
|
| | | this.dicDeviceCardControl[mainKeys].RefreshControlInfo(locadevice);
|
| | | }
|
| | | }
|
| | | }, ShowErrorMode.NO);
|
| | | });
|
| | |
| | | private void ShowSelectFloorForm(NormalViewControl btnFloor)
|
| | | {
|
| | | var floorFL = new Category.SelectFloorForm();
|
| | | floorFL.CurFloorId = Config.Instance.Home.CurrentFloorId;
|
| | | this.AddChidren(floorFL);
|
| | | floorFL.Init(35, 153);
|
| | | floorFL.changeFloor = true;
|
| | | floorFL.FloorAction = (floorId) =>
|
| | | {
|
| | | btnFloor.Text = HdlResidenceLogic.Current.GetFloorNameById(floorId);
|
| | | Config.Instance.Home.CurrentFloorId = floorId;
|
| | | HdlRoomLogic.Current.NowMainPageRoom = HdlRoomLogic.Current.GetLoveRoom();
|
| | | //分类界面需要刷新
|
| | | UserView.UserPage.Instance.RefreshCategoryForm = true;
|
| | | this.ShowForm();
|
| | | };
|
| | | }
|
| | |
| | | return true;
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 初始化默认楼层ID
|
| | | /// </summary>
|
| | | private void InitDefultFloorId()
|
| | | {
|
| | | if (Config.Instance.Home.CurrentFloorId != string.Empty)
|
| | | {
|
| | | return;
|
| | | }
|
| | | var dicFloor = HdlRoomLogic.Current.GetFloorSortList();
|
| | | foreach (var floorId in dicFloor.Keys)
|
| | | {
|
| | | Config.Instance.Home.CurrentFloorId = floorId;
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
|
| | | #region ■ 界面重新激活事件___________________
|
| | |
| | | };
|
| | |
|
| | | //获取楼层
|
| | | this.curFloorId = Config.Instance.Home.CurrentFloorId;
|
| | |
|
| | | var dicFloor = HdlRoomLogic.Current.GetFloorSortList();
|
| | | if (dicFloor.Count == 0)
|
| | | {
|
| | | return;
|
| | | }
|
| | | //楼层初始ID
|
| | | foreach (var floorId in dicFloor.Keys)
|
| | | {
|
| | | this.curFloorId = floorId;
|
| | | break;
|
| | | }
|
| | |
|
| | | //楼层图标
|
| | | var btnIconContr = new MostRightIconControl(69, 69);
|
| | | btnIconContr.UnSelectedImagePath = "Item/Drop_Down.png";
|
| | |
| | | {
|
| | | //楼层菜单
|
| | | var floors = new Category.SelectFloorForm();
|
| | | floors.CurFloorId = this.curFloorId;
|
| | | AddChidren(floors);
|
| | | floors.changeFloor = false;
|
| | | floors.CurFloorId = curFloorId;
|
| | | floors.CurFloorId = this.curFloorId;
|
| | | floors.Init(599, 161, Direction.Right);
|
| | | floors.FloorAction += (floorId) =>
|
| | | {
|
| | |
| | | {
|
| | | return;
|
| | | }
|
| | | string oldFloorId = Config.Instance.Home.CurrentFloorId;
|
| | | CommonPage.Instance.CloseLeftMenu();
|
| | |
|
| | | HdlThreadLogic.Current.RunThread(() =>
|
| | |
| | | //点击的是收藏房间的话,不变更当前楼层id
|
| | | if (room.FloorId != string.Empty)
|
| | | {
|
| | | Config.Instance.Home.CurrentFloorId = room.FloorId;
|
| | | if (oldFloorId != room.FloorId)
|
| | | if (Config.Instance.Home.CurrentFloorId != room.FloorId)
|
| | | {
|
| | | //楼层都切换的话,刷新整个主页
|
| | | Config.Instance.Home.CurrentFloorId = room.FloorId;
|
| | | HdlRoomLogic.Current.NowMainPageRoom = room;
|
| | | UserPage.Instance.ReFreshControl();
|
| | | return;
|
| | | }
|
| | |
| | | {
|
| | | HdlControlLogic.Current.ShowBottomListRoomView(string.Empty, Language.StringByID(R.MyInternationalizationString.AddTo), (selectId, selectName) => |
| | | { |
| | | if (selectId == string.Empty)
|
| | | {
|
| | | //选择的是未分配
|
| | | return;
|
| | | } |
| | | //变更了当前房间的东西,主页需要刷新 |
| | | if (HdlRoomLogic.Current.NowMainPageRoom.Id == selectId)
|
| | | {
|
| | |
| | | } |
| | | //保存选择的设备和场景 |
| | | var room = HdlRoomLogic.Current.GetRoomById(selectId); |
| | | this.SaveSelectDeviceAndScene(room); |
| | | this.SaveSelectDeviceAndScene(room);
|
| | | //分类界面需要刷新
|
| | | UserPage.Instance.RefreshCategoryForm = true; |
| | | });
|
| | | };
|
| | | }
|
| | |
| | | /// 行数
|
| | | /// </summary>
|
| | | private int RowCount = 0;
|
| | | /// <summary>
|
| | | /// 当前楼层id
|
| | | /// </summary>
|
| | | private string nowFloorId = string.Empty;
|
| | |
|
| | | #endregion
|
| | |
|
| | |
| | | /// <para>1: 395宽度</para>
|
| | | /// <para>2: 449宽度</para>
|
| | | /// </param>
|
| | | /// <param name="i_floorId">当前选择的楼层ID</param>
|
| | | /// <param name="titleText">标题文本(如果不为空,菜单模式变更为拥有标题的模式)</param>
|
| | | public TopRightFloorMenuControl(int i_RowCount, int i_widthType, string titleText = null)
|
| | | public TopRightFloorMenuControl(int i_RowCount, int i_widthType,string i_floorId, string titleText = null)
|
| | | {
|
| | | this.nowFloorId = i_floorId;
|
| | | this.RowCount = i_RowCount;
|
| | | if (i_widthType == 1)
|
| | | {
|
| | |
| | | btnLine.X = Application.GetRealWidth(81);
|
| | | }
|
| | |
|
| | | if (floorId == Common.Config.Instance.Home.CurrentFloorId)
|
| | | if (this.nowFloorId == floorId)
|
| | | {
|
| | | //当前楼层默认设置为选择状态
|
| | | this.SetRowSelectStatu(rowFrame, true);
|
| | |
| | | this.RefreshDfunctionType();
|
| | |
|
| | | //设备改变功能类型的话,主页需要重新刷新
|
| | | UserView.UserPage.Instance.RefreshForm = true;
|
| | | UserView.UserPage.Instance.RefreshAllForm = true;
|
| | |
|
| | | //调用回调函数
|
| | | this.FinishSelectEvent?.Invoke(nowSelectNo);
|
| | |
| | | var room = HdlRoomLogic.Current.GetRoomBySceneId(this.SceneId);
|
| | | if (room != null)
|
| | | {
|
| | | btnRoom.Text = room.Name;
|
| | | btnRoom.Text = HdlRoomLogic.Current.GetRoomName(room);
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | //如果没有自动备份数据,则把本地全部东西上传
|
| | | var pathTemp = DirNameResourse.AutoBackupDirectory;
|
| | | //复制本地所有文件过去
|
| | | List<string> listAllFile = Global.FileListByHomeId();
|
| | | List<string> listAllFile = HdlFileLogic.Current.GetRootPathListFile();
|
| | | foreach (string fileName in listAllFile)
|
| | | {
|
| | | string oldFile = System.IO.Path.Combine(Config.Instance.FullPath, fileName);
|
| | |
| | | if (upPath == string.Empty)
|
| | | {
|
| | | //获取本地文件
|
| | | listAllFile = Global.FileListByHomeId();
|
| | | listAllFile = HdlFileLogic.Current.GetRootPathListFile();
|
| | | fullDir = Common.Config.Instance.FullPath;
|
| | | }
|
| | | else
|
| | |
| | | var listFloorKey = this.GetAllFloorKeys();
|
| | | var dicRoomName = this.GetRoomSampleList();
|
| | |
|
| | | //设置初始楼层
|
| | | Config.Instance.Home.CurrentFloorId = listFloorKey[0];
|
| | | foreach (string floorKey in listFloorKey)
|
| | | {
|
| | | foreach (string roomId in dicRoomName.Keys)
|
| | |
| | | return new List<string>();
|
| | | }
|
| | |
|
| | | List<string> list = new List<string>();
|
| | | var files = System.IO.Directory.GetFiles(directory);
|
| | | foreach (var file in files)
|
| | | var list = new List<string>();
|
| | | try
|
| | | {
|
| | | string fileName = file;
|
| | | if (onlyFileName == true)
|
| | | //2020.07.10的时候,出现过获取失败异常 提示:write fault on path
|
| | | var files = System.IO.Directory.GetFiles(directory);
|
| | | foreach (var file in files)
|
| | | {
|
| | | fileName = fileName.Substring(directory.Length + 1);
|
| | | string fileName = file;
|
| | | if (onlyFileName == true)
|
| | | {
|
| | | fileName = fileName.Substring(directory.Length + 1);
|
| | | }
|
| | | list.Add(fileName);
|
| | | }
|
| | | list.Add(fileName);
|
| | | }
|
| | | catch (Exception ex)
|
| | | { HdlLogLogic.Current.WriteLog(ex); }
|
| | |
|
| | | return list;
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 获取根目录的全部文件列表
|
| | | /// </summary>
|
| | | /// <returns></returns>
|
| | | public List<string> GetRootPathListFile()
|
| | | {
|
| | | return this.GetFileFromDirectory(Common.Config.Instance.FullPath);
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 将指定文件夹里面的全部文件移动到当前住宅的文件夹内
|
| | | /// </summary>
|
| | | /// <param name="fulldirectory">文件夹全路径</param>
|
| | |
| | | return false;
|
| | | } |
| | | //添加网关的话,强制主页刷新 |
| | | UserView.UserPage.Instance.RefreshForm = true; |
| | | UserView.UserPage.Instance.RefreshAllForm = true; |
| | | |
| | | return true; |
| | | }
|
| | |
| | | }
|
| | |
|
| | | //添加网关的话,强制主页刷新
|
| | | UserView.UserPage.Instance.RefreshForm = true;
|
| | | UserView.UserPage.Instance.RefreshAllForm = true;
|
| | |
|
| | | return 1; |
| | | } |
| | |
| | | //切换网关,保存缓存
|
| | | this.SaveGatewayIdToLocation(gatewayId);
|
| | | //切换网关的话,主页需要重新刷新
|
| | | UserView.UserPage.Instance.RefreshForm = true;
|
| | | UserView.UserPage.Instance.RefreshAllForm = true;
|
| | |
|
| | | return true;
|
| | | }
|
| | |
| | | public List<string> GetAllGatewayFile()
|
| | | {
|
| | | List<string> list = new List<string>();
|
| | | List<string> listFile = Global.FileListByHomeId();
|
| | | List<string> listFile = HdlFileLogic.Current.GetRootPathListFile();
|
| | | foreach (string file in listFile)
|
| | | {
|
| | | //只获取网关设备
|
| | |
| | | home.Name = residenceName;
|
| | | home.Save();
|
| | | //住宅修改名称的话,主页需要重新刷新
|
| | | UserView.UserPage.Instance.RefreshForm = true;
|
| | | UserView.UserPage.Instance.RefreshAllForm = true;
|
| | | }
|
| | |
|
| | |
|
| | |
| | | //检测我的喜爱这个房间对象
|
| | | this.CheckLoveRoom();
|
| | |
|
| | | var listFile = Global.FileListByHomeId();
|
| | | var listFile = HdlFileLogic.Current.GetRootPathListFile();
|
| | | foreach (var fileName in listFile)
|
| | | {
|
| | | if (fileName.StartsWith("Room_") == true)
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | | //设置当前楼层的ID
|
| | | Config.Instance.Home.SetCurrentFloorId();
|
| | | //顺便刷新场景
|
| | | HdlSceneLogic.Current.ReFreshByLocal();
|
| | | //刷新房间视图列表
|
| | |
| | | /// </summary>
|
| | | public void RefreshAllRoomByLocation()
|
| | | {
|
| | | var listFile = Global.FileListByHomeId();
|
| | | var listFile = HdlFileLogic.Current.GetRootPathListFile();
|
| | |
|
| | | //我的喜爱的房间必须要在第0位才行
|
| | | string fRoom = "Room_Favorite.json";
|
| | |
| | | /// <returns></returns>
|
| | | public void RemoveRoom(string roomId, bool refreshLeftView = true)
|
| | | {
|
| | | if (this.NowMainPageRoom != null && this.NowMainPageRoom.Id == roomId)
|
| | | {
|
| | | //当删除的是主页的房间的时候
|
| | | this.NowMainPageRoom = this.GetLoveRoom();
|
| | | }
|
| | | if (this.NowCategoryRoom != null && this.NowCategoryRoom.Id == roomId)
|
| | | {
|
| | | //当删除的是分类的房间的时候
|
| | | this.NowCategoryRoom = this.GetLoveRoom();
|
| | | }
|
| | |
|
| | | //根据房间Id,获取房间对象
|
| | | var room = this.GetRoomById(roomId);
|
| | | if (room == null)
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | | return listRoom;
|
| | | return this.SortRoom(listRoom);
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | |
| | | listRoom.Add(room);
|
| | | }
|
| | | return this.SortRoom(listRoom);
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 获取当前楼层的房间名称
|
| | | /// </summary>
|
| | | /// <param name="id"></param>
|
| | | /// <returns></returns>
|
| | | public List<string> GetRoomNamesByFloorId(string id)
|
| | | {
|
| | | var listName = new List<string>();
|
| | | if (Config.Instance.Home.FloorDics.Count == 0)
|
| | | {
|
| | | //没有楼层
|
| | | foreach (var room in this.dicRooms.Values)
|
| | | {
|
| | | listName.Add(room.Name);
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | foreach (var room in this.dicRooms.Values)
|
| | | {
|
| | | if (room.FloorId == id)
|
| | | {
|
| | | listName.Add(room.Name);
|
| | | }
|
| | | }
|
| | | }
|
| | | return listName;
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | | listRoom = this.SortRoom(listRoom);
|
| | |
|
| | | listRoom.Insert(0, GetLoveRoom());
|
| | | return listRoom;
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 获取当前楼层的房间(拼接了【常用】在第一位)
|
| | | /// </summary>
|
| | | /// <returns></returns>
|
| | | public List<Room> GetRoomsByCurrentFloorIdAppendLoveRoom()
|
| | | {
|
| | | return this.GetRoomsByFloorIdAppendLoveRoom(Config.Instance.Home.CurrentFloorId);
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
| | | //移除我的喜爱
|
| | | this.DeleteLoveDevice(device);
|
| | | //设备改变房间的话,主页需要重新刷新
|
| | | UserView.UserPage.Instance.RefreshForm = true;
|
| | | UserView.UserPage.Instance.RefreshAllForm = true;
|
| | | return;
|
| | | }
|
| | | //房间是否修改
|
| | |
| | | this.AddDevice(room, device, saveRealRoom);
|
| | | }
|
| | | //设备改变房间的话,主页需要重新刷新
|
| | | UserView.UserPage.Instance.RefreshForm = true;
|
| | | UserView.UserPage.Instance.RefreshAllForm = true;
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | |
| | | //保存到本地
|
| | | loveRoom.ListDevice.Add(mainkeys);
|
| | | loveRoom.Save();
|
| | | //添加收藏设备时,需要刷新主页
|
| | | UserView.UserPage.Instance.RefreshAllForm = true;
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | loveRoom.Save();
|
| | | //更改自动备份
|
| | | HdlAutoBackupLogic.AddOrEditorFile(loveRoom.FileName);
|
| | | //添加收藏设备时,需要刷新主页
|
| | | UserView.UserPage.Instance.RefreshAllForm = true;
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | /// <returns></returns>
|
| | | public Dictionary<string, string> GetFloorSortList()
|
| | | {
|
| | | //没有楼层
|
| | | if (Config.Instance.Home.FloorDics.Count == 0)
|
| | | {
|
| | | return new Dictionary<string, string>();
|
| | | }
|
| | | //从一堆文字中,获取这一堆文字里面数字字符串的最长长度
|
| | | var listName = new List<string>();
|
| | | foreach (var floorName in Config.Instance.Home.FloorDics.Values)
|
| | |
| | | {
|
| | | nowRoom.ListSceneId.Add(scene.Id);
|
| | | nowRoom.Save();
|
| | | //添加收藏场景时,需要刷新主页
|
| | | UserView.UserPage.Instance.RefreshAllForm = true;
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | HdlAutoBackupLogic.DeleteFile(sceneUI.IconPath);
|
| | | }
|
| | | }
|
| | | //删除场景时,需要刷新主页
|
| | | UserView.UserPage.Instance.RefreshAllForm = true;
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | |
| | | {
|
| | | nowRoom.ListSceneId.Remove(scene.Id);
|
| | | nowRoom.Save();
|
| | | //取消收藏场景时,需要刷新主页
|
| | | UserView.UserPage.Instance.RefreshAllForm = true;
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | public List<string> GetAllSceneFile()
|
| | | {
|
| | | List<string> listSceneFile = new List<string>();
|
| | | List<string> listAllFile = Global.FileListByHomeId();
|
| | | List<string> listAllFile = HdlFileLogic.Current.GetRootPathListFile();
|
| | |
|
| | | foreach (string file in listAllFile)
|
| | | {
|
| | |
| | | //清空楼层数据
|
| | | Common.Config.Instance.Home.FloorDics.Clear();
|
| | | //然后检测本地的文件
|
| | | var listLocalFile = Global.FileListByHomeId();
|
| | | var listLocalFile = HdlFileLogic.Current.GetRootPathListFile();
|
| | | foreach (string fileName in listLocalFile)
|
| | | {
|
| | | if (fileName == DirNameResourse.ShardFloorFile)
|
| | |
| | | public static bool InitUserCenterMenmoryAndThread(bool ShowPrompted = true)
|
| | | {
|
| | | //调用这个方法,都需要重新刷新主页
|
| | | UserView.UserPage.Instance.RefreshForm = true;
|
| | | UserView.UserPage.Instance.RefreshAllForm = true;
|
| | |
|
| | | //添加网络状态监听
|
| | | HdlWifiLogic.Current.StartListenNetWork();
|
| | |
| | | /// </summary> |
| | | public Action FloorAction = null; |
| | | /// <summary> |
| | | /// 选中的楼层回调[ |
| | | /// 选中的楼层回调 |
| | | /// </summary> |
| | | public Action<string, Button> ChooseFloorAction = null; |
| | | /// <summary> |
| | | /// 重新加载 |
| | | /// </summary> |
| | | public Action ReLoadAction = null; |
| | | |
| | | public FrameLayout topFrameLayout = new FrameLayout { Height = Application.GetRealHeight(184), BackgroundColor = ZigbeeColor.Current.XMTopFrameLayout }; |
| | | public FrameLayout midFrameLayout = new FrameLayout { Height = Application.GetRealHeight(1925 - 184), BackgroundColor = ZigbeeColor.Current.XMMidFrameLayout }; |
| | |
| | | btnTitle.Text = titleText; |
| | | } |
| | | /// <summary> |
| | | /// 门锁中部布局 |
| | | /// 中部布局 |
| | | /// </summary> |
| | | /// <param name="frameLayout"></param> |
| | | public void MidFrameLayout(FrameLayout frameLayout) |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 门锁底部布局 |
| | | /// 底部布局 |
| | | /// </summary> |
| | | /// <param name="frameLayout"></param> |
| | | public void BottomFrameLayout(FrameLayout frameLayout) |
| | |
| | | BackgroundColor = ZigbeeColor.Current.XMWhite, |
| | | }; |
| | | this.midFrameLayout.AddChidren(bottomFrameLayout1); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 显示重新加载的界面(主要是用在界面加载错误时,再次加载) |
| | | /// </summary> |
| | | public void ShowReLoadView() |
| | | { |
| | | var frame = new FrameLayout(); |
| | | frame.BackgroundColor = UserCenterColor.Current.White; |
| | | frame.Tag = "ReLoadView"; |
| | | this.midFrameLayout.AddChidren(frame); |
| | | |
| | | //重新加载 |
| | | var btnReLoad = new BottomClickButton(); |
| | | btnReLoad.Gravity = Gravity.Center; |
| | | btnReLoad.TextID = R.MyInternationalizationString.uDoReload; |
| | | frame.AddChidren(btnReLoad); |
| | | btnReLoad.ButtonClickEvent += (sender, e) => |
| | | { |
| | | ReLoadAction?.Invoke(); |
| | | ReLoadAction = null; |
| | | }; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | btnFloorText = new Button |
| | | { |
| | | Width = Application.GetRealWidth(300 - 69 - 58), |
| | | Text = Language.StringByID(R.MyInternationalizationString.FirstFloor), |
| | | TextColor = Shared.Common.ZigbeeColor.Current.XMBlack, |
| | | TextSize = 14, |
| | | IsBold = true, |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取楼层对应的房间列表 |
| | | /// 获取支持的房间列表 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public static List<Room> GetFloorRoomList() |
| | | public static List<Room> GetSupportRoomList() |
| | | { |
| | | var supportRoomListTemp = new List<Room>(); |
| | | var listAllRoom = HdlRoomLogic.Current.GetAllListRooms(); |
| | |
| | | var device = LocalDevice.Current.GetDevice(de); |
| | | if (device != null) |
| | | { |
| | | //获取设备类型的 |
| | | var deviceEnumInfo = Common.LocalDevice.Current.GetMyDeviceEnumInfo(new List<CommonDevice>() { device }); |
| | | //新风面板的新风设备,则不显示 |
| | | if (deviceEnumInfo.ConcreteType == Common.DeviceConcreteType.ButtonPanel_FangyueFreshAir) |
| | | if (BindInfo.checkRealFreshAirDevice(device) == false) |
| | | { |
| | | continue; |
| | | } |
| | |
| | | { |
| | | bool result = true; |
| | | //获取设备类型的 |
| | | var clu = device.OutClusterList.Find((obj) => obj.OutCluster == 513); |
| | | var clu = device.OutClusterList.Find((obj) => obj.OutCluster == 513 || obj.OutCluster == 514); |
| | | if (clu != null) |
| | | { |
| | | result = false; |
| | |
| | | } |
| | | } |
| | | }
|
| | | else |
| | | { |
| | | btnFloorRoomNameText = Language.StringByID(R.MyInternationalizationString.Undistributed); |
| | | } |
| | |
|
| | | devicePic.UnSelectedImagePath = tempDev.IconPath;
|
| | | devicePic.Text = ""; |
| | |
| | | foreach (var bDev in bList) |
| | | { |
| | | var device = LocalDevice.Current.GetDevice(bDev.BindMacAddr, bDev.BindEpoint); |
| | | if (device == null) |
| | | { |
| | | continue; |
| | | } |
| | | switch (curBindType) |
| | | { |
| | | case 0: |
| | |
| | | //空调绑定类型 |
| | | if (device.Type == DeviceType.Thermostat && bDev.BindCluster == 513) |
| | | { |
| | | //Thermostat是空调 |
| | | tempList.Add(bDev); |
| | | } |
| | | } |
| | |
| | | foreach (var bDev in bList) |
| | | { |
| | | var device = LocalDevice.Current.GetDevice(bDev.BindMacAddr, bDev.BindEpoint); |
| | | if (device == null) |
| | | { |
| | | continue; |
| | | } |
| | | switch (curBindType) |
| | | { |
| | | case 0: |
| | |
| | | //空调绑定类型 |
| | | if (device.Type == DeviceType.Thermostat && bDev.BindCluster == 513) |
| | | { |
| | | //Thermostat是空调 |
| | | tempList.Remove(bDev.KeyEpoint); |
| | | } |
| | | } |
| | |
| | | roomIncludeMatchDevice.Add(device); |
| | | } |
| | | } |
| | | if (device.Type == DeviceType.DimmableLight) |
| | | { |
| | | roomIncludeMatchDevice.Add(device); |
| | | } |
| | | //if (device.Type == DeviceType.DimmableLight) |
| | | //{ |
| | | // roomIncludeMatchDevice.Add(device); |
| | | //} |
| | | break; |
| | | case 4: |
| | | if (device.Type == DeviceType.WindowCoveringDevice) |
| | |
| | | case 5: |
| | | if (device.Type == DeviceType.Thermostat) |
| | | { |
| | | //Thermostat是空调 |
| | | if (BindInfo.checkRealAcDevice(device) == false) |
| | | { |
| | | continue; |
| | | } |
| | | roomIncludeMatchDevice.Add(device); |
| | | } |
| | | break; |
| | |
| | | { |
| | | currentPanelBindSupportDeviceListTemp.Add(device); |
| | | } |
| | | if (device.Type == DeviceType.DimmableLight) |
| | | { |
| | | currentPanelBindSupportDeviceListTemp.Add(device); |
| | | } |
| | | //if (device.Type == DeviceType.DimmableLight) |
| | | //{ |
| | | // currentPanelBindSupportDeviceListTemp.Add(device); |
| | | //} |
| | | break; |
| | | case 4: |
| | | if (device.Type == DeviceType.WindowCoveringDevice) |
| | |
| | | case 5: |
| | | if (device.Type == DeviceType.Thermostat) |
| | | { |
| | | //Thermostat是空调 |
| | | if (BindInfo.checkRealAcDevice(device) == false) |
| | | { |
| | | continue; |
| | | } |
| | | currentPanelBindSupportDeviceListTemp.Add(device); |
| | | } |
| | | break; |
| | |
| | | undistruibuteDevList.Add(device); |
| | | } |
| | | } |
| | | if (device.Type == DeviceType.DimmableLight) |
| | | { |
| | | undistruibuteDevList.Add(device); |
| | | } |
| | | break; |
| | | case 4: |
| | | if (device.Type == DeviceType.WindowCoveringDevice) |
| | |
| | | case 5: |
| | | if (device.Type == DeviceType.Thermostat) |
| | | { |
| | | //Thermostat是空调 |
| | | if (BindInfo.checkRealAcDevice(device) == false) |
| | | { |
| | | continue; |
| | | } |
| | | undistruibuteDevList.Add(device); |
| | | } |
| | | break; |
| | |
| | | curRoomDeviceListTemp.Add(device); |
| | | } |
| | | } |
| | | if (device.Type == DeviceType.DimmableLight) |
| | | { |
| | | if (deviceEnumInfo.ConcreteType != Common.DeviceConcreteType.ButtonPanel_SimpleMultifunction) |
| | | { |
| | | //Thermostat是空调 |
| | | curRoomDeviceListTemp.Add(device); |
| | | } |
| | | } |
| | | break; |
| | | case 4: |
| | | if (device.Type == DeviceType.WindowCoveringDevice) |
| | | { |
| | | if (deviceEnumInfo.ConcreteType != Common.DeviceConcreteType.ButtonPanel_SimpleMultifunction) |
| | | { |
| | | //Thermostat是空调 |
| | | curRoomDeviceListTemp.Add(device); |
| | | } |
| | | } |
| | |
| | | case 5: |
| | | if (device.Type == DeviceType.Thermostat) |
| | | { |
| | | if (deviceEnumInfo.ConcreteType != Common.DeviceConcreteType.ButtonPanel_SimpleMultifunction) |
| | | if (BindInfo.checkRealAcDevice(device) == false) |
| | | { |
| | | //Thermostat是空调 |
| | | curRoomDeviceListTemp.Add(device); |
| | | continue; |
| | | } |
| | | curRoomDeviceListTemp.Add(device); |
| | | } |
| | | break; |
| | | case 6: |
| | |
| | | /// <summary> |
| | | /// 楼层列表 |
| | | /// </summary> |
| | | Dictionary<string, string> dicFloorList; |
| | | Dictionary<string, string> dicFloorList = new Dictionary<string, string> { }; |
| | | /// <summary> |
| | | /// 所有房间中支持被绑定的设备列表 |
| | | /// </summary> |
| | |
| | | /// Ac绑定目标回调 |
| | | /// </summary> |
| | | public Action<string> actionAcTarget = null; |
| | | |
| | | /// <summary> |
| | | /// 是否能刷新 |
| | | /// </summary> |
| | | private bool canFresh = false; |
| | | #endregion |
| | | |
| | | #region UI设计 |
| | |
| | | //标题栏下的UI |
| | | MidFrameLayoutContent(); |
| | | //初始化设备数据 |
| | | CommonPage.Loading.Start(""); |
| | | InitData(); |
| | | } |
| | | |
| | |
| | | /// <summary> |
| | | /// 中部UI【标题栏下的UI】 |
| | | /// </summary> |
| | | async void MidFrameLayoutContent() |
| | | void MidFrameLayoutContent() |
| | | { |
| | | var btnMidTopLayout = new FrameLayout |
| | | { |
| | |
| | | this.midFrameLayout.AddChidren(midVerticalScrolViewLayout); |
| | | midVerticalScrolViewLayout.BeginHeaderRefreshingAction += () => |
| | | { |
| | | canFresh = true; |
| | | midVerticalScrolViewLayout.BeginHeaderRefreshing(); |
| | | InitData(); |
| | | }; |
| | |
| | | }; |
| | | this.midFrameLayout.AddChidren(bottomFrameLayout); |
| | | |
| | | var bottomTipPicFrameLayout = new FrameLayout() |
| | | { |
| | | Height = Application.GetMinReal(40 + 44 - 10), |
| | | }; |
| | | bottomFrameLayout.AddChidren(bottomTipPicFrameLayout); |
| | | |
| | | var btnTipPicFrameLayout = new FrameLayout() |
| | | { |
| | | Width = Application.GetMinReal(40 + 23 + 37), |
| | | Width = Application.GetMinReal(23 + 37), |
| | | Height = Application.GetMinReal(40 + 44 - 10), |
| | | X = Application.GetMinReal(383 - 37), |
| | | }; |
| | | bottomFrameLayout.AddChidren(btnTipPicFrameLayout); |
| | | bottomTipPicFrameLayout.AddChidren(btnTipPicFrameLayout); |
| | | |
| | | btnTipPic = new Button() |
| | | { |
| | | Width = Application.GetMinReal(40), |
| | | Height = Application.GetMinReal(40), |
| | | X = Application.GetMinReal(40), |
| | | Y = Application.GetRealHeight(22), |
| | | Y = Application.GetRealHeight(19), |
| | | UnSelectedImagePath = "BindPic/EmptyTargets.png", |
| | | SelectedImagePath = "BindPic/EmptyTargetsSelected.png", |
| | | }; |
| | |
| | | btnTipText = new Button() |
| | | { |
| | | Height = Application.GetRealHeight(84 - 10), |
| | | X = Application.GetMinReal(444), |
| | | X = Application.GetMinReal(58), |
| | | Width = Application.GetMinReal(1080 - 446), |
| | | TextID = R.MyInternationalizationString.BindEmptyTargets, |
| | | TextColor = Shared.Common.ZigbeeColor.Current.XMGray3,//XMTopTitleText |
| | | TextColor = Shared.Common.ZigbeeColor.Current.XMGray3, |
| | | TextSize = 12, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | }; |
| | | bottomFrameLayout.AddChidren(btnTipText); |
| | | bottomTipPicFrameLayout.AddChidren(btnTipText); |
| | | bottomTipPicFrameLayout.Width = btnTipPicFrameLayout.Width + Application.GetMinReal(2) + btnTipText.GetTextWidth(); |
| | | bottomTipPicFrameLayout.Gravity = Gravity.CenterHorizontal; |
| | | |
| | | EventHandler<MouseEventArgs> eHandlerEmptyTargets = (sender, e) => |
| | | { |
| | |
| | | void RefreshRoomList() |
| | | { |
| | | Room curRoom = null; |
| | | if (supportRoomList.Count == 0) |
| | | { |
| | | return; |
| | | } |
| | | btnHorizontalScrolViewLayout.RemoveAll(); |
| | | Button curentOldRoom = null; |
| | | FrameLayout curentOldRoomFrameLayout = null; |
| | | int index = 0; |
| | | var roomTempList = BindInfo.GetSupportRoomList(curControlDev, supportRoomList, curDeviceBindType); |
| | | Room slectedRoom = null; |
| | | |
| | | var roomUn = new Room(); |
| | | roomUn.Name = Language.StringByID(R.MyInternationalizationString.Undistributed); |
| | | roomUn.Id = "UndistributedId"; |
| | | List<Room> roomTempList = new List<Room> { }; |
| | | if (supportRoomList.Count != 0) |
| | | { |
| | | roomTempList = BindInfo.GetSupportRoomList(curControlDev, supportRoomList, curDeviceBindType); |
| | | } |
| | | if (undistruibuteDevList.Count != 0) |
| | | { |
| | | roomTempList.Add(roomUn); |
| | |
| | | var btn = (Button)frame.GetChildren(0); |
| | | frame.BackgroundImagePath = "Item/RoomIconBackgroundSelected.png"; |
| | | btn.TextColor = Shared.Common.ZigbeeColor.Current.XMWhite; |
| | | curentOldRoom = btn; |
| | | curentOldRoomFrameLayout = frame; |
| | | } |
| | | else |
| | | { |
| | |
| | | midVerticalScrolViewLayout.RemoveAll(); |
| | | Button oldDevice = null; |
| | | int curIndex = 0; |
| | | |
| | | if (curRoom.Id == "UndistributedId") |
| | | { |
| | | currentRoomSupportBindDeviceList = BindInfo.GetUndistributeDeviceList(undistruibuteDevList, curDeviceBindType); |
| | |
| | | btnChoose.MouseUpEventHandler += hander; |
| | | curIndex++; |
| | | } |
| | | |
| | | //首次是否能点击保存 |
| | | if (targetList.Count == 0) |
| | | { |
| | | if (targetListTemp.Count == 0) |
| | | { |
| | | btnFinifh.Enable = false; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect; |
| | | } |
| | | else |
| | | { |
| | | btnFinifh.Enable = true; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | btnFinifh.Enable = true; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | |
| | | /// <summary> |
| | | /// 初始化设备数据 |
| | | /// </summary> |
| | | void InitData() |
| | | void InitData(bool canUpdateBindName = false) |
| | | { |
| | | System.Threading.Tasks.Task.Run(async () => |
| | | { |
| | | try |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | CommonPage.Loading.Start(""); |
| | | }); |
| | | //获取被绑目标等信息 |
| | | BindDevInfo(curBindDevice); |
| | | |
| | | //获取楼层 |
| | | //获取楼层 |
| | | dicFloorList = HdlRoomLogic.Current.GetFloorSortList(); |
| | | //获取楼层中房间列表 |
| | | supportRoomList = BindInfo.GetFloorRoomList(); |
| | | //获取房间列表 |
| | | supportRoomList = BindInfo.GetSupportRoomList(); |
| | | |
| | | //获取所有房间中匹配的能绑的目标 |
| | | currentPanelSupportBindDeviceList = BindInfo.GetAllRoomSupportDeviceList(currentPanelSupportBindDeviceList, supportRoomList, curDeviceBindType); |
| | |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | CommonPage.Loading.Hide(); |
| | | canFresh = false; |
| | | midVerticalScrolViewLayout.EndHeaderRefreshing(); |
| | | CommonPage.Loading.Hide(); |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(Common.CommonPage.Instance); |
| | | |
| | | this.midFrameLayout.RemoveAll(); |
| | | |
| | | ShowReLoadView(); |
| | | ReLoadAction += () => |
| | | { |
| | | this.midFrameLayout.RemoveAll(); |
| | | //初始化设备数据 |
| | | CommonPage.Loading.Start(""); |
| | | MidFrameLayoutContent(); |
| | | InitData(true); |
| | | }; |
| | | |
| | | }); |
| | | } |
| | | |
| | | targetList.Clear(); |
| | | oldTargetList.Clear(); |
| | | //选中目标列表 targetList |
| | | if (curControlDev.bindList.Count != 0) |
| | | { |
| | |
| | | var mainKey = bindDev.BindMacAddr + bindDev.BindEpoint; |
| | | |
| | | //分配的目标列表 |
| | | if (currentPanelSupportBindDeviceList.Count != 0) |
| | | if (Shared.Common.LocalDevice.Current.listAllDevice.Count != 0) |
| | | { |
| | | var dev = currentPanelSupportBindDeviceList.Find(obj => (obj != null) && (obj.DeviceAddr + obj.DeviceEpoint == mainKey)); |
| | | if (dev != null) |
| | |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | BindDownFrameLayout(this.midFrameLayout, curControlDev, dicFloorList, ref btnFloorText); |
| | | //楼层侧边栏绑定 |
| | | if (!canFresh) |
| | | { |
| | | BindDownFrameLayout(this.midFrameLayout, curControlDev, dicFloorList, ref btnFloorText); |
| | | } |
| | | ChooseFloorAction += (floorId, btnMethodText) => |
| | | { |
| | | btnFloorText.Text = string.Empty; |
| | | btnFloorText.Text = dicFloorList[floorId]; |
| | | //获取楼层中房间列表 |
| | | supportRoomList = BindInfo.GetFloorRoomList(); |
| | | //获取房间列表 |
| | | supportRoomList = BindInfo.GetSupportRoomList(); |
| | | //获取本地未分配的支持当前类型的绑定设备列表 |
| | | undistruibuteDevList = BindInfo.GetUndistributeDeviceList(undistruibuteDevList, curDeviceBindType); |
| | | RefreshRoomList(); |
| | | }; |
| | | |
| | | //默认楼层显示 |
| | | if (BindInfo.GetCurrentSelectFloorIdName() != null) |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | btnFloorText.Text = BindInfo.GetCurrentSelectFloorIdName(); |
| | | }); |
| | | } |
| | | |
| | | //首次是否能点击保存 |
| | | if (targetList.Count == 0) |
| | | { |
| | | curControlDev.currentSelectFloorId = BindInfo.GetCurrentSelectFloorId(); |
| | | curControlDev.currentSelectRoomId = null; |
| | | if (BindInfo.GetCurrentSelectFloorIdName() != null) |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | btnFloorText.Text = BindInfo.GetCurrentSelectFloorIdName(); |
| | | }); |
| | | } |
| | | btnFinifh.Enable = false; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect; |
| | | |
| | | //更新外面目标名字:无 |
| | | if (canUpdateBindName) |
| | | { |
| | | TargesBindName(); |
| | | } |
| | | } |
| | | else |
| | | { |
| | |
| | | curControlDev.currentSelectRoomId = "UndistributedId";
|
| | | } |
| | | } |
| | | |
| | | if (canUpdateBindName) |
| | | { |
| | | //更新外面目标名字:具体名字【刷新本地界面会导致外部目标变化】 |
| | | string bindName = Common.LocalDevice.Current.GetDeviceEpointName(dev); |
| | | switch (curDeviceBindType) |
| | | { |
| | | case BindInfo.BindType.Temperature: |
| | | if (dev.Type == DeviceType.PMSensor) |
| | | { |
| | | bindName += "-" + Language.StringByID(R.MyInternationalizationString.TemperatureSensor); |
| | | } |
| | | break; |
| | | case BindInfo.BindType.Humidity: |
| | | if (dev.Type == DeviceType.PMSensor) |
| | | { |
| | | bindName += "-" + Language.StringByID(R.MyInternationalizationString.HumiditySensor); |
| | | } |
| | | break; |
| | | } |
| | | TargesBindName(bindName); |
| | | } |
| | | } |
| | | if (!string.IsNullOrEmpty(curControlDev.currentSelectFloorId)) |
| | | { |
| | |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | } |
| | | |
| | | |
| | | //获取楼层中房间列表 |
| | | if (supportRoomList.Count != 0) |
| | | { |
| | | RefreshRoomList(); |
| | | } |
| | | |
| | | CommonPage.Loading.Hide(); |
| | | RefreshRoomList(); |
| | | canFresh = false; |
| | | midVerticalScrolViewLayout.EndHeaderRefreshing(); |
| | | CommonPage.Loading.Hide(); |
| | | }); |
| | | } |
| | | }); |
| | |
| | | try |
| | | { |
| | | Application.RunOnMainThread(() => { CommonPage.Loading.Start(""); }); |
| | | |
| | | if (oldTargetList.Count != 0) |
| | | if (btnTipPic.IsSelected) |
| | | { |
| | | //删除取消的目标 |
| | | foreach (var bd in oldTargetList) |
| | | //删除情况1:绑定空目标必须取消按键中已经存在的目标 |
| | | if (oldTargetList.Count != 0) |
| | | { |
| | | var delDevice = new DelDeviceBindData(); |
| | | delDevice.DeviceAddr = curControlDev.DeviceAddr; |
| | | delDevice.Epoint = curControlDev.DeviceEpoint; |
| | | //删除按键中已经绑定的目标个数【删除成功个数】 |
| | | int sOldTargetListCount = 0; |
| | | |
| | | var removeDevice = new RemoveBindListObj(); |
| | | removeDevice.BindType = 0; |
| | | switch (curDeviceBindType) |
| | | foreach (var bd in oldTargetList) |
| | | { |
| | | case BindInfo.BindType.FreshAir: |
| | | removeDevice.BindCluster = 514; |
| | | break; |
| | | case BindInfo.BindType.Temperature: |
| | | removeDevice.BindCluster = 1026; |
| | | break; |
| | | case BindInfo.BindType.Humidity: |
| | | removeDevice.BindCluster = 1029; |
| | | break; |
| | | case BindInfo.BindType.PM: |
| | | removeDevice.BindCluster = 1066; |
| | | break; |
| | | case BindInfo.BindType.AC: |
| | | removeDevice.BindCluster = 513;//Ac需要绑定2个簇513和514 |
| | | break; |
| | | } |
| | | removeDevice.BindMacAddr = bd.DeviceAddr; |
| | | removeDevice.BindEpoint = bd.DeviceEpoint; |
| | | delDevice.RemoveBindList.Add(removeDevice); |
| | | var delDevice = DelBindDevice(bd); |
| | | |
| | | if (curDeviceBindType == BindInfo.BindType.AC) |
| | | { |
| | | //要移除空调:需要移除513,514 |
| | | var removeDevice3 = new RemoveBindListObj(); |
| | | removeDevice3.BindCluster = 514; |
| | | removeDevice3.BindType = 0; |
| | | removeDevice3.BindMacAddr = bd.DeviceAddr; |
| | | removeDevice3.BindEpoint = bd.DeviceEpoint; |
| | | delDevice.RemoveBindList.Add(removeDevice3); |
| | | } |
| | | //此次按键中需要移除的目标个数【同一个目标携带的多个功能删除成功的个数】 |
| | | int sRemoveBindListCount = 0; |
| | | |
| | | var delResult = new DelDeviceBindResponseAllData(); |
| | | delResult = HdlDeviceBindLogic.Current.DelDeviceBindAsync(delDevice); |
| | | if (delResult == null) |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | var delResult = new DelDeviceBindResponseAllData(); |
| | | delResult = HdlDeviceBindLogic.Current.DelDeviceBindAsync(delDevice); |
| | | if (delResult == null) |
| | | { |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindFailed), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(CommonPage.Instance); |
| | | btnFinifh.Enable = true; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | CommonPage.Loading.Hide(); |
| | | }); |
| | | return; |
| | | } |
| | | else |
| | | { |
| | | if (delResult.removeBindResultResponseData == null) |
| | | { |
| | | if (delResult.delDeviceBindResponseData != null) |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | foreach (var d in delResult.delDeviceBindResponseData.RemoveBindList) |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindFailed), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(CommonPage.Instance); |
| | | CommonPage.Loading.Hide(); |
| | | |
| | | ShowReLoadView(); |
| | | ReLoadAction += () => |
| | | { |
| | | if (d.Result == 0 || d.Result == 1) |
| | | this.midFrameLayout.RemoveAll(); |
| | | //初始化设备数据 |
| | | CommonPage.Loading.Start(""); |
| | | MidFrameLayoutContent(); |
| | | InitData(true); |
| | | }; |
| | | }); |
| | | return; |
| | | } |
| | | else |
| | | { |
| | | if (delResult.removeBindResultResponseData == null) |
| | | { |
| | | if (delResult.delDeviceBindResponseData != null) |
| | | { |
| | | foreach (var d in delResult.delDeviceBindResponseData.RemoveBindList) |
| | | { |
| | | EmptyTargesMess(); |
| | | if (d.Result == 0 || d.Result == 1) |
| | | { |
| | | sRemoveBindListCount++; |
| | | if (sRemoveBindListCount == delDevice.RemoveBindList.Count) |
| | | { |
| | | sOldTargetListCount++; |
| | | } |
| | | |
| | | //按键目标中的该类型个数都删除成功 |
| | | if (sOldTargetListCount == oldTargetList.Count) |
| | | { |
| | | TargesBindName(); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | CommonPage.Loading.Hide(); |
| | | btnFinifh.Enable = true; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | this.RemoveFromParent(); |
| | | }); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindFailed), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(CommonPage.Instance); |
| | | btnFinifh.Enable = true; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | CommonPage.Loading.Hide(); |
| | | }); |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (delResult.removeBindResultResponseData.Result == 0) |
| | | { |
| | | sOldTargetListCount++; |
| | | //按键目标中的该类型个数都删除成功 |
| | | if (sOldTargetListCount == oldTargetList.Count) |
| | | { |
| | | TargesBindName(); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | CommonPage.Loading.Hide(); |
| | |
| | | this.RemoveFromParent(); |
| | | }); |
| | | } |
| | | else |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindFailed), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(CommonPage.Instance); |
| | | btnFinifh.Enable = true; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | CommonPage.Loading.Hide(); |
| | | }); |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (delResult.removeBindResultResponseData.Result == 0) |
| | | { |
| | | EmptyTargesMess(); |
| | | Application.RunOnMainThread(() => |
| | | else |
| | | { |
| | | CommonPage.Loading.Hide(); |
| | | btnFinifh.Enable = true; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | this.RemoveFromParent(); |
| | | }); |
| | | |
| | | } |
| | | else |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindFailed), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(CommonPage.Instance); |
| | | btnFinifh.Enable = true; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | CommonPage.Loading.Hide(); |
| | | }); |
| | | return; |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindFailed), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(CommonPage.Instance); |
| | | btnFinifh.Enable = true; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | CommonPage.Loading.Hide(); |
| | | }); |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (btnTipPic.IsSelected) |
| | | else |
| | | { |
| | | EmptyTargesMess(); |
| | | //按键中没有目标直接绑定空目标 |
| | | TargesBindName(); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | CommonPage.Loading.Hide(); |
| | |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | this.RemoveFromParent(); |
| | | }); |
| | | } |
| | | else |
| | | { |
| | | //没有目标提示 |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | var myTip = new Tip(); |
| | | myTip.Direction = AMPopTipDirection.None; |
| | | myTip.CloseTime = 2; |
| | | myTip.Text = Language.StringByID(R.MyInternationalizationString.BindDeviceTargetIsEmpty); |
| | | myTip.Show(Common.CommonPage.Instance); |
| | | btnFinifh.Enable = true; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | CommonPage.Loading.Hide(); |
| | | }); |
| | | return; |
| | | } |
| | | } |
| | | } |
| | |
| | | CommonPage.Loading.Hide(); |
| | | }); |
| | | btnFinifh.Enable = true; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | |
| | | } |
| | | }); |
| | | } |
| | |
| | | { |
| | | Application.RunOnMainThread(() => { CommonPage.Loading.Start(""); }); |
| | | |
| | | //删除已经存在的目标 |
| | | //删除情况2:按键之前已经存在的目标 |
| | | if (oldTargetList.Count != 0) |
| | | { |
| | | //删除按键中已经绑定的目标个数【删除成功个数】 |
| | | int sOldTargetListCount = 0; |
| | | |
| | | foreach (var bd in oldTargetList) |
| | | { |
| | | //此次按键中需要移除的目标个数【同一个目标携带的多个功能删除成功的个数】 |
| | | int sRemoveBindListCount = 0; |
| | | |
| | | var delDevice = DelBindDevice(bd); |
| | | var delResult = new DelDeviceBindResponseAllData(); |
| | | delResult = HdlDeviceBindLogic.Current.DelDeviceBindAsync(delDevice); |
| | |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindFailed), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(CommonPage.Instance); |
| | | btnFinifh.Enable = true; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | CommonPage.Loading.Hide(); |
| | | |
| | | ShowReLoadView(); |
| | | ReLoadAction += () => |
| | | { |
| | | this.midFrameLayout.RemoveAll(); |
| | | //初始化设备数据 |
| | | CommonPage.Loading.Start(""); |
| | | MidFrameLayoutContent(); |
| | | InitData(true); |
| | | }; |
| | | }); |
| | | return; |
| | | } |
| | |
| | | }); |
| | | return; |
| | | } |
| | | |
| | | sRemoveBindListCount++; |
| | | if (sRemoveBindListCount == delDevice.RemoveBindList.Count) |
| | | { |
| | | sOldTargetListCount++; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | if (delResult != null && delResult.removeBindResultResponseData != null) |
| | | { |
| | | if (delResult.removeBindResultResponseData.Result != 0) |
| | | else |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | if (delResult.removeBindResultResponseData.Result != 0) |
| | | { |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindFailed), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(CommonPage.Instance); |
| | | btnFinifh.Enable = true; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | CommonPage.Loading.Hide(); |
| | | }); |
| | | return; |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindFailed), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(CommonPage.Instance); |
| | | btnFinifh.Enable = true; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | CommonPage.Loading.Hide(); |
| | | }); |
| | | return; |
| | | } |
| | | sOldTargetListCount++; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | //检测已经绑定的目标是否不在本地或者没有分配到任何房间中 |
| | | //此时需要删除已经被绑定到目标,才能继续绑定新目标 |
| | | if (curBindDevice != null) |
| | | { |
| | | var delDevice = DelBindDevice(curBindDevice); |
| | | var delResult = new DelDeviceBindResponseAllData(); |
| | | delResult = HdlDeviceBindLogic.Current.DelDeviceBindAsync(delDevice); |
| | | |
| | | if (delResult == null) |
| | | if (sOldTargetListCount != oldTargetList.Count) |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindFailed), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(CommonPage.Instance); |
| | | btnFinifh.Enable = true; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | CommonPage.Loading.Hide(); |
| | | }); |
| | | return; |
| | | } |
| | | else |
| | | { |
| | | if (delResult.removeBindResultResponseData == null) |
| | | { |
| | | if (delResult.delDeviceBindResponseData != null) |
| | | { |
| | | foreach (var d in delResult.delDeviceBindResponseData.RemoveBindList) |
| | | { |
| | | if (d.Result != 0 && d.Result != 1) |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindFailed), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(CommonPage.Instance); |
| | | btnFinifh.Enable = true; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | CommonPage.Loading.Hide(); |
| | | }); |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | if (delResult != null && delResult.removeBindResultResponseData != null) |
| | | { |
| | | if (delResult.removeBindResultResponseData.Result != 0) |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindFailed), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(CommonPage.Instance); |
| | | btnFinifh.Enable = true; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | CommonPage.Loading.Hide(); |
| | | }); |
| | | return; |
| | | } |
| | | } |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindFailed), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(CommonPage.Instance); |
| | | btnFinifh.Enable = true; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | CommonPage.Loading.Hide(); |
| | | }); |
| | | return; |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | CommonPage.Loading.Hide(); |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(CommonPage.Instance); |
| | | btnFinifh.Enable = true; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | return; |
| | | |
| | | ShowReLoadView(); |
| | | ReLoadAction += () => |
| | | { |
| | | this.midFrameLayout.RemoveAll(); |
| | | //初始化设备数据 |
| | | CommonPage.Loading.Start(""); |
| | | MidFrameLayoutContent(); |
| | | InitData(true); |
| | | }; |
| | | }); |
| | | } |
| | | else |
| | |
| | | { |
| | | targetList.Clear(); |
| | | targetListTemp.Clear(); |
| | | switch (curDeviceBindType) |
| | | { |
| | | case BindInfo.BindType.FreshAir: |
| | | if (actionFreshAirTarget != null) |
| | | { |
| | | actionFreshAirTarget(addBindeDev.BindName); |
| | | } |
| | | break; |
| | | case BindInfo.BindType.Temperature: |
| | | if (actionTemperatureTarget != null) |
| | | { |
| | | actionTemperatureTarget(addBindeDev.BindName); |
| | | } |
| | | break; |
| | | case BindInfo.BindType.Humidity: |
| | | if (actionHumidityTarget != null) |
| | | { |
| | | actionHumidityTarget(addBindeDev.BindName); |
| | | } |
| | | break; |
| | | case BindInfo.BindType.PM: |
| | | if (actionPMTarget != null) |
| | | { |
| | | actionPMTarget(addBindeDev.BindName); |
| | | } |
| | | break; |
| | | case BindInfo.BindType.AC: |
| | | if (actionAcTarget != null) |
| | | { |
| | | actionAcTarget(addBindeDev.BindName); |
| | | } |
| | | break; |
| | | } |
| | | |
| | | TargesBindName(addBindeDev.BindName); |
| | | |
| | | Application.RunOnMainThread(() => |
| | | { |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 目标为空时的文本显示 |
| | | /// 目标为文本显示 |
| | | /// </summary> |
| | | void EmptyTargesMess() |
| | | void EmptyTargesMess1() |
| | | { |
| | | switch (curDeviceBindType) |
| | | { |
| | |
| | | break; |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// 目标为文本显示 |
| | | /// </summary> |
| | | void TargesBindName(string name = "") |
| | | { |
| | | switch (curDeviceBindType) |
| | | { |
| | | case BindInfo.BindType.FreshAir: |
| | | if (actionFreshAirTarget != null) |
| | | { |
| | | actionFreshAirTarget(name); |
| | | } |
| | | break; |
| | | case BindInfo.BindType.Temperature: |
| | | if (actionTemperatureTarget != null) |
| | | { |
| | | actionTemperatureTarget(name); |
| | | } |
| | | break; |
| | | case BindInfo.BindType.Humidity: |
| | | if (actionHumidityTarget != null) |
| | | { |
| | | actionHumidityTarget(name); |
| | | } |
| | | break; |
| | | case BindInfo.BindType.PM: |
| | | if (actionPMTarget != null) |
| | | { |
| | | actionPMTarget(name); |
| | | } |
| | | break; |
| | | case BindInfo.BindType.AC: |
| | | if (actionAcTarget != null) |
| | | { |
| | | actionAcTarget(name); |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 绑定目标列表 |
| | |
| | | { |
| | | if (device.Type == DeviceType.FreshAir) |
| | | { |
| | | targetList.Add(device); |
| | | oldTargetList.Add(device); |
| | | } |
| | | } |
| | |
| | | var bDev = device as TemperatureSensor; |
| | | if (bDev.SensorDiv == 1) |
| | | { |
| | | targetList.Add(device); |
| | | oldTargetList.Add(device); |
| | | } |
| | | } |
| | |
| | | { |
| | | if (bindDev.BindCluster == 1026) |
| | | { |
| | | targetList.Add(device); |
| | | oldTargetList.Add(device); |
| | | } |
| | | } |
| | |
| | | var bDev = device as TemperatureSensor; |
| | | if (bDev.SensorDiv == 2) |
| | | { |
| | | targetList.Add(device); |
| | | oldTargetList.Add(device); |
| | | } |
| | | } |
| | | if (device.Type == DeviceType.FreshAirHumiditySensor) |
| | | { |
| | | targetList.Add(device); |
| | | oldTargetList.Add(device); |
| | | } |
| | | if (device.Type == DeviceType.PMSensor) |
| | | { |
| | | if (bindDev.BindCluster == 1029) |
| | | { |
| | | targetList.Add(device); |
| | | oldTargetList.Add(device); |
| | | } |
| | | } |
| | |
| | | { |
| | | if (bindDev.BindCluster == 1066) |
| | | { |
| | | targetList.Add(device); |
| | | oldTargetList.Add(device); |
| | | } |
| | | } |
| | |
| | | { |
| | | if (bindDev.BindCluster == 513) |
| | | { |
| | | targetList.Add(device); |
| | | oldTargetList.Add(device); |
| | | } |
| | | } |
| | | break; |
| | | } |
| | | |
| | | targetList.Clear(); |
| | | if (oldTargetList.Count != 0) |
| | | { |
| | | targetList.Add(oldTargetList[0]); |
| | | } |
| | | |
| | | targetListTemp.Clear(); |
| | | foreach (var d in targetList) |
| | | { |
| | |
| | | removeDevice.BindCluster = 1066; |
| | | break; |
| | | case BindInfo.BindType.AC: |
| | | removeDevice.BindCluster = 513; |
| | | removeDevice.BindCluster = 513;//Ac需要绑定2个簇513和514 |
| | | break; |
| | | } |
| | | removeDevice.BindMacAddr = bd.DeviceAddr; |
| | | removeDevice.BindEpoint = bd.DeviceEpoint; |
| | | delDevice.RemoveBindList.Add(removeDevice); |
| | | |
| | | if (curDeviceBindType == BindInfo.BindType.AC) |
| | | { |
| | | //要移除空调:需要移除513,514 |
| | | var removeDevice3 = new RemoveBindListObj(); |
| | | removeDevice3.BindCluster = 514; |
| | | removeDevice3.BindType = 0; |
| | | removeDevice3.BindMacAddr = bd.DeviceAddr; |
| | | removeDevice3.BindEpoint = bd.DeviceEpoint; |
| | | delDevice.RemoveBindList.Add(removeDevice3); |
| | | } |
| | | return delDevice; |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region 移除方法 |
| | |
| | | }
|
| | |
|
| | | //添加新设备的话,主页需要重新刷新
|
| | | UserView.UserPage.Instance.RefreshForm = true;
|
| | | UserView.UserPage.Instance.RefreshAllForm = true;
|
| | |
|
| | | //设置标题信息
|
| | | base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uAddDevice));
|
| | |
| | | listView.BeginHeaderRefreshingAction += () =>
|
| | | {
|
| | | //刷新设备的话,主页需要重新刷新
|
| | | UserView.UserPage.Instance.RefreshForm = true;
|
| | | UserView.UserPage.Instance.RefreshAllForm = true;
|
| | |
|
| | | HdlThreadLogic.Current.RunThread(() =>
|
| | | {
|
| | |
| | | {
|
| | | //简约面板随便一个回路来获取设备信息
|
| | | var dev = Common.LocalDevice.Current.GetDevice(deviceMac, 62);
|
| | | var key = new ZigBee.Device.Panel();
|
| | | key.DeviceAddr = deviceMac;
|
| | | key.CurrentGateWayId = dev.CurrentGateWayId;
|
| | | InitBindInfo(key);
|
| | | if (dev != null)
|
| | | {
|
| | | var key = new ZigBee.Device.Panel();
|
| | | key.DeviceAddr = deviceMac;
|
| | | key.CurrentGateWayId = dev.CurrentGateWayId;
|
| | | InitBindInfo(key);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | private void AddPirSensorWorkModeRow()
|
| | | {
|
| | | if (this.deviceEnumInfo.ConcreteType != DeviceConcreteType.Sensor_Pir
|
| | | || deviceEnumInfo.IsHdlDevice == false)
|
| | | || deviceEnumInfo.IsHdlDevice == false
|
| | | || this.listNewDevice.Count != 2)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
| | | /// </summary>
|
| | | private void AddPirSensorBindRow()
|
| | | {
|
| | | if (this.deviceEnumInfo.ConcreteType != DeviceConcreteType.Sensor_Pir)
|
| | | if (this.deviceEnumInfo.ConcreteType != DeviceConcreteType.Sensor_Pir
|
| | | || this.listNewDevice.Count != 2)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
| | | foreach (var bDev in bindList)
|
| | | {
|
| | | var device = Common.LocalDevice.Current.GetDevice(bDev.BindMacAddr, bDev.BindEpoint);
|
| | | if (device == null)
|
| | | {
|
| | | continue;
|
| | | }
|
| | | if (device.Type == DeviceType.TemperatureSensor)
|
| | | {
|
| | | var bD = device as TemperatureSensor;
|
| | |
| | | //检测此回路是否拥有定位功能(拿端点最小的那个回路去定位)
|
| | | bool canTest = Common.LocalDevice.Current.DeviceIsCanFixedPosition(listNewDevice[0]);
|
| | |
|
| | | var frame = new TopRightMenuControl(canTest == true ? 2 : 1, 1);
|
| | | TopRightMenuControl frame = null;
|
| | |
|
| | | if (deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_SimpleMultifunction)
|
| | | {
|
| | | frame = new TopRightMenuControl(3, 1);
|
| | | }
|
| | | else
|
| | | {
|
| | | frame = new TopRightMenuControl(canTest == true ? 2 : 1, 1);
|
| | | }
|
| | |
|
| | | string deviceMenu = string.Empty;
|
| | | if (canTest == true)
|
| | | {
|
| | |
| | | });
|
| | | });
|
| | |
|
| | | //同步
|
| | | deviceMenu = Language.StringByID(R.MyInternationalizationString.Synchronization);
|
| | | if (Common.LocalDevice.Current.DeviceIsCanFixedPosition(listNewDevice[0]))
|
| | | {
|
| | | frame.AddRowMenu(deviceMenu, "", "Item/SynchronizationSelected.png", () =>
|
| | | {
|
| | | //如果当前住宅是虚拟住宅,此功能无效
|
| | | if (Common.Config.Instance.Home.IsVirtually == true)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | //同步指定设备
|
| | | this.SynchronizationDevice();
|
| | | });
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | |
| | | });
|
| | | });
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 同步指定设备
|
| | | /// </summary>
|
| | | private void SynchronizationDevice()
|
| | | {
|
| | | HdlThreadLogic.Current.RunThread(async () =>
|
| | | {
|
| | | //打开进度条
|
| | | this.ShowProgressBar();
|
| | |
|
| | | //同步设备
|
| | | bool result = await Common.LocalDevice.Current.SynchronizationDevice(listNewDevice);
|
| | | //关闭进度条
|
| | | this.CloseProgressBar();
|
| | | if (result == false)
|
| | | {
|
| | | return;
|
| | | }
|
| | | });
|
| | | }
|
| | | #endregion
|
| | |
|
| | | #region ■ 关闭界面___________________________
|
| | |
| | | foreach (var bDev in bindList) |
| | | { |
| | | var device = Common.LocalDevice.Current.GetDevice(bDev.BindMacAddr, bDev.BindEpoint); |
| | | |
| | | if (device == null) |
| | | { |
| | | continue; |
| | | } |
| | | if (device.Type == DeviceType.FreshAir) |
| | | { |
| | | //获取设备类型的 |
| | |
| | | foreach (var bDev in bindList) |
| | | { |
| | | var device = Common.LocalDevice.Current.GetDevice(bDev.BindMacAddr, bDev.BindEpoint); |
| | | |
| | | if (device == null) |
| | | { |
| | | continue; |
| | | } |
| | | if (device.Type == DeviceType.FreshAir) |
| | | { |
| | | //获取设备类型的 |
| | |
| | | } |
| | | |
| | | bindAcDev = device; |
| | | } |
| | | else if (device.Type == DeviceType.PMSensor) |
| | | { |
| | | if (bDev.BindCluster == 1026) |
| | | { |
| | | bindTemperatureName = Common.LocalDevice.Current.GetDeviceEpointName(device) + "-" + Language.StringByID(R.MyInternationalizationString.TemperatureSensor); |
| | | bindTemperatureDev = device; |
| | | } |
| | | if (bDev.BindCluster == 1029) |
| | | { |
| | | bindHumidityName = Common.LocalDevice.Current.GetDeviceEpointName(device) + "-" + Language.StringByID(R.MyInternationalizationString.HumiditySensor); |
| | | bindHumidityDev = device; |
| | | } |
| | | } |
| | | } |
| | | count++; |
| | |
| | | var btnHumidityStatu = rowHumidity.AddMostRightView(msg, 700); |
| | | rowHumidity.ButtonClickEvent += (sender, e) => |
| | | { |
| | | this.deviceObj.DeviceEpoint = 2; |
| | | this.deviceObj.DeviceEpoint = 1; |
| | | var paneTargetsBaseFormp = new PaneTargetsBaseForm(this.deviceObj, bindAcDev, DeviceBind.BindInfo.BindType.Humidity); |
| | | Shared.Phone.UserView.HomePage.Instance.AddChidren(paneTargetsBaseFormp); |
| | | Shared.Phone.UserView.HomePage.Instance.PageIndex += 1; |
| | |
| | | /// 刷新绑定表页面 |
| | | /// </summary> |
| | | public Action actionRefreshBindList; |
| | | /// <summary> |
| | | /// 是否能刷新 |
| | | /// </summary> |
| | | private bool canFresh = false; |
| | | #endregion |
| | | |
| | | #region UI设计 |
| | |
| | | { |
| | | TitleUI(); |
| | | MidFrameLayouUI(); |
| | | //首次初始化数据 |
| | | CommonPage.Loading.Start(""); |
| | | InitData(); |
| | | } |
| | | |
| | |
| | | midVerticalScrolViewLayout.BeginHeaderRefreshingAction += () => |
| | | { |
| | | midVerticalScrolViewLayout.BeginHeaderRefreshing(); |
| | | canFresh = true; |
| | | InitData(); |
| | | }; |
| | | |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 楼层选择的侧边栏 |
| | | /// </summary> |
| | | void SideslipFramelayout() |
| | | { |
| | | var dialog = new Dialog |
| | | { |
| | | }; |
| | | dialog.Show(); |
| | | |
| | | var flMain = new FrameLayout { BackgroundColor = 0x00000000 }; |
| | | dialog.AddChidren(flMain); |
| | | flMain.MouseUpEventHandler += (sender11, e11) => |
| | | { |
| | | dialog.Close(); |
| | | }; |
| | | |
| | | var sidelipFrameLayout = new FrameLayout() |
| | | { |
| | | Width = Application.GetMinReal(449), |
| | | Y = Application.GetRealHeight(161), |
| | | X = Application.GetRealWidth(596), |
| | | BackgroundImagePath = "DoorLock/SideslipPic.png", |
| | | }; |
| | | flMain.AddChidren(sidelipFrameLayout); |
| | | |
| | | var btnSelectFloor = new Button() |
| | | { |
| | | Width = Application.GetRealWidth(200), |
| | | Height = Application.GetRealHeight(58), |
| | | X = Application.GetRealWidth(81), |
| | | Y = Application.GetRealHeight(81), |
| | | TextColor = Shared.Common.ZigbeeColor.Current.XMBlack, |
| | | TextSize = 14, |
| | | IsBold = true, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextID = R.MyInternationalizationString.SelectFloor, |
| | | }; |
| | | sidelipFrameLayout.AddChidren(btnSelectFloor); |
| | | |
| | | var sidelipVerticalScrolViewLayout = new VerticalScrolViewLayout() |
| | | { |
| | | Y = btnSelectFloor.Bottom + Application.GetRealHeight(45), |
| | | Height = Application.GetRealHeight(600), |
| | | }; |
| | | sidelipFrameLayout.AddChidren(sidelipVerticalScrolViewLayout); |
| | | |
| | | Button oldbutton = null; |
| | | Button oldbuttonText = null; |
| | | int count = 0; |
| | | foreach (var floorId in dicFloorList.Keys) |
| | | { |
| | | var rowFrameLayout = new RowLayout() |
| | | { |
| | | Height = Application.GetRealHeight(152), |
| | | LineColor = Shared.Common.ZigbeeColor.Current.XMRowLine, |
| | | X = Application.GetRealWidth(81), |
| | | }; |
| | | sidelipVerticalScrolViewLayout.AddChidren(rowFrameLayout); |
| | | |
| | | var btnAllMethod = new Button() |
| | | { |
| | | Width = Application.GetMinReal(81), |
| | | Height = Application.GetMinReal(81), |
| | | UnSelectedImagePath = "Floor/Floor.png", |
| | | SelectedImagePath = "Floor/FloorSelected.png", |
| | | Gravity = Gravity.CenterVertical, |
| | | }; |
| | | rowFrameLayout.AddChidren(btnAllMethod); |
| | | |
| | | var btnMethodText = new Button() |
| | | { |
| | | Width = Application.GetRealWidth(311), |
| | | Height = Application.GetRealHeight(58), |
| | | X = Application.GetRealWidth(92), |
| | | Gravity = Gravity.CenterVertical, |
| | | TextColor = Shared.Common.ZigbeeColor.Current.XMGray3, |
| | | TextSize = 14, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | Text = dicFloorList[floorId], |
| | | }; |
| | | rowFrameLayout.AddChidren(btnMethodText); |
| | | |
| | | if (curControlDev.currentSelectFloorId == floorId) |
| | | { |
| | | btnAllMethod.IsSelected = true; |
| | | btnAllMethod.IsBold = true; |
| | | btnMethodText.TextColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | } |
| | | |
| | | string curFloorId = floorId; |
| | | EventHandler<MouseEventArgs> hander = (sender, e) => |
| | | { |
| | | if (curControlDev.currentSelectFloorId == curFloorId) |
| | | { |
| | | return; |
| | | } |
| | | curControlDev.currentSelectFloorId = curFloorId; |
| | | |
| | | |
| | | |
| | | if (!btnMethodText.IsSelected) |
| | | { |
| | | if (oldbutton != null) |
| | | { |
| | | oldbutton.IsSelected = false; |
| | | } |
| | | if (oldbuttonText != null) |
| | | { |
| | | oldbuttonText.TextColor = Shared.Common.ZigbeeColor.Current.XMGray3; |
| | | } |
| | | oldbutton = btnMethodText; |
| | | oldbuttonText = btnMethodText; |
| | | btnMethodText.IsSelected = true; |
| | | oldbuttonText.TextColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | oldbuttonText.IsBold = true; |
| | | } |
| | | |
| | | int index = 0; |
| | | RefreshRoomList(); |
| | | dialog.Close(); |
| | | }; |
| | | btnAllMethod.MouseUpEventHandler += hander; |
| | | rowFrameLayout.MouseUpEventHandler += hander; |
| | | btnMethodText.MouseUpEventHandler += hander; |
| | | count++; |
| | | } |
| | | |
| | | if (count == 0) |
| | | { |
| | | sidelipFrameLayout.Height = 0; |
| | | } |
| | | else if (count <= 4 && count > 0) |
| | | { |
| | | sidelipFrameLayout.Height = Application.GetRealHeight(180) + count * Application.GetRealHeight(150); |
| | | } |
| | | else |
| | | { |
| | | sidelipFrameLayout.Height = Application.GetMinReal(780); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 面板绑定目标表显示 |
| | | /// </summary> |
| | | /// <param name="gateway">Gateway.</param> |
| | | /// <param name="key">Key.</param> |
| | | void RefreshRoomList() |
| | | { |
| | | Room curRoom = null; |
| | | if (supportRoomList.Count == 0) |
| | | { |
| | | return; |
| | | } |
| | | btnHorizontalScrolViewLayout.RemoveAll(); |
| | | Room curRoom = null; |
| | | Button curentOldRoom = null; |
| | | FrameLayout curentOldRoomFrameLayout = null; |
| | | int index = 0; |
| | | curBindTypeList = MutilfunctionPanelMethod.GetMatchBindList(curBindType); |
| | | var roomTempList = MutilfunctionPanelMethod.GetSupportRoomList(curControlDev, supportRoomList, curBindTypeList, curBindType); |
| | | List<Room> roomTempList = new List<Room> { }; |
| | | Room slectedRoom = null; |
| | | var roomUn = new Room(); |
| | | roomUn.Name = Language.StringByID(R.MyInternationalizationString.Undistributed); |
| | | roomUn.Id = "UndistributedId"; |
| | | |
| | | if (supportRoomList.Count != 0) |
| | | { |
| | | roomTempList = MutilfunctionPanelMethod.GetSupportRoomList(curControlDev, supportRoomList, curBindTypeList, curBindType); |
| | | } |
| | | |
| | | if (curBindType == 0) |
| | | { |
| | | if (undistributeScList != null && undistributeScList.Count != 0) |
| | |
| | | var btn = (Button)frame.GetChildren(0); |
| | | frame.BackgroundImagePath = "Item/RoomIconBackgroundSelected.png"; |
| | | btn.TextColor = Shared.Common.ZigbeeColor.Current.XMWhite; |
| | | curentOldRoom = btn; |
| | | curentOldRoomFrameLayout = frame; |
| | | } |
| | | else |
| | | { |
| | |
| | | { |
| | | try |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | CommonPage.Loading.Start(""); |
| | | }); |
| | | |
| | | //获取楼层 |
| | | dicFloorList = HdlRoomLogic.Current.GetFloorSortList(); |
| | | curControlDev.currentSelectFloorId = BindInfo.GetCurrentSelectFloorId(); |
| | | |
| | | //获取楼层中房间列表 |
| | | supportRoomList = BindInfo.GetFloorRoomList(); |
| | | //获取房间列表 |
| | | supportRoomList = BindInfo.GetSupportRoomList(); |
| | | //获取面板已经绑定的匹配类型的列表 |
| | | curBindTypeList = MutilfunctionPanelMethod.GetMatchBindList(curBindType); |
| | | |
| | | if (curBindType == 0) |
| | | { |
| | |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | BindDownFrameLayout(this.midFrameLayout, curControlDev, dicFloorList, ref btnFloorText); |
| | | if (!canFresh) |
| | | { |
| | | BindDownFrameLayout(this.midFrameLayout, curControlDev, dicFloorList, ref btnFloorText); |
| | | } |
| | | ChooseFloorAction += (floorId, btnMethodText) => |
| | | { |
| | | btnFloorText.Text = dicFloorList[floorId]; |
| | | |
| | | //获取楼层中房间列表 |
| | | //获取房间列表 |
| | | supportRoomList.Clear(); |
| | | supportRoomList = BindInfo.GetFloorRoomList(); |
| | | supportRoomList = BindInfo.GetSupportRoomList(); |
| | | if (curBindType == 0) |
| | | { |
| | | // 获取本地未分配的支持当前类型的绑定场景列表 |
| | |
| | | } |
| | | RefreshRoomList(); |
| | | }; |
| | | |
| | | btnFloorText.Text = BindInfo.GetCurrentSelectFloorIdName(); |
| | | //获取楼层中房间列表 |
| | | if (supportRoomList.Count != 0) |
| | | //默认楼层显示 |
| | | if (BindInfo.GetCurrentSelectFloorIdName() != null) |
| | | { |
| | | RefreshRoomList(); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | btnFloorText.Text = BindInfo.GetCurrentSelectFloorIdName(); |
| | | }); |
| | | } |
| | | |
| | | //获取楼层中房间列表 |
| | | RefreshRoomList(); |
| | | CommonPage.Loading.Hide(); |
| | | canFresh = false; |
| | | midVerticalScrolViewLayout.EndHeaderRefreshing(); |
| | | }); |
| | | } |
| | |
| | |
|
| | | Type type = typeof(DirNameResourse);
|
| | |
|
| | | var PropertyList = type.GetFields();
|
| | | var PropertyList = type.GetProperties();
|
| | |
|
| | | var listFile = new List<System.Reflection.FieldInfo>();
|
| | | var listFile = new List<System.Reflection.PropertyInfo>();
|
| | | foreach (var item in PropertyList)
|
| | | {
|
| | | if (item.Name.EndsWith("Directory") == true)
|
| | |
| | |
|
| | | private void AddRowControl(VerticalListControl listView, string directory, string directoryValue, bool addLine)
|
| | | {
|
| | | string localDir = DirNameResourse.LocalMemoryDirectory;
|
| | | string myPath = System.IO.Path.Combine(localDir, directoryValue);
|
| | | if (localDir.EndsWith(directoryValue) == true)
|
| | | {
|
| | | myPath = localDir;
|
| | | }
|
| | | if (System.IO.Directory.Exists(myPath) == false)
|
| | | if (System.IO.Directory.Exists(directoryValue) == false)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
| | | row1.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | var form = new HideOptionFileListForm();
|
| | | form.AddForm(myPath);
|
| | | form.AddForm(directoryValue);
|
| | | };
|
| | | }
|
| | |
|
| | |
| | | var revertObj = Newtonsoft.Json.JsonConvert.DeserializeObject<Common.ResponseEntity.ResponsePack>(System.Text.Encoding.UTF8.GetString(byteData));
|
| | | if (revertObj.StateCode == "AccountNoExists")
|
| | | {
|
| | | //成员不存在
|
| | | var form = new MemberNotEsixtForm();
|
| | | form.AddForm();
|
| | | HdlThreadLogic.Current.RunMain(() =>
|
| | | {
|
| | | //成员不存在
|
| | | var form = new MemberNotEsixtForm();
|
| | | form.AddForm();
|
| | | });
|
| | |
|
| | | return;
|
| | | }
|
| | |
|
old mode 100755
new mode 100644
| | |
| | |
|
| | | if (string.IsNullOrEmpty(resultValue) == true)
|
| | | {
|
| | | //出现未知错误,数据丢失
|
| | | string msg = Language.StringByID(R.MyInternationalizationString.uUnKnownError);
|
| | | this.ShowMassage(ShowMsgType.Tip, msg);
|
| | | return;
|
| | | }
|
| | | List<MemberInfoRes> listInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<List<MemberInfoRes>>(resultValue);
|
| | |
| | | break;
|
| | | }
|
| | | }
|
| | | if (memberInfoRes == null)
|
| | | {
|
| | | //出现未知错误,数据丢失
|
| | | string msg = Language.StringByID(R.MyInternationalizationString.uUnKnownError);
|
| | | this.ShowMassage(ShowMsgType.Tip, msg);
|
| | | return;
|
| | | if (memberInfoRes == null) |
| | | { |
| | | //出现意外情况,数据丢失 |
| | | string msg = Language.StringByID(R.MyInternationalizationString.uUnKnownErrorAndLostData); |
| | | this.ShowMassage(ShowMsgType.Tip, msg); |
| | | return; |
| | | }
|
| | |
|
| | | string iconPath = System.IO.Path.Combine(UserCenterResourse.AccountOption.UserPictruePath, memberInfoRes.DistributedMark + ".png");
|
| | |
| | | var revertObj = Newtonsoft.Json.JsonConvert.DeserializeObject<Common.ResponseEntity.ResponsePack>(System.Text.Encoding.UTF8.GetString(byteData));
|
| | | if (revertObj.StateCode == "AccountNoExists")
|
| | | {
|
| | | //成员不存在
|
| | | var form = new MemberNotEsixtForm();
|
| | | form.AddForm();
|
| | | HdlThreadLogic.Current.RunMain(() =>
|
| | | {
|
| | | //成员不存在
|
| | | var form = new MemberNotEsixtForm();
|
| | | form.AddForm();
|
| | | });
|
| | | return;
|
| | | }
|
| | |
|
| | |
| | | }
|
| | |
|
| | | //添加房间,主页需要重新刷新
|
| | | UserView.UserPage.Instance.RefreshForm = true;
|
| | | UserView.UserPage.Instance.RefreshAllForm = true;
|
| | |
|
| | | HdlRoomLogic.Current.AddRoom(newRoom);
|
| | | this.FinishEditorEvent?.Invoke();
|
| | |
| | | {
|
| | | //获取温度传感器
|
| | | if (device is ZigBee.Device.TemperatureSensor && ((ZigBee.Device.TemperatureSensor)device).SensorDiv == 1)
|
| | | {
|
| | | listDevice.Add(device);
|
| | | }
|
| | | //PM2.5是温度和湿度合在同一个端点
|
| | | else if (device.Type == ZigBee.Device.DeviceType.PMSensor)
|
| | | {
|
| | | listDevice.Add(device);
|
| | | }
|
| | |
| | | {
|
| | | listDevice.Add(device);
|
| | | }
|
| | | //新风
|
| | | else if (device.Type == ZigBee.Device.DeviceType.FreshAirHumiditySensor)
|
| | | {
|
| | | listDevice.Add(device);
|
| | | }
|
| | | //PM2.5是温度和湿度合在同一个端点
|
| | | else if (device.Type == ZigBee.Device.DeviceType.PMSensor)
|
| | | {
|
| | | listDevice.Add(device);
|
| | | }
|
| | | }
|
| | | var listSelect = new List<string>() { newRoom.HumidityDevice };
|
| | | var form = new SelectDeviceForm();
|
| | |
| | | }
|
| | |
|
| | | //算了,这里如果按下保存,则主页需要重新刷新
|
| | | UserView.UserPage.Instance.RefreshForm = true;
|
| | | UserView.UserPage.Instance.RefreshAllForm = true;
|
| | |
|
| | | this.CloseForm();
|
| | | };
|
| | |
| | | {
|
| | | //获取温度传感器
|
| | | if (device is ZigBee.Device.TemperatureSensor && ((ZigBee.Device.TemperatureSensor)device).SensorDiv == 1)
|
| | | {
|
| | | listDevice.Add(device);
|
| | | }
|
| | | //PM2.5是温度和湿度合在同一个端点
|
| | | else if (device.Type == ZigBee.Device.DeviceType.PMSensor)
|
| | | {
|
| | | listDevice.Add(device);
|
| | | }
|
| | |
| | | {
|
| | | listDevice.Add(device);
|
| | | }
|
| | | //新风
|
| | | else if (device.Type == ZigBee.Device.DeviceType.FreshAirHumiditySensor)
|
| | | {
|
| | | listDevice.Add(device);
|
| | | }
|
| | | //PM2.5是温度和湿度合在同一个端点
|
| | | else if (device.Type == ZigBee.Device.DeviceType.PMSensor)
|
| | | {
|
| | | listDevice.Add(device);
|
| | | }
|
| | | }
|
| | | var listSelect = new List<string>() { cloneRoom.HumidityDevice };
|
| | | var form = new SelectDeviceForm();
|
| | |
| | | Common.Config.Instance.Home.FloorDics.Remove(keys);
|
| | | if (Common.Config.Instance.Home.CurrentFloorId == keys)
|
| | | {
|
| | | //如果删除的是当前楼层的话
|
| | | Common.Config.Instance.Home.CurrentFloorId = string.Empty;
|
| | | foreach (string floorId in Common.Config.Instance.Home.FloorDics.Keys)
|
| | | var dicFloor = HdlRoomLogic.Current.GetFloorSortList();
|
| | | foreach (var floorId in dicFloor.Keys)
|
| | | {
|
| | | //把第一个楼层ID给它
|
| | | //把第一个楼层赋值给当前楼层
|
| | | Common.Config.Instance.Home.CurrentFloorId = floorId;
|
| | | break;
|
| | | }
|
| | |
| | | this.AdjustContrlTableHeight();
|
| | | }
|
| | | //删除楼层的话,主页需要重新刷新
|
| | | UserView.UserPage.Instance.RefreshForm = true;
|
| | | UserView.UserPage.Instance.RefreshAllForm = true;
|
| | | });
|
| | | };
|
| | | }
|
| | |
| | | Common.Config.Instance.Home.Save();
|
| | | if (Common.Config.Instance.Home.CurrentFloorId == string.Empty)
|
| | | {
|
| | | Common.Config.Instance.Home.CurrentFloorId = keys;
|
| | | //创建第一个新的楼层的话,需要去刷新主页左边的房间列表
|
| | | HdlRoomLogic.Current.RefreshRoomListView();
|
| | | }
|
| | |
| | | this.InitFrameTableByMode();
|
| | | }
|
| | | //创建或者修改楼层的话,主页需要重新刷新
|
| | | UserView.UserPage.Instance.RefreshForm = true;
|
| | | UserView.UserPage.Instance.RefreshAllForm = true;
|
| | | }
|
| | | });
|
| | | }
|
| | |
| | | this.AdjustContrlTableHeight();
|
| | | }
|
| | | //删除房间的话,主页需要重新刷新
|
| | | UserView.UserPage.Instance.RefreshForm = true;
|
| | | UserView.UserPage.Instance.RefreshAllForm = true;
|
| | | });
|
| | | };
|
| | | }
|
| | |
| | | btnIconContr.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | //楼层菜单
|
| | | var contr = new TopRightFloorMenuControl(dicFloor.Count, 2, Language.StringByID(R.MyInternationalizationString.SelectFloor));
|
| | | var contr = new TopRightFloorMenuControl(dicFloor.Count, 2, this.nowSelectFloorId, Language.StringByID(R.MyInternationalizationString.SelectFloor));
|
| | | foreach (var floorId in dicFloor.Keys)
|
| | | {
|
| | | contr.AddRowMenu(floorId, () =>
|
| | |
| | | UserCenterResourse.ResidenceOption.Save();
|
| | | btnShortCut.IsSelected = false;
|
| | | //取消主页的「安防」捷径的话,主页需要重新刷新
|
| | | UserView.UserPage.Instance.RefreshForm = true;
|
| | | UserView.UserPage.Instance.RefreshAllForm = true;
|
| | | });
|
| | | }
|
| | | else
|
| | |
| | | UserCenterResourse.ResidenceOption.Save();
|
| | | btnShortCut.IsSelected = true;
|
| | | //创建主页的「安防」捷径的话,主页需要重新刷新
|
| | | UserView.UserPage.Instance.RefreshForm = true;
|
| | | UserView.UserPage.Instance.RefreshAllForm = true;
|
| | | });
|
| | | }
|
| | | };
|
| | |
| | | btnIconContr.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | //楼层菜单
|
| | | var contr = new TopRightFloorMenuControl(dicFloor.Count, 2, Language.StringByID(R.MyInternationalizationString.SelectFloor));
|
| | | var contr = new TopRightFloorMenuControl(dicFloor.Count, 2, this.nowSelectFloorId, Language.StringByID(R.MyInternationalizationString.SelectFloor));
|
| | | foreach (var floorId in dicFloor.Keys)
|
| | | {
|
| | | contr.AddRowMenu(floorId, () =>
|
| | |
| | | /// <summary>
|
| | | /// 如果设置此变量为true,则在单击底部菜单时,强制无条件全部刷新
|
| | | /// </summary>
|
| | | public bool RefreshForm = false;
|
| | | public bool RefreshAllForm = false;
|
| | | /// <summary>
|
| | | /// 刷新主页
|
| | | /// </summary>
|
| | | public bool RefreshMainPageForm = false;
|
| | | /// <summary>
|
| | | /// 刷新分类
|
| | | /// </summary>
|
| | | public bool RefreshCategoryForm = false;
|
| | |
|
| | | #endregion
|
| | |
|
| | |
| | | /// <param name="handClick">是否是手动点击</param> |
| | | private void BottomMenuClickEvent(MenuSelectEnum selectEnum, bool handClick)
|
| | | {
|
| | | if (this.RefreshForm == false && selectEnum == this.nowSelectMenu && handClick == true)
|
| | | if (this.RefreshAllForm == false && selectEnum == this.nowSelectMenu && handClick == true)
|
| | | {
|
| | | //手动点击同一个菜单,则不做处理
|
| | | return;
|
| | | }
|
| | |
|
| | | //如果强制指定刷新界面的话
|
| | | if (this.RefreshForm == true)
|
| | | if (this.RefreshAllForm == true)
|
| | | {
|
| | | //全部刷新
|
| | | this.listForm = new List<EditorCommonForm>() { null, null, null };
|
| | | this.bodyFrameView.RemoveAll();
|
| | |
|
| | | this.RefreshForm = false;
|
| | | this.RefreshAllForm = false;
|
| | | }
|
| | |
|
| | | this.nowSelectMenu = selectEnum;
|
| | |
| | | {
|
| | | //左滑菜单可
|
| | | CommonPage.Instance.IsDrawerLockMode = false; |
| | | if (this.RefreshMainPageForm == true)
|
| | | {
|
| | | //刷新主页
|
| | | listForm[0]?.CloseForm();
|
| | | listForm[0] = null;
|
| | | this.RefreshMainPageForm = false;
|
| | | } |
| | | if (listForm[0] == null)
|
| | | {
|
| | | var form = new MainPage.HomeMainPageForm();
|
| | |
| | | {
|
| | | //左滑菜单不可
|
| | | CommonPage.Instance.IsDrawerLockMode = true;
|
| | | if (this.RefreshCategoryForm == true)
|
| | | {
|
| | | //刷新分类
|
| | | listForm[1]?.CloseForm();
|
| | | listForm[1] = null;
|
| | | this.RefreshCategoryForm = false;
|
| | | }
|
| | | if (listForm[1] == null)
|
| | | {
|
| | | var form = new Category.CategoryMainForm();
|
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region 一键更新四寸屏按键属性 |
| | | /// <summary> |
| | | /// 同步设备功能 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public async System.Threading.Tasks.Task<SynchronizationDeviceResponseAllData> SyncMsgToBindSource(string deviceAddr, int deviceEpoint) |
| | | { |
| | | if (Gateway == null) |
| | | { |
| | | return null; |
| | | } |
| | | |
| | | return await System.Threading.Tasks.Task.Run(async () => |
| | | { |
| | | SynchronizationDeviceResponseAllData resContent = null; |
| | | Action<string, string> action = (topic, message) => |
| | | { |
| | | var gatewayID = topic.Split('/')[0]; |
| | | var jobject = Newtonsoft.Json.Linq.JObject.Parse(message); |
| | | |
| | | if (topic == gatewayID + "/" + "Error_Respon") |
| | | { |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); |
| | | |
| | | if (temp == null) |
| | | { |
| | | resContent = new SynchronizationDeviceResponseAllData { errorMessageBase = "网关错误回复,且数据是空" }; |
| | | } |
| | | else |
| | | { |
| | | resContent = new SynchronizationDeviceResponseAllData { errorResponData = temp, errorMessageBase = ErrorMess(temp.Error) }; |
| | | } |
| | | } |
| | | |
| | | if (topic == gatewayID + "/" + "Bind/SyncMsgToBindSourceRespon") |
| | | { |
| | | var res = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["Result"].ToString()); |
| | | if (res == null) |
| | | { |
| | | resContent = new SynchronizationDeviceResponseAllData { errorMessageBase = "网关返回的数据为空" }; |
| | | } |
| | | else |
| | | { |
| | | resContent = new SynchronizationDeviceResponseAllData { result = res }; |
| | | System.Console.WriteLine($"UI收到通知后的主题_{ topic}"); |
| | | } |
| | | } |
| | | }; |
| | | Gateway.Actions = action; |
| | | DebugPrintLog("Bind/SyncMsgToBindSourceRespon_Actions 启动" + "_" + System.DateTime.Now.ToString()); |
| | | |
| | | try |
| | | { |
| | | var jObject = new JObject { { "DeviceAddr", deviceAddr }, { "Epoint", deviceEpoint }, { "Cluster_ID", 0 }, { "Command", 5010 } }; |
| | | Gateway.Send("Bind/SyncMsgToBindSource", jObject.ToString()); |
| | | } |
| | | catch { } |
| | | |
| | | var dateTime = DateTime.Now; |
| | | while ((DateTime.Now - dateTime).TotalMilliseconds < WaitReceiveDataTime) |
| | | { |
| | | await System.Threading.Tasks.Task.Delay(10); |
| | | if (resContent != null) |
| | | { |
| | | break; |
| | | } |
| | | } |
| | | if ((DateTime.Now - dateTime).TotalMilliseconds > WaitReceiveDataTime) |
| | | { |
| | | resContent = new SynchronizationDeviceResponseAllData { errorMessageBase = " 回复超时,请重新操作" }; |
| | | } |
| | | Gateway.Actions -= action; |
| | | DebugPrintLog("Bind/SyncMsgToBindSource_Actions 退出" + System.DateTime.Now.ToString()); |
| | | |
| | | return resContent; |
| | | }); |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 同步设备,网关反馈具体信息 |
| | | /// </summary> |
| | | [System.Serializable] |
| | | public class SynchronizationDeviceResponseAllData |
| | | { |
| | | /// <summary> |
| | | /// 错误信息 |
| | | /// </summary> |
| | | public string errorMessageBase; |
| | | /// <summary> |
| | | /// 网关信息错误反馈 |
| | | /// <para>当网关接收到客户端信息后,出现以下异常情况将反馈错误。</para> |
| | | /// </summary> |
| | | public ErrorResponData errorResponData; |
| | | /// <summary> |
| | | /// 同步结果 |
| | | /// 0:成功:网关内部自动写入设备目标名字、设备目标功能类型、场景目标名字、utc时间写入4寸屏 |
| | | /// 1:失败 |
| | | /// </summary> |
| | | public int result; |
| | | } |
| | | #endregion |
| | | |
| | | #region 删除设备(使设备离网) |
| | | /// <summary> |
| | | /// 删除设备(使设备离网) |
| | |
| | | } |
| | | }; |
| | | Gateway.Actions += action; |
| | | System.Console.WriteLine("RemoveDevice_Actions 启动" + "_" + System.DateTime.Now.ToString()); |
| | | DebugPrintLog("RemoveDevice_Actions 启动" + "_" + System.DateTime.Now.ToString()); |
| | | |
| | | try |
| | | { |
| | |
| | | d = new RemoveDeviceResponseAllData { errorMessageBase = " 回复超时,请重新操作" }; |
| | | } |
| | | Gateway.Actions -= action; |
| | | System.Console.WriteLine("RemoveDevice_Actions 退出" + System.DateTime.Now.ToString()); |
| | | DebugPrintLog("RemoveDevice_Actions 退出" + System.DateTime.Now.ToString()); |
| | | |
| | | return d; |
| | | }); |
old mode 100755
new mode 100644
| | |
| | | /// 警告!数据出错,必须刷新列表,否则控制现象错乱 |
| | | /// </summary> |
| | | public const int UpdateBindList = 335; |
| | | /// <summary> |
| | | /// 同步 |
| | | /// </summary> |
| | | public const int Synchronization = 336; |
| | | /// <summary> |
| | | /// 同步失败 |
| | | /// </summary> |
| | | public const int SynchronizationFailed = 337; |
| | | |
| | | public readonly static int cancel = 5097; |
| | | public readonly static int confrim = 5098; |
| | |
| | | public readonly static int dark = 5411; |
| | | public readonly static int bright = 5412; |
| | | public readonly static int tipIlluminanceValue = 5413; |
| | | public readonly static int videoIntercom = 5414; |
| | | public readonly static int dong = 5415; |
| | | public readonly static int unit = 5416; |
| | | public readonly static int theOutdoorUnit = 5417; |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | |
| | | /// <summary>
|
| | | /// 需重新绑定
|
| | | /// </summary> |
| | | public const int uNeedToRebind = 16136;
|
| | | public const int uNeedToRebind = 16136; |
| | | /// <summary> |
| | | /// 出现意外情况,数据丢失 |
| | | /// </summary> |
| | | public const int uUnKnownErrorAndLostData = 16137;
|
| | |
|
| | |
|
| | |
|
| | |
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\RoomAndDeviceView.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\SkipView.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\SoneLogicList.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\VideoIntercom\VideoMachine.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\Login\AccountForgetPWD.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\Login\Logic\AccountLogic.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\Login\AccountRegister.cs" />
|