| | |
| | | <Properties StartupConfiguration="{D998E133-F0DD-4760-BE3C-461632F54DA4}|Default"> |
| | | <MonoDevelop.Ide.ItemProperties.HDL-ON__iOS PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneDeviceTarget.00008020-000404163432002E" /> |
| | | <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/UI/UI2/FuntionControlView/ArmCenter/ArmCenterPage.cs"> |
| | | <Files> |
| | | <File FileName="HDL_ON/UI/UI2/FuntionControlView/ArmCenter/ArmCenterPage.cs" Line="88" Column="66" /> |
| | | <File FileName="HDL_ON/DAL/Mqtt/MqttClient.cs" /> |
| | | <File FileName="HDL_ON/Common/ApiUtlis.cs" /> |
| | | <File FileName="HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs" /> |
| | | <File FileName="HDL_ON/DAL/DriverLayer/Control.cs" /> |
| | | </Files> |
| | | <Properties StartupConfiguration="{09712674-2A38-407B-B1E2-560B2C352F9A}|Default"> |
| | | <MonoDevelop.Ide.ItemProperties.HDL-ON__iOS PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneDeviceTarget.6242be7109c740c6cb8999a8904b6e0ea8d45192" /> |
| | | <MonoDevelop.Ide.Workbench> |
| | | <Pads> |
| | | <Pad Id="ProjectPad"> |
| | | <State name="__root__"> |
| | |
| | | <Node name="HDL_ON" expanded="True"> |
| | | <Node name="Common" expanded="True" /> |
| | | <Node name="DAL" expanded="True"> |
| | | <Node name="DriverLayer" expanded="True" /> |
| | | <Node name="Mqtt" expanded="True" /> |
| | | <Node name="Server" expanded="True" /> |
| | | <Node name="ThirdPartySdk" expanded="True" /> |
| | | </Node> |
| | | <Node name="Entity" expanded="True"> |
| | | <Node name="Function" expanded="True" /> |
| | | </Node> |
| | | <Node name="UI" expanded="True"> |
| | | <Node name="UI2" expanded="True"> |
| | | <Node name="1-HomePage" expanded="True" /> |
| | | <Node name="3-Intelligence" expanded="True" /> |
| | | <Node name="4-PersonalCenter" expanded="True"> |
| | | <Node name="FaceManagement" expanded="True" /> |
| | | </Node> |
| | | <Node name="FuntionControlView" expanded="True"> |
| | | <Node name="ArmCenter" expanded="True"> |
| | | <Node name="ArmCenterPage.cs" selected="True" /> |
| | | </Node> |
| | | <Node name="1ContorlPage" expanded="True" /> |
| | | </Node> |
| | | </Node> |
| | | </Node> |
| | | </Node> |
| | | <Node name="HDL-ON_iOS" expanded="True"> |
| | | <Node name="Resources" expanded="True" /> |
| | | </Node> |
| | | <Node name="HDL-ON_Android" selected="True" /> |
| | | <Node name="HDL-ON_iOS" expanded="True" /> |
| | | </Node> |
| | | </State> |
| | | </Pad> |
| | | <Pad Id="MonoDevelop.Debugger.WatchPad"> |
| | | <State> |
| | | <Value>cus.customerFaceUrl</Value> |
| | | </State> |
| | | </Pad> |
| | | </Pads> |
| | |
| | | <String>Shared.Droid.TouchID/Shared.Droid.TouchID.csproj</String> |
| | | <String>Shared.IOS/Shared.IOS.csproj</String> |
| | | </DisabledProjects> |
| | | <MonoDevelop.Ide.Workspace ActiveConfiguration="Debug|iPhone" /> |
| | | <MonoDevelop.Ide.Workspace ActiveConfiguration="Release|iPhone" /> |
| | | <MonoDevelop.Ide.ItemProperties.HDL-ON__Android PreferredExecutionTarget="Android.SelectDevice" /> |
| | | <MonoDevelop.Ide.DebuggingService.Breakpoints> |
| | | <BreakpointStore> |
| | |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/DAL/Mqtt/MqttClient.cs" relfile="HDL_ON/DAL/Mqtt/MqttClient.cs" line="431" column="1" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSensorPage.cs" relfile="HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSensorPage.cs" line="747" column="1" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/Transfer/TransferUserConfirmPage.cs" relfile="HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/Transfer/TransferUserConfirmPage.cs" line="106" column="1" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalPage.cs" relfile="HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalPage.cs" line="348" column="1" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/AddDevciePage.cs" relfile="HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/AddDevciePage.cs" line="54" column="1" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/FuntionControlView/Light/RGBPageBLL.cs" relfile="HDL_ON/UI/UI2/FuntionControlView/Light/RGBPageBLL.cs" line="168" column="1" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/Common/ApiUtlis.cs" relfile="HDL_ON/Common/ApiUtlis.cs" line="391" column="1" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/FuntionControlView/ArmCenter/ArmCenterPage.cs" relfile="HDL_ON/UI/UI2/FuntionControlView/ArmCenter/ArmCenterPage.cs" line="91" column="1" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AirFreshRelayControlPage.cs" relfile="HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AirFreshRelayControlPage.cs" line="71" column="1" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/FuntionControlView/ArmCenter/ArmCenterPage.cs" relfile="HDL_ON/UI/UI2/FuntionControlView/ArmCenter/ArmCenterPage.cs" line="468" column="1" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/4-PersonalCenter/FaceManagement/FacePassagePage.cs" relfile="HDL_ON/UI/UI2/4-PersonalCenter/FaceManagement/FacePassagePage.cs" line="224" column="1" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/4-PersonalCenter/FaceManagement/FacePassagePage.cs" relfile="HDL_ON/UI/UI2/4-PersonalCenter/FaceManagement/FacePassagePage.cs" line="466" column="1" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/4-PersonalCenter/FaceManagement/FacePassagePage.cs" relfile="HDL_ON/UI/UI2/4-PersonalCenter/FaceManagement/FacePassagePage.cs" line="523" column="1" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalPage.cs" relfile="HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalPage.cs" line="279" column="1" /> |
| | | </BreakpointStore> |
| | | </MonoDevelop.Ide.DebuggingService.Breakpoints> |
| | | <MultiItemStartupConfigurations /> |
| | |
| | | 499=Add defense function |
| | | 500=Add alarm target |
| | | 501=Security alarm: {0} is triggered. |
| | | 502=Clear the security alarm? |
| | | |
| | | |
| | | 1000=Room Humidity |
| | |
| | | 7144=excellence |
| | | 7145=Security |
| | | 7146=Add security |
| | | |
| | | 7147=Arm |
| | | 7148=Disarm |
| | | |
| | | |
| | | |
| | | 9000=Please sign in with new cell phone number. |
| | |
| | | 499=添加布防功能 |
| | | 500=添加告警目标 |
| | | 501=安防报警:{0}被触发。 |
| | | 502=是否解除安防警报? |
| | | |
| | | 1000=室内湿度 |
| | | 1001=童锁 |
| | |
| | | 7144=优秀 |
| | | 7145=安防 |
| | | 7146=添加安防 |
| | | |
| | | 7147=布防 |
| | | 7148=撤防 |
| | | |
| | | |
| | | 9000=请使用新的手机账号登录APP |
| | | 9001=请使用新的邮箱账号登录APP |
| | |
| | | <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" /> |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\DoorLock\BindScene.png" /> |
| | |
| | | <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" /> |
| | |
| | | <?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"> |
| | | <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="202108271" android:versionName="1.2.202108271" package="com.hdl.onpro"> |
| | | <uses-sdk android:minSdkVersion="26" android:targetSdkVersion="29" /> |
| | | <!-- 乐橙可视对讲需要的权限 --> |
| | | <!--<uses-permission android:name="android.permission.INTERNET" />--> |
| | |
| | | <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" /> |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | | <ITunesArtwork Include="iTunesArtwork" /> |
| | |
| | | <key>UIStatusBarStyle</key> |
| | | <string>UIStatusBarStyleLightContent</string> |
| | | <key>CFBundleShortVersionString</key> |
| | | <string>1.2.202108211</string> |
| | | <string>1.2.202108271</string> |
| | | <key>CFBundleVersion</key> |
| | | <string>1.2.08211</string> |
| | | <string>1.2.08271</string> |
| | | <key>NSLocationWhenInUseUsageDescription</key> |
| | | <string>Use geographic location to provide services such as weather</string> |
| | | <key>NSAppleMusicUsageDescription</key> |
| | |
| | | 499=Add defense function |
| | | 500=Add alarm target |
| | | 501=Security alarm: {0} is triggered. |
| | | 502=Clear the security alarm? |
| | | |
| | | |
| | | 1000=Room Humidity |
| | |
| | | 499=添加布防功能 |
| | | 500=添加告警目标 |
| | | 501=安防报警:{0}被触发。 |
| | | 502=是否解除安防警报? |
| | | |
| | | 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>(); |
| | |
| | | { |
| | | UI.UI2.PersonalCenter.PirDevice.PirSend.LcSubAccessToken = video.subAccountToken; |
| | | } |
| | | else if(video.interphoneType == InterphoneType.HDL.ToString()) |
| | | { |
| | | DB_ResidenceData.Instance.SupportFacePass = true; |
| | | DB_ResidenceData.Instance.SaveResidenceData(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | //======================安防==================== |
| | | GetSecurityList(); |
| | | //======================SIP账号==================== |
| | | |
| | | } |
| | | catch (Exception ex) |
| | |
| | | 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> |
| | | /// 一级建筑标准 |
| | | /// </summary> |
| | | public const int Class_I_BuildingStandard = 505; |
| | | /// <summary> |
| | | /// 二级建筑标准 |
| | | /// </summary> |
| | | public const int SecondaryBuildingStandard = 506; |
| | | /// <summary> |
| | | /// 超标 |
| | | /// </summary> |
| | | public const int ExceedingTheStandard = 503; |
| | | /// <summary> |
| | | /// 是否解除安防警报? |
| | | /// </summary> |
| | | public const int ClearTheSecurityAlarmTip = 502; |
| | | /// <summary> |
| | | /// 安防报警 |
| | | /// </summary> |
| | | public const int SecurityAlarmTipString = 501; |
| | |
| | | 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; |
| | |
| | | { |
| | | 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}"); |
| | | } |
| | | } |
| | | } |
| | |
| | | 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); |
| | | |
| | | //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 |
| | | public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; |
| | | //public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";//mmmm |
| | | /// <summary> |
| | | /// RegionMark |
| | | /// </summary> |
| | |
| | | /// <summary> |
| | | /// 响应错误信息 |
| | | /// </summary> |
| | | public string message; |
| | | public string message = ""; |
| | | |
| | | /// <summary> |
| | | /// 这个是请求错误时的扩展数据,以后所有的附带扩展数据都会放在这里面动态维护 |
| | |
| | | /// 获取通话记录 |
| | | /// </summary> |
| | | public const string API_POST_FL_GetCallList = "/home-wisdom/platform/imou/listCallRecords"; |
| | | |
| | | public const string Api_Post_GetSipInfo = ""; |
| | | /// <summary> |
| | | /// 人脸录入 |
| | | /// </summary> |
| | | public const string Api_Post_InputUserFace = "/community-wisdom/app/doorDevice/inputUserFace"; |
| | | /// <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"; |
| | | #endregion |
| | | |
| | | |
| | |
| | | public const string API_POST_DoorHistory = "/home-wisdom/app/device/door/logs"; |
| | | |
| | | #endregion |
| | | |
| | | #region ■ -- SIP相关接口_______________________________ |
| | | #endregion |
| | | |
| | | |
| | | } |
| | | |
| | | ///// <summary> |
| | |
| | | /// 萤石猫眼呼叫 |
| | | /// </summary> |
| | | EZVIZ, |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | HDL, |
| | | |
| | | |
| | | } |
| | |
| | | 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("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(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.SensorReferenceHumidityTipLevel1); |
| | | _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; |
| | |
| | | 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" />
|
| | | </ItemGroup>
|
| | | <ItemGroup>
|
| | | <Folder Include="$(MSBuildThisFileDirectory)Entity\Device\" />
|
| | |
| | | /// <summary> |
| | | /// 版本号 |
| | | /// </summary> |
| | | public static string VersionString = "1.2.0821"; |
| | | public static string VersionString = "1.2.0827"; |
| | | ///// <summary> |
| | | ///// 客户端类型 |
| | | ///// </summary> |
| | |
| | | { |
| | | SPK.EnergyStandard, |
| | | SPK.MusicStandard, |
| | | SPK.AirSwitch, |
| | | SPK.ElectricEnergy, |
| | | }; |
| | | |
| | | |
| | |
| | | ///等待获取住宅信息 |
| | | 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.AirFreshStandard, |
| | | // name = "测试新风", |
| | | // spk = SPK.AirSwitch, |
| | | // name = "智能空开", |
| | | // 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" } }, |
| | | // }, |
| | | //}); |
| | | |
| | | FunctionList.List.Functions.Add(new Function() |
| | | { |
| | | spk = SPK.SensorGas, |
| | | name = "燃气传感器", |
| | | spk = SPK.AirFreshStandard, |
| | | 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" } }, |
| | | new FunctionAttributes(){ key = "on_off",curValue= "on",state = "on" }, |
| | | 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.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> |
| | |
| | | { |
| | | 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; |
| | | } |
| | | }); |
| | | } |
| | | }) |
| | |
| | | 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), |
| | |
| | | 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 = () => { |
| | | btnCommunityAccessControlIcon.IsSelected = !btnCommunityAccessControlIcon.IsSelected; |
| | | }; |
| | | 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); |
| | | btnSetFaceId.MouseUpEventHandler = (sender, e) => { |
| | | LoadPictureOptionView(); |
| | | }; |
| | | |
| | | if (string.IsNullOrEmpty(faceid)) |
| | | btnEraseData = new Button() |
| | | { |
| | | } |
| | | else |
| | | { |
| | | btnSetFaceId.TextID = StringId.ResetFace; |
| | | |
| | | var 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, |
| | | 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 = () => { |
| | | initButtonStatus(); |
| | | }; |
| | | contentView.AddChidren(btnEraseData); |
| | | } |
| | | editFaceInfo(3,action); |
| | | }; |
| | | |
| | | ReadFaceInfo(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取人脸信息 |
| | | /// </summary> |
| | | void ReadFaceInfo() |
| | | { |
| | | var 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, 1000); |
| | | |
| | | 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,1000); |
| | | |
| | | 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.SelectPicture((imagePath) => |
| | | { |
| | | CropImageCallBack(imagePath, 2, imageName); |
| | | }, imageName, 4, 6); |
| | | } |
| | | else |
| | | { |
| | | CropImage.TakePicture((imagePath) => |
| | | { |
| | | CropImageCallBack(imagePath, 1,imageName); |
| | | }, imageName, 4, 6); |
| | | } |
| | | }else |
| | | { |
| | | ReadFaceInfo(); |
| | | } |
| | | }; |
| | | 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) |
| | | { |
| | | 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); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | 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.DeleteSceneTip, 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(); |
| | | |
| | | }; |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | /// <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() |
| | | //{ |