Merge remote-tracking branch 'origin/newBranch1' into WJC
| | |
| | | 499=Add defense function |
| | | 500=Add alarm target |
| | | 501=Security alarm: {0} is triggered. |
| | | |
| | | 502=Clear the security alarm? |
| | | 503=Exceeding standard |
| | | 504=Secondary standard |
| | | 505=Class I standard |
| | | 506=Face input succeeded |
| | | 507=Face input failed |
| | | 508=Formaldehyde |
| | | |
| | | 1000=Room Humidity |
| | | 1001=V-chip |
| | |
| | | 7148=Disarm |
| | | 7149=Manually |
| | | 7150=Smart |
| | | |
| | | |
| | | |
| | | 9000=Please sign in with new cell phone number. |
| | |
| | | 499=添加布防功能 |
| | | 500=添加告警目标 |
| | | 501=安防报警:{0}被触发。 |
| | | 502=是否解除安防警报? |
| | | 503=超标 |
| | | 504=二级 |
| | | 505=一级 |
| | | 506=人脸录入成功 |
| | | 507=人脸录入失败 |
| | | 508=甲醛 |
| | | |
| | | 1000=室内湿度 |
| | | 1001=童锁 |
| | |
| | | 7148=撤防 |
| | | 7149=手动 |
| | | 7150=智能 |
| | | |
| | | |
| | | |
| | | 9000=请使用新的手机账号登录APP |
| | |
| | | <Reference Include="ys"> |
| | | <HintPath>..\DLL\EZvizMonitor\ys.dll</HintPath> |
| | | </Reference> |
| | | <Reference Include="Shared.Droid.HDLLinphone"> |
| | | <HintPath>..\DLL\Linphone\Android\Shared.Droid.HDLLinphone.dll</HintPath> |
| | | </Reference> |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | | <Compile Include="MainActivity.cs" /> |
| | |
| | | <AndroidAsset Include="Assets\Phone\Collection\DefenseStatusIcon.png" /> |
| | | <AndroidAsset Include="Assets\Phone\Collection\DisarmStatusIcon.png" /> |
| | | <AndroidAsset Include="Assets\Phone\PersonalCenter\ResidenceDefenseIcon.png" /> |
| | | <AndroidAsset Include="Assets\Phone\Collection\DefenseAlarmIcon.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\ArmCenter\InAlarmBigIcon.png" /> |
| | | <AndroidAsset Include="Assets\Phone\PersonalCenter\ResidenceInAlarmIcon.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\Icon\electricalbreaker.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\Electrical\AirSwitch\AirSwitchBgIcon.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\Electrical\AirSwitch\AirSwitchBgOnIcon.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\Electrical\AirSwitch\EnergyIcon.png" /> |
| | | <AndroidAsset Include="Assets\Phone\PersonalCenter\FacePassage\FailIcon.png" /> |
| | | <AndroidAsset Include="Assets\Phone\PersonalCenter\FacePassage\TrueIcon.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\Icon\sensorhcho.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\EnvirSensor\HchoBg.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\EnvirSensor\HchoIcon.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\Icon\HomeIcon\electricalbreaker_blue.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\Icon\HomeIcon\electricalbreaker_white.png" /> |
| | | <AndroidAsset Include="Assets\Phone\LogicIcon\security.png" /> |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | |
| | | <Folder Include="Assets\Phone\FunctionIcon\IrFan\" /> |
| | | <Folder Include="Assets\Phone\PersonalCenter\FacePassage\" /> |
| | | <Folder Include="Assets\Phone\FunctionIcon\Light\LightScene\" /> |
| | | <Folder Include="Assets\Phone\FunctionIcon\Electrical\AirSwitch\" /> |
| | | </ItemGroup> |
| | | <Import Project="..\HDL_ON\HDL_ON.projitems" Label="Shared" Condition="Exists('..\HDL_ON\HDL_ON.projitems')" /> |
| | | <Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" /> |
| | |
| | | |
| | | using System;
|
| | | using Android.App; |
| | | using Android.Content; |
| | | using CN.Jpush.Android.Api; |
| | | using CN.Jpush.Android.Service; |
| | |
| | | { |
| | | HDLCommon.Current.AdjustPushMessage(pushMes); |
| | | }); |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="202108211" android:versionName="1.2.202108211" package="com.hdl.onpro"> |
| | | <uses-sdk android:minSdkVersion="26" android:targetSdkVersion="29" /> |
| | | <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="202108282" android:versionName="1.2.2021082782" package="com.hdl.onpro"> |
| | | <uses-sdk android:minSdkVersion="23" android:targetSdkVersion="28" /> |
| | | <!-- 乐橙可视对讲需要的权限 --> |
| | | <!--<uses-permission android:name="android.permission.INTERNET" />--> |
| | | <!--网络访问--> |
| | |
| | | <Reference Include="Shared.IOS.LCVideoOnSDK"> |
| | | <HintPath>..\DLL\LC\IOS\Shared.IOS.LCVideoOnSDK.dll</HintPath> |
| | | </Reference> |
| | | <Reference Include="Shared.IOS.HDLLinphoneSDK"> |
| | | <HintPath>..\DLL\Linphone\iOS\Shared.IOS.HDLLinphoneSDK.dll</HintPath> |
| | | </Reference> |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | | <PackageReference Include="Newtonsoft.Json"> |
| | |
| | | </PackageReference> |
| | | <PackageReference Include="Xamarin.Essentials"> |
| | | <Version>1.7.0</Version> |
| | | </PackageReference> |
| | | <PackageReference Include="Xamarin.Swift"> |
| | | <Version>1.0.8</Version> |
| | | </PackageReference> |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | |
| | | <Folder Include="Assets.xcassets\device_bg.imageset\" /> |
| | | <Folder Include="Resources\Phone\FunctionIcon\Light\LightScene\" /> |
| | | <Folder Include="Resources\Phone\PersonalCenter\FacePassage\" /> |
| | | <Folder Include="Resources\Phone\FunctionIcon\Electrical\AirSwitch\" /> |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | | <InterfaceDefinition Include="LaunchScreen.storyboard" /> |
| | |
| | | <BundleResource Include="Resources\Phone\Collection\DefenseStatusIcon.png" /> |
| | | <BundleResource Include="Resources\Phone\Collection\DisarmStatusIcon.png" /> |
| | | <BundleResource Include="Resources\Phone\PersonalCenter\ResidenceDefenseIcon.png" /> |
| | | <BundleResource Include="Resources\Phone\Collection\DefenseAlarmIcon.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\ArmCenter\InAlarmBigIcon.png" /> |
| | | <BundleResource Include="Resources\Phone\PersonalCenter\ResidenceInAlarmIcon.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\Electrical\AirSwitch\AirSwitchBgIcon.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\Electrical\AirSwitch\AirSwitchBgOnIcon.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\Electrical\AirSwitch\EnergyIcon.png" /> |
| | | <BundleResource Include="Resources\Phone\PersonalCenter\FacePassage\FailIcon.png" /> |
| | | <BundleResource Include="Resources\Phone\PersonalCenter\FacePassage\TrueIcon.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\EnvirSensor\HchoBg.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\EnvirSensor\HchoIcon.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\Icon\sensorhcho.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\Icon\electricalbreaker.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\Icon\HomeIcon\electricalbreaker_blue.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\Icon\HomeIcon\electricalbreaker_white.png" /> |
| | | <BundleResource Include="Resources\Phone\LogicIcon\security.png" /> |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | |
| | | <key>LSRequiresIPhoneOS</key> |
| | | <true/> |
| | | <key>MinimumOSVersion</key> |
| | | <string>9.0</string> |
| | | <string>11.0</string> |
| | | <key>UIDeviceFamily</key> |
| | | <array> |
| | | <integer>1</integer> |
| | |
| | | <key>UIStatusBarStyle</key> |
| | | <string>UIStatusBarStyleLightContent</string> |
| | | <key>CFBundleShortVersionString</key> |
| | | <string>1.2.202108211</string> |
| | | <string>1.2.202108282</string> |
| | | <key>CFBundleVersion</key> |
| | | <string>1.2.08211</string> |
| | | <string>1.2.08282</string> |
| | | <key>NSLocationWhenInUseUsageDescription</key> |
| | | <string>Use geographic location to provide services such as weather</string> |
| | | <key>NSAppleMusicUsageDescription</key> |
| | |
| | | </array> |
| | | <key>UIBackgroundModes</key> |
| | | <array> |
| | | <string>audio</string> |
| | | <string>voip</string> |
| | | <string>remote-notification</string> |
| | | </array> |
| | | <key>NSFaceIDUsageDescription</key> |
| | |
| | | <string>This application uses Bluetooth to communicate with the device, this application does not collect, store or record any data that communicates via Bluetooth.</string> |
| | | <key>NSBluetoothAlwaysUsageDescription</key> |
| | | <string>This application uses Bluetooth to communicate with the device, this application does not collect, store or record any data that communicates via Bluetooth.</string> |
| | | <key>NSVoIPUsageDescription</key> |
| | | <string>Make audio/video calls</string> |
| | | </dict> |
| | | </plist> |
| | |
| | | 499=Add defense function |
| | | 500=Add alarm target |
| | | 501=Security alarm: {0} is triggered. |
| | | |
| | | 502=Clear the security alarm? |
| | | 503=Exceeding standard |
| | | 504=Secondary standard |
| | | 505=Class I standard |
| | | 506=Face input succeeded |
| | | 507=Face input failed |
| | | 508=Formaldehyde |
| | | |
| | | 1000=Room Humidity |
| | | 1001=V-chip |
| | |
| | | 499=添加布防功能 |
| | | 500=添加告警目标 |
| | | 501=安防报警:{0}被触发。 |
| | | 502=是否解除安防警报? |
| | | 503=超标 |
| | | 504=二级 |
| | | 505=一级 |
| | | 506=人脸录入成功 |
| | | 507=人脸录入失败 |
| | | 508=甲醛 |
| | | |
| | | 1000=室内湿度 |
| | | 1001=童锁 |
| | |
| | | { |
| | | endTime = DateTime.Now.AddSeconds(100); |
| | | MainPage.Log($"读取场景数据成功"); |
| | | var sceneList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Scene>>(pack.Data.ToString()); |
| | | var sceneList = JsonConvert.DeserializeObject<List<Scene>>(pack.Data.ToString()); |
| | | if (sceneList == null) |
| | | { |
| | | sceneList = new List<Scene>(); |
| | |
| | | //} |
| | | |
| | | //======================获取可视对讲设备列表==================== |
| | | bool isInterphoneType_HDL = false;//是否为HDLLinphone可视对讲 |
| | | var videoInfo= VideoSend.GetVideoInfoList(); |
| | | if (videoInfo.Code == StateCode.SUCCESS) |
| | | { |
| | |
| | | if (video.interphoneType == InterphoneType.IMOUVISIAL.ToString()) |
| | | { |
| | | UI.UI2.PersonalCenter.PirDevice.PirSend.LcSubAccessToken = video.subAccountToken; |
| | | } else if (video.interphoneType == InterphoneType.HDL.ToString()) { |
| | | isInterphoneType_HDL = true; |
| | | DB_ResidenceData.Instance.SupportFacePass = true; |
| | | DB_ResidenceData.Instance.SaveResidenceData(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | //======================获取Sip账号并且初始化SDK可视对讲设备列表==================== |
| | | //如果检测线程没启动,才继续下面操作 因为App有可能刚启动马上收到推送了,然后才执行到这里 |
| | | if (HDLLinphone.Current.CheckIncomingCallThreadIsNull()) { |
| | | //当前住宅是HDL可视对讲类型的设备 |
| | | if (isInterphoneType_HDL) |
| | | { |
| | | //HDLLinphone可视对讲,获取Sip账号并初始化SDK |
| | | HDLLinphone.Current.GetHDLSipInfoAndInitSDK(DB_ResidenceData.Instance.CurrentRegion.id); |
| | | } |
| | | else |
| | | { |
| | | Utlis.WriteLine("当前住宅不支持HDL可视对讲,退出登录所有账号"); |
| | | //当前住宅不支持HDL可视对讲 |
| | | HDLLinphone.Current.LogoutAllAccount(); |
| | | } |
| | | } |
| | | |
| | | //======================安防==================== |
| | | GetSecurityList(); |
| | |
| | | MainPage.Log($"结束读取云端数据线程"); |
| | | endTime = DateTime.MinValue; |
| | | DownloadDataComplete = true; |
| | | waitPage.Hide(); |
| | | waitPage.RemoveFromParent(); |
| | | if (waitPage != null) |
| | | { |
| | | waitPage.RemoveFromParent(); |
| | | waitPage = null; |
| | | } |
| | | }); |
| | | //不考虑网关情况,直接订阅 |
| | | DAL.Mqtt.MqttClient.InitState(); |
| | |
| | | DownloadDataComplete = true; |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | waitPage.Hide(); |
| | | waitPage.RemoveFromParent(); |
| | | if (waitPage != null) |
| | | { |
| | | waitPage.RemoveFromParent(); |
| | | waitPage = null; |
| | | } |
| | | }); |
| | | //初始化数据 |
| | | //SpatialInfo.CurrentSpatial.Clear(); |
| | |
| | | } |
| | | var infoListPack = Ins.httpRequest.GetSecurityInfo(sidList, new List<string>()); |
| | | var infoList = JsonConvert.DeserializeObject<List<SecurityAlarm>>(infoListPack.Data.ToString()); |
| | | foreach (var function in infoList) |
| | | if (infoList != null) |
| | | { |
| | | function.SaveFile(); |
| | | FunctionList.List.IniFunctionList(function.savePath, true); |
| | | var filePathList = FileUtlis.Files.ReadFiles().FindAll((obj) => obj.StartsWith("SecurityData_")); |
| | | if (filePathList != null) |
| | | { |
| | | foreach (var file in filePathList) |
| | | { |
| | | FileUtlis.Files.DeleteFile(file); |
| | | } |
| | | } |
| | | foreach (var function in infoList) |
| | | { |
| | | function.SaveFile(); |
| | | FunctionList.List.IniFunctionList(function.savePath, true); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | MainPage.Log($"读取安防列表失败:Code:{pack.Code}; Msg:{pack.message}"); |
| | | } |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取SIP账号信息 |
| | | /// </summary> |
| | | public void GetSipInfo() |
| | | { |
| | | var pack = Ins.HttpRequest.GetSecurityList(); |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | /// 系统信息 |
| | | /// </summary> |
| | | Prompt, |
| | | /// <summary> |
| | | /// 新闻 |
| | | /// </summary> |
| | | News, |
| | | /// <summary> |
| | | /// 推荐 |
| | | /// </summary> |
| | | Recommend, |
| | | /// <summary> |
| | | /// 物业通知,待确认修改 |
| | | /// </summary> |
| | | Property, |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | //1.视对讲厂家类型 |
| | | string interphoneTypeEnum = json["interphoneTypeEnum"].ToString(); |
| | | if (string.IsNullOrEmpty(interphoneTypeEnum)) return; |
| | | // |
| | | ESVideoInfo eSVideoInfo = new ESVideoInfo();// GetESOnVideoJson(jpushMessageInfo.expantContent); |
| | | //2.根据可视对讲厂家类型,处理不同的数据 |
| | | if (interphoneTypeEnum == InterphoneType.IMOUVISIAL.ToString()) |
| | |
| | | eSVideoInfo.Lc_AccessToken = json["subToken"].ToString();//"子账号token |
| | | eSVideoInfo.DeviceSerial = json["devSerial"].ToString();//设备序列号 |
| | | eSVideoInfo.HomeId = jpushMessageInfo.HomeId; |
| | | } |
| | | else if (interphoneTypeEnum == InterphoneType.HDL.ToString()) |
| | | { |
| | | //HDL Linphone 狄耐克 |
| | | eSVideoInfo.HomeId = jpushMessageInfo.HomeId; |
| | | eSVideoInfo.callId = json["callId"].ToString(); |
| | | eSVideoInfo.Lc_DeviceId = json["deviceId"].ToString(); |
| | | eSVideoInfo.DeviceName = json["deviceName"].ToString(); |
| | | eSVideoInfo.deviceSipAccount = json["deviceSipAccount"].ToString(); |
| | | //ShowAlert("狄耐克门口机呼叫"); |
| | | //打开呼叫页面 |
| | | HDLLinphone.Current.ShowESVideoIntercom(eSVideoInfo); |
| | | return; |
| | | } |
| | | |
| | | //3.打开呼叫页面 |
| | |
| | | UserInfo.Current.LastTime = DateTime.MinValue; |
| | | UserInfo.Current.SaveUserInfo(); |
| | | DB_ResidenceData.Instance.EixtAccount(); |
| | | //4.注销HDLSIP账号登录 2021-08-20 |
| | | HDLLinphone.Current.LogoutAllAccount(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | { |
| | | public static class StringId |
| | | { |
| | | |
| | | /// <summary> |
| | | /// 甲醛 |
| | | /// </summary> |
| | | public const int Formaldehyde = 508; |
| | | /// <summary> |
| | | /// 人脸录入失败 |
| | | /// </summary> |
| | | public const int FaceInputFailed = 507; |
| | | /// <summary> |
| | | /// 人脸录入成功 |
| | | /// </summary> |
| | | public const int FaceInputSucceeded = 506; |
| | | /// <summary> |
| | | /// 一级建筑标准 |
| | | /// </summary> |
| | | public const int Class_I_BuildingStandard = 505; |
| | | /// <summary> |
| | | /// 二级建筑标准 |
| | | /// </summary> |
| | | public const int SecondaryBuildingStandard = 504; |
| | | /// <summary> |
| | | /// 超标 |
| | | /// </summary> |
| | | public const int ExceedingTheStandard = 503; |
| | | /// <summary> |
| | | /// 是否解除安防警报? |
| | | /// </summary> |
| | | public const int ClearTheSecurityAlarmTip = 502; |
| | | /// <summary> |
| | | /// 安防报警 |
| | | /// </summary> |
| | |
| | | var actionObjs = new List<ApiAlinkControlActionObj>(); |
| | | actionObjs.Add(apiControlData); |
| | | var pack = httpServer.ControlDevice(actionObjs); |
| | | MainPage.Log($"远程控制反馈:{pack.message}"); |
| | | } |
| | | |
| | | } |
| | |
| | | gatewayId = DB_ResidenceData.Instance.HomeGateway.gatewayId, |
| | | sid = securityAlarm.sid, status = state, userSecurityId = securityAlarm.userSecurityId |
| | | } }); |
| | | MainPage.Log($"安防控制结果:{result.Code}"); |
| | | } |
| | | else |
| | | { |
| | |
| | | || receiveObj.Topic == CommunicationTopic.ct.ReadSecurityStatus + "_reply" |
| | | || receiveObj.Topic == CommunicationTopic.ct.SecurityStatusUp) |
| | | { |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<SecurityStatusObj>(receiveObj.BodyDataString); |
| | | if (temp != null) |
| | | try |
| | | { |
| | | Control_Udp.ReceiveRepeatManager(temp.id, null); |
| | | foreach (var updataSecurity in temp.objects) |
| | | { |
| | | var updataLocalSecurity = FunctionList.List.securities.Find((obj) => obj.sid == updataSecurity.sid); |
| | | if (updataLocalSecurity != null) |
| | | MainPage.Log($"局域网安防信息: {receiveObj.Topic} : 内容: {res[1]}"); |
| | | var tt = ""; |
| | | lock (tt) { |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<SecurityStatusObj>(receiveObj.BodyDataString); |
| | | if (temp != null) |
| | | { |
| | | updataLocalSecurity.status = updataSecurity.status; |
| | | updataLocalSecurity.alarm = updataSecurity.alarm; |
| | | Control_Udp.ReceiveRepeatManager(temp.id, null); |
| | | foreach (var updataSecurity in temp.objects) |
| | | { |
| | | var updataLocalSecurity = FunctionList.List.securities.Find((obj) => obj.sid == updataSecurity.sid); |
| | | if (updataLocalSecurity != null) |
| | | { |
| | | updataLocalSecurity.status = updataSecurity.status; |
| | | updataLocalSecurity.alarm = updataSecurity.alarm; |
| | | ArmCenterPage.LoadEvent_RefreshSecurityStatus(updataLocalSecurity); |
| | | } |
| | | } |
| | | HomePage.LoadEvent_RefreshSecurityStatus(); |
| | | } |
| | | } |
| | | HomePage.LoadEvent_RefreshSecurityStatus(); |
| | | ArmCenterPage.LoadEvent_RefreshSecurityStatus(); |
| | | } |
| | | catch (Exception ex){ |
| | | MainPage.Log($"安防局域网异常:{ex.Message}"); |
| | | } |
| | | } |
| | | else |
| | |
| | | return; |
| | | } |
| | | } |
| | | MainPage.Log($"A协议更新状态:{revString}"); |
| | | //MainPage.Log($"A协议更新状态:{revString}"); |
| | | foreach (var attr in updateTemp.status) |
| | | { |
| | | localFunction.time_stamp = temp.time_stamp; |
| | |
| | | Function localObj = null; |
| | | switch (localFunction.spk) |
| | | { |
| | | case SPK.AirSwitch: |
| | | AirSwitchPage.UpdataState(localFunction); |
| | | break; |
| | | case SPK.ElectricEnergy: |
| | | EnergyMainPage.UpdataStatus(localFunction); |
| | | break; |
| | |
| | | } |
| | | break; |
| | | case SPK.FloorHeatStandard: |
| | | localFunction.lastState = ""; |
| | | switch (localFunction.GetAttrState(FunctionAttributeKey.Mode)) |
| | | { |
| | | case "normal": |
| | |
| | | case SPK.ClothesHanger: |
| | | case SPK.AcIr: |
| | | case SPK.SenesorMegahealth: |
| | | case SPK.AirFreshStandard: |
| | | //设备状态推送 |
| | | //状态更新 |
| | | Stan.HdlDeviceStatuPushLogic.Current.UpdateDeviceStatu(updateTemp.sid, updateTemp.status); |
| | |
| | | { |
| | | if (!string.IsNullOrEmpty(DB_ResidenceData.Instance.HomeGateway.aesKey)) |
| | | { |
| | | var securityBytes = Securitys.EncryptionService.AesDecryptPayload(e.ApplicationMessage.Payload, DB_ResidenceData.Instance.HomeGateway.aesKey); |
| | | var securityString = Encoding.UTF8.GetString(securityBytes); |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<SecurityStatusObj>(securityString); |
| | | MainPage.Log($"安防状态变化:{securityString}"); |
| | | |
| | | if (temp != null) |
| | | try |
| | | { |
| | | Control_Udp.ReceiveRepeatManager(temp.id, null); |
| | | foreach (var updataSecurity in temp.objects) |
| | | var securityBytes = Securitys.EncryptionService.AesDecryptPayload(e.ApplicationMessage.Payload, DB_ResidenceData.Instance.HomeGateway.aesKey); |
| | | var securityString = Encoding.UTF8.GetString(securityBytes); |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<SecurityStatusObj>(securityString); |
| | | MainPage.Log($"安防状态变化:{securityString}"); |
| | | |
| | | if (temp != null) |
| | | { |
| | | var updataLocalSecurity = FunctionList.List.securities.Find((obj) => obj.sid == updataSecurity.sid); |
| | | if (updataLocalSecurity != null) |
| | | Control_Udp.ReceiveRepeatManager(temp.id, null); |
| | | foreach (var updataSecurity in temp.objects) |
| | | { |
| | | updataLocalSecurity.status = updataSecurity.status; |
| | | updataLocalSecurity.alarm = updataSecurity.alarm; |
| | | var updataLocalSecurity = FunctionList.List.securities.Find((obj) => obj.sid == updataSecurity.sid); |
| | | if (updataLocalSecurity != null) |
| | | { |
| | | updataLocalSecurity.status = updataSecurity.status; |
| | | updataLocalSecurity.alarm = updataSecurity.alarm; |
| | | ArmCenterPage.LoadEvent_RefreshSecurityStatus(updataLocalSecurity); |
| | | } |
| | | } |
| | | HomePage.LoadEvent_RefreshSecurityStatus(); |
| | | } |
| | | HomePage.LoadEvent_RefreshSecurityStatus(); |
| | | ArmCenterPage.LoadEvent_RefreshSecurityStatus(); |
| | | }catch(Exception ex) |
| | | { |
| | | MainPage.Log($"安防远程信息异常:{ex.Message}"); |
| | | } |
| | | } |
| | | } |
| | |
| | | /// <summary> |
| | | /// 查询推送信息列表 |
| | | /// </summary> |
| | | /// <param name="queryType">0全部 1分享与功能 2报警类 3系统信息</param> |
| | | /// <param name="queryType">0全部 1分享与功能 2报警类 3系统信息 4物业通知</param> |
| | | /// <returns></returns> |
| | | public ResponsePackNew PushSerivceGetPushmessagelist(int queryType = 0) |
| | | { |
| | |
| | | { |
| | | pushType = PushType.Prompt.ToString(); |
| | | } |
| | | |
| | | else if (queryType == 4) |
| | | { |
| | | pushType = PushType.Property.ToString(); |
| | | } |
| | | var requestJson = HttpUtil.GetSignRequestJson(new GetMessageListObj() |
| | | { |
| | | pushId = OnAppConfig.Instance.PushId, |
| | | pushType = pushType, |
| | | homeId = DB_ResidenceData.Instance.CurrentRegion.id, |
| | | }); |
| | | return HttpUtil.RequestHttpsPost(NewAPI.API_POST_PushSerivce_Getpushmessagelist, requestJson); |
| | | //2021-08-28 改为分页查询 |
| | | return HttpUtil.RequestHttpsPost(NewAPI.API_POST_PushSerivce_Getpushmessagelist_Paging, requestJson); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("securitys", securityStates); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | MainPage.Log($"api安防控制:{requestJson}"); |
| | | var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Security_StatusSet, requestJson); |
| | | return pack; |
| | | } |
| | |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | /// <summary> |
| | | /// 人脸录入 |
| | | /// </summary> |
| | | /// <param name="imageBytes"></param> |
| | | /// <returns></returns> |
| | | public ResponsePackNew FaceSetting(string imageBytes) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("userFace", @"data:image/jpg;base64,"+imageBytes); |
| | | d.Add("houseId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | |
| | | //MainPage.Log(imageBytes); |
| | | |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_InputUserFace, requestJson); |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 修改住户人脸关闭状态 |
| | | /// 1:开启状态 2:关闭状态 |
| | | /// 3:清除人脸数据 |
| | | /// </summary> |
| | | public ResponsePackNew EditFaceFunction(int status) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("houseId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("faceClose", status); |
| | | |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_SwitchFaceFunction, requestJson); |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 获取住户详情 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public ResponsePackNew GetCustomerInfo() |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("houseId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetCustomerInfo, requestJson); |
| | | } |
| | | } |
| | | } |
| | |
| | | /// <summary> |
| | | /// 固定域名,正式环境 |
| | | /// 公共域名就近解析 |
| | | /// |
| | | /// </summary> |
| | | //public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; |
| | | public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";//mmmm |
| | |
| | | /// <summary> |
| | | /// 响应错误信息 |
| | | /// </summary> |
| | | public string message; |
| | | public string message = ""; |
| | | |
| | | /// <summary> |
| | | /// 这个是请求错误时的扩展数据,以后所有的附带扩展数据都会放在这里面动态维护 |
| | |
| | | /// 删除推送Token |
| | | /// </summary> |
| | | public const string API_POST_PushSerivce_DeleteToken = "/smart-footstone/app/push-information/delete"; |
| | | ///// <summary> |
| | | /////// 获取推送消息记录 |
| | | /////// </summary> |
| | | //public const string API_POST_PushSerivce_Getpushmessagelist = "/smart-footstone/app/message/list"; |
| | | /// <summary> |
| | | /// 获取推送消息记录 |
| | | /// 获取推送消息记录 分页 |
| | | /// </summary> |
| | | public const string API_POST_PushSerivce_Getpushmessagelist = "/smart-footstone/app/message/list"; |
| | | public const string API_POST_PushSerivce_Getpushmessagelist_Paging = "/smart-footstone/app/message/page"; |
| | | /// <summary> |
| | | /// 清空推送的消息记录 |
| | | /// </summary> |
| | |
| | | /// 获取通话记录 |
| | | /// </summary> |
| | | public const string API_POST_FL_GetCallList = "/home-wisdom/platform/imou/listCallRecords"; |
| | | |
| | | /// <summary> |
| | | /// 人脸录入 |
| | | /// </summary> |
| | | public const string Api_Post_InputUserFace = "/community-wisdom/app/doorDevice/inputUserFaceHouse"; |
| | | /// <summary> |
| | | /// 开关人脸功能 |
| | | /// </summary> |
| | | public const string Api_Post_SwitchFaceFunction = "/community-wisdom/app/doorDevice/updateCustomerFaceClose"; |
| | | /// <summary> |
| | | /// 获取住户详情 |
| | | /// </summary> |
| | | public const string Api_Post_GetCustomerInfo = "/basis-footstone/app/customer/detail"; |
| | | /// 住宅sip账号获取 |
| | | /// </summary> |
| | | public const string API_POST_VideoDevice_GetSipAccount = "/home-wisdom/app/home/getSipAccount"; |
| | | #endregion |
| | | |
| | | |
| | |
| | | public const string API_POST_DoorHistory = "/home-wisdom/app/device/door/logs"; |
| | | |
| | | #endregion |
| | | |
| | | #region ■ -- SIP相关接口_______________________________ |
| | | #endregion |
| | | |
| | | |
| | | } |
| | | |
| | | ///// <summary> |
| | |
| | | public string regionUrl; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 分页 |
| | | /// </summary> |
| | | public class BasePagingObj |
| | | { |
| | | public int totalCount = 0; |
| | | public int totalPage = 0; |
| | | public int pageNo = 0; |
| | | public int pageSize = 0; |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region ■ 登录 ____________________________ |
| | |
| | | /// "":全部;Default:分享与功能;Alarm:报警类;Prompt:系统消息 |
| | | /// </summary> |
| | | public string pushType; |
| | | /// <summary> |
| | | /// 页面大小 |
| | | /// </summary> |
| | | public int pageSize = 100; |
| | | /// <summary> |
| | | /// 页面序号 |
| | | /// </summary> |
| | | public int pageNo = 1; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | { |
| | | //乐橙可视对讲 |
| | | //1.初始化LCOpenSDK_Api |
| | | LCApiKit.SharedInstance().IsChinaMainland = OnAppConfig.Instance.RequestHttpsHost.Contains("china");//如果域名包含china,则SDK 使用乐橙的中国大陆(正式)域名 |
| | | LCApiKit.SharedInstance().InitSDKOpenApi(mESVideoInfo.Lc_AccessToken); |
| | | LCApiKit.SharedInstance().CurrentDevicePlayToken = mESVideoInfo.Lc_PlayToken; |
| | | LCApiKit.SharedInstance().CurrentDeviceId = mESVideoInfo.Lc_DeviceId; |
| | |
| | | //vc.MLCCallDelegate = new OnLCCallDelegate(this); |
| | | Shared.Application.currentVC.NavigationController.PushViewController(vc, true); |
| | | } |
| | | else |
| | | else if(interphoneType == InterphoneType.FLVI.ToString()) |
| | | { |
| | | |
| | | ESOnMonitorViewController vc = new ESOnMonitorViewController(); |
| | |
| | | //vc.RoomName = mESVideoInfo.RoomName; |
| | | //vc.MESCallDelegate = new OnESCallDelegate(this); |
| | | Shared.Application.currentVC.NavigationController.PushViewController(vc, true); |
| | | }else if (interphoneType == InterphoneType.HDL.ToString()) |
| | | { |
| | | //HDLLinphone 狄耐克 |
| | | HDLLinphone.Current.ShowESVideoMonitor(mESVideoInfo); |
| | | } |
| | | else |
| | | { |
| | | HDLUtils.WriteLine("未对接,不支持监视"); |
| | | } |
| | | #else |
| | | Intent intent = null; |
| | | if (interphoneType == InterphoneType.IMOUVISIAL.ToString()) |
| | | { |
| | | intent = new Intent(Shared.Application.Activity, typeof(HDL_ON_Android.LeChengVideoActivity)); |
| | | intent.PutExtra("ESVideoUUID", mESVideoInfo.ESVideoUUID); |
| | | intent.PutExtra("uuid", mESVideoInfo.uuid); |
| | | intent.PutExtra("DeviceName", mESVideoInfo.DeviceName); |
| | | intent.PutExtra("cmtID", mESVideoInfo.cmtID); |
| | | intent.PutExtra("roomno", mESVideoInfo.roomno); |
| | | intent.PutExtra("unitno", mESVideoInfo.unitno); |
| | | intent.PutExtra("HomeID", PirSend.HomeId); |
| | | intent.PutExtra("callId", mESVideoInfo.callId); |
| | | intent.PutExtra("Type", 0); |
| | | |
| | | //=========乐橙========== |
| | | intent.PutExtra("AccessToken", mESVideoInfo.Lc_AccessToken); |
| | | intent.PutExtra("DeviceId", mESVideoInfo.Lc_DeviceId); |
| | | intent.PutExtra("Location", OnAppConfig.Instance.RequestHttpsHost.Contains("china") ? 0 : 1);//如果域名包含china,则是国内账号); |
| | | intent.PutExtra("PlayToken", mESVideoInfo.Lc_PlayToken); |
| | | intent.PutExtra("Psk", mESVideoInfo.Lc_Psk); |
| | | |
| | | Shared.Application.Activity.StartActivity(intent); |
| | | } |
| | | else if (interphoneType == InterphoneType.FLVI.ToString()) |
| | | { |
| | | |
| | | intent = new Intent(Shared.Application.Activity, typeof(HDL_ON_Android.VideoActivity)); |
| | | intent.PutExtra("ESVideoUUID", mESVideoInfo.ESVideoUUID); |
| | | intent.PutExtra("uuid", mESVideoInfo.uuid); |
| | | intent.PutExtra("DeviceName", mESVideoInfo.DeviceName); |
| | | intent.PutExtra("cmtID", mESVideoInfo.cmtID); |
| | | intent.PutExtra("roomno", mESVideoInfo.roomno); |
| | | intent.PutExtra("unitno", mESVideoInfo.unitno); |
| | | intent.PutExtra("HomeID", PirSend.HomeId); |
| | | intent.PutExtra("callId", mESVideoInfo.callId); |
| | | intent.PutExtra("Type", 0); |
| | | |
| | | //=========乐橙========== |
| | | intent.PutExtra("AccessToken", mESVideoInfo.Lc_AccessToken); |
| | | intent.PutExtra("DeviceId", mESVideoInfo.Lc_DeviceId); |
| | | intent.PutExtra("Location", OnAppConfig.Instance.RequestHttpsHost.Contains("china") ? 0 : 1);//如果域名包含china,则是国内账号); |
| | | intent.PutExtra("PlayToken", mESVideoInfo.Lc_PlayToken); |
| | | intent.PutExtra("Psk", mESVideoInfo.Lc_Psk); |
| | | |
| | | Shared.Application.Activity.StartActivity(intent); |
| | | } |
| | | else if (interphoneType == InterphoneType.HDL.ToString()) |
| | | { |
| | | //HDLLinphone 狄耐克 |
| | | HDLLinphone.Current.ShowESVideoMonitor(mESVideoInfo); |
| | | } |
| | | else |
| | | { |
| | | intent = new Intent(Shared.Application.Activity, typeof(HDL_ON_Android.VideoActivity)); |
| | | HDLUtils.WriteLine("未对接,不支持监视"); |
| | | } |
| | | |
| | | intent.PutExtra("ESVideoUUID", mESVideoInfo.ESVideoUUID); |
| | | intent.PutExtra("uuid", mESVideoInfo.uuid); |
| | | intent.PutExtra("DeviceName", mESVideoInfo.DeviceName); |
| | | intent.PutExtra("cmtID", mESVideoInfo.cmtID); |
| | | intent.PutExtra("roomno", mESVideoInfo.roomno); |
| | | intent.PutExtra("unitno", mESVideoInfo.unitno); |
| | | intent.PutExtra("HomeID", PirSend.HomeId); |
| | | intent.PutExtra("callId", mESVideoInfo.callId); |
| | | intent.PutExtra("Type", 0); |
| | | |
| | | //=========乐橙========== |
| | | intent.PutExtra("AccessToken", mESVideoInfo.Lc_AccessToken); |
| | | intent.PutExtra("DeviceId", mESVideoInfo.Lc_DeviceId); |
| | | intent.PutExtra("Location", OnAppConfig.Instance.RequestHttpsHost.Contains("China") ? 0 : 1);//如果域名包含china,则是国内账号); |
| | | intent.PutExtra("PlayToken", mESVideoInfo.Lc_PlayToken); |
| | | intent.PutExtra("Psk", mESVideoInfo.Lc_Psk); |
| | | |
| | | Shared.Application.Activity.StartActivity(intent); |
| | | |
| | | |
| | | #endif |
| | | } |
| | |
| | | { |
| | | //乐橙可视对讲 |
| | | //1.初始化LCOpenSDK_Api |
| | | LCApiKit.SharedInstance().IsChinaMainland = OnAppConfig.Instance.RequestHttpsHost.Contains("china");//如果域名包含china,则SDK 使用乐橙的中国大陆(正式)域名 |
| | | LCApiKit.SharedInstance().InitSDKOpenApi(mESVideoInfo.Lc_AccessToken); |
| | | //2021-05-18 目前推送的PlayToken;有问题会导致SDK崩溃,暂时不传 |
| | | //LCApiKit.SharedInstance().CurrentDevicePlayToken = mESVideoInfo.Lc_PlayToken; |
| | |
| | | EZSDK.IOS.EZSDK.SharedInstance().PlayWithDeviceSerial(mESVideoInfo.DeviceSerial); |
| | | |
| | | } |
| | | else |
| | | else if (interphoneType == InterphoneType.HDL.ToString()) |
| | | { |
| | | //HDL Linphone 狄耐克 |
| | | |
| | | |
| | | } |
| | | else if (interphoneType == InterphoneType.FLVI.ToString()) |
| | | { |
| | | |
| | | ESOnIntercomViewController vc = new ESOnIntercomViewController(); |
| | |
| | | mOnESCallDelegate = new OnESCallDelegate(this); |
| | | vc.MESCallDelegate = mOnESCallDelegate; |
| | | Shared.Application.currentVC.NavigationController.PushViewController(vc, true); |
| | | }else{ |
| | | HDLUtils.WriteLine("未支持的可视对讲类型"); |
| | | |
| | | } |
| | | #else |
| | | #region |
| | | #region Android 处理 |
| | | |
| | | Intent intent = null; |
| | | if (interphoneType == InterphoneType.IMOUVISIAL.ToString()) |
| | | { |
| | | //待删减不必要参数 |
| | | intent = new Intent(Shared.Application.Activity, typeof(HDL_ON_Android.LeChengVideoActivity)); |
| | | intent.PutExtra("ESVideoUUID", mESVideoInfo.ESVideoUUID); |
| | | intent.PutExtra("uuid", mESVideoInfo.uuid); |
| | | intent.PutExtra("DeviceName", mESVideoInfo.DeviceName); |
| | | intent.PutExtra("cmtID", mESVideoInfo.cmtID); |
| | | intent.PutExtra("roomno", mESVideoInfo.roomno); |
| | | intent.PutExtra("unitno", mESVideoInfo.unitno); |
| | | intent.PutExtra("HomeID", PirSend.HomeId); |
| | | intent.PutExtra("callId", mESVideoInfo.callId); |
| | | intent.PutExtra("Type", 1); |
| | | |
| | | //=========乐橙========== |
| | | intent.PutExtra("AccessToken", mESVideoInfo.Lc_AccessToken); |
| | | intent.PutExtra("DeviceId", mESVideoInfo.Lc_DeviceId); |
| | | intent.PutExtra("Location", OnAppConfig.Instance.RequestHttpsHost.Contains("china") ? 0 : 1);//如果域名包含china,则是国内账号); |
| | | intent.PutExtra("PlayToken", mESVideoInfo.Lc_PlayToken); |
| | | intent.PutExtra("Psk", mESVideoInfo.Lc_Psk); |
| | | |
| | | Shared.Application.Activity.StartActivity(intent); |
| | | |
| | | } |
| | | else if (interphoneType == InterphoneType.EZVIZ.ToString()) |
| | | { |
| | |
| | | }); |
| | | return; |
| | | } |
| | | else if (interphoneType == InterphoneType.HDL.ToString()) |
| | | { |
| | | //HDL Linphone 狄耐克 |
| | | |
| | | |
| | | } |
| | | else if (interphoneType == InterphoneType.FLVI.ToString()) |
| | | { |
| | | //待删减不必要参数 |
| | | intent = new Intent(Shared.Application.Activity, typeof(HDL_ON_Android.VideoActivity)); |
| | | intent.PutExtra("ESVideoUUID", mESVideoInfo.ESVideoUUID); |
| | | intent.PutExtra("uuid", mESVideoInfo.uuid); |
| | | intent.PutExtra("DeviceName", mESVideoInfo.DeviceName); |
| | | intent.PutExtra("cmtID", mESVideoInfo.cmtID); |
| | | intent.PutExtra("roomno", mESVideoInfo.roomno); |
| | | intent.PutExtra("unitno", mESVideoInfo.unitno); |
| | | intent.PutExtra("HomeID", PirSend.HomeId); |
| | | intent.PutExtra("callId", mESVideoInfo.callId); |
| | | intent.PutExtra("Type", 1); |
| | | |
| | | //=========乐橙========== |
| | | intent.PutExtra("AccessToken", mESVideoInfo.Lc_AccessToken); |
| | | intent.PutExtra("DeviceId", mESVideoInfo.Lc_DeviceId); |
| | | intent.PutExtra("Location", OnAppConfig.Instance.RequestHttpsHost.Contains("china") ? 0 : 1);//如果域名包含china,则是国内账号); |
| | | intent.PutExtra("PlayToken", mESVideoInfo.Lc_PlayToken); |
| | | intent.PutExtra("Psk", mESVideoInfo.Lc_Psk); |
| | | |
| | | |
| | | Shared.Application.Activity.StartActivity(intent); |
| | | } |
| | | else |
| | | { |
| | | intent = new Intent(Shared.Application.Activity, typeof(HDL_ON_Android.VideoActivity)); |
| | | HDLUtils.WriteLine("未支持的可视对讲类型"); |
| | | |
| | | } |
| | | |
| | | intent.PutExtra("ESVideoUUID", mESVideoInfo.ESVideoUUID); |
| | | intent.PutExtra("uuid", mESVideoInfo.uuid); |
| | | intent.PutExtra("DeviceName", mESVideoInfo.DeviceName); |
| | | intent.PutExtra("cmtID", mESVideoInfo.cmtID); |
| | | intent.PutExtra("roomno", mESVideoInfo.roomno); |
| | | intent.PutExtra("unitno", mESVideoInfo.unitno); |
| | | intent.PutExtra("HomeID", PirSend.HomeId); |
| | | intent.PutExtra("callId", mESVideoInfo.callId); |
| | | intent.PutExtra("Type", 1); |
| | | |
| | | |
| | | //=========乐橙========== |
| | | intent.PutExtra("AccessToken", mESVideoInfo.Lc_AccessToken); |
| | | intent.PutExtra("DeviceId", mESVideoInfo.Lc_DeviceId); |
| | | intent.PutExtra("Location", OnAppConfig.Instance.RequestHttpsHost.Contains("China") ? 0 : 1);//如果域名包含china,则是国内账号); |
| | | intent.PutExtra("PlayToken", mESVideoInfo.Lc_PlayToken); |
| | | intent.PutExtra("Psk", mESVideoInfo.Lc_Psk); |
| | | |
| | | Shared.Application.Activity.StartActivity(intent); |
| | | |
| | | |
| | | #endregion |
| | | #endif |
| | |
| | | /// 设备序列号 |
| | | /// </summary> |
| | | public string DeviceSerial = string.Empty; |
| | | |
| | | |
| | | //========================HDL SIP========================== |
| | | /// <summary> |
| | | /// 设备sip账号 interphoneType是HDL时才会有值 |
| | | /// </summary> |
| | | public string deviceSipAccount; |
| | | } |
| | | |
| | | |
| | |
| | | /// 萤石猫眼呼叫 |
| | | /// </summary> |
| | | EZVIZ, |
| | | /// <summary> |
| | | /// 狄耐克 HDL Linphone |
| | | /// </summary> |
| | | HDL, |
| | | |
| | | |
| | | } |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Threading; |
| | | |
| | | using HDL_ON; |
| | | using HDL_ON.DAL.Server; |
| | | using HDL_ON.Entity; |
| | | |
| | | #if __Android__ |
| | | using Android.App; |
| | | using Android.Content; |
| | | using Android.Graphics; |
| | | using Android.Widget; |
| | | using Com.Hdl.Hdllinphonesdk; |
| | | #else |
| | | using Foundation; |
| | | using UIKit; |
| | | using Shared.IOS.HDLLinphoneSDK; |
| | | #endif |
| | | |
| | | namespace Shared |
| | | { |
| | | /// <summary> |
| | | /// 目前是每个住宅对应一个SIP账号,切换住宅需要重新获取SIP账号 |
| | | /// </summary> |
| | | public class HDLLinphone |
| | | { |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public HDLLinphone() |
| | | { |
| | | |
| | | } |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | private static HDLLinphone m_Current = null; |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public static HDLLinphone Current |
| | | { |
| | | get |
| | | { |
| | | if (m_Current == null) |
| | | { |
| | | m_Current = new HDLLinphone(); |
| | | } |
| | | return m_Current; |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 当前住宅是否支持可视对讲 |
| | | /// </summary> |
| | | public bool IsEnable = false; |
| | | /// <summary> |
| | | /// 是否自动跳转呼叫页面, |
| | | /// false:收到推送并且已经收到sip呼叫才跳转呼叫页面 |
| | | /// true:原生收到呼叫马上跳转呼叫页面,不等待推送过来 |
| | | /// </summary> |
| | | bool IsAutoJumpCallView = false; |
| | | /// <summary> |
| | | /// 是否初始化了SDK |
| | | /// </summary> |
| | | bool IsInitSdk; |
| | | /// <summary> |
| | | /// 当前登录的Sip账号 |
| | | /// </summary> |
| | | HDLSipInfo currentHDLSipInfo; |
| | | /// <summary> |
| | | /// 可视对讲设备参数 |
| | | /// </summary> |
| | | HDLCallVideoInfo mHDLCallVideoInfo; |
| | | |
| | | #region ■ -- 初始化SDK_______________________________ |
| | | /// <summary> |
| | | /// 初始化SDK |
| | | /// </summary> |
| | | void InitLinphone() |
| | | { |
| | | //防止重复初始化 |
| | | if (IsInitSdk) return; |
| | | |
| | | IsInitSdk = true; |
| | | |
| | | #if __IOS__ |
| | | |
| | | Shared.IOS.HDLLinphoneSDK.HDLLinPhoneSDK.Instance().InitalLinPhone(); |
| | | //设置收到来电后、是否需自动跳转呼叫页面方案 |
| | | Shared.IOS.HDLLinphoneSDK.HDLLinPhoneSDK.Instance().IsAutoJumpCallView = IsAutoJumpCallView; |
| | | //设置Listener监听 |
| | | mOnHDLLinphoneCallDelegate = new OnHDLLinphoneCallDelegate(this); |
| | | Shared.IOS.HDLLinphoneSDK.HDLLinPhoneSDK.Instance().HdlLinphoneCallDelegate = mOnHDLLinphoneCallDelegate; |
| | | #else |
| | | HDLLinphoneKit.Instance.InitLinphone(Application.Activity); |
| | | //设置收到来电后、是否需自动跳转呼叫页面方案 |
| | | HDLLinphoneKit.Instance.AutoJumpCallView = IsAutoJumpCallView; |
| | | //设置Listener监听 |
| | | setOnHDLLinphoneCallListener(); |
| | | #endif |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 设置sip登录账号 |
| | | /// </summary> |
| | | /// <param name="mHDLSipInfo"></param> |
| | | public void SetAccountAndLogin(HDLSipInfo mHDLSipInfo) |
| | | { |
| | | |
| | | this.currentHDLSipInfo = mHDLSipInfo; |
| | | |
| | | if (mHDLSipInfo == null) return; |
| | | |
| | | #if __IOS__ |
| | | //Shared.IOS.HDLLinphoneSDK.HDLLinPhoneSDK.Instance().Login("6666", "85521566", "116.62.26.215:5060"); |
| | | Shared.IOS.HDLLinphoneSDK.HDLLinPhoneSDK.Instance().Login(mHDLSipInfo.sipAccount, mHDLSipInfo.sipPasswd, mHDLSipInfo.realm); |
| | | #else |
| | | HDLLinphoneKit.Instance.SetAccountAndLogin(mHDLSipInfo.sipAccount, mHDLSipInfo.sipPasswd, mHDLSipInfo.realm); |
| | | #endif |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 注销所有账号 |
| | | /// </summary> |
| | | public void LogoutAllAccount() { |
| | | //没初始化过则返回 |
| | | if (!IsInitSdk) return; |
| | | |
| | | this.currentHDLSipInfo = null; |
| | | this.mHDLCallVideoInfo = null; |
| | | #if __IOS__ |
| | | |
| | | HDLLinPhoneSDK.Instance().LogoutAllLinphoneUser(); |
| | | #else |
| | | HDLLinphoneKit.Instance.Logout(); |
| | | #endif |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 清除配置表 |
| | | /// </summary> |
| | | public void ClearProxyConfig() |
| | | { |
| | | #if __IOS__ |
| | | |
| | | HDLLinPhoneSDK.Instance().ClearAllConfigs(); |
| | | #else |
| | | HDLLinphoneKit.Instance.ClearProxyConfig(); |
| | | #endif |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region ■ -- 获取sip账号_______________________________ |
| | | /// <summary> |
| | | /// 获取当前住宅的SIP账号 |
| | | /// </summary> |
| | | public HDLSipInfo GetHDLSipInfo(string homeId) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", homeId); |
| | | |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | var resultObj = HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_VideoDevice_GetSipAccount, requestJson); |
| | | |
| | | if (resultObj.Code == StateCode.SUCCESS) |
| | | { |
| | | if (string.IsNullOrEmpty(resultObj.Data.ToString())) |
| | | { |
| | | //控的话代表当前住宅不支持 |
| | | return null; |
| | | } |
| | | else |
| | | { |
| | | var info = Newtonsoft.Json.JsonConvert.DeserializeObject<HDLSipInfo>(resultObj.Data.ToString()); |
| | | return info; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | return null; |
| | | } |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 请求服务器获取当前住宅Sip账号信息并初始化LinphoneSDK和登录 |
| | | /// </summary> |
| | | /// <param name="homeId"></param> |
| | | public void GetHDLSipInfoAndInitSDK(string homeId, bool clearCallInfo = true) |
| | | { |
| | | try |
| | | { |
| | | |
| | | |
| | | //先清空呼叫和监视设备信息 |
| | | if (clearCallInfo) |
| | | { |
| | | InitCallInfo(null); |
| | | } |
| | | |
| | | HDLSipInfo mHDLSipInfo = GetHDLSipInfo(homeId); |
| | | if (mHDLSipInfo != null) |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | InitLinphone(); |
| | | mHDLSipInfo.homeId = homeId; |
| | | SetAccountAndLogin(mHDLSipInfo); |
| | | Utlis.WriteLine("CALL 获取SIP账号成功:" + mHDLSipInfo.sipAccount); |
| | | }); |
| | | } |
| | | } |
| | | catch { } |
| | | |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region ■ -- 动作回调和原生交互,提交记录到云端_______________________________ |
| | | |
| | | /// <summary> |
| | | /// 初始化呼叫参数 |
| | | /// </summary> |
| | | /// <param name="mHDLCallVideoInfo"></param> |
| | | /// <param name="mInterphoneType"></param> |
| | | void InitCallInfo(HDLCallVideoInfo mHDLCallVideoInfo) |
| | | { |
| | | this.mHDLCallVideoInfo = mHDLCallVideoInfo; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 判断callId是否为空 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | bool CheckmHDLCallVideoInfoIsNullOrEmpty() |
| | | { |
| | | return (mHDLCallVideoInfo == null || string.IsNullOrEmpty(mHDLCallVideoInfo.CallId)); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 截图成功 暂时废弃 |
| | | /// </summary> |
| | | public void ScreenshotSuccessfulAction(byte[] dataBytes) |
| | | { |
| | | //Utlis.WriteLine("ScreenshotSuccessfulAction"); |
| | | |
| | | if (CheckmHDLCallVideoInfoIsNullOrEmpty()) return; |
| | | |
| | | new Thread(() => |
| | | { |
| | | //var imageName = Guid.NewGuid().ToString(); |
| | | Dictionary<string, object> dic = new Dictionary<string, object>(); |
| | | dic.Add("callId", mHDLCallVideoInfo.CallId); |
| | | dic.Add("images", dataBytes); |
| | | #if __IOS__ |
| | | dic.Add("imagesName", "_IOS.jpg"); |
| | | #else |
| | | dic.Add("imagesName", "_Android.jpg"); |
| | | #endif |
| | | |
| | | var requestJson = HttpUtil.GetSignRequestJson(dic); |
| | | var revertObj = HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_FL_Screenshot, requestJson); |
| | | if (revertObj.Code == StateCode.SUCCESS) |
| | | { |
| | | //Utlis.WriteLine("POST 截图上传成功"); |
| | | } |
| | | else |
| | | { |
| | | Utlis.WriteLine("POST 截图上传失败 code: " + revertObj.Code); |
| | | } |
| | | |
| | | }) |
| | | { IsBackground = false }.Start(); |
| | | |
| | | } |
| | | |
| | | //DateTime UnlockDateTime = DateTime.MinValue; |
| | | #endregion |
| | | |
| | | #region ■ -- 新接听和开锁接口_______________________________ |
| | | /// <summary> |
| | | /// 开锁 |
| | | /// </summary> |
| | | public void HDLUnlockAction() |
| | | { |
| | | //Utlis.WriteLine("UnlockAction"); |
| | | |
| | | if (mHDLCallVideoInfo == null) return; |
| | | |
| | | new Thread(() => |
| | | { |
| | | Dictionary<string, object> dic = new Dictionary<string, object>(); |
| | | dic.Add("deviceId", mHDLCallVideoInfo.DeviceId);//设备id |
| | | dic.Add("callId", mHDLCallVideoInfo.CallId);//当前呼叫id |
| | | dic.Add("interphoneType", mHDLCallVideoInfo.InterphoneType);//可视对讲厂家类型 |
| | | dic.Add("homeId", mHDLCallVideoInfo.HomeId);//住宅ID |
| | | var requestJson = HttpUtil.GetSignRequestJson(dic); |
| | | var revertObj = HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_VideoDevice_OpenDoorbell, requestJson); |
| | | |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | |
| | | #if __IOS__ |
| | | if (revertObj.Code == StateCode.SUCCESS) |
| | | { |
| | | //和原生监控界面交互、发送开锁成功通知 |
| | | NSNotificationCenter.DefaultCenter.PostNotificationName("lcCallDelegateOpenDoorSuccess", null); |
| | | } |
| | | else |
| | | { |
| | | Utlis.WriteLine("POST 开锁失败 code: " + revertObj.Code); |
| | | } |
| | | #else |
| | | if (revertObj.Code == StateCode.SUCCESS) |
| | | { |
| | | HDLLinphoneKit.Instance.OnOpenSuccess(); |
| | | } |
| | | else |
| | | { |
| | | Utlis.WriteLine("POST 开锁失败 code: " + revertObj.Code); |
| | | HDLLinphoneKit.Instance.OnOpenError(revertObj.message); |
| | | } |
| | | #endif |
| | | |
| | | }); |
| | | |
| | | |
| | | }) |
| | | { IsBackground = false }.Start(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 更改通话状态 |
| | | /// </summary> |
| | | public void HDLUpdateCallStatus(CallStatusType callStatusType, InterphoneType interphoneType, int callDuration = 0) |
| | | { |
| | | |
| | | if (CheckmHDLCallVideoInfoIsNullOrEmpty()) return; |
| | | |
| | | new Thread(() => |
| | | { |
| | | Dictionary<string, object> dic = new Dictionary<string, object>(); |
| | | dic.Add("callId", mHDLCallVideoInfo.CallId);//呼叫id |
| | | dic.Add("callStatus", callStatusType.ToString());//可用值:MISSED,RECEIVED,REJECT |
| | | dic.Add("interphoneTypeEnum", interphoneType.ToString()); |
| | | if (callStatusType == CallStatusType.RECEIVED && callDuration > 0) |
| | | { |
| | | dic.Add("callDuration", callDuration);//通话时长(秒) |
| | | } |
| | | |
| | | var requestJson = HttpUtil.GetSignRequestJson(dic); |
| | | var revertObj = HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_VideoDevice_UpdateCallStatus, requestJson); |
| | | if (revertObj.Code == StateCode.SUCCESS) |
| | | { |
| | | |
| | | } |
| | | else |
| | | { |
| | | Utlis.WriteLine("POST 更新状态失败 code: " + revertObj.Code); |
| | | } |
| | | |
| | | }) |
| | | { IsBackground = false }.Start(); |
| | | |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region ■ -- 跳转监控页面_______________________________ |
| | | /// <summary> |
| | | /// 跳转监控页面 |
| | | /// </summary> |
| | | /// <param name="mESVideoInfo"></param> |
| | | public void ShowESVideoMonitor(ESVideoInfo mESVideoInfo) |
| | | { |
| | | InitLinphone(); |
| | | //sip账号为空 |
| | | if (string.IsNullOrEmpty(mESVideoInfo.deviceSipAccount)) |
| | | { |
| | | |
| | | HDLCommon.Current.ShowAlert(Language.StringByID(StringId.shebeibucunzai)); |
| | | return; |
| | | } |
| | | HDLCallVideoInfo mHDLCallVideoInfo = new HDLCallVideoInfo(); |
| | | mHDLCallVideoInfo.HomeId = mESVideoInfo.HomeId; |
| | | mHDLCallVideoInfo.DeviceId = mESVideoInfo.Lc_DeviceId; |
| | | mHDLCallVideoInfo.DeviceName = mESVideoInfo.DeviceName; |
| | | mHDLCallVideoInfo.InterphoneType = InterphoneType.HDL.ToString(); |
| | | mHDLCallVideoInfo.DeviceSipAccount = mESVideoInfo.deviceSipAccount;//监视主动呼叫门口机时用到 |
| | | InitCallInfo(mHDLCallVideoInfo); |
| | | |
| | | #if __IOS__ |
| | | |
| | | HDLLinPhoneSDK.Instance().CallWithUserName(mHDLCallVideoInfo.DeviceSipAccount, mHDLCallVideoInfo.DeviceName); |
| | | |
| | | #else |
| | | //1.先呼叫设备 |
| | | Com.Hdl.Hdllinphonesdk.HDLLinphoneKit.Instance.CallTo(mHDLCallVideoInfo.DeviceSipAccount, true); |
| | | //2.跳转打开监控页面 |
| | | var intent = new Intent(Shared.Application.Activity, typeof(Com.Hdl.Hdllinphonesdk.Activity.HDLLinphoneMonitorActivity)); ; |
| | | intent.PutExtra(HDLLinphoneKit.KeyTitleName, mHDLCallVideoInfo.DeviceName);//传入设备名称为显示标题 |
| | | Shared.Application.Activity.StartActivity(intent); |
| | | #endif |
| | | |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region ■ -- 跳转呼叫页面_______________________________ |
| | | /// <summary> |
| | | /// 收到推送,后判断呼叫住宅是否为当前住宅,不是的话重新获取SIP账号并登录 |
| | | /// </summary> |
| | | /// <param name="mESVideoInfo"></param> |
| | | public void ShowESVideoIntercom(ESVideoInfo mESVideoInfo) |
| | | { |
| | | InitLinphone(); |
| | | |
| | | HDLCallVideoInfo mHDLCallVideoInfo = new HDLCallVideoInfo(); |
| | | mHDLCallVideoInfo.CallId = mESVideoInfo.callId; |
| | | mHDLCallVideoInfo.HomeId = mESVideoInfo.HomeId; |
| | | mHDLCallVideoInfo.DeviceId = mESVideoInfo.Lc_DeviceId; |
| | | mHDLCallVideoInfo.DeviceName = mESVideoInfo.DeviceName; |
| | | mHDLCallVideoInfo.InterphoneType = InterphoneType.HDL.ToString(); |
| | | mHDLCallVideoInfo.DeviceSipAccount = mESVideoInfo.deviceSipAccount; |
| | | InitCallInfo(mHDLCallVideoInfo); |
| | | |
| | | //当前呼叫来电的住宅和之前注册登录的住宅一致的情况下 |
| | | if (currentHDLSipInfo != null && currentHDLSipInfo.homeId == mESVideoInfo.HomeId) |
| | | { |
| | | Utlis.WriteLine("CALL 收到推送 推送住宅和之前注册登录的住宅一致"); |
| | | CheckCallStateAndGotoPage(); |
| | | } |
| | | else |
| | | { |
| | | //注意:之前没登录SIP账号或者住宅不一致的情况下需要重新获取SIP账号 |
| | | //获取呼叫住宅的SIP账号并登录 |
| | | Utlis.WriteLine("CALL 收到推送 其他住宅,重新获取呼叫住宅的SIP账号并登录"); |
| | | new Thread(() => |
| | | { |
| | | GetHDLSipInfoAndInitSDK(mESVideoInfo.HomeId, false); |
| | | }) |
| | | { IsBackground = false }.Start(); |
| | | |
| | | // |
| | | CheckCallStateAndGotoPage(); |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 检测来电状态,判断是否马上打开呼叫页面,如果还没来电则开启线程检测等待 |
| | | /// </summary> |
| | | /// <param name="mESVideoInfo"></param> |
| | | public void CheckCallStateAndGotoPage() |
| | | { |
| | | //如果开启了自动跳转方案,则无需继续下面处理、无需手动跳转 |
| | | if (IsAutoJumpCallView) return; |
| | | //先结束掉之前的线程 |
| | | EndCheckIncomingCallThread(); |
| | | //检测是否来电了如果是直接调整呼叫页面如果不是则开启线程等待判断 |
| | | if (IsIncomingReceivedCallState()) { |
| | | Utlis.WriteLine("CALL 已经来电了。。。打开呼叫页面"); |
| | | GoToHDLLinphoneIntercomActivity(); |
| | | } |
| | | else |
| | | { |
| | | //如果还没来电 开启线程检测 |
| | | StartCheckIncomingCallThread(); |
| | | } |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 是否来电状态 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | bool IsIncomingReceivedCallState() { |
| | | #if __IOS__ |
| | | return HDLLinPhoneSDK.Instance().IsIncomingReceivedCallState; |
| | | #else |
| | | return HDLLinphoneKit.Instance.IsIncomingReceivedCallState; |
| | | #endif |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 跳转打开原生的呼叫页面 |
| | | /// </summary> |
| | | void GoToHDLLinphoneIntercomActivity() { |
| | | |
| | | #if __IOS__ |
| | | |
| | | HDLLinPhoneSDK.Instance().GotoHDLLinphoneIntercomVC(mHDLCallVideoInfo.DeviceName); |
| | | |
| | | #else |
| | | var intent = new Intent(Shared.Application.Activity, typeof(Com.Hdl.Hdllinphonesdk.Activity.HDLLinphoneIntercomActivity)); |
| | | if (mHDLCallVideoInfo != null) |
| | | { |
| | | intent.PutExtra(HDLLinphoneKit.KeyTitleName, mHDLCallVideoInfo.DeviceName); |
| | | } |
| | | Shared.Application.Activity.StartActivity(intent); |
| | | #endif |
| | | |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 检测来电线程 |
| | | /// </summary> |
| | | Thread checkIncomingCallThread = null; |
| | | /// <summary> |
| | | /// 检测线程持续时间 |
| | | /// </summary> |
| | | const int MAX_THREAD_TIME = 30; |
| | | /// <summary> |
| | | /// 线程结束 |
| | | /// </summary> |
| | | int threadTime = MAX_THREAD_TIME; |
| | | /// <summary> |
| | | /// 开启检测来电线程 |
| | | /// </summary> |
| | | void StartCheckIncomingCallThread() |
| | | { |
| | | try |
| | | { |
| | | Utlis.WriteLine("CALL 还没来电,开启线程"); |
| | | threadTime = MAX_THREAD_TIME; |
| | | //结束之前的线程 |
| | | EndCheckIncomingCallThread(); |
| | | //新建线程 |
| | | checkIncomingCallThread = new Thread(() => |
| | | { |
| | | try |
| | | { |
| | | //15S后自动结束线程 |
| | | while (threadTime > 0) |
| | | { |
| | | threadTime--; |
| | | Utlis.WriteLine("CALL 检测中...." + threadTime); |
| | | Thread.Sleep(1000); |
| | | //来电了,跳转呼叫页面 |
| | | if (IsIncomingReceivedCallState()) |
| | | { |
| | | Utlis.WriteLine("CALL 来电了。。。打开呼叫页面"); |
| | | threadTime = 0;//跳出循环,关闭线程 |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | GoToHDLLinphoneIntercomActivity(); |
| | | }); |
| | | |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | catch { } |
| | | }); |
| | | //开启线程 |
| | | checkIncomingCallThread.Start(); |
| | | } |
| | | catch { } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 结束线程 |
| | | /// </summary> |
| | | void EndCheckIncomingCallThread() |
| | | { |
| | | if (checkIncomingCallThread != null) |
| | | { |
| | | try |
| | | { |
| | | checkIncomingCallThread.Interrupt(); |
| | | } |
| | | catch { |
| | | |
| | | } |
| | | |
| | | checkIncomingCallThread = null; |
| | | Utlis.WriteLine("CALL 先结束线程"); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 判断线程是否启动了 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public bool CheckIncomingCallThreadIsNull() |
| | | { |
| | | return checkIncomingCallThread == null || checkIncomingCallThread.ThreadState != ThreadState.Running; |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | |
| | | #region ■ -- Android相关操作_______________________________ |
| | | |
| | | #if __Android__ |
| | | |
| | | /// <summary> |
| | | /// 接听、挂断、开锁等动作监听处理 |
| | | /// </summary> |
| | | private class HDLLinphoneCallListener : Java.Lang.Object, Com.Hdl.Hdllinphonesdk.Callback.IOnHDLLinphoneCallListener |
| | | { |
| | | [Weak] HDLLinphone hdlLinphone; |
| | | |
| | | public HDLLinphoneCallListener(HDLLinphone mHDLLinphone) |
| | | { |
| | | hdlLinphone = mHDLLinphone; |
| | | } |
| | | |
| | | |
| | | //showToast |
| | | void showToast(string text) |
| | | { |
| | | Toast.MakeText(Application.Activity, text, ToastLength.Short).Show(); |
| | | } |
| | | /// <summary> |
| | | /// 接听事件 |
| | | /// </summary> |
| | | public void OnAnswerAction() |
| | | { |
| | | //showToast("接听"); |
| | | hdlLinphone.HDLUpdateCallStatus(CallStatusType.RECEIVED, InterphoneType.HDL); |
| | | } |
| | | /// <summary> |
| | | /// 挂断事件 |
| | | /// </summary> |
| | | /// <param name="callDuration"></param> |
| | | public void OnHangUpAction(int callDuration) |
| | | { |
| | | |
| | | //showToast("挂断 通话时长:" + callDuration); |
| | | hdlLinphone.HDLUpdateCallStatus(CallStatusType.RECEIVED, InterphoneType.HDL, callDuration); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 拒接事件 |
| | | /// </summary> |
| | | public void OnRejectCallAction() |
| | | { |
| | | //showToast("拒接"); |
| | | hdlLinphone.HDLUpdateCallStatus(CallStatusType.REJECT, InterphoneType.HDL); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 截图成功事件 |
| | | /// </summary> |
| | | /// <param name="p0"></param> |
| | | public void OnScreenshotSuccessfulAction(Bitmap imgBitmap) |
| | | { |
| | | //showToast("截图成功"); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 开锁事件 |
| | | /// </summary> |
| | | public void OnUnlockAction() |
| | | { |
| | | hdlLinphone.HDLUnlockAction(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 来电事件 |
| | | /// </summary> |
| | | /// <param name="userName"></param> |
| | | public void OnIncomingCall(string userName) |
| | | { |
| | | Utlis.WriteLine("OnIncomingCall :" + userName); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 设置原生的Listener监听 |
| | | /// </summary> |
| | | void setOnHDLLinphoneCallListener() |
| | | { |
| | | HDLLinphoneKit.Instance.OnHDLLinphoneCallListener = new HDLLinphoneCallListener(this); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 清楚通知栏所有通知 |
| | | /// </summary> |
| | | void CancelAllNotification() |
| | | { |
| | | NotificationManager nMgr = (NotificationManager)Application.Activity.GetSystemService(Context.NotificationService); |
| | | nMgr.CancelAll(); |
| | | } |
| | | |
| | | #endif |
| | | #endregion |
| | | |
| | | #region ■ -- iOS相关操作_______________________________ |
| | | |
| | | #if __IOS__ |
| | | |
| | | #region OnHDLLinphoneCallDelegate |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | OnHDLLinphoneCallDelegate mOnHDLLinphoneCallDelegate; |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public class OnHDLLinphoneCallDelegate : HDLLinphoneCallDelegate |
| | | { |
| | | [Weak] HDLLinphone hdlLinphone; |
| | | |
| | | public OnHDLLinphoneCallDelegate(HDLLinphone mHDLLinphone) |
| | | { |
| | | this.hdlLinphone = mHDLLinphone; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 接听 |
| | | /// </summary> |
| | | public override void OnAnswerAction() |
| | | { |
| | | hdlLinphone.HDLUpdateCallStatus(CallStatusType.RECEIVED, InterphoneType.HDL); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 挂断 |
| | | /// </summary> |
| | | /// <param name="callDuration"></param> |
| | | public override void OnHangUpAction(int callDuration) |
| | | { |
| | | hdlLinphone.HDLUpdateCallStatus(CallStatusType.RECEIVED, InterphoneType.HDL, callDuration); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 拒接 |
| | | /// </summary> |
| | | public override void OnRejectCallAction() |
| | | { |
| | | hdlLinphone.HDLUpdateCallStatus(CallStatusType.REJECT, InterphoneType.HDL); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 截图成功 |
| | | /// </summary> |
| | | /// <param name="image"></param> |
| | | public override void OnScreenshotSuccessfulAction(UIImage image) |
| | | { |
| | | ////NSData imageData = UIImagePNGRepresentation(image); UIImage |
| | | //NSData imageData = image.AsPNG(); |
| | | //byte[] dataBytes = new byte[imageData.Length]; |
| | | //System.Runtime.InteropServices.Marshal.Copy(imageData.Bytes, dataBytes, 0, Convert.ToInt32(imageData.Length)); |
| | | ////image.g |
| | | ////hdlLinphone.ScreenshotSuccessfulAction(dataBytes); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 开锁成功 |
| | | /// </summary> |
| | | public override void OnUnlockAction() |
| | | { |
| | | hdlLinphone.HDLUnlockAction(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 来电中... |
| | | /// </summary> |
| | | public override void OnIncomingCall(string userName) |
| | | { |
| | | Utlis.WriteLine("OnIncomingCall :" + userName); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | #endregion |
| | | #endif |
| | | |
| | | #endregion |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// SIP可视对讲参数 |
| | | /// </summary> |
| | | public class HDLCallVideoInfo |
| | | { |
| | | /// <summary> |
| | | /// 设备序列号,通讯必要字段 |
| | | /// </summary> |
| | | public string DeviceId = string.Empty; |
| | | /// <summary> |
| | | /// 设备名称 |
| | | /// </summary> |
| | | public string DeviceName = string.Empty; |
| | | /// <summary> |
| | | /// 设备Sip账号 |
| | | /// </summary> |
| | | public string DeviceSipAccount = string.Empty; |
| | | /// <summary> |
| | | /// 呼叫记录Id |
| | | /// </summary> |
| | | public string CallId = string.Empty; |
| | | /// <summary> |
| | | /// 住宅Id |
| | | /// </summary> |
| | | public string HomeId = string.Empty; |
| | | /// <summary> |
| | | /// 类型 |
| | | /// </summary> |
| | | public string InterphoneType; |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// SIP账号相关信息 |
| | | /// </summary> |
| | | public class HDLSipInfo |
| | | { |
| | | /// <summary> |
| | | /// Sip服务器 |
| | | /// </summary> |
| | | public string proxy { get; set; } |
| | | /// <summary> |
| | | /// 设备域 |
| | | /// </summary> |
| | | public string realm { get; set; } |
| | | /// <summary> |
| | | /// sip账号 |
| | | /// </summary> |
| | | public string sipAccount { get; set; } |
| | | /// <summary> |
| | | /// sipPasswd sip密码 |
| | | /// </summary> |
| | | public string sipPasswd { get; set; } |
| | | /// <summary> |
| | | /// 住宅ID |
| | | /// </summary> |
| | | public string homeId; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | HDL_ON.UI.UI2.Intelligence.Automation.Logic.LogicList.Clear(); |
| | | DAL.Mqtt.MqttClient.DisConnectRemote("退出登录,或者切换住宅"); |
| | | } |
| | | /// <summary> |
| | | /// 是否支持人脸通行 |
| | | /// </summary> |
| | | public bool SupportFacePass = false; |
| | | |
| | | /// <summary> |
| | | /// 网关详细信息 |
New file |
| | |
| | | using System; |
| | | namespace HDL_ON.Entity |
| | | { |
| | | public class AirSwitch |
| | | { |
| | | public AirSwitch() |
| | | { |
| | | } |
| | | } |
| | | } |
| | |
| | | /// 青萍环境传感器 |
| | | /// </summary> |
| | | public const string SensorEnvironment3 = "sensor.environment3"; |
| | | /// <summary> |
| | | /// 甲醛 |
| | | /// </summary> |
| | | public const string SensorHcho = "sensor.hcho"; |
| | | |
| | | /// <summary> |
| | | /// 环境传感器spk列表 |
| | |
| | | spkList.Add(SensorEnvironment); |
| | | spkList.Add(SensorEnvironment2); |
| | | spkList.Add(SensorEnvironment3); |
| | | spkList.Add(SensorHcho); |
| | | return spkList; |
| | | } |
| | | |
| | |
| | | /// 红外风扇 |
| | | /// </summary> |
| | | public const string FanIr = "ir.fan"; |
| | | /// <summary> |
| | | /// 智能空开 |
| | | /// </summary> |
| | | public const string AirSwitch = "electrical.breaker"; |
| | | |
| | | #region 涂鸦 |
| | | /// <summary> |
| | |
| | | spkList.Add(ElectricTuyaFan); |
| | | spkList.Add(ElectricTuyaWeepRobot); |
| | | spkList.Add(ElectricTuyaWaterValve); |
| | | spkList.Add(AirSwitch); |
| | | return spkList; |
| | | } |
| | | |
| | |
| | | namespace HDL_ON.Entity |
| | | { |
| | | |
| | | public class SecurityCenter |
| | | public class SecurityCenter111111 |
| | | { |
| | | static SecurityCenter _securityCenter; |
| | | static SecurityCenter111111 _securityCenter; |
| | | |
| | | public static SecurityCenter Ins |
| | | public static SecurityCenter111111 Ins |
| | | { |
| | | get |
| | | { |
| | | if (_securityCenter == null) |
| | | { |
| | | _securityCenter = new SecurityCenter(); |
| | | _securityCenter = new SecurityCenter111111(); |
| | | } |
| | | return _securityCenter; |
| | | } |
| | |
| | | { |
| | | get |
| | | { |
| | | foreach (var temp in FunctionList.List.securities) |
| | | lock (FunctionList.List.securities) |
| | | { |
| | | if (temp.status == "enable") |
| | | { |
| | | return true; |
| | | } |
| | | var temp = FunctionList.List.securities.Find((obj) => obj.status == "enable"); |
| | | return temp == null ? false : true; |
| | | } |
| | | return false; |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | get |
| | | { |
| | | foreach (var temp in FunctionList.List.securities) |
| | | lock (FunctionList.List.securities) |
| | | { |
| | | if (temp.alarm) |
| | | { |
| | | return true; |
| | | } |
| | | var temp = FunctionList.List.securities.Find((obj) => obj.alarm == true); |
| | | return temp == null ? false : true; |
| | | } |
| | | return false; |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | if (_inDefenseMode == null) |
| | | { |
| | | foreach (var temp in FunctionList.List.securities) |
| | | lock (FunctionList.List.securities) |
| | | { |
| | | if (temp.status == "enable") |
| | | { |
| | | _inDefenseMode = temp; |
| | | return _inDefenseMode; |
| | | } |
| | | var temp = FunctionList.List.securities.Find((obj) => obj.status == "enable"); |
| | | return temp; |
| | | } |
| | | } |
| | | return _inDefenseMode; |
| | |
| | | _intervalValue.Add("33°C ~"); |
| | | break; |
| | | case SPK.SensorTVOC: |
| | | _intervalValue.Add("0 ~ 0.6"); |
| | | _intervalValue.Add("0.61 ~ 2"); |
| | | _intervalValue.Add("2.01 ~ 5"); |
| | | _intervalValue.Add("5 ~"); |
| | | _intervalValue.Add("0 ~ 600"); |
| | | _intervalValue.Add("601 ~ 2000"); |
| | | _intervalValue.Add("2001 ~ 5000"); |
| | | _intervalValue.Add("5001 ~"); |
| | | break; |
| | | case SPK.SensorHumidity: |
| | | _intervalValue.Add("70 ~"); |
| | | _intervalValue.Add("71 ~ 40"); |
| | | _intervalValue.Add("0 ~ 39"); |
| | | break; |
| | | case SPK.SensorHcho: |
| | | _intervalValue.Add("~ 0.08"); |
| | | _intervalValue.Add("0.08 ~ 0.1"); |
| | | _intervalValue.Add("0.1 ~ "); |
| | | break; |
| | | |
| | | } |
| | | return _intervalValue; |
| | | } |
| | |
| | | _levelColorList.Add(0xFF2172FF); |
| | | _levelColorList.Add(0xFFADE764); |
| | | _levelColorList.Add(0xFFFF3D3D); |
| | | break; |
| | | case SPK.SensorHcho: |
| | | _levelColorList.Add(0xFF2172FF); |
| | | _levelColorList.Add(0xFFADE764); |
| | | _levelColorList.Add(0xFFFF3D3D); |
| | | break; |
| | | default: |
| | | _levelColorList.Add(0x00000000); |
| | | _levelColorList.Add(0x00000000); |
| | | _levelColorList.Add(0x00000000); |
| | | break; |
| | | } |
| | | return _levelColorList; |
| | |
| | | _levelTextList.Add(StringId.SensorReferenceHumidityTipLevel2); |
| | | _levelTextList.Add(StringId.SensorReferenceHumidityTipLevel3); |
| | | break; |
| | | case SPK.SensorHcho: |
| | | _levelTextList.Add(StringId.Class_I_BuildingStandard); |
| | | _levelTextList.Add(StringId.SecondaryBuildingStandard); |
| | | _levelTextList.Add(StringId.ExceedingTheStandard); |
| | | break; |
| | | default: |
| | | _levelTextList.Add(99999999); |
| | | _levelTextList.Add(99999999); |
| | | _levelTextList.Add(99999999); |
| | | break; |
| | | } |
| | | return _levelTextList; |
| | | } |
| | |
| | | level = 2; |
| | | else if (values < 5000) |
| | | level = 3; |
| | | else if (values > 5000) |
| | | else if (values >= 5000) |
| | | level = 4; |
| | | break; |
| | | case SPK.SensorTemperature: |
| | |
| | | level = 7; |
| | | break; |
| | | case SPK.SensorTVOC: |
| | | if (values < 0.6) |
| | | if (values < 600) |
| | | level = 1; |
| | | else if (values < 2) |
| | | else if (values < 2000) |
| | | level = 2; |
| | | else if (values < 5) |
| | | else if (values < 5000) |
| | | level = 3; |
| | | else if (values > 5) |
| | | else if (values >= 5000) |
| | | level = 4; |
| | | break; |
| | | case SPK.SensorHumidity: |
| | |
| | | else if (values < 40) |
| | | level = 3; |
| | | break; |
| | | case SPK.SensorHcho: |
| | | if (values <= 0.08) |
| | | level = 1; |
| | | else if (values <= 0.1) |
| | | level = 2; |
| | | else |
| | | level = 3; |
| | | break; |
| | | } |
| | | return level; |
| | | } |
| | |
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\ArmCenter\AddInputPage.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\ArmCenter\AddOutputPage.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\ArmCenter\AddOutputSettingPage.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\FaceManagement\FaceSettingPage.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\Security.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Electrical\AirSwitchPage.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Entity\Function\AirSwitch.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\FaceManagement\FaceSettingResultPage.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\FaceManagement\CustomerObj.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\Security.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)DAL\ThirdPartySdk\HDLLinphone.cs" />
|
| | | </ItemGroup>
|
| | | <ItemGroup>
|
| | | <Folder Include="$(MSBuildThisFileDirectory)Entity\Device\" />
|
| | |
| | | /// <summary> |
| | | /// 版本号 |
| | | /// </summary> |
| | | public static string VersionString = "1.2.0821"; |
| | | public static string VersionString = "1.2.0828"; |
| | | ///// <summary> |
| | | ///// 客户端类型 |
| | | ///// </summary> |
| | |
| | | SPK.CurtainRoller,SPK.CurtainSwitch,SPK.CurtainTrietex, |
| | | SPK.AcIr,SPK.AcStandard, |
| | | SPK.FloorHeatStandard, |
| | | SPK.AirFreshStandard, |
| | | |
| | | }; |
| | | /// <summary> |
| | |
| | | { |
| | | SPK.EnergyStandard, |
| | | SPK.MusicStandard, |
| | | SPK.AirSwitch, |
| | | SPK.ElectricEnergy, |
| | | }; |
| | | |
| | | |
| | |
| | | //}) |
| | | //{ IsBackground = true }.Start(); |
| | | Common.ApiUtlis.Ins.DownloadData(); |
| | | |
| | | |
| | | GoUserPage(false,true); |
| | | } |
| | | } |
| | |
| | | /// <param name="isFirstOpen">如果是第一次启动 检测校验密码</param> |
| | | /// <param name="pageShowEvent">主页显示之后触发的事件(没有住宅的话,则不会触发)</param> |
| | | public static void GoUserPage(bool downloadData , bool isFirstOpen = false, Action pageShowEvent = null) |
| | | { |
| | | { |
| | | BaseView.RemoveAll(); |
| | | #region 后退事件 |
| | | BasePageView = new PageLayout(); |
| | |
| | | ///等待获取住宅信息 |
| | | Application.RunOnMainThread( () => |
| | | { |
| | | waitPage.Hide(); |
| | | waitPage.RemoveFromParent(); |
| | | if (waitPage != null) |
| | | { |
| | | waitPage.RemoveFromParent(); |
| | | waitPage = null; |
| | | } |
| | | |
| | | //跳转页面---- |
| | | UserBasePage = new UserPage(); |
| | |
| | | if (showedTime.AddSeconds(30) > DateTime.Now) |
| | | { |
| | | thread.Abort(); |
| | | waitPage.RemoveFromParent(); |
| | | if (waitPage != null) |
| | | { |
| | | waitPage.RemoveFromParent(); |
| | | waitPage = null; |
| | | } |
| | | } |
| | | }; |
| | | thread.Start(); |
| | |
| | | //跳转到功能信息设置页面 |
| | | switch (function.spk) |
| | | { |
| | | case SPK.AirSwitch: |
| | | var airSwitchPage = new AirSwitchPage(function); |
| | | MainPage.BasePageView.AddChidren(airSwitchPage); |
| | | airSwitchPage.LoadPage(btnCollectionIcon, btnName, btnFromFloor); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | break; |
| | | case SPK.LightSwitch: |
| | | var relayView = new RelayPage(function); |
| | | MainPage.BasePageView.AddChidren(relayView); |
| | |
| | | /// </summary> |
| | | /// <param name="frame"></param> |
| | | /// <param name="tilte"></param> |
| | | public void LoadTopView_FunctionTop(Function function, Action action) |
| | | public void LoadTopView_FunctionTop(Function function, Action action,bool locationSet = true) |
| | | { |
| | | backAction = action; |
| | | |
| | |
| | | { |
| | | var infoView = new FunctionBaseInfoSetPage(function, action); |
| | | MainPage.BasePageView.AddChidren(infoView); |
| | | infoView.LoadPage(); |
| | | infoView.LoadPage(locationSet); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | | } |
| | |
| | | //etAccount.Text = "1033326940@qq.com"; |
| | | //etAccount.Text = "18022428438";//wjc |
| | | //etAccount.Text = "13602944661";//kx |
| | | //etAccount.Text = "13226233133";//豆豆 |
| | | //etAccount.Text = "18316672920";//lcg "18316672920";//hzx;// ""//cf;; |
| | | etAccount.Text = "13226233133";//豆豆 |
| | | etAccount.Text = "18316672920"; |
| | | //etAccount.Text = "18316120654";//tujie |
| | | // "15622703419"lwn;// "18824864143";//"464027401@qq.com"; //"2791308028@qq.com";//13697499568 |
| | | etAccount.Text = "15626203746"; |
| | | //etAccount.Text = "15626203746"; |
| | | //etAccount.Text = "13450425807";//黄竹溪 knx项目 |
| | | } |
| | | else |
| | |
| | | //etAccount.Text = "15971583093";//高胜 |
| | | //etAccount.Text = "15217626103";//昆明金茂项目 |
| | | //etAccount.Text = "18598273624"; |
| | | etAccount.Text = "fslcjm5@163.com"; |
| | | etAccount.Text = "18824864143";//"464027401@qq.com"; //"2791308028@qq.com";//13697499568 |
| | | } |
| | | b = !b; |
| | | etPassword.Text = "123456"; |
| | | if(etAccount.Text == "15626203746") |
| | | if(etAccount.Text == "fslcjm5@163.com") |
| | | { |
| | | etPassword.Text = "123456"; |
| | | etPassword.Text = "a123456"; |
| | | } |
| | | //etPassword.Text = "Hdl85521566"; |
| | | btnLogin.IsSelected = true; |
| | |
| | | |
| | | |
| | | #if DEBUG |
| | | |
| | | |
| | | //FunctionList.List.Functions.Add(new Function() |
| | | //{ |
| | | // spk = SPK.AirSwitch, |
| | | // name = "智能空开", |
| | | // attributes = new List<FunctionAttributes>() |
| | | // { |
| | | // new FunctionAttributes(){ key = "on_off",curValue= "on",state = "on" }, |
| | | // }, |
| | | //}); |
| | | |
| | | //FunctionList.List.Functions.Add(new Function() |
| | | //{ |
| | | // spk = SPK.AirFreshStandard, |
| | |
| | | // attributes = new List<FunctionAttributes>() |
| | | // { |
| | | // new FunctionAttributes(){ key = "on_off",curValue= "on",state = "on" }, |
| | | // new FunctionAttributes(){ key = "fan",curValue= "on",state = "on" ,value = new List<string>(){ "high","low" } }, |
| | | // new FunctionAttributes(){ key = "fan",curValue= "low",state = "low" ,value = new List<string>(){ "high", "medium", "low" } }, |
| | | // }, |
| | | //}); |
| | | |
| | | FunctionList.List.Functions.Add(new Function() |
| | | { |
| | | spk = SPK.SensorGas, |
| | | name = "燃气传感器", |
| | | attributes = new List<FunctionAttributes>() |
| | | { |
| | | new FunctionAttributes(){ key = "enable",curValue= "true",state = "true" ,value = new List<string>(){ "true", "false" } }, |
| | | new FunctionAttributes(){ key = "status",curValue= "normal",state = "normal" ,value = new List<string>(){ "alarm", "normal" } }, |
| | | }, |
| | | }); |
| | | //FunctionList.List.Functions.Add(new Function() |
| | | //{ |
| | | // spk = SPK.SensorGas, |
| | | // name = "燃气传感器", |
| | | // attributes = new List<FunctionAttributes>() |
| | | // { |
| | | // new FunctionAttributes(){ key = "enable",curValue= "true",state = "true" ,value = new List<string>(){ "true", "false" } }, |
| | | // new FunctionAttributes(){ key = "status",curValue= "normal",state = "normal" ,value = new List<string>(){ "alarm", "normal" } }, |
| | | // }, |
| | | //}); |
| | | |
| | | //FunctionList.List.Functions.Add(new Function() { spk = SPK.PjtIr, name = "测试投影仪", |
| | | // attributes = new List<FunctionAttributes>() { |
| | |
| | | GetUnreadPushMessages(); |
| | | RegisterGetPushMessageAction(); |
| | | |
| | | waitPage.Hide(); |
| | | if (waitPage != null) |
| | | { |
| | | waitPage.RemoveFromParent(); |
| | | waitPage = null; |
| | | } |
| | | }); |
| | | } |
| | | catch (Exception ex) { |
| | |
| | | /// </summary> |
| | | public static void LoadEvent_RefreshSecurityStatus() |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | try |
| | | { |
| | | if (bodyView != null) |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | //foreach(var temp in FunctionList.List.securities) |
| | | //{ |
| | | // if(temp.status == "enable") |
| | | // { |
| | | // bodyView.btnSecurityStatus.IsSelected = true; |
| | | // return; |
| | | // } |
| | | //} |
| | | bodyView.btnSecurityStatus.IsSelected = SecurityCenter.Ins.InDefense; |
| | | } |
| | | }); |
| | | if (bodyView != null) |
| | | { |
| | | lock (FunctionList.List.securities) |
| | | { |
| | | foreach (var temp in FunctionList.List.securities) |
| | | { |
| | | if (temp.status == "enable") |
| | | { |
| | | if (temp.alarm) |
| | | { |
| | | bodyView.btnSecurityStatus.SelectedImagePath = "Collection/DefenseAlarmIcon.png"; |
| | | } |
| | | else |
| | | { |
| | | bodyView.btnSecurityStatus.SelectedImagePath = "Collection/DefenseStatusIcon.png"; |
| | | } |
| | | bodyView.btnSecurityStatus.IsSelected = true; |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log($"安防主页更新异常:{ex.Message}"); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | { |
| | | //未读的消息列表 |
| | | var unreadList = new List<PushMessageInfo>(); |
| | | |
| | | var pushMessageInfoList = Newtonsoft.Json.JsonConvert.DeserializeObject<PushMessageInfoList>(result.Data.ToString()); |
| | | |
| | | var pushMessageInfoList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<PushMessageInfo>>(result.Data.ToString()); |
| | | |
| | | if (pushMessageInfoList != null && pushMessageInfoList.Count > 0) |
| | | if (pushMessageInfoList != null && pushMessageInfoList.list != null && pushMessageInfoList.list.Count > 0) |
| | | { |
| | | foreach (var info in pushMessageInfoList) |
| | | foreach (var info in pushMessageInfoList.list) |
| | | { |
| | | if (!info.isRead) |
| | | { |
| | |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | ShowMesBtnState(pushMessageInfoList[0], true); |
| | | ShowMesBtnState(pushMessageInfoList.list[0], true); |
| | | }); |
| | | } |
| | | } |
| | |
| | | /// <summary> |
| | | /// menuView |
| | | /// </summary> |
| | | FrameLayout menuView; |
| | | HorizontalScrolViewLayout menuView;//2021-08-27 增加多了一个菜单按钮所以改为滚动控件 |
| | | MenuButton allMenuButton; |
| | | MenuButton shareMenuButton; |
| | | MenuButton alarmMenuButton; |
| | | MenuButton systemMenuButton; |
| | | MenuButton propertyMenuButton;//增加物业通知按钮 |
| | | FrameLayout messageView; |
| | | |
| | | /// <summary> |
| | | /// 显示的消息类型 |
| | | /// 0全部 1分享与功能 2报警类 3系统信息 |
| | | /// 0全部 1分享与功能 2报警类 3系统信息 4物业公告 |
| | | /// </summary> |
| | | int showMesType = 0; |
| | | /// <summary> |
| | |
| | | void AddTopMenuView() |
| | | { |
| | | |
| | | menuView = new FrameLayout() |
| | | menuView = new HorizontalScrolViewLayout() |
| | | { |
| | | Y = Application.GetRealHeight(64), |
| | | Height = Application.GetRealWidth(117), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | HorizontalScrollBarEnabled = false//隐藏滚动条 |
| | | }; |
| | | bodyView.AddChidren(menuView); |
| | | |
| | | //左padding View |
| | | menuView.AddChidren(new Button() |
| | | { |
| | | Width = Application.GetRealWidth(15), |
| | | BackgroundColor = CSS_Color.viewTranslucence |
| | | }); |
| | | |
| | | #region 全部按钮 |
| | | allMenuButton = new MenuButton() |
| | |
| | | MenuButtonSelect(3); |
| | | }; |
| | | systemMenuButton.SelectAction = systemAction; |
| | | #endregion |
| | | #endregion |
| | | |
| | | #region 物业通知 |
| | | propertyMenuButton = new MenuButton() |
| | | { |
| | | X = systemMenuButton.Right, |
| | | Y = Application.GetRealWidth(16), |
| | | }; |
| | | //menuView.AddChidren(propertyMenuButton); //先屏蔽 |
| | | propertyMenuButton.ImageButton.SelectedImagePath = "Collection/MesCenter/SystemOn.png"; |
| | | propertyMenuButton.ImageButton.UnSelectedImagePath = "Collection/MesCenter/System.png"; |
| | | propertyMenuButton.TextButton.TextID = StringId.SystemMessage; |
| | | Action propertyAction = () => |
| | | { |
| | | MenuButtonSelect(4); |
| | | }; |
| | | propertyMenuButton.SelectAction = propertyAction; |
| | | #endregion |
| | | |
| | | //先屏蔽 |
| | | ////右paddingView |
| | | //menuView.AddChidren(new Button() { |
| | | // Width = Application.GetRealWidth(15), |
| | | // BackgroundColor = CSS_Color.viewTranslucence |
| | | //}); |
| | | |
| | | } |
| | | |
| | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | /// <param name="selectId">0全部 1分享与功能 2报警类 3系统信息</param> |
| | | /// <param name="selectId">0全部 1分享与功能 2报警类 3系统信息 4物业通知</param> |
| | | void MenuButtonSelect(int selectId) |
| | | { |
| | | showMesType = selectId; |
| | |
| | | shareMenuButton.IsSelected = true; |
| | | alarmMenuButton.IsSelected = true; |
| | | systemMenuButton.IsSelected = true; |
| | | propertyMenuButton.IsSelected = true; |
| | | |
| | | } |
| | | else if (selectId == 1) |
| | |
| | | shareMenuButton.IsSelected = true; |
| | | alarmMenuButton.IsSelected = false; |
| | | systemMenuButton.IsSelected = false; |
| | | propertyMenuButton.IsSelected = false; |
| | | |
| | | } |
| | | else if (selectId == 2) |
| | |
| | | shareMenuButton.IsSelected = false; |
| | | alarmMenuButton.IsSelected = true; |
| | | systemMenuButton.IsSelected = false; |
| | | propertyMenuButton.IsSelected = false; |
| | | } |
| | | else if (selectId == 3) |
| | | { |
| | |
| | | shareMenuButton.IsSelected = false; |
| | | alarmMenuButton.IsSelected = false; |
| | | systemMenuButton.IsSelected = true; |
| | | propertyMenuButton.IsSelected = false; |
| | | |
| | | } |
| | | else if (selectId == 4) |
| | | { |
| | | allMenuButton.IsSelected = false; |
| | | shareMenuButton.IsSelected = false; |
| | | alarmMenuButton.IsSelected = false; |
| | | systemMenuButton.IsSelected = false; |
| | | propertyMenuButton.IsSelected = true; |
| | | |
| | | } |
| | | |
| | |
| | | var result = new HttpServerRequest().PushSerivceGetPushmessagelist(queryType); |
| | | if (result.Code == StateCode.SUCCESS) |
| | | { |
| | | PushMessageInfoList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<PushMessageInfo>>(result.Data.ToString()); |
| | | //PushMessageInfoList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<PushMessageInfo>>(result.Data.ToString()); |
| | | //2021-08-28 改为分页接口 |
| | | var mPushMesList = Newtonsoft.Json.JsonConvert.DeserializeObject<PushMessageInfoList>(result.Data.ToString()); |
| | | if(mPushMesList != null) { |
| | | PushMessageInfoList = mPushMesList.list; |
| | | } |
| | | |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | if (PushMessageInfoList != null && PushMessageInfoList.Count > 0) |
| | |
| | | public long createTime; |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | // 推送消息分页对象 |
| | | /// </summary> |
| | | public class PushMessageInfoList : BasePagingObj |
| | | { |
| | | public List<PushMessageInfo> list = new List<PushMessageInfo>(); |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | waitPage.Hide(); |
| | | waitPage.RemoveFromParent(); |
| | | if (waitPage != null) |
| | | { |
| | | waitPage.RemoveFromParent(); |
| | | waitPage = null; |
| | | } |
| | | }); |
| | | } |
| | | }) |
| | |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | waitPage.Hide(); |
| | | waitPage.RemoveFromParent(); |
| | | if (waitPage != null) |
| | | { |
| | | waitPage.RemoveFromParent(); |
| | | waitPage = null; |
| | | } |
| | | }); |
| | | } |
| | | }) |
| | |
| | | }; |
| | | } |
| | | break; |
| | | |
| | | } |
| | | return list; |
| | | } |
| | |
| | | { |
| | | value = "5"; |
| | | } |
| | | else if (text == Language.StringByID(StringId.yanzhong) +":>700PPB") |
| | | else if (text == Language.StringByID(StringId.yanzhong) + ":>700PPB") |
| | | { |
| | | value = "8"; |
| | | } |
| | |
| | | btnZone = new Button() |
| | | { |
| | | X = Application.GetRealWidth(12), |
| | | Y = btnName.Bottom, |
| | | Y = Application.GetRealWidth(68+24), |
| | | Height = Application.GetRealWidth(18), |
| | | Width = Application.GetRealWidth(113), |
| | | TextColor = CSS_Color.MainBackgroundColor, |
| | |
| | | } |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => { waitPage.Hide(); }); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | if (waitPage != null) |
| | | { |
| | | waitPage.RemoveFromParent(); |
| | | waitPage = null; |
| | | } |
| | | }); |
| | | } |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | |
| | | } |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => { waitPage.Hide(); }); |
| | | Application.RunOnMainThread(() => { |
| | | if (waitPage != null) |
| | | { |
| | | waitPage.RemoveFromParent(); |
| | | waitPage = null; |
| | | } |
| | | }); |
| | | } |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | |
| | | } |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => { waitPage.Hide(); }); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | if (waitPage != null) |
| | | { |
| | | waitPage.RemoveFromParent(); |
| | | waitPage = null; |
| | | } |
| | | }); |
| | | } |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | |
| | | } |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => { waitPage.Hide(); }); |
| | | Application.RunOnMainThread(() => { |
| | | if (waitPage != null) |
| | | { |
| | | waitPage.RemoveFromParent(); |
| | | waitPage = null; |
| | | } |
| | | }); |
| | | } |
| | | }) |
| | | { IsBackground = true }.Start(); |
New file |
| | |
| | | using System; |
| | | namespace HDL_ON.Entity |
| | | { |
| | | public class CustomerObj |
| | | { |
| | | public CustomerObj() |
| | | { |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 住户id |
| | | /// </summary> |
| | | public string customerId; |
| | | /// <summary> |
| | | /// 住户名称 |
| | | /// </summary> |
| | | public string customerName; |
| | | /// <summary> |
| | | /// 住户类型 |
| | | /// </summary> |
| | | public int customerType; |
| | | /// <summary> |
| | | /// 住户类型中文 |
| | | /// </summary> |
| | | public string customerTypeText; |
| | | /// <summary> |
| | | /// 苑期区编号 |
| | | /// </summary> |
| | | public string groupCode; |
| | | /// <summary> |
| | | /// 楼幢编号 |
| | | /// </summary> |
| | | public string buildingCode; |
| | | /// <summary> |
| | | /// 单元编号 |
| | | /// </summary> |
| | | public string unitCode; |
| | | /// <summary> |
| | | /// 楼层号 |
| | | /// </summary> |
| | | public string floorNum; |
| | | /// <summary> |
| | | /// 房屋编号 |
| | | /// </summary> |
| | | public string houseCode; |
| | | /// <summary> |
| | | /// 房屋名称 |
| | | /// </summary> |
| | | public string houseName; |
| | | /// <summary> |
| | | /// 住户手机号 |
| | | /// </summary> |
| | | public string customerPhone; |
| | | /// <summary> |
| | | /// 住户分机号 |
| | | /// </summary> |
| | | public string customerPhoneProfix; |
| | | /// <summary> |
| | | /// 住户性别 |
| | | /// </summary> |
| | | public string customerSex; |
| | | /// <summary> |
| | | /// 住户性别中文 |
| | | /// </summary> |
| | | public string customerSexText; |
| | | /// <summary> |
| | | /// 住户证件号 |
| | | /// </summary> |
| | | public string certificateNo; |
| | | /// <summary> |
| | | /// 住户人脸url |
| | | /// </summary> |
| | | public string customerFaceUrl; |
| | | /// <summary> |
| | | /// 住户地址 |
| | | /// </summary> |
| | | public string address; |
| | | /// <summary> |
| | | /// 人脸录入状态 |
| | | /// 1:录入状态 |
| | | /// 2:下发成功 |
| | | /// 3:下发失败 |
| | | /// </summary> |
| | | public int faceStatus = 0; |
| | | /// <summary> |
| | | /// 人脸开启状态 |
| | | /// 1:开启状态 |
| | | /// 2:关闭状态 |
| | | /// 3:清除人脸数据 |
| | | /// </summary> |
| | | public int faceClose = 0; |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | using System; |
| | | using System.Threading; |
| | | using HDL_ON.DAL.Server; |
| | | using HDL_ON.Entity; |
| | | using HDL_ON.UI.CSS; |
| | | using Shared; |
| | | |
| | |
| | | public class FacePassagePage : FrameLayout |
| | | { |
| | | FrameLayout bodyView; |
| | | |
| | | FrameLayout contentView; |
| | | Button btnCommunityAccessControlIcon; |
| | | |
| | | Button btnSetFaceId; |
| | | |
| | | Button btnEraseData; |
| | | |
| | | #region 图标选择部分图标 |
| | | /// <summary> |
| | | /// 面容id |
| | | /// 背景图选项区域 |
| | | /// </summary> |
| | | string faceid = ""; |
| | | FrameLayout pictureOptionView; |
| | | /// <summary> |
| | | /// 背景图选项选择区域 |
| | | /// </summary> |
| | | VerticalScrolViewLayout optionView; |
| | | /// <summary> |
| | | /// 拍照按钮 |
| | | /// </summary> |
| | | Button btnTakePicture; |
| | | /// <summary> |
| | | /// 相册按钮 |
| | | /// </summary> |
| | | Button btnAlbum; |
| | | /// <summary> |
| | | /// 取消按钮 |
| | | /// </summary> |
| | | Button btnCancel; |
| | | #endregion |
| | | |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 住户详情 |
| | | /// </summary> |
| | | CustomerObj customerObj = new CustomerObj(); |
| | | |
| | | public FacePassagePage() |
| | | { |
| | |
| | | bodyView.BackgroundColor = CSS_Color.BackgroundColor; |
| | | |
| | | |
| | | var contentView = new FrameLayout() |
| | | contentView = new FrameLayout() |
| | | { |
| | | Y = Application.GetRealHeight(64), |
| | | Height = Application.GetRealHeight(667-64), |
| | | Height = Application.GetRealHeight(667 - 64), |
| | | }; |
| | | bodyView.AddChidren(contentView); |
| | | |
| | |
| | | }; |
| | | topView.AddChidren(btnText1); |
| | | |
| | | topView.AddChidren(new Button() { Height = 1,BackgroundColor = CSS_Color.DividingLineColor,Y = Application.GetRealHeight(188) ,X = Application.GetRealWidth(16),Width = Application.GetRealWidth(359)}); |
| | | topView.AddChidren(new Button() { Height = 1, BackgroundColor = CSS_Color.DividingLineColor, Y = Application.GetRealHeight(188), X = Application.GetRealWidth(16), Width = Application.GetRealWidth(359) }); |
| | | |
| | | #region 社区门禁通行 |
| | | var communityRow = new FrameLayout() |
| | |
| | | communityRow.AddChidren(btnCommunityTitle); |
| | | |
| | | |
| | | var btnCommunityAccessControlIcon = new Button() |
| | | btnCommunityAccessControlIcon = new Button() |
| | | { |
| | | X = Application.GetRealWidth(314), |
| | | Gravity = Gravity.CenterVertical, |
| | |
| | | }; |
| | | communityRow.AddChidren(btnCommunityAccessControlIcon); |
| | | |
| | | btnCommunityAccessControlIcon.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (customerObj.faceClose == 3)//没有人脸数据不能开启人脸通行功能 |
| | | { |
| | | return; |
| | | } |
| | | btnCommunityAccessControlIcon.IsSelected = !btnCommunityAccessControlIcon.IsSelected; |
| | | int switchStatus = btnCommunityAccessControlIcon.IsSelected == true ? 1 : 2; |
| | | |
| | | //刷新回调 |
| | | Action action = () => |
| | | { |
| | | initButtonStatus(); |
| | | }; |
| | | editFaceInfo(switchStatus, action); |
| | | }; |
| | | |
| | | #endregion |
| | | |
| | |
| | | contentView.AddChidren(btnTip); |
| | | |
| | | |
| | | var btnSetFaceId = new Button() |
| | | btnSetFaceId = new Button() |
| | | { |
| | | Y = Application.GetRealHeight(539), |
| | | Gravity = Gravity.CenterHorizontal, |
| | |
| | | IsBold = true, |
| | | }; |
| | | contentView.AddChidren(btnSetFaceId); |
| | | |
| | | if (string.IsNullOrEmpty(faceid)) |
| | | btnSetFaceId.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | } |
| | | else |
| | | { |
| | | btnSetFaceId.TextID = StringId.ResetFace; |
| | | LoadPictureOptionView(); |
| | | }; |
| | | |
| | | var btnEraseData = new Button() |
| | | btnEraseData = new Button() |
| | | { |
| | | Y = Application.GetRealHeight(481), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(220), |
| | | Height = Application.GetRealWidth(44), |
| | | Radius = (uint)Application.GetRealWidth(22), |
| | | BackgroundColor = CSS_Color.WarningColor, |
| | | TextID = StringId.EraseData, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextColor = CSS_Color.MainBackgroundColor, |
| | | TextAlignment = TextAlignment.Center, |
| | | IsBold = true, |
| | | }; |
| | | btnEraseData.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | Action action = () => |
| | | { |
| | | Y = Application.GetRealHeight(481), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(220), |
| | | Height = Application.GetRealWidth(44), |
| | | Radius = (uint)Application.GetRealWidth(22), |
| | | BackgroundColor = CSS_Color.WarningColor, |
| | | TextID = StringId.EraseData, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextColor = CSS_Color.MainBackgroundColor, |
| | | TextAlignment = TextAlignment.Center, |
| | | IsBold = true, |
| | | initButtonStatus(); |
| | | }; |
| | | contentView.AddChidren(btnEraseData); |
| | | editFaceInfo(3, action); |
| | | }; |
| | | |
| | | ReadFaceInfo(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取人脸信息 |
| | | /// </summary> |
| | | void ReadFaceInfo(bool isLoading = true) |
| | | { |
| | | Loading waitPage = null; |
| | | if (isLoading) |
| | | { |
| | | waitPage = new Loading(); |
| | | waitPage.Start(); |
| | | } |
| | | |
| | | new Thread(() => |
| | | { |
| | | try |
| | | { |
| | | var hsr = new HttpServerRequest(); |
| | | var pack = hsr.GetCustomerInfo(); |
| | | if (pack != null) |
| | | { |
| | | if (pack.Code == StateCode.SUCCESS) |
| | | { |
| | | var cus = Newtonsoft.Json.JsonConvert.DeserializeObject<CustomerObj>(pack.Data.ToString()); |
| | | if (cus != null) |
| | | { |
| | | customerObj = cus; |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | initButtonStatus(); |
| | | }); |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log($"读取人脸信息异常:{ex.Message}"); |
| | | } |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | if (waitPage != null) |
| | | { |
| | | waitPage.RemoveFromParent(); |
| | | waitPage = null; |
| | | } |
| | | }); |
| | | } |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | } |
| | | /// <summary> |
| | | /// 清除人脸数据 |
| | | /// </summary> |
| | | void editFaceInfo(int status, Action action) |
| | | { |
| | | var waitPage = new Loading(); |
| | | waitPage.Start(); |
| | | new Thread(() => |
| | | { |
| | | try |
| | | { |
| | | var hsr = new HttpServerRequest(); |
| | | var pack = hsr.EditFaceFunction(status); |
| | | if (pack != null) |
| | | { |
| | | if (pack.Code == StateCode.SUCCESS) |
| | | { |
| | | customerObj.faceClose = status; |
| | | } |
| | | else |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | IMessageCommon.Current.ShowErrorInfoAlter(pack.Code); |
| | | }); |
| | | } |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log($"清除人脸信息异常:{ex.Message}"); |
| | | } |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | if (waitPage != null) |
| | | { |
| | | waitPage.RemoveFromParent(); |
| | | waitPage = null; |
| | | } |
| | | action?.Invoke(); |
| | | }); |
| | | } |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 初始化底部按钮 |
| | | /// </summary> |
| | | void initButtonStatus() |
| | | { |
| | | if (customerObj.faceClose == 1 || customerObj.faceClose == 2)//人脸数据已经存在1:人脸通行开启;2:关闭 |
| | | { |
| | | if (customerObj.faceStatus == 2)//人脸数据下发门口机成功 |
| | | { |
| | | btnCommunityAccessControlIcon.IsSelected = customerObj.faceClose == 1;//人脸通行功能是否开启 |
| | | contentView.AddChidren(btnEraseData); |
| | | btnSetFaceId.TextID = StringId.ResetFace; |
| | | return; |
| | | } |
| | | } |
| | | btnCommunityAccessControlIcon.IsSelected = false; |
| | | btnEraseData.RemoveFromParent(); |
| | | btnSetFaceId.TextID = StringId.SetFace; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 加载图标选择选项 |
| | | /// </summary> |
| | | void LoadPictureOptionView() |
| | | { |
| | | var pView = new FrameLayout() |
| | | { |
| | | BackgroundColor = CSS_Color.DialogTransparentColor1, |
| | | }; |
| | | bodyView.AddChidren(pView); |
| | | |
| | | pictureOptionView = new FrameLayout() |
| | | { |
| | | Y = Application.GetRealHeight(445 + 50), |
| | | Height = Application.GetRealHeight(250), |
| | | AnimateSpeed = 0.3f, |
| | | Animate = Animate.DownToUp, |
| | | }; |
| | | pView.AddChidren(pictureOptionView); |
| | | |
| | | optionView = new VerticalScrolViewLayout() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealHeight(100), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | Radius = (uint)Application.GetRealWidth(12), |
| | | }; |
| | | pictureOptionView.AddChidren(optionView); |
| | | |
| | | btnTakePicture = new Button() |
| | | { |
| | | Height = Application.GetRealHeight(50), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.TextualColor, |
| | | SelectedTextColor = CSS_Color.MainColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextID = StringId.TakePicture, |
| | | }; |
| | | optionView.AddChidren(btnTakePicture); |
| | | |
| | | optionView.AddChidren(new Button() { Height = Application.GetRealHeight(1), Width = Application.GetRealWidth(343), BackgroundColor = CSS_Color.DividingLineColor }); |
| | | |
| | | btnAlbum = new Button() |
| | | { |
| | | Height = Application.GetRealHeight(50), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.TextualColor, |
| | | SelectedTextColor = CSS_Color.MainColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextID = StringId.Album, |
| | | }; |
| | | optionView.AddChidren(btnAlbum); |
| | | |
| | | optionView.AddChidren(new Button() { Height = Application.GetRealHeight(1), Width = Application.GetRealWidth(343), BackgroundColor = CSS_Color.DividingLineColor }); |
| | | |
| | | btnCancel = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealHeight(8) + optionView.Bottom, |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealHeight(50), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | Radius = (uint)Application.GetRealWidth(12), |
| | | TextID = StringId.Cancel, |
| | | TextColor = CSS_Color.WarningColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | }; |
| | | pictureOptionView.AddChidren(btnCancel); |
| | | |
| | | |
| | | LoadEvent_PictureOptionViewEventList(pView); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 加载背景图选择区域事件列表 |
| | | /// </summary> |
| | | void LoadEvent_PictureOptionViewEventList(FrameLayout pView) |
| | | { |
| | | pictureOptionView.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | pictureOptionView.Parent.RemoveFromParent(); |
| | | }; |
| | | pView.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | pictureOptionView.Parent.RemoveFromParent(); |
| | | }; |
| | | |
| | | btnCancel.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | pictureOptionView.Parent.RemoveFromParent(); |
| | | }; |
| | | btnTakePicture.MouseDownEventHandler = (sender, e) => |
| | | { |
| | | btnTakePicture.IsSelected = true; |
| | | }; |
| | | btnTakePicture.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | btnTakePicture.IsSelected = false; |
| | | var imageName = Guid.NewGuid().ToString(); |
| | | CropImage.TakePicture((imagePath) => |
| | | { |
| | | CropImageCallBack(imagePath, 1, imageName); |
| | | }, imageName, 4, 6, 400); |
| | | |
| | | pictureOptionView.Parent.RemoveFromParent(); |
| | | }; |
| | | btnAlbum.MouseDownEventHandler = (sender, e) => |
| | | { |
| | | btnAlbum.IsSelected = true; |
| | | }; |
| | | |
| | | btnAlbum.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | btnAlbum.IsSelected = false; |
| | | //从相册选择图片裁剪 |
| | | var imageName = Guid.NewGuid().ToString(); |
| | | //var imageName = scene.sid; |
| | | CropImage.SelectPicture((imagePath) => |
| | | { |
| | | CropImageCallBack(imagePath, 2, imageName); |
| | | }, imageName, 4, 6, 400);//OutputYSize目前仅对Android有些 400代表Y的最多分辨率,所以最终得到图片的分辨率为:266*400 |
| | | |
| | | pictureOptionView.Parent.RemoveFromParent(); |
| | | }; |
| | | |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 裁剪完照片回调,统一处理 |
| | | /// </summary> |
| | | /// <param name="imagePath">裁剪后的真实路径</param> |
| | | /// <param name="imageSource">照片来源;1:拍照;2:图库</param> |
| | | void CropImageCallBack(string selectImagePath, int imageSource, string imageName) |
| | | { |
| | | if (string.IsNullOrEmpty(selectImagePath) == true) |
| | | { |
| | | return; |
| | | } |
| | | //上传成功到回调 |
| | | Action<bool> uploadSuccessAction = (isSuccess) => |
| | | { |
| | | //点击重新录入事件 |
| | | Action action = () => |
| | | { |
| | | if (!isSuccess) |
| | | { |
| | | if (imageSource == 1) |
| | | { |
| | | CropImage.TakePicture((imagePath) => |
| | | { |
| | | CropImageCallBack(imagePath, 2, imageName); |
| | | }, imageName, 4, 6, 400); |
| | | } |
| | | else |
| | | { |
| | | CropImage.SelectPicture((imagePath) => |
| | | { |
| | | CropImageCallBack(imagePath, 1, imageName); |
| | | }, imageName, 4, 6, 400); |
| | | } |
| | | } |
| | | }; |
| | | |
| | | if (isSuccess) |
| | | { |
| | | ReadFaceInfo(false); |
| | | } |
| | | |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | var page = new FaceSettingResultPage(action); |
| | | MainPage.BasePageView.AddChidren(page); |
| | | page.LoadPage(isSuccess); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }); |
| | | }; |
| | | //上传图片到云端 |
| | | UploadImage(selectImagePath, uploadSuccessAction); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 上传图片方法 |
| | | /// </summary> |
| | | /// <param name="selectImagePath">裁剪后的图片路径</param> |
| | | /// <param name="imageView"></param> |
| | | /// <param name="uploadResultAction"></param> |
| | | void UploadImage(string selectImagePath, Action<bool> uploadResultAction) |
| | | { |
| | | try |
| | | { |
| | | //1.读取裁剪后的图片,然后删除 |
| | | var imageBytes = Shared.IO.FileUtils.ReadFile(selectImagePath); |
| | | System.IO.File.Delete(selectImagePath); |
| | | |
| | | var waitPage = new Loading(); |
| | | bodyView.AddChidren(waitPage); |
| | | waitPage.Start(Language.StringByID(StringId.PleaseWait)); |
| | | //开始上传 |
| | | new Thread(() => |
| | | { |
| | | try |
| | | { |
| | | string base64string = Convert.ToBase64String(imageBytes); |
| | | var pack = new HttpServerRequest().FaceSetting(base64string); |
| | | if (pack != null) |
| | | { |
| | | Utlis.WriteLine("上传结果:" + pack.message); |
| | | uploadResultAction?.Invoke(pack.Code == StateCode.SUCCESS); |
| | | } |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | } |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | if (waitPage != null) |
| | | { |
| | | waitPage.RemoveFromParent(); |
| | | waitPage = null; |
| | | } |
| | | }); |
| | | } |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | } |
| | | catch { } |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | //using System; |
| | | //using HDL_ON.UI.CSS; |
| | | //using Shared; |
| | | //namespace HDL_ON.UI |
| | | //{ |
| | | // public class FaceSettingPage : FrameLayout |
| | | // { |
| | | // FrameLayout bodyView; |
| | | |
| | | // #region 图标选择部分图标 |
| | | // /// <summary> |
| | | // /// 背景图选项区域 |
| | | // /// </summary> |
| | | // FrameLayout pictureOptionView; |
| | | // /// <summary> |
| | | // /// 背景图选项选择区域 |
| | | // /// </summary> |
| | | // VerticalScrolViewLayout optionView; |
| | | // /// <summary> |
| | | // /// 拍照按钮 |
| | | // /// </summary> |
| | | // Button btnTakePicture; |
| | | // /// <summary> |
| | | // /// 相册按钮 |
| | | // /// </summary> |
| | | // Button btnAlbum; |
| | | // /// <summary> |
| | | // /// 取消按钮 |
| | | // /// </summary> |
| | | // Button btnCancel; |
| | | // #endregion |
| | | |
| | | // public FaceSettingPage() |
| | | // { |
| | | // bodyView = this; |
| | | // } |
| | | |
| | | // public void LoadPage() |
| | | // { |
| | | // new TopViewDiv(bodyView, Language.StringByID(StringId.FacePassage)).LoadTopView(); |
| | | // bodyView.BackgroundColor = CSS_Color.BackgroundColor; |
| | | |
| | | // var contentView = new FrameLayout() |
| | | // { |
| | | // Y = Application.GetRealHeight(64), |
| | | // Height = Application.GetRealHeight(667 - 64), |
| | | // BackgroundColor = 0xFFFFFFFF, |
| | | // }; |
| | | // bodyView.AddChidren(contentView); |
| | | |
| | | |
| | | // var imageName = Guid.NewGuid().ToString(); |
| | | // CropImage.TakePicture((imagePath) => |
| | | // { |
| | | |
| | | // }, imageName, 4, 3); |
| | | |
| | | |
| | | // } |
| | | |
| | | |
| | | |
| | | |
| | | // /// <summary> |
| | | // /// 加载图标选择选项 |
| | | // /// </summary> |
| | | // void LoadPictureOptionView() |
| | | // { |
| | | // var pView = new FrameLayout() |
| | | // { |
| | | // BackgroundColor = CSS_Color.DialogTransparentColor1, |
| | | // }; |
| | | // bodyView.AddChidren(pView); |
| | | |
| | | // pictureOptionView = new FrameLayout() |
| | | // { |
| | | // Y = Application.GetRealHeight(445), |
| | | // Height = Application.GetRealHeight(250), |
| | | // AnimateSpeed = 0.3f, |
| | | // Animate = Animate.DownToUp, |
| | | // }; |
| | | // pView.AddChidren(pictureOptionView); |
| | | |
| | | // optionView = new VerticalScrolViewLayout() |
| | | // { |
| | | // Gravity = Gravity.CenterHorizontal, |
| | | // Width = Application.GetRealWidth(343), |
| | | // Height = Application.GetRealHeight(150), |
| | | // BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | // Radius = (uint)Application.GetRealWidth(12), |
| | | // }; |
| | | // pictureOptionView.AddChidren(optionView); |
| | | |
| | | // btnTakePicture = new Button() |
| | | // { |
| | | // Height = Application.GetRealHeight(50), |
| | | // TextAlignment = TextAlignment.Center, |
| | | // TextColor = CSS_Color.TextualColor, |
| | | // SelectedTextColor = CSS_Color.MainColor, |
| | | // TextSize = CSS_FontSize.SubheadingFontSize, |
| | | // TextID = StringId.TakePicture, |
| | | // }; |
| | | // optionView.AddChidren(btnTakePicture); |
| | | |
| | | // optionView.AddChidren(new Button() { Height = Application.GetRealHeight(1), Width = Application.GetRealWidth(343), BackgroundColor = CSS_Color.DividingLineColor }); |
| | | |
| | | // btnAlbum = new Button() |
| | | // { |
| | | // Height = Application.GetRealHeight(50), |
| | | // TextAlignment = TextAlignment.Center, |
| | | // TextColor = CSS_Color.TextualColor, |
| | | // SelectedTextColor = CSS_Color.MainColor, |
| | | // TextSize = CSS_FontSize.SubheadingFontSize, |
| | | // TextID = StringId.Album, |
| | | // }; |
| | | // optionView.AddChidren(btnAlbum); |
| | | |
| | | // optionView.AddChidren(new Button() { Height = Application.GetRealHeight(1), Width = Application.GetRealWidth(343), BackgroundColor = CSS_Color.DividingLineColor }); |
| | | |
| | | // btnCancel = new Button() |
| | | // { |
| | | // Gravity = Gravity.CenterHorizontal, |
| | | // Y = Application.GetRealHeight(8) + optionView.Bottom, |
| | | // Width = Application.GetRealWidth(343), |
| | | // Height = Application.GetRealHeight(50), |
| | | // BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | // Radius = (uint)Application.GetRealWidth(12), |
| | | // TextID = StringId.Cancel, |
| | | // TextColor = CSS_Color.WarningColor, |
| | | // TextSize = CSS_FontSize.SubheadingFontSize, |
| | | // }; |
| | | // pictureOptionView.AddChidren(btnCancel); |
| | | |
| | | |
| | | // LoadEvent_PictureOptionViewEventList(pView); |
| | | // } |
| | | |
| | | // /// <summary> |
| | | // /// 加载背景图选择区域事件列表 |
| | | // /// </summary> |
| | | // void LoadEvent_PictureOptionViewEventList(FrameLayout pView) |
| | | // { |
| | | // pictureOptionView.MouseUpEventHandler = (sender, e) => |
| | | // { |
| | | // pictureOptionView.Parent.RemoveFromParent(); |
| | | // }; |
| | | // pView.MouseUpEventHandler = (sender, e) => |
| | | // { |
| | | // pictureOptionView.Parent.RemoveFromParent(); |
| | | // }; |
| | | |
| | | // btnCancel.MouseUpEventHandler = (sender, e) => |
| | | // { |
| | | // pictureOptionView.Parent.RemoveFromParent(); |
| | | // }; |
| | | // btnTakePicture.MouseDownEventHandler = (sender, e) => { |
| | | // btnTakePicture.IsSelected = true; |
| | | // }; |
| | | // btnTakePicture.MouseUpEventHandler = (sender, e) => |
| | | // { |
| | | // btnTakePicture.IsSelected = false; |
| | | // var imageName = Guid.NewGuid().ToString(); |
| | | // //var imageName = scene.sid; |
| | | // CropImage.TakePicture((imagePath) => |
| | | // { |
| | | // CropImageCallBack(imagePath); |
| | | |
| | | // }, imageName, 4, 3); |
| | | |
| | | // //if (pageTitleId == StringId.EditScene) |
| | | // //{ |
| | | // // scene.SaveFunctionData(); |
| | | // //} |
| | | // pictureOptionView.Parent.RemoveFromParent(); |
| | | // }; |
| | | // btnAlbum.MouseDownEventHandler = (sender, e) => { |
| | | // btnAlbum.IsSelected = true; |
| | | // }; |
| | | |
| | | // btnAlbum.MouseUpEventHandler = (sender, e) => |
| | | // { |
| | | // btnAlbum.IsSelected = false; |
| | | // //从相册选择图片裁剪 |
| | | // var imageName = Guid.NewGuid().ToString(); |
| | | // //var imageName = scene.sid; |
| | | // CropImage.SelectPicture((imagePath) => |
| | | // { |
| | | // //CropImageCallBack(imagePath); |
| | | // }, imageName, 4, 3); |
| | | |
| | | // pictureOptionView.Parent.RemoveFromParent(); |
| | | // }; |
| | | |
| | | // } |
| | | |
| | | // } |
| | | //} |
New file |
| | |
| | | using System; |
| | | using HDL_ON.UI.CSS; |
| | | using Shared; |
| | | namespace HDL_ON.UI |
| | | { |
| | | public class FaceSettingResultPage : FrameLayout |
| | | { |
| | | FrameLayout bodyView; |
| | | |
| | | Action backAction; |
| | | public FaceSettingResultPage(Action action) |
| | | { |
| | | bodyView = this; |
| | | backAction = action; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | /// <param name="isSuccess">是否成功</param> |
| | | public void LoadPage(bool isSuccess) |
| | | { |
| | | new TopViewDiv(bodyView, Language.StringByID(StringId.FacePassage)).LoadTopView(); |
| | | bodyView.BackgroundColor = CSS_Color.BackgroundColor; |
| | | |
| | | |
| | | var contentView = new FrameLayout() |
| | | { |
| | | Y = Application.GetRealHeight(64), |
| | | Height = Application.GetRealHeight(667 - 64), |
| | | }; |
| | | bodyView.AddChidren(contentView); |
| | | |
| | | |
| | | |
| | | var btnResultIcon = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealHeight(99), |
| | | Width = Application.GetRealWidth(100), |
| | | Height = Application.GetRealWidth(100), |
| | | UnSelectedImagePath = "PersonalCenter/FacePassage/FailIcon.png", |
| | | SelectedImagePath = "PersonalCenter/FacePassage/TrueIcon.png", |
| | | IsSelected = isSuccess, |
| | | }; |
| | | contentView.AddChidren(btnResultIcon); |
| | | |
| | | Button btnResultText = new Button() |
| | | { |
| | | Y = Application.GetRealHeight(240), |
| | | Height = Application.GetRealHeight(40), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | }; |
| | | contentView.AddChidren(btnResultText); |
| | | |
| | | if(isSuccess) |
| | | { |
| | | btnResultText.TextID = StringId.FaceInputSucceeded; |
| | | } |
| | | else |
| | | { |
| | | btnResultText.TextID = StringId.FaceInputFailed; |
| | | } |
| | | |
| | | var btnSetFaceId = new Button() |
| | | { |
| | | Y = Application.GetRealHeight(539), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(220), |
| | | Height = Application.GetRealWidth(44), |
| | | Radius = (uint)Application.GetRealWidth(22), |
| | | BackgroundColor = CSS_Color.MainColor, |
| | | TextID = isSuccess ? StringId.Complete :StringId.Retry, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextColor = CSS_Color.MainBackgroundColor, |
| | | TextAlignment = TextAlignment.Center, |
| | | IsBold = true, |
| | | }; |
| | | contentView.AddChidren(btnSetFaceId); |
| | | |
| | | btnSetFaceId.MouseUpEventHandler = (sender, e) => { |
| | | if (isSuccess) |
| | | { |
| | | this.RemoveFromParent(); |
| | | } |
| | | else |
| | | { |
| | | backAction?.Invoke(); |
| | | this.RemoveFromParent(); |
| | | } |
| | | }; |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | /// 区域成员小区域文本 |
| | | /// </summary> |
| | | Button btnResidenceMemberText; |
| | | #region F3阶段 |
| | | /// <summary> |
| | | /// 区域安放小区域 |
| | | /// </summary> |
| | |
| | | /// 区域添加功能小区域文本 |
| | | /// </summary> |
| | | Button btnResidenceAddFunctionText; |
| | | #endregion |
| | | |
| | | #region F3阶段 |
| | | ///// <summary> |
| | | ///// 软件设置区域 |
| | | ///// </summary> |
| | |
| | | /// </summary> |
| | | Button btnSmartSpeakerText; |
| | | |
| | | #endregion |
| | | |
| | | public PersonalCenterPage() |
| | | { |
| | |
| | | residenceArmView.AddChidren(btnResidenceArmText); |
| | | #endregion |
| | | } |
| | | #region F3阶段 |
| | | |
| | | #region ---数据备份区域 |
| | | //residenceDataBackupView = new FrameLayout() |
| | |
| | | //residenceAuxiliaryFunctionView.AddChidren(btnResidenceAuxiliaryFunctionText); |
| | | #endregion |
| | | |
| | | #region ---添加功能区域 |
| | | residenceAddFunctionView = new FrameLayout() |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | | //X = residenceMemberView.Right, |
| | | X = Application.GetRealWidth(28 - 24), |
| | | Y = residenceManageView.Bottom, |
| | | Width = Application.GetRealWidth(64 + 48), |
| | | Height = Application.GetRealWidth(64), |
| | | }; |
| | | residenceInfoView.AddChidren(residenceAddFunctionView); |
| | | btnResidenceAddFunctionIcon = new Button |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealHeight(5), |
| | | Width = Application.GetMinRealAverage(30), |
| | | Height = Application.GetMinRealAverage(30), |
| | | UnSelectedImagePath = "PersonalCenter/AddFunctionIcon.png", |
| | | }; |
| | | residenceAddFunctionView.AddChidren(btnResidenceAddFunctionIcon); |
| | | btnResidenceAddFunctionText = new Button() |
| | | { |
| | | Y = btnResidenceManageIcon.Bottom, |
| | | Height = Application.GetRealHeight(29), |
| | | TextID = StringId.AddFunction, |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel |
| | | }; |
| | | residenceAddFunctionView.AddChidren(btnResidenceAddFunctionText); |
| | | #endregion |
| | | #endregion |
| | | #region ---添加功能区域 |
| | | residenceAddFunctionView = new FrameLayout() |
| | | { |
| | | //X = residenceMemberView.Right, |
| | | X = Application.GetRealWidth(28 - 24), |
| | | Y = residenceManageView.Bottom, |
| | | Width = Application.GetRealWidth(64 + 48), |
| | | Height = Application.GetRealWidth(64), |
| | | }; |
| | | residenceInfoView.AddChidren(residenceAddFunctionView); |
| | | btnResidenceAddFunctionIcon = new Button |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealHeight(5), |
| | | Width = Application.GetMinRealAverage(30), |
| | | Height = Application.GetMinRealAverage(30), |
| | | UnSelectedImagePath = "PersonalCenter/AddFunctionIcon.png", |
| | | }; |
| | | residenceAddFunctionView.AddChidren(btnResidenceAddFunctionIcon); |
| | | btnResidenceAddFunctionText = new Button() |
| | | { |
| | | Y = btnResidenceManageIcon.Bottom, |
| | | Height = Application.GetRealHeight(29), |
| | | TextID = StringId.AddFunction, |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel |
| | | }; |
| | | residenceAddFunctionView.AddChidren(btnResidenceAddFunctionText); |
| | | #endregion |
| | | } |
| | | } |
| | | else |
| | | { |
| | |
| | | if (btnResidenceArmIcon != null) |
| | | { |
| | | btnResidenceArmIcon.IsSelected = false; |
| | | foreach (var temp in FunctionList.List.securities) |
| | | lock (FunctionList.List.securities) |
| | | { |
| | | if (temp.status == "enable") |
| | | foreach (var temp in FunctionList.List.securities) |
| | | { |
| | | btnResidenceArmIcon.IsSelected = true; |
| | | break; |
| | | if (temp.status == "enable") |
| | | { |
| | | if (temp.alarm) |
| | | { |
| | | btnResidenceArmIcon.SelectedImagePath = "PersonalCenter/ResidenceInAlarmIcon.png"; |
| | | } |
| | | else |
| | | { |
| | | btnResidenceArmIcon.SelectedImagePath = "PersonalCenter/ResidenceDefenseIcon.png"; |
| | | } |
| | | btnResidenceArmIcon.IsSelected = true; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | btnResidenceArmIcon.MouseUpEventHandler = (sender, e) => |
| | |
| | | #region 添加设备 |
| | | void LoadEvent_SkipbtnAddFunctionPage() |
| | | { |
| | | EventHandler<MouseEventArgs> eventHandler = (sender, e) => |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | | var page = new BrandListPage(); |
| | | MainPage.BasePageView.AddChidren(page); |
| | | page.LoadPage(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | | btnResidenceAddFunctionIcon.MouseUpEventHandler = eventHandler; |
| | | btnResidenceAddFunctionText.MouseUpEventHandler = eventHandler; |
| | | try |
| | | { |
| | | EventHandler<MouseEventArgs> eventHandler = (sender, e) => |
| | | { |
| | | var page = new BrandListPage(); |
| | | MainPage.BasePageView.AddChidren(page); |
| | | page.LoadPage(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | | btnResidenceAddFunctionIcon.MouseUpEventHandler = eventHandler; |
| | | btnResidenceAddFunctionText.MouseUpEventHandler = eventHandler; |
| | | } |
| | | catch { } |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | |
| | | /// </summary> |
| | | optionListView = new VerticalScrolViewLayout() |
| | | { |
| | | Height = Application.GetRealHeight(51 * (6+1)), |
| | | Height = Application.GetRealHeight(51 * 6), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | ScrollEnabled = false, |
| | | }; |
| | | bodyScrolView.AddChidren(optionListView); |
| | | |
| | | if(Entity.DB_ResidenceData.Instance.SupportFacePass) |
| | | { |
| | | optionListView.Height = Application.GetRealHeight(51 * (6 + 1)); |
| | | } |
| | | |
| | | #region 个人选项-名字区域 |
| | | /// <summary> |
| | | /// 个人选项-名字区域 |
| | |
| | | optionListView.AddChidren(new Button() { X = Application.GetRealWidth(16), Height = Application.GetRealHeight(1), Width = Application.GetRealWidth(343), BackgroundColor = CSS_Color.DividingLineColor }); |
| | | #endregion |
| | | |
| | | |
| | | #region 个人选项-人脸通行管理 |
| | | faceManagementView = new FrameLayout() |
| | | if (Entity.DB_ResidenceData.Instance.SupportFacePass) |
| | | { |
| | | Height = Application.GetRealHeight(50), |
| | | }; |
| | | optionListView.AddChidren(faceManagementView); |
| | | #region 个人选项-人脸通行管理 |
| | | faceManagementView = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealHeight(50), |
| | | }; |
| | | optionListView.AddChidren(faceManagementView); |
| | | |
| | | var btnFaceManagementRight = new Button() |
| | | { |
| | | X = Application.GetRealWidth(339), |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetMinRealAverage(16), |
| | | Height = Application.GetMinRealAverage(16), |
| | | UnSelectedImagePath = "Public/Right.png", |
| | | }; |
| | | faceManagementView.AddChidren(btnFaceManagementRight); |
| | | var btnFaceManagementRight = new Button() |
| | | { |
| | | X = Application.GetRealWidth(339), |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetMinRealAverage(16), |
| | | Height = Application.GetMinRealAverage(16), |
| | | UnSelectedImagePath = "Public/Right.png", |
| | | }; |
| | | faceManagementView.AddChidren(btnFaceManagementRight); |
| | | |
| | | btnFaceManagementText = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextID = StringId.FacePassageSetting, |
| | | }; |
| | | faceManagementView.AddChidren(btnFaceManagementText); |
| | | btnFaceManagementText = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextID = StringId.FacePassageSetting, |
| | | }; |
| | | faceManagementView.AddChidren(btnFaceManagementText); |
| | | |
| | | btnFaceManagementText.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | var page = new FacePassagePage(); |
| | | MainPage.BasePageView.AddChidren(page); |
| | | page.LoadPage(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | |
| | | }; |
| | | btnFaceManagementText.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | var page = new FacePassagePage(); |
| | | MainPage.BasePageView.AddChidren(page); |
| | | page.LoadPage(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | | |
| | | #endregion |
| | | #endregion |
| | | |
| | | |
| | | } |
| | | |
| | | #endregion |
| | | |
| | |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | waitPage.Hide(); |
| | | if (waitPage != null) |
| | | { |
| | | waitPage.RemoveFromParent(); |
| | | waitPage = null; |
| | | } |
| | | }); |
| | | } |
| | | }) |
| | |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => { |
| | | waitPage.Hide(); |
| | | waitPage.RemoveFromParent(); |
| | | if (waitPage != null) |
| | | { |
| | | waitPage.RemoveFromParent(); |
| | | waitPage = null; |
| | | } |
| | | int count = SpatialInfo.CurrentSpatial.FloorList.Count > 10 ? 10 : SpatialInfo.CurrentSpatial.FloorList.Count; |
| | | floorsListView.Height = Application.GetRealHeight(50 * count); |
| | | contentView.Height = Application.GetRealHeight(50 * (count + 1)); |
| | |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => { |
| | | waitPage.Hide(); |
| | | waitPage.RemoveFromParent(); |
| | | if (waitPage != null) |
| | | { |
| | | waitPage.RemoveFromParent(); |
| | | waitPage = null; |
| | | } |
| | | }); |
| | | } |
| | | }) |
| | |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => { |
| | | waitPage.Hide(); |
| | | waitPage.RemoveFromParent(); |
| | | if (waitPage != null) |
| | | { |
| | | waitPage.RemoveFromParent(); |
| | | waitPage = null; |
| | | } |
| | | }); |
| | | } |
| | | }) |
| | |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | waitPage.Hide(); |
| | | waitPage.RemoveFromParent(); |
| | | if (waitPage != null) |
| | | { |
| | | waitPage.RemoveFromParent(); |
| | | waitPage = null; |
| | | } |
| | | }); |
| | | } |
| | | }) |
| | |
| | | fanSpeedList = device.GetAttribute(FunctionAttributeKey.FanSpeed).value; |
| | | btnFan.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | if( !btnSwitch.IsSelected){return;} |
| | | var curFanSpeedIndex = fanSpeedList.IndexOf(device.GetAttrState(FunctionAttributeKey.FanSpeed)); |
| | | var sendFanSpeedIndex = curFanSpeedIndex == fanSpeedList.Count - 1 ? 0 : 1+curFanSpeedIndex; |
| | | ShowFanSelectView(); |
| | | //return; |
| | | //if ( !btnSwitch.IsSelected){return;} |
| | | //var curFanSpeedIndex = fanSpeedList.IndexOf(device.GetAttrState(FunctionAttributeKey.FanSpeed)); |
| | | //var sendFanSpeedIndex = curFanSpeedIndex == fanSpeedList.Count - 1 ? 0 : 1+curFanSpeedIndex; |
| | | |
| | | device.SetAttrState(FunctionAttributeKey.FanSpeed, fanSpeedList[sendFanSpeedIndex]); |
| | | new System.Threading.Thread(() => |
| | | { |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.FanSpeed, fanSpeedList[sendFanSpeedIndex]); |
| | | Control.Ins.SendWriteCommand(device, d); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | RefreshFanSpeed(); |
| | | //device.SetAttrState(FunctionAttributeKey.FanSpeed, fanSpeedList[sendFanSpeedIndex]); |
| | | //new System.Threading.Thread(() => |
| | | //{ |
| | | // Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | // d.Add(FunctionAttributeKey.FanSpeed, fanSpeedList[sendFanSpeedIndex]); |
| | | // Control.Ins.SendWriteCommand(device, d); |
| | | //}) |
| | | //{ IsBackground = true }.Start(); |
| | | //RefreshFanSpeed(); |
| | | }; |
| | | //风速文本 |
| | | this.btnFanView = new NormalViewControl(this.FrameWhiteCentet1.Width / 3, Application.GetRealHeight(18), false); |
| | |
| | | }; |
| | | frameBack.Show(); |
| | | |
| | | var fanAttr = device.GetAttribute(FunctionAttributeKey.FanSpeed); |
| | | if(fanAttr == null) |
| | | { |
| | | return; |
| | | } |
| | | var valueCount = fanAttr.value.Count; |
| | | |
| | | //菜单控件(风速) |
| | | var menuContr = new DialogTitleMenuControl(3, Language.StringByID(StringId.FanSpeed)); |
| | | menuContr.X = Application.GetRealWidth(209); |
| | | var menuContr = new DialogTitleMenuControl(valueCount, Language.StringByID(StringId.FanSpeed)); |
| | | //menuContr.X = Application.GetRealWidth(209); |
| | | menuContr.Gravity = Gravity.CenterHorizontal; |
| | | menuContr.Y = Application.GetRealHeight(231); |
| | | menuContr.Width = Application.GetRealWidth(160); |
| | | menuContr.Height = Application.GetRealHeight(199); |
| | | if (valueCount > 2) |
| | | { |
| | | menuContr.Height = Application.GetRealHeight(199); |
| | | } |
| | | else |
| | | { |
| | | menuContr.Height = Application.GetRealHeight(154); |
| | | } |
| | | dialogBody.AddChidren(menuContr); |
| | | |
| | | //1档 |
| | | var iconPath = this.device.GetAttrState(FunctionAttributeKey.FanSpeed) == "low" ? "FunctionIcon/AirFresh/Fan1Select.png" : "FunctionIcon/AirFresh/Fan1.png"; |
| | | menuContr.AddRowMenu(Language.StringByID(StringId.FanOneGear), iconPath, this.device.GetAttrState(FunctionAttributeKey.FanSpeed) == "low", () => |
| | | foreach(var fanAttrValue in fanAttr.value) |
| | | { |
| | | frameBack.Close(); |
| | | //发送档位命令 |
| | | this.SendOtherComand(this.btnFan, FunctionAttributeKey.FanSpeed, "low"); |
| | | }); |
| | | bool isSelecte = false; |
| | | var iconPath = "FunctionIcon/AirFresh/Fan1.png"; |
| | | string text = Language.StringByID(StringId.FanOneGear); |
| | | if (fanAttrValue == "low" || fanAttrValue == "level_1") |
| | | { |
| | | text = Language.StringByID(StringId.LowWindSpeed); |
| | | if (this.device.GetAttrState(FunctionAttributeKey.FanSpeed) == "low"|| this.device.GetAttrState(FunctionAttributeKey.FanSpeed) == "level_1") |
| | | { |
| | | iconPath = "FunctionIcon/AirFresh/Fan1Select.png"; |
| | | isSelecte = true; |
| | | } |
| | | } |
| | | else if (fanAttrValue == "medium" || fanAttrValue == "level_2") |
| | | { |
| | | text = Language.StringByID(StringId.MiddleWindSpeed); |
| | | iconPath = "FunctionIcon/AirFresh/Fan2.png"; |
| | | if (this.device.GetAttrState(FunctionAttributeKey.FanSpeed) == "medium" || this.device.GetAttrState(FunctionAttributeKey.FanSpeed) == "level_2") |
| | | { |
| | | iconPath = "FunctionIcon/AirFresh/Fan2Select.png"; |
| | | isSelecte = true; |
| | | } |
| | | } |
| | | else if (fanAttrValue == "high" || fanAttrValue == "level_3") |
| | | { |
| | | text = Language.StringByID(StringId.HighWindSpeed); |
| | | iconPath = "FunctionIcon/AirFresh/Fan3.png"; |
| | | if (this.device.GetAttrState(FunctionAttributeKey.FanSpeed) == "high" || this.device.GetAttrState(FunctionAttributeKey.FanSpeed) == "level_3") |
| | | { |
| | | iconPath = "FunctionIcon/AirFresh/Fan3Select.png"; |
| | | isSelecte = true; |
| | | } |
| | | } |
| | | |
| | | //2档 |
| | | iconPath = this.device.GetAttrState(FunctionAttributeKey.FanSpeed) == "medium" ? "FunctionIcon/AirFresh/Fan2Select.png" : "FunctionIcon/AirFresh/Fan2.png"; |
| | | menuContr.AddRowMenu(Language.StringByID(StringId.FanTwoGear), iconPath, this.device.GetAttrState(FunctionAttributeKey.FanSpeed) == "medium", () => |
| | | { |
| | | frameBack.Close(); |
| | | //发送档位命令 |
| | | this.SendOtherComand(this.btnFan, FunctionAttributeKey.FanSpeed, "medium"); |
| | | }); |
| | | menuContr.AddRowMenu(text, iconPath, isSelecte, () => |
| | | { |
| | | frameBack.Close(); |
| | | //发送档位命令 |
| | | this.SendOtherComand(this.btnFan, FunctionAttributeKey.FanSpeed, fanAttrValue); |
| | | }); |
| | | } |
| | | |
| | | //3档 |
| | | iconPath = this.device.GetAttrState(FunctionAttributeKey.FanSpeed) == "high" ? "FunctionIcon/AirFresh/Fan3Select.png" : "FunctionIcon/AirFresh/Fan3.png"; |
| | | menuContr.AddRowMenu(Language.StringByID(StringId.FanThreeGear), iconPath, this.device.GetAttrState(FunctionAttributeKey.FanSpeed) == "high", () => |
| | | { |
| | | frameBack.Close(); |
| | | //发送档位命令 |
| | | this.SendOtherComand(this.btnFan, FunctionAttributeKey.FanSpeed, "high"); |
| | | }); |
| | | //if (fanAttr.value.Contains("low")) |
| | | //{ |
| | | // //1档 |
| | | // var iconPath = this.device.GetAttrState(FunctionAttributeKey.FanSpeed) == "low" ? "FunctionIcon/AirFresh/Fan1Select.png" : "FunctionIcon/AirFresh/Fan1.png"; |
| | | // menuContr.AddRowMenu(Language.StringByID(StringId.FanOneGear), iconPath, this.device.GetAttrState(FunctionAttributeKey.FanSpeed) == "low", () => |
| | | // { |
| | | // frameBack.Close(); |
| | | // //发送档位命令 |
| | | // this.SendOtherComand(this.btnFan, FunctionAttributeKey.FanSpeed, "low"); |
| | | // }); |
| | | //} |
| | | |
| | | //if (fanAttr.value.Contains("medium")) |
| | | //{ |
| | | // //2档 |
| | | // var iconPath = this.device.GetAttrState(FunctionAttributeKey.FanSpeed) == "medium" ? "FunctionIcon/AirFresh/Fan2Select.png" : "FunctionIcon/AirFresh/Fan2.png"; |
| | | // menuContr.AddRowMenu(Language.StringByID(StringId.FanTwoGear), iconPath, this.device.GetAttrState(FunctionAttributeKey.FanSpeed) == "medium", () => |
| | | // { |
| | | // frameBack.Close(); |
| | | // //发送档位命令 |
| | | // this.SendOtherComand(this.btnFan, FunctionAttributeKey.FanSpeed, "medium"); |
| | | // }); |
| | | //} |
| | | |
| | | //if (fanAttr.value.Contains("high")) |
| | | //{ |
| | | // //3档 |
| | | // var iconPath = this.device.GetAttrState(FunctionAttributeKey.FanSpeed) == "high" ? "FunctionIcon/AirFresh/Fan3Select.png" : "FunctionIcon/AirFresh/Fan3.png"; |
| | | // menuContr.AddRowMenu(Language.StringByID(StringId.FanThreeGear), iconPath, this.device.GetAttrState(FunctionAttributeKey.FanSpeed) == "high", () => |
| | | // { |
| | | // frameBack.Close(); |
| | | // //发送档位命令 |
| | | // this.SendOtherComand(this.btnFan, FunctionAttributeKey.FanSpeed, "high"); |
| | | // }); |
| | | //} |
| | | } |
| | | |
| | | #endregion |
| | |
| | | |
| | | #endregion |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => { |
| | | waitPage.Hide(); |
| | | if (waitPage != null) |
| | | { |
| | | waitPage.RemoveFromParent(); |
| | | waitPage = null; |
| | | } |
| | | }); |
| | | } |
| | | }) |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using HDL_ON.DriverLayer; |
| | | using HDL_ON.Entity; |
| | | using HDL_ON.UI.CSS; |
| | |
| | | /// 撤防区域 |
| | | /// </summary> |
| | | FrameLayout disarmView; |
| | | |
| | | /// <summary> |
| | | /// 布防接口 |
| | | /// </summary> |
| | | SecurityAlarm InDefenseMode = null; |
| | | /// <summary> |
| | | /// 自定义布防控件列表 |
| | | /// </summary> |
| | | List<ArmDiyView> armDiyViewList = new List<ArmDiyView>(); |
| | | |
| | | public ArmCenterPage() |
| | | { |
| | |
| | | { |
| | | Width = Application.GetRealWidth(198), |
| | | Height = Application.GetRealWidth(198), |
| | | UnSelectedImagePath = "FunctionIcon/ArmCenter/InAlarmBigIcon.png", |
| | | }; |
| | | btnInalarmIcon.MouseUpEventHandler = (sender, e) => { |
| | | if(SecurityCenter.Ins.InDefenseMode!= null) |
| | | if(InDefenseMode!= null) |
| | | { |
| | | SecurityCenter.Ins.InDefenseMode.alarm = false; |
| | | Control.Ins.ControlSecurity(SecurityCenter.Ins.InDefenseMode, "enable"); |
| | | Action action = () => |
| | | { |
| | | InDefenseMode.alarm = false; |
| | | Control.Ins.ControlSecurity(InDefenseMode, "enable"); |
| | | }; |
| | | new PublicAssmebly().TipOptionMsg(StringId.Tip, StringId.ClearTheSecurityAlarmTip, action); |
| | | |
| | | } |
| | | }; |
| | | InitAlarmStatus(SecurityCenter.Ins.InAlarm); |
| | | |
| | | |
| | | btnDefenseName = new Button() |
| | | { |
| | |
| | | // break; |
| | | // } |
| | | //} |
| | | if(SecurityCenter.Ins.InDefenseMode!= null) |
| | | if(InDefenseMode!= null) |
| | | { |
| | | Control.Ins.ControlSecurity(SecurityCenter.Ins.InDefenseMode, "disable"); |
| | | Control.Ins.ControlSecurity(InDefenseMode, "disable"); |
| | | } |
| | | }; |
| | | |
| | | #endregion |
| | | #endregion |
| | | |
| | | #region 自定义布防 |
| | | //自定义布防标题 |
| | | Button btnCustomDeploymentTitle = new Button() |
| | | #region 自定义布防 |
| | | //自定义布防标题 |
| | | Button btnCustomDeploymentTitle = new Button() |
| | | { |
| | | X = Application.GetRealWidth(24), |
| | | Height = Application.GetRealWidth(54), |
| | |
| | | #endregion |
| | | |
| | | |
| | | |
| | | |
| | | ///刷新界面 |
| | | LoadEvent_RefreshSecurityStatus(); |
| | | iniCustomDeploymentView(); |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 初始化报警状态 |
| | | /// </summary> |
| | | /// <param name="inAlarm"></param> |
| | | public void InitAlarmStatus(bool inAlarm) |
| | | { |
| | | try |
| | | { |
| | | if (inAlarm) |
| | | { |
| | | alarmIconBgView.AddChidren(btnInalarmIcon); |
| | | if (btnInalarmIcon.Parent == null) |
| | | { |
| | | alarmIconBgView.AddChidren(btnInalarmIcon); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | btnInalarmIcon.RemoveFromParent(); |
| | | if (btnInalarmIcon.Parent != null) |
| | | { |
| | | btnInalarmIcon.RemoveFromParent(); |
| | | } |
| | | } |
| | | } |
| | | catch { } |
| | |
| | | private void iniCustomDeploymentView() |
| | | { |
| | | customDeploymentView.RemoveAll(); |
| | | |
| | | armDiyViewList.Clear(); |
| | | foreach (var mode in FunctionList.List.securities) |
| | | { |
| | | var armDiyView = new ArmDiyView("FunctionIcon/ArmCenter/AtHomeDefenseIcon.png", "FunctionIcon/ArmCenter/AtHomeDefenseIconOn.png", |
| | | mode.name); |
| | | mode.name,mode.sid); |
| | | customDeploymentView.AddChidren(armDiyView); |
| | | EventHandler<MouseEventArgs> event2 = (sender, e) => |
| | | { |
| | |
| | | if (mode.status == "enable") |
| | | { |
| | | armDiyView.LightingView(true); |
| | | InDefenseMode = mode; |
| | | |
| | | ///刷新界面 |
| | | LoadEvent_RefreshSecurityStatus(InDefenseMode); |
| | | } |
| | | armDiyViewList.Add(armDiyView); |
| | | } |
| | | |
| | | if (FunctionList.List.securities.Count < 4) |
| | | { |
| | | var view = new ArmDiyView("FunctionIcon/ArmCenter/AddDefenseIcon.png", "FunctionIcon/ArmCenter/AddDefenseIcon.png", |
| | | Language.StringByID(StringId.Custom)); |
| | | Language.StringByID(StringId.Custom),"customSid"); |
| | | customDeploymentView.AddChidren(view); |
| | | EventHandler<MouseEventArgs> event1 = (sender, e) => |
| | | { |
| | |
| | | } |
| | | |
| | | btnOpen.MouseUpEventHandler = (sender, e) => { |
| | | if (alarm.status == "disable") |
| | | string controlStatus = alarm.status == "disable" ? "enable" : "disable"; |
| | | new System.Threading.Thread(() => |
| | | { |
| | | Control.Ins.ControlSecurity(alarm, "enable"); |
| | | }else |
| | | { |
| | | Control.Ins.ControlSecurity(alarm, "disable"); |
| | | } |
| | | Control.Ins.ControlSecurity(alarm, controlStatus); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | dialog.Close(); |
| | | }; |
| | | |
| | |
| | | |
| | | } |
| | | |
| | | public static void LoadEvent_RefreshSecurityStatus() |
| | | public static void LoadEvent_RefreshSecurityStatus(SecurityAlarm updataTemp) |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | if (bodyView != null) |
| | | try |
| | | { |
| | | bodyView.iniCustomDeploymentView(); |
| | | bodyView.disarmView.Height = 0; |
| | | bodyView.btnArmTipIcon.IsSelected = false; |
| | | bodyView.btnDefenseName.Text = ""; |
| | | foreach (var temp in FunctionList.List.securities) |
| | | if (bodyView != null) |
| | | { |
| | | if (temp.status == "enable") |
| | | //布防 |
| | | if (updataTemp.status == "enable") |
| | | { |
| | | bodyView.disarmView.Height = Application.GetRealHeight(68); |
| | | bodyView.btnArmTipIcon.IsSelected = true; |
| | | bodyView.btnDefenseName.Text = temp.name; |
| | | |
| | | bodyView.InitAlarmStatus(temp.alarm); |
| | | break; |
| | | bodyView.InDefenseMode = updataTemp; |
| | | foreach (var tempView in bodyView.armDiyViewList) |
| | | { |
| | | tempView.LightingView(false); |
| | | if (tempView.sid == updataTemp.sid) |
| | | { |
| | | tempView.LightingView(updataTemp.status == "enable"); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | //撤防 |
| | | if(bodyView.InDefenseMode.sid == updataTemp.sid) |
| | | { |
| | | foreach (var tempView in bodyView.armDiyViewList) |
| | | { |
| | | tempView.LightingView(false); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | //foreach(var tempView in bodyView.armDiyViewList) |
| | | //{ |
| | | // tempView.LightingView(false); |
| | | // if(tempView.sid == updataTemp.sid) |
| | | // { |
| | | // tempView.LightingView(updataTemp.status == "enable"); |
| | | // } |
| | | //} |
| | | |
| | | //没有布防的情况 |
| | | if (bodyView.InDefenseMode ==null|| bodyView.InDefenseMode.status == "disable") |
| | | { |
| | | bodyView.disarmView.Height = 0; |
| | | bodyView.btnArmTipIcon.IsSelected = false; |
| | | bodyView.btnDefenseName.Text = ""; |
| | | } |
| | | else |
| | | { |
| | | bodyView.disarmView.Height = Application.GetRealHeight(68); |
| | | bodyView.btnArmTipIcon.IsSelected = true; |
| | | bodyView.btnDefenseName.Text = bodyView.InDefenseMode.name; |
| | | } |
| | | bodyView.InitAlarmStatus(bodyView.InDefenseMode.alarm); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log($"安防界面更新异常:{ex.Message}"); |
| | | } |
| | | }); |
| | | } |
| | |
| | | { |
| | | Button btnIcon; |
| | | Button btnText; |
| | | public string sid; |
| | | /// <summary> |
| | | /// 自定义布防界面 |
| | | /// </summary> |
| | | /// <param name="UnSelectedIconPath">图片路径</param> |
| | | /// <param name="SelectedIconPath">图片路径</param> |
| | | /// <param name="Text">显示文本</param> |
| | | public ArmDiyView(string UnSelectedIconPath, string SelectedIconPath, string Text) |
| | | public ArmDiyView(string UnSelectedIconPath, string SelectedIconPath, string Text,string inSid) |
| | | { |
| | | sid = inSid; |
| | | this.Width = Application.GetRealWidth(82); |
| | | this.Height = Application.GetRealWidth(80); |
| | | |
| | |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 固定布防控件 |
| | | /// </summary> |
| | | public class FixedArmView : FrameLayout |
| | | { |
| | | /// <summary> |
| | |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => { |
| | | waitPage.Hide(); |
| | | if (waitPage != null) |
| | | { |
| | | waitPage.RemoveFromParent(); |
| | | waitPage = null; |
| | | } |
| | | }); |
| | | } |
| | | }) |
| | |
| | | Control.Ins.SendWriteCommand(function, d); |
| | | }; |
| | | |
| | | |
| | | btnCurtainStop.MouseDownEventHandler = (sender, e) => |
| | | { |
| | | btnCurtainStop.IsSelected = true; |
| | | btnCurtainClose.IsSelected = false; |
| | | btnCurtainOpen.IsSelected = false; |
| | | }; |
| | | btnCurtainOpen.MouseDownEventHandler = (sender, e) => |
| | | { |
| | | btnCurtainOpen.IsSelected = true; |
| | | btnCurtainClose.IsSelected = false; |
| | | btnCurtainStop.IsSelected = false; |
| | | }; |
| | | btnCurtainClose.MouseDownEventHandler = (sender, e) => |
| | | { |
| | | btnCurtainClose.IsSelected = true; |
| | | btnCurtainOpen.IsSelected = false; |
| | | btnCurtainStop.IsSelected = false; |
| | | }; |
| | | |
| | | btnCurtainStop.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | new System.Threading.Thread(() => { |
| | |
| | | return; |
| | | if (updateTemp.spk == bodyView.function.spk && updateTemp.sid == bodyView.function.sid) |
| | | { |
| | | var percentString = updateTemp.GetAttrState(FunctionAttributeKey.Percent); |
| | | if (percentString != null) |
| | | { |
| | | int percent = 0; |
| | | int.TryParse(percentString, out percent); |
| | | bodyView.btnCurtainOpen.IsSelected = percent > 0; |
| | | bodyView.btnCurtainClose.IsSelected = percent == 0; |
| | | } |
| | | //var percentString = updateTemp.GetAttrState(FunctionAttributeKey.Percent); |
| | | //if (percentString != null) |
| | | //{ |
| | | // int percent = 0; |
| | | // int.TryParse(percentString, out percent); |
| | | // bodyView.btnCurtainOpen.IsSelected = percent > 0; |
| | | // bodyView.btnCurtainClose.IsSelected = percent == 0; |
| | | //} |
| | | try |
| | | { |
| | | if (!bodyView.onCurtainAnimation) |
| | |
| | | { |
| | | btnCurtainClose.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | //new System.Threading.Thread(() => { |
| | | // System.Threading.Thread.Sleep(2000); |
| | | // Application.RunOnMainThread(() => { |
| | | // btnCurtainClose.IsSelected = false; |
| | | // }); |
| | | //}) |
| | | //{ IsBackground = true }.Start(); |
| | | new System.Threading.Thread(() => |
| | | { |
| | | System.Threading.Thread.Sleep(2000); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | btnCurtainClose.IsSelected = false; |
| | | }); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | function.trait_on_off.curValue = "off"; |
| | | function.SetAttrState(FunctionAttributeKey.Percent, 0); |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | |
| | | |
| | | btnCurtainOpen.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | //new System.Threading.Thread(() => { |
| | | // System.Threading.Thread.Sleep(2000); |
| | | // Application.RunOnMainThread(() => { |
| | | // btnCurtainOpen.IsSelected = false; |
| | | // }); |
| | | //}) |
| | | //{ IsBackground = true }.Start(); |
| | | new System.Threading.Thread(() => |
| | | { |
| | | System.Threading.Thread.Sleep(2000); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | btnCurtainOpen.IsSelected = false; |
| | | }); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | function.trait_on_off.curValue = "on"; |
| | | function.SetAttrState(FunctionAttributeKey.Percent, 100); |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | |
| | | btnCurtainStop.MouseDownEventHandler = (sender, e) => |
| | | { |
| | | btnCurtainStop.IsSelected = true; |
| | | btnCurtainClose.IsSelected = false; |
| | | btnCurtainOpen.IsSelected = false; |
| | | }; |
| | | btnCurtainOpen.MouseDownEventHandler = (sender, e) => |
| | | { |
| | | btnCurtainOpen.IsSelected = true; |
| | | btnCurtainClose.IsSelected = false; |
| | | btnCurtainStop.IsSelected = false; |
| | | }; |
| | | btnCurtainClose.MouseDownEventHandler = (sender, e) => |
| | | { |
| | | btnCurtainClose.IsSelected = true; |
| | | btnCurtainOpen.IsSelected = false; |
| | | btnCurtainStop.IsSelected = false; |
| | | }; |
| | | |
| | | //btnMinusSignIcon.MouseUpEventHandler = (sender, e) => |
| | |
| | | return; |
| | | if (updateTemp.spk == bodyView.function.spk && updateTemp.sid == bodyView.function.sid) |
| | | { |
| | | var percentString = updateTemp.GetAttrState(FunctionAttributeKey.Percent); |
| | | int percent = 0; |
| | | int.TryParse(percentString, out percent); |
| | | bodyView.btnCurtainOpen.IsSelected = percent > 0; |
| | | bodyView.btnCurtainClose.IsSelected = percent == 0; |
| | | //var percentString = updateTemp.GetAttrState(FunctionAttributeKey.Percent); |
| | | //int percent = 0; |
| | | //int.TryParse(percentString, out percent); |
| | | //bodyView.btnCurtainOpen.IsSelected = percent > 0; |
| | | //bodyView.btnCurtainClose.IsSelected = percent == 0; |
| | | try |
| | | { |
| | | if (!bodyView.onCurtainAnimation) |
| | |
| | | { |
| | | btnCurtainClose.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | //new System.Threading.Thread(() => { |
| | | // System.Threading.Thread.Sleep(2000); |
| | | // Application.RunOnMainThread(() => { |
| | | // btnCurtainClose.IsSelected = false; |
| | | // }); |
| | | //}) |
| | | //{ IsBackground = true }.Start(); |
| | | new System.Threading.Thread(() => |
| | | { |
| | | System.Threading.Thread.Sleep(2000); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | btnCurtainClose.IsSelected = false; |
| | | }); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | function.trait_on_off.curValue = "off"; |
| | | function.SetAttrState(FunctionAttributeKey.Percent, 0); |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | |
| | | |
| | | btnCurtainOpen.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | //new System.Threading.Thread(() => { |
| | | // System.Threading.Thread.Sleep(2000); |
| | | // Application.RunOnMainThread(() => { |
| | | // btnCurtainOpen.IsSelected = false; |
| | | // }); |
| | | //}) |
| | | //{ IsBackground = true }.Start(); |
| | | new System.Threading.Thread(() => |
| | | { |
| | | System.Threading.Thread.Sleep(2000); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | btnCurtainOpen.IsSelected = false; |
| | | }); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | function.trait_on_off.curValue = "on"; |
| | | function.SetAttrState(FunctionAttributeKey.Percent, 100); |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | |
| | | btnCurtainStop.MouseDownEventHandler = (sender, e) => |
| | | { |
| | | btnCurtainStop.IsSelected = true; |
| | | btnCurtainClose.IsSelected = false; |
| | | btnCurtainOpen.IsSelected = false; |
| | | }; |
| | | btnCurtainOpen.MouseDownEventHandler = (sender, e) => |
| | | { |
| | | btnCurtainOpen.IsSelected = true; |
| | | btnCurtainClose.IsSelected = false; |
| | | btnCurtainStop.IsSelected = false; |
| | | }; |
| | | btnCurtainClose.MouseDownEventHandler = (sender, e) => |
| | | { |
| | | btnCurtainClose.IsSelected = true; |
| | | btnCurtainOpen.IsSelected = false; |
| | | btnCurtainStop.IsSelected = false; |
| | | }; |
| | | |
| | | |
New file |
| | |
| | | using System; |
| | | using HDL_ON.Entity; |
| | | using HDL_ON.UI.CSS; |
| | | using Shared; |
| | | |
| | | namespace HDL_ON.UI |
| | | { |
| | | public class AirSwitchPage : FrameLayout |
| | | { |
| | | |
| | | #region 控件集合 |
| | | static AirSwitchPage bodyView; |
| | | /// <summary> |
| | | /// 控制界面加载区域 |
| | | /// </summary> |
| | | FrameLayout controlView; |
| | | /// <summary> |
| | | /// 功能备注 |
| | | /// </summary> |
| | | Button btnFunctionName; |
| | | /// <summary> |
| | | /// 功能所属楼层、房间 |
| | | /// </summary> |
| | | Button btnFromFoorAndRoom; |
| | | /// <summary> |
| | | /// 收藏按钮 |
| | | /// </summary> |
| | | Button btnCollection; |
| | | /// <summary> |
| | | /// 继电器状态图标 |
| | | /// </summary> |
| | | Button btnSwitchIcon; |
| | | /// <summary> |
| | | /// 开关按钮 |
| | | /// </summary> |
| | | Button btnSwitch; |
| | | #endregion |
| | | |
| | | #region 区域变量 |
| | | Function function; |
| | | Button btnCollection_Out; |
| | | Button btnFunctionName_Out; |
| | | Button btnFromFloor_Out; |
| | | /// <summary> |
| | | /// 刷新显示信息 |
| | | /// </summary> |
| | | Action actionRefresh; |
| | | #endregion |
| | | |
| | | public AirSwitchPage(Function func) |
| | | { |
| | | bodyView = this; |
| | | function = func; |
| | | |
| | | } |
| | | /// <summary> |
| | | /// 加载界面 |
| | | /// </summary> |
| | | /// <param name="btnCollectionIcon">收藏按钮</param> |
| | | /// <param name="btnFunctionName">功能名称信息按钮</param> |
| | | /// <param name="btnFromFloor">功能楼层信息按钮</param> |
| | | public void LoadPage(Button btnCollectionIcon, Button btnFunctionNameOut, Button btnFromFloorOut) |
| | | { |
| | | if (btnCollectionIcon == null) |
| | | { |
| | | btnCollection_Out = new Button(); |
| | | btnFunctionName_Out = new Button(); |
| | | btnFromFloor_Out = new Button(); |
| | | } |
| | | else |
| | | { |
| | | btnCollection_Out = btnCollectionIcon; |
| | | btnFunctionName_Out = btnFunctionNameOut; |
| | | btnFromFloor_Out = btnFromFloorOut; |
| | | } |
| | | bodyView.BackgroundColor = CSS_Color.BackgroundColor; |
| | | //new PublicAssmebly().LoadTopView(bodyView, Language.StringByID(StringId.Lights), function); |
| | | |
| | | controlView = new FrameLayout() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealHeight(88), |
| | | Width = Application.GetRealWidth(327), |
| | | Height = Application.GetRealHeight(526), |
| | | BackgroundImagePath = "Public/Fragmentbg.png", |
| | | }; |
| | | bodyView.AddChidren(controlView); |
| | | |
| | | btnFunctionName = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = Application.GetRealHeight(14), |
| | | Width = Application.GetRealWidth(270), |
| | | Height = Application.GetRealHeight(37), |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = CSS_FontSize.EmphasisFontSize_FirstLevel, |
| | | Text = function.name, |
| | | }; |
| | | controlView.AddChidren(btnFunctionName); |
| | | |
| | | btnFromFoorAndRoom = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = btnFunctionName.Bottom, |
| | | Width = Application.GetRealWidth(270), |
| | | Height = Application.GetRealHeight(21), |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | Text = function.GetRoomListName() |
| | | }; |
| | | controlView.AddChidren(btnFromFoorAndRoom); |
| | | |
| | | btnCollection = new Button() |
| | | { |
| | | X = Application.GetRealWidth(273), |
| | | Y = Application.GetRealHeight(14), |
| | | Width = Application.GetMinRealAverage(40), |
| | | Height = Application.GetMinRealAverage(40), |
| | | SelectedImagePath = "Collection/CollectionIcon.png", |
| | | UnSelectedImagePath = "Collection/CollectionGrayIcon.png", |
| | | IsSelected = function.collect |
| | | }; |
| | | controlView.AddChidren(btnCollection); |
| | | |
| | | btnSwitchIcon = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealHeight(102), |
| | | Width = Application.GetRealWidth(148), |
| | | Height = Application.GetRealWidth(198), |
| | | UnSelectedImagePath = "FunctionIcon/Electrical/AirSwitch/AirSwitchBgIcon.png", |
| | | SelectedImagePath = "FunctionIcon/Electrical/AirSwitch/AirSwitchBgOnIcon.png", |
| | | IsSelected = function.trait_on_off.curValue.ToString() == "on" |
| | | }; |
| | | controlView.AddChidren(btnSwitchIcon); |
| | | |
| | | btnSwitch = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealHeight(466),// + btnSwitchIcon.Bottom, |
| | | Width = Application.GetMinRealAverage(32), |
| | | Height = Application.GetMinRealAverage(32), |
| | | UnSelectedImagePath = "Public/PowerClose.png", |
| | | SelectedImagePath = "Public/PowerOpen.png", |
| | | IsSelected = function.trait_on_off.curValue.ToString() == "on" |
| | | }; |
| | | controlView.AddChidren(btnSwitch); |
| | | |
| | | new TopViewDiv(bodyView, Language.StringByID(StringId.Electric)).LoadTopView_FunctionTop(function, actionRefresh,false); |
| | | new System.Threading.Thread(() => |
| | | { |
| | | DriverLayer.Control.Ins.SendReadCommand(function); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | |
| | | |
| | | LoadEventList(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 更新状态 |
| | | /// </summary> |
| | | public static void UpdataState(Function updataTemp) |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | try |
| | | { |
| | | if (bodyView == null) |
| | | return; |
| | | if (updataTemp.spk == bodyView.function.spk && updataTemp.sid == bodyView.function.sid) |
| | | { |
| | | bodyView.btnSwitch.IsSelected = bodyView.btnSwitchIcon.IsSelected = updataTemp.trait_on_off.curValue.ToString() == "on"; |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log($"AirSwitch error {ex.Message}"); |
| | | } |
| | | }); |
| | | } |
| | | /// <summary> |
| | | /// 加载事件列表 |
| | | /// </summary> |
| | | void LoadEventList() |
| | | { |
| | | LoadSwitchEvent(); |
| | | LoadCollectionEvent(); |
| | | |
| | | //回退刷新信息事件 |
| | | actionRefresh = () => { |
| | | btnFunctionName.Text = btnFunctionName_Out.Text = function.name; |
| | | btnFromFloor_Out.Text = btnFromFoorAndRoom.Text = function.GetRoomListName(); |
| | | //function.SaveFunctionData(true); |
| | | }; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 收藏功能按钮事件 |
| | | /// </summary> |
| | | void LoadCollectionEvent() |
| | | { |
| | | btnCollection.MouseUpEventHandler += (sender, e) => { |
| | | btnCollection.IsSelected = function.collect = btnCollection_Out.IsSelected = !btnCollection.IsSelected; |
| | | function.CollectFunction(); |
| | | }; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 加载开关事件 |
| | | /// </summary> |
| | | void LoadSwitchEvent() |
| | | { |
| | | btnSwitchIcon.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | btnSwitch.IsSelected = btnSwitchIcon.IsSelected = !btnSwitchIcon.IsSelected; |
| | | new System.Threading.Thread(() => |
| | | { |
| | | function.trait_on_off.curValue = btnSwitchIcon.IsSelected ? "on" : "off"; |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | d.Add("on_off", function.trait_on_off.curValue.ToString()); |
| | | DriverLayer.Control.Ins.SendWriteCommand(function, d); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | }; |
| | | btnSwitch.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | btnSwitchIcon.IsSelected = btnSwitch.IsSelected = !btnSwitch.IsSelected; |
| | | new System.Threading.Thread(() => |
| | | { |
| | | function.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off"; |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | d.Add("on_off", function.trait_on_off.curValue.ToString()); |
| | | DriverLayer.Control.Ins.SendWriteCommand(function, d); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | |
| | | }; |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | imagePath = "FunctionIcon/EnvirSensor/TempBg.png"; |
| | | iconPath = "FunctionIcon/EnvirSensor/TempIcon.png"; |
| | | break; |
| | | case SPK.SensorHcho: |
| | | imagePath = "FunctionIcon/EnvirSensor/HchoBg.png"; |
| | | iconPath = "FunctionIcon/EnvirSensor/HchoIcon.png"; |
| | | break; |
| | | } |
| | | sensorView.BackgroundImagePath = imagePath; |
| | | |
| | |
| | | Width = Application.GetRealWidth(100), |
| | | Height = Application.GetRealWidth(32), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextColor = sensorTemp.GetLevelColorList(sensor.spk)[sensorTemp.GetCurLevel(sensor) - 1], |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextID = levelTextList[sensorTemp.GetCurLevel(sensor) - 1], |
| | | Tag = "SensorLevel", |
| | | }; |
| | | sensorView.AddChidren(btnLevel); |
| | | |
| | | btnLevel.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | #region |
| | |
| | | btnTitle.Text = Language.StringByID(StringId.Temp) + "(°C)"; |
| | | break; |
| | | case SPK.SensorTVOC: |
| | | btnTitle.Text = "TVOC(PPM)"; |
| | | btnTitle.Text = "TVOC(PPB)"; |
| | | break; |
| | | case SPK.SensorCO2: |
| | | btnTitle.Text = "CO2(PPM)"; |
| | |
| | | case SPK.SensorHumidity: |
| | | btnTitle.Text = Language.StringByID(StringId.Humidity) + "(%)"; |
| | | break; |
| | | case SPK.SensorHcho: |
| | | btnTitle.Text = Language.StringByID(StringId.Formaldehyde) +"(mg/m3)"; |
| | | break; |
| | | } |
| | | |
| | | FrameLayout subTitleView = new FrameLayout() |
| | |
| | | /// <summary> |
| | | /// 加载界面 |
| | | /// </summary> |
| | | public void LoadPage() |
| | | public void LoadPage(bool locationSetting = true) |
| | | { |
| | | bodyView.BackgroundColor = CSS_Color.BackgroundColor; |
| | | new TopViewDiv(bodyView, Language.StringByID(StringId.Setting)).LoadTopView(actionRefresh); |
| | |
| | | }); |
| | | |
| | | #endregion |
| | | |
| | | #region 位置管理 |
| | | var locationMagtView = new FrameLayout() |
| | | if (locationSetting) |
| | | { |
| | | Height = Application.GetRealHeight(55), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | }; |
| | | contentView.AddChidren(locationMagtView); |
| | | |
| | | var btnLocationMagtTitle = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Width = Application.GetRealWidth(160), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextID = StringId.LocationManagement, |
| | | }; |
| | | locationMagtView.AddChidren(btnLocationMagtTitle); |
| | | |
| | | btnLocationValues = new Button() |
| | | { |
| | | X = Application.GetRealWidth(86), |
| | | Width = Application.GetRealWidth(237), |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | Text = function.GetRoomListName(), |
| | | }; |
| | | locationMagtView.AddChidren(btnLocationValues); |
| | | |
| | | btnLocationInfoRight = new Button() |
| | | { |
| | | X = Application.GetRealWidth(339), |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetMinRealAverage(16), |
| | | Height = Application.GetMinRealAverage(16), |
| | | UnSelectedImagePath = "Public/RightIcon.png", |
| | | }; |
| | | locationMagtView.AddChidren(btnLocationInfoRight); |
| | | |
| | | locationMagtView.AddChidren( |
| | | new Button() |
| | | #region 位置管理 |
| | | var locationMagtView = new FrameLayout() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealHeight(54), |
| | | BackgroundColor = CSS_Color.DividingLineColor, |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealHeight(1) |
| | | }); |
| | | #endregion |
| | | Height = Application.GetRealHeight(55), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | }; |
| | | contentView.AddChidren(locationMagtView); |
| | | |
| | | var btnLocationMagtTitle = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Width = Application.GetRealWidth(160), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextID = StringId.LocationManagement, |
| | | }; |
| | | locationMagtView.AddChidren(btnLocationMagtTitle); |
| | | |
| | | btnLocationValues = new Button() |
| | | { |
| | | X = Application.GetRealWidth(86), |
| | | Width = Application.GetRealWidth(237), |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | Text = function.GetRoomListName(), |
| | | }; |
| | | locationMagtView.AddChidren(btnLocationValues); |
| | | |
| | | btnLocationInfoRight = new Button() |
| | | { |
| | | X = Application.GetRealWidth(339), |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetMinRealAverage(16), |
| | | Height = Application.GetMinRealAverage(16), |
| | | UnSelectedImagePath = "Public/RightIcon.png", |
| | | }; |
| | | locationMagtView.AddChidren(btnLocationInfoRight); |
| | | |
| | | locationMagtView.AddChidren( |
| | | new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealHeight(54), |
| | | BackgroundColor = CSS_Color.DividingLineColor, |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealHeight(1) |
| | | }); |
| | | #endregion |
| | | } |
| | | #region 共享 |
| | | //var sharedView = new FrameLayout() |
| | | //{ |
| | |
| | | /// 丰林可视对讲data |
| | | /// </summary> |
| | | public VideoFlData flRoomBindVO = new VideoFlData(); |
| | | /// <summary> |
| | | /// 设备sip账号 interphoneType是HDL时才会有值 |
| | | /// </summary> |
| | | public string deviceSipAccount; |
| | | /// <summary> |
| | | /// homeId |
| | | /// </summary> |
| | | public string homeId; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | DeviceName = video.deviceName, |
| | | roomno = video.flRoomBindVO.flRoomId, |
| | | unitno = video.flRoomBindVO.flBuildingId, |
| | | uuid= getUuid(video.deviceId), |
| | | cmtID=video.flRoomBindVO.flCmtId, |
| | | uuid = getUuid(video.deviceId), |
| | | cmtID = video.flRoomBindVO.flCmtId, |
| | | Lc_AccessToken = video.subAccountToken, |
| | | Lc_DeviceId = video.deviceId, |
| | | Lc_Psk = video.deviceName, |
| | | Lc_PlayToken = video.playToken, |
| | | deviceSipAccount = video.deviceSipAccount, |
| | | HomeId = video.homeId |
| | | }; |
| | | ESOnVideo.Current.ShowESVideoMonitor(eSVideoInfo, video.interphoneType); |
| | | } |