| | |
| | | <Properties StartupConfiguration="{D998E133-F0DD-4760-BE3C-461632F54DA4}|Default"> |
| | | <MonoDevelop.Ide.ItemProperties.HDL-ON__iOS PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneDeviceTarget.6242be7109c740c6cb8999a8904b6e0ea8d45192" /> |
| | | <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/DAL/Server/HttpUtil.cs"> |
| | | <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs"> |
| | | <Files> |
| | | <File FileName="HDL_ON/Entity/Function/Scene.cs" Line="83" Column="23" /> |
| | | <File FileName="HDL_ON/UI/UI2/3-Intelligence/Scene/SceneEditPage.cs" Line="376" Column="33" /> |
| | | <File FileName="HDL_ON/UI/UI2/1-HomePage/HomePage.cs" Line="392" Column="53" /> |
| | | <File FileName="HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs" Line="28" Column="22" /> |
| | | <File FileName="HDL_ON/DAL/DriverLayer/UdpSocket.cs" Line="123" Column="1" /> |
| | | <File FileName="HDL_ON/UI/UI2/FuntionControlView/ArmCenter/ArmCenterPage.cs" Line="199" Column="1" /> |
| | | <File FileName="HDL_ON/DAL/DriverLayer/Control.cs" Line="789" Column="18" /> |
| | | <File FileName="HDL_ON/DAL/Server/HttpServerRequest.cs" Line="2295" Column="32" /> |
| | | <File FileName="HDL_ON/DAL/Server/NewAPI.cs" Line="483" Column="23" /> |
| | | <File FileName="HDL_ON/Entity/FunctionList.cs" Line="179" Column="48" /> |
| | | <File FileName="HDL_ON/Common/ApiUtlis.cs" Line="394" Column="1" /> |
| | | <File FileName="HDL_ON/Entity/Function/SecurityAlarm.cs" Line="72" Column="1" /> |
| | | <File FileName="HDL_ON/DAL/DriverLayer/Control_Udp.cs" Line="79" Column="28" /> |
| | | <File FileName="HDL_ON/DAL/Server/HttpUtil.cs" Line="22" Column="87" /> |
| | | <File FileName="HDL_ON/UI/UI2/3-Intelligence/Scene/SceneEditPage.cs" /> |
| | | <File FileName="HDL_ON/DAL/DriverLayer/UdpSocket.cs" /> |
| | | <File FileName="HDL_ON/Entity/FunctionList.cs" Line="435" Column="32" /> |
| | | <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPage.cs" Line="459" Column="40" /> |
| | | <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPageBLL.cs" Line="295" Column="67" /> |
| | | <File FileName="HDL_ON/UI/UI2/FuntionControlView/ArmCenter/ArmCenterPage.cs" Line="234" Column="1" /> |
| | | <File FileName="HDL_ON/UI/UI2/FuntionControlView/ArmCenter/ArmDeploymentSettingPage.cs" Line="29" Column="16" /> |
| | | <File FileName="HDL_ON/UI/UI2/1-HomePage/HomePage.cs" Line="390" Column="52" /> |
| | | <File FileName="HDL_ON/UI/UI2/FuntionControlView/ArmCenter/AddAlarmDeploymentPage.cs" Line="154" Column="15" /> |
| | | <File FileName="HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs" Line="705" Column="5" /> |
| | | </Files> |
| | | <Pads> |
| | | <Pad Id="ProjectPad"> |
| | | <State name="__root__"> |
| | | <Node name="HDL_APP_Project" expanded="True"> |
| | | <Node name="HDL_ON" expanded="True"> |
| | | <Node name="Common" expanded="True" /> |
| | | <Node name="Common" expanded="True"> |
| | | <Node name="Utlis" expanded="True" /> |
| | | </Node> |
| | | <Node name="DAL" expanded="True"> |
| | | <Node name="DriverLayer" expanded="True" /> |
| | | <Node name="Server" expanded="True"> |
| | | <Node name="HttpUtil.cs" selected="True" /> |
| | | </Node> |
| | | <Node name="Mqtt" expanded="True" /> |
| | | <Node name="Server" expanded="True" /> |
| | | </Node> |
| | | <Node name="Entity" expanded="True"> |
| | | <Node name="Function" expanded="True" /> |
| | | </Node> |
| | | <Node name="UI" expanded="True"> |
| | | <Node name="UI0-Public" expanded="True" /> |
| | | <Node name="UI2" expanded="True"> |
| | | <Node name="1-HomePage" expanded="True" /> |
| | | <Node name="2-Classification" expanded="True"> |
| | | <Node name="ClassificationPage.cs" selected="True" /> |
| | | </Node> |
| | | <Node name="4-PersonalCenter" expanded="True" /> |
| | | <Node name="FuntionControlView" expanded="True"> |
| | | <Node name="ArmCenter" expanded="True" /> |
| | | </Node> |
| | | </Node> |
| | | </Node> |
| | | </Node> |
| | | <Node name="HDL-ON_Android" expanded="True"> |
| | | <Node name="Assets" expanded="True"> |
| | | <Node name="Phone" expanded="True"> |
| | | <Node name="PersonalCenter" expanded="True" /> |
| | | </Node> |
| | | </Node> |
| | | </Node> |
| | | <Node name="HDL-ON_iOS" expanded="True"> |
| | | <Node name="Resources" expanded="True"> |
| | | <Node name="Phone" expanded="True"> |
| | | <Node name="Collection" expanded="True" /> |
| | | <Node name="FunctionIcon" expanded="True"> |
| | | <Node name="ArmCenter" expanded="True" /> |
| | | </Node> |
| | | </Node> |
| | | </Node> |
| | | </Node> |
| | |
| | | <MonoDevelop.Ide.DebuggingService.Breakpoints> |
| | | <BreakpointStore> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/FuntionControlView/Electrical/IrFanPage.cs" relfile="HDL_ON/UI/UI2/FuntionControlView/Electrical/IrFanPage.cs" line="42" column="1" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/DAL/Mqtt/MqttClient.cs" relfile="HDL_ON/DAL/Mqtt/MqttClient.cs" line="422" column="1" /> |
| | | <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/DAL/Server/HttpServerRequest.cs" relfile="HDL_ON/DAL/Server/HttpServerRequest.cs" line="2318" 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/UI/UI2/FuntionControlView/ArmCenter/AddAlarmDeploymentPage.cs" relfile="HDL_ON/UI/UI2/FuntionControlView/ArmCenter/AddAlarmDeploymentPage.cs" line="424" column="1" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/DAL/DriverLayer/Control.cs" relfile="HDL_ON/DAL/DriverLayer/Control.cs" line="785" column="1" /> |
| | | </BreakpointStore> |
| | | </MonoDevelop.Ide.DebuggingService.Breakpoints> |
| | | <MultiItemStartupConfigurations /> |
| | |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\Light\LightScene\SetLightSceneIcon.png" /> |
| | | <AndroidAsset Include="Assets\Phone\Collection\DefenseStatusIcon.png" /> |
| | | <AndroidAsset Include="Assets\Phone\Collection\DisarmStatusIcon.png" /> |
| | | <AndroidAsset Include="Assets\Phone\PersonalCenter\ResidenceDefenseIcon.png" /> |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\DoorLock\BindScene.png" /> |
| | |
| | | <BundleResource Include="Resources\Phone\PersonalCenter\FacePassage\FaceIcon.png" /> |
| | | <BundleResource Include="Resources\Phone\Collection\DefenseStatusIcon.png" /> |
| | | <BundleResource Include="Resources\Phone\Collection\DisarmStatusIcon.png" /> |
| | | <BundleResource Include="Resources\Phone\PersonalCenter\ResidenceDefenseIcon.png" /> |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | | <ITunesArtwork Include="iTunesArtwork" /> |
| | |
| | | 498=Trigger delay |
| | | 499=Add defense function |
| | | 500=Add alarm target |
| | | 501=Security alarm: {0} is triggered. |
| | | |
| | | |
| | | 1000=Room Humidity |
| | |
| | | 498=触发延时 |
| | | 499=添加布防功能 |
| | | 500=添加告警目标 |
| | | 501=安防报警:{0}被触发。 |
| | | |
| | | 1000=室内湿度 |
| | | 1001=童锁 |
| | |
| | | if (deviceResult.Code == StateCode.SUCCESS) |
| | | { |
| | | MainPage.Log($"读取设备信息成功"); |
| | | var packList = Newtonsoft.Json.JsonConvert.DeserializeObject<DevcieApiPack>(deviceResult.Data.ToString()); |
| | | var packList = JsonConvert.DeserializeObject<DevcieApiPack>(deviceResult.Data.ToString()); |
| | | |
| | | foreach(var function in packList.list) |
| | | { |
| | |
| | | { |
| | | public static class StringId |
| | | { |
| | | |
| | | /// <summary> |
| | | /// 安防报警 |
| | | /// </summary> |
| | | public const int SecurityAlarmTipString = 501; |
| | | /// <summary> |
| | | /// 添加告警目标 |
| | | /// </summary> |
| | |
| | | if (roomInfo.uid == this.nowShowSelectId)
|
| | | {
|
| | | btnFloorName.Text = roomInfo.floorName + roomInfo.roomName;
|
| | | btnFloorName.Width = btnFloorName.GetTextWidth();
|
| | | //btnFloorName.Width = btnFloorName.GetTextWidth();
|
| | | return;
|
| | | }
|
| | | }
|
| | |
| | | if (floorInfo.uid == this.nowShowSelectId)
|
| | | {
|
| | | btnFloorName.Text = floorInfo.roomName;
|
| | | btnFloorName.Width = btnFloorName.GetTextWidth();
|
| | | //btnFloorName.Width = btnFloorName.GetTextWidth();
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | return $"/user/{Control.Ins.GatewayId}/custom/security/status/set"; |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// 安防状态更新 |
| | | /// </summary> |
| | | public string SecurityStatusUp |
| | | { |
| | | get |
| | | { |
| | | return $"/user/{Control.Ins.GatewayId}/custom/security/status/up"; |
| | | }///user/1413055228417130497/custom/security/status/up |
| | | } |
| | | /// <summary> |
| | | /// 读取安防状态信息 |
| | | /// </summary> |
| | | public string ReadSecurityStatus |
| | | { |
| | | get |
| | | { |
| | | return $"/user/{Control.Ins.GatewayId}/custom/security/list/get"; |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | //TODO 暂时不传正确的数据上去,如果后面要优化前面这些代码 |
| | | UpdataFunctionStatus(receiveObj.BodyDataString, null); |
| | | } |
| | | else if (receiveObj.Topic == CommunicationTopic.ct.ControlSeurity +"_reply") |
| | | else if (receiveObj.Topic == CommunicationTopic.ct.ControlSeurity +"_reply" |
| | | || receiveObj.Topic == CommunicationTopic.ct.ReadSecurityStatus + "_reply" |
| | | || receiveObj.Topic == CommunicationTopic.ct.SecurityStatusUp) |
| | | { |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<AlinkFunctionStatusObj>(receiveObj.BodyDataString); |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<SecurityStatusObj>(receiveObj.BodyDataString); |
| | | if (temp != null) |
| | | { |
| | | Control_Udp.ReceiveRepeatManager(temp.id, null); |
| | | foreach (var updataSecurity in temp.objects) |
| | | { |
| | | var updataLocalSecurity = FunctionList.List.securities.Find((obj) => obj.sid == updataSecurity.sid); |
| | | if (updataLocalSecurity != null) |
| | | { |
| | | updataLocalSecurity.status = updataSecurity.status; |
| | | } |
| | | } |
| | | HomePage.LoadEvent_RefreshSecurityStatus(); |
| | | ArmCenterPage.LoadEvent_RefreshSecurityStatus(); |
| | | } |
| | | } |
| | | else |
| | |
| | | QualityOfServiceLevel = MQTTnet.Protocol.MqttQualityOfServiceLevel.AtMostOnce |
| | | }; |
| | | |
| | | //安防状态变化 |
| | | var securityStatusChange = new MqttTopicFilter() |
| | | { |
| | | Topic = $"/user/{MqttInfoConfig.Current.HomeGatewayInfo.gatewayId}/custom/security/status/up", |
| | | QualityOfServiceLevel = MQTTnet.Protocol.MqttQualityOfServiceLevel.AtMostOnce |
| | | }; |
| | | |
| | | |
| | | #endregion |
| | | |
| | | |
| | |
| | | var result = await RemoteMqttClient.SubscribeAsync(new MqttTopicFilter[] { |
| | | pirStatus,pirStudy, |
| | | appDeviceRefresh,appHomeRefresh,appRoomRefresh,residenceChange, |
| | | topicFilterPush2, topicAlinkStatus ,mqttkeyChange}); |
| | | topicFilterPush2, topicAlinkStatus ,mqttkeyChange, |
| | | securityStatusChange}); |
| | | if (result.Items[0].ResultCode == MQTTnet.Client.Subscribing.MqttClientSubscribeResultCode.GrantedQoS0) |
| | | { |
| | | isSubscribeSuccess = true; |
| | |
| | | pm.GetHomeGatewayList(); |
| | | MainPage.Log($"网关密钥变更.新密钥:{DB_ResidenceData.Instance.HomeGateway.aesKey}"); |
| | | } |
| | | //安防状态变化 |
| | | else if (topic == $"/user/{MqttInfoConfig.Current.HomeGatewayInfo.gatewayId}/custom/security/status/up") |
| | | { |
| | | MainPage.Log($"安防状态变化"); |
| | | 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); |
| | | |
| | | if (temp != null) |
| | | { |
| | | Control_Udp.ReceiveRepeatManager(temp.id, null); |
| | | foreach (var updataSecurity in temp.objects) |
| | | { |
| | | var updataLocalSecurity = FunctionList.List.securities.Find((obj) => obj.sid == updataSecurity.sid); |
| | | if (updataLocalSecurity != null) |
| | | { |
| | | updataLocalSecurity.status = updataSecurity.status; |
| | | } |
| | | } |
| | | HomePage.LoadEvent_RefreshSecurityStatus(); |
| | | ArmCenterPage.LoadEvent_RefreshSecurityStatus(); |
| | | } |
| | | } |
| | | } |
| | | #endregion |
| | | //A网关设备状态-包含涂鸦设备 |
| | | else if (topic == $"/user/{DB_ResidenceData.Instance.CurrentRegion.id}/app/thing/property/send") |
| | |
| | | /// <summary> |
| | | /// 编辑安防 |
| | | /// </summary> |
| | | public const string Api_Post_Security_Edit = "/home-wisdom/app/security/update"; |
| | | public const string Api_Post_Security_Edit = "/home-wisdom/app/security/edit"; |
| | | /// <summary> |
| | | /// 删除安防 |
| | | /// </summary> |
| | |
| | | |
| | | namespace HDL_ON.Entity |
| | | { |
| | | /// <summary> |
| | | /// 安防中心 |
| | | /// </summary> |
| | | public class SecurityCenter |
| | | { |
| | | static SecurityCenter _center; |
| | | |
| | | public static SecurityCenter Security |
| | | { |
| | | get |
| | | { |
| | | if(_center == null) |
| | | { |
| | | _center = new SecurityCenter(); |
| | | } |
| | | return _center; |
| | | } |
| | | } |
| | | |
| | | SecurityAlarm _securityAlarm; |
| | | /// <summary> |
| | | /// 当前布防模式 |
| | | /// </summary> |
| | | public SecurityAlarm CurrentDefenseMode |
| | | { |
| | | get |
| | | { |
| | | return _securityAlarm; |
| | | } |
| | | set |
| | | { |
| | | _securityAlarm = value; |
| | | UI.HomePage.LoadEvent_RefreshSecurityStatus(); |
| | | } |
| | | } |
| | | |
| | | HttpServerRequest httpServerRequest = new HttpServerRequest(); |
| | | |
| | | |
| | | |
| | | List<SecurityAlarm> _securityAlarmList; |
| | | /// <summary> |
| | | /// 防区列表 |
| | | /// </summary> |
| | | public List<SecurityAlarm> securityAlarmList |
| | | { |
| | | get |
| | | { |
| | | if(_securityAlarmList == null) |
| | | { |
| | | _securityAlarmList = GetSecurityAlarmList(); |
| | | } |
| | | return _securityAlarmList; |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 读取云端安防列表 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public List<SecurityAlarm> GetSecurityAlarmList() |
| | | { |
| | | var pack = httpServerRequest.GetSecurityList(); |
| | | if(pack.Code == StateCode.SUCCESS) |
| | | { |
| | | var revData = Newtonsoft.Json.JsonConvert.DeserializeObject<List<SecurityAlarm>>(pack.Data.ToString()); |
| | | if(revData!= null) |
| | | { |
| | | _securityAlarmList = revData; |
| | | return revData; |
| | | } |
| | | } |
| | | return new List<SecurityAlarm>(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 状态 enable布防、disable撒防 |
| | | /// </summary> |
| | | public string status |
| | | { |
| | | get |
| | | { |
| | | string result = "disable"; |
| | | foreach(var s in securityAlarmList) |
| | | { |
| | | if(s.status == "enable") |
| | | { |
| | | result = "enable"; |
| | | break; |
| | | } |
| | | } |
| | | return result; |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | public class SecurityAlarm |
| | | { |
| | | public SecurityAlarm() |
| | | { |
| | | pushConfigs.Add(new SecurityPushConfig() |
| | | { |
| | | pushMethod = "APP", |
| | | pushTarget = new List<string>() { UserInfo.Current.ID } |
| | | }); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 安防云端id |
| | | /// </summary> |
| | |
| | | /// </summary> |
| | | public string delay; |
| | | /// <summary> |
| | | /// 状态 enable布防、disable撒防 |
| | | /// 状态 |
| | | /// 布防:enable |
| | | /// 撒防:disable |
| | | /// </summary> |
| | | public string status = "disable"; |
| | | /// <summary> |
| | |
| | | public string SaveInfo() |
| | | { |
| | | HttpServerRequest hsr = new HttpServerRequest(); |
| | | this.noticeConfig.enable = true; |
| | | this.noticeConfig.noticeContent = Language.StringByID(StringId.SecurityAlarmTipString).Replace("{0}", name); |
| | | if (string.IsNullOrEmpty(sid)) |
| | | { |
| | | NewSid(); |
| | |
| | | if (pack.Code == StateCode.SUCCESS) |
| | | { |
| | | SaveFile(); |
| | | }else |
| | | } |
| | | else |
| | | { |
| | | sid = ""; |
| | | } |
| | |
| | | int maxId = 1; |
| | | |
| | | |
| | | for (int i = 0; i < SecurityCenter.Security.securityAlarmList.Count; i++) |
| | | for (int i = 0; i < FunctionList.List.securities.Count; i++) |
| | | { |
| | | string s = SecurityCenter.Security.securityAlarmList[i].sid.Substring(20, 4); |
| | | string s = FunctionList.List.securities[i].sid.Substring(20, 4); |
| | | int iThisSceneId = Convert.ToInt16(s, 16); |
| | | if (iThisSceneId > maxId) |
| | | maxId = iThisSceneId; |
| | |
| | | /// 安防输入条件 |
| | | /// </summary> |
| | | public List<SecurityInputCondition> condition = new List<SecurityInputCondition>(); |
| | | |
| | | /// <summary> |
| | | /// 判断条件 |
| | | /// </summary> |
| | | public string comparator = "="; |
| | | |
| | | /// <summary> |
| | | /// 加入输入条件 |
| | |
| | | /// </summary> |
| | | public List<string> pushTarget = new List<string>(); |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// A协议控制数据的对象 |
| | | /// </summary> |
| | | public class SecurityStatusObj |
| | | { |
| | | public List<SecurityStatusData> objects = new List<SecurityStatusData>(); |
| | | |
| | | public string time_stamp = ""; |
| | | public string id = ""; |
| | | } |
| | | |
| | | public class SecurityStatusData |
| | | { |
| | | public string sid; |
| | | public string status ="disable" ; |
| | | public string alarm ="false"; |
| | | } |
| | | } |
| | |
| | | using HDL_ON.Common; |
| | | using HDL_ON.DAL; |
| | | using HDL_ON.DAL.Server; |
| | | using HDL_ON.DriverLayer; |
| | | using Shared; |
| | | |
| | | namespace HDL_ON.Entity |
| | |
| | | /// <summary> |
| | | /// 安防列表 |
| | | /// </summary> |
| | | public List<SecurityAlarm> securities |
| | | { |
| | | get |
| | | { |
| | | return SecurityCenter.Security.securityAlarmList; |
| | | } |
| | | } |
| | | public List<SecurityAlarm> securities = new List<SecurityAlarm>(); |
| | | |
| | | |
| | | /// <summary> |
| | |
| | | // break; |
| | | //} |
| | | } |
| | | if(DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | | Dictionary<string, string> pairs = new Dictionary<string, string>(); |
| | | string sendId = Control.Ins.msg_id.ToString(); |
| | | pairs.Add("id", sendId); |
| | | pairs.Add("time_stamp", Utlis.GetTimestamp()); |
| | | var readSecurityStatusJson = Newtonsoft.Json.JsonConvert.SerializeObject(pairs); |
| | | var sendBytes = Control.Ins.ConvertSendBodyData(CommunicationTopic.ct.ReadSecurityStatus, readSecurityStatusJson); |
| | | MainPage.Log($"本地通讯 读取安防状态:{readSecurityStatusJson}"); |
| | | new Control_Udp().SendLocalHdlLinkData(sendBytes, sendId); |
| | | } |
| | | } |
| | | else |
| | | { |
| | |
| | | Height = Application.GetMinRealAverage(28), |
| | | UnSelectedImagePath = "FunctionIcon/ArmCenter/HistoryIcon.png", |
| | | }; |
| | | contentView.AddChidren(btnAddIcon); |
| | | //contentView.AddChidren(btnAddIcon); |
| | | |
| | | btnAddIcon.MouseUpEventHandler += (sender, e) => |
| | | { |
| | |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | | topView.AddChidren(btnSecurityStatus); |
| | | btnSecurityStatus.IsSelected = SecurityCenter.Security.CurrentDefenseMode != null; |
| | | foreach (var temp in FunctionList.List.securities) |
| | | { |
| | | if (temp.status == "enable") |
| | | { |
| | | btnSecurityStatus.IsSelected = true; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | btnSecurityStatus.MouseUpEventHandler = (sender, e) => { |
| | | var page = new ArmCenterPage(); |
| | | MainPage.BasePageView.AddChidren(page); |
| | |
| | | { |
| | | if (bodyView != null) |
| | | { |
| | | bodyView.btnSecurityStatus.IsSelected = SecurityCenter.Security.CurrentDefenseMode != null; |
| | | foreach(var temp in FunctionList.List.securities) |
| | | { |
| | | if(temp.status == "enable") |
| | | { |
| | | bodyView.btnSecurityStatus.IsSelected = true; |
| | | return; |
| | | } |
| | | } |
| | | bodyView.btnSecurityStatus.IsSelected = false; |
| | | } |
| | | }); |
| | | } |
| | |
| | | break; |
| | | case ShowFunction.SecurityCenter: |
| | | functionCount = FunctionList.List.securities.Count; |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | | functionCount = 1; |
| | | } |
| | | //if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | //{ |
| | | // functionCount = 1; |
| | | //} |
| | | break; |
| | | |
| | | } |
| | |
| | | /// </summary> |
| | | Button btnResidenceMemberText; |
| | | #region F3阶段 |
| | | ///// <summary> |
| | | ///// 区域安放小区域 |
| | | ///// </summary> |
| | | //FrameLayout residenceArmView; |
| | | ///// <summary> |
| | | ///// 区域成安放小区域图标 |
| | | ///// </summary> |
| | | //Button btnResidenceArmIcon; |
| | | ///// <summary> |
| | | ///// 区域安放小区域文本 |
| | | ///// </summary> |
| | | //Button btnResidenceArmText; |
| | | /// <summary> |
| | | /// 区域安放小区域 |
| | | /// </summary> |
| | | FrameLayout residenceArmView; |
| | | /// <summary> |
| | | /// 区域成安放小区域图标 |
| | | /// </summary> |
| | | Button btnResidenceArmIcon; |
| | | /// <summary> |
| | | /// 区域安放小区域文本 |
| | | /// </summary> |
| | | Button btnResidenceArmText; |
| | | ///// <summary> |
| | | ///// 区域辅助功能小区域 |
| | | ///// </summary> |
| | |
| | | contentView.RemoveAll(); |
| | | |
| | | #region 住宅信息区域 |
| | | //if (!DB_ResidenceData.Instance.CurrentRegion.IsOthreShare) |
| | | //{ |
| | | // residenceInfoView = new FrameLayout() |
| | | // { |
| | | // Gravity = Gravity.CenterHorizontal, |
| | | // Width = Application.GetRealWidth(343), |
| | | // Height = Application.GetRealHeight(213), |
| | | // BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | // Radius = (uint)Application.GetRealHeight(12), |
| | | // BorderColor = 0x00FFFFFF, |
| | | // BorderWidth = 0, |
| | | // }; |
| | | // contentView.AddChidren(residenceInfoView); |
| | | //} |
| | | //else |
| | | if (!DB_ResidenceData.Instance.CurrentRegion.isOtherShare && DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | | residenceInfoView = new FrameLayout() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealHeight(213), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | Radius = (uint)Application.GetRealHeight(12), |
| | | BorderColor = 0x00FFFFFF, |
| | | BorderWidth = 0, |
| | | }; |
| | | contentView.AddChidren(residenceInfoView); |
| | | } |
| | | else |
| | | { |
| | | residenceInfoView = new FrameLayout() |
| | | { |
| | |
| | | }; |
| | | residenceMemberView.AddChidren(btnResidenceMemberText); |
| | | #endregion |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | | #region ---安放区域 |
| | | #region F3阶段 |
| | | //residenceArmView = new FrameLayout() |
| | | //{ |
| | | // X = residenceMemberView.Right, |
| | | // Y = Application.GetRealHeight(68), |
| | | // Width = Application.GetRealWidth(64 + 48), |
| | | // Height = Application.GetRealHeight(64), |
| | | //}; |
| | | //residenceInfoView.AddChidren(residenceArmView); |
| | | //btnResidenceArmIcon = new Button |
| | | //{ |
| | | // Gravity = Gravity.CenterHorizontal, |
| | | // Y = Application.GetRealHeight(5), |
| | | // Width = Application.GetMinRealAverage(30), |
| | | // Height = Application.GetMinRealAverage(30), |
| | | // UnSelectedImagePath = "PersonalCenter/ResidenceArmIcon.png", |
| | | //}; |
| | | //residenceArmView.AddChidren(btnResidenceArmIcon); |
| | | //btnResidenceArmText = new Button() |
| | | //{ |
| | | // Y = btnResidenceManageIcon.Bottom, |
| | | // Height = Application.GetRealHeight(29), |
| | | // TextID = StringId.Undefense, |
| | | // TextAlignment = TextAlignment.Center, |
| | | // TextColor = CSS_Color.FirstLevelTitleColor, |
| | | // TextSize = CSS_FontSize.PromptFontSize_FirstLevel |
| | | //}; |
| | | //residenceArmView.AddChidren(btnResidenceArmText); |
| | | residenceArmView = new FrameLayout() |
| | | { |
| | | X = residenceMemberView.Right, |
| | | Y = Application.GetRealHeight(68), |
| | | Width = Application.GetRealWidth(64 + 48), |
| | | Height = Application.GetRealHeight(64), |
| | | }; |
| | | residenceInfoView.AddChidren(residenceArmView); |
| | | btnResidenceArmIcon = new Button |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealHeight(5), |
| | | Width = Application.GetMinRealAverage(30), |
| | | Height = Application.GetMinRealAverage(30), |
| | | UnSelectedImagePath = "PersonalCenter/ResidenceArmIcon.png", |
| | | SelectedImagePath = "PersonalCenter/ResidenceDefenseIcon.png", |
| | | }; |
| | | residenceArmView.AddChidren(btnResidenceArmIcon); |
| | | btnResidenceArmText = new Button() |
| | | { |
| | | Y = btnResidenceManageIcon.Bottom, |
| | | Height = Application.GetRealHeight(29), |
| | | TextID = StringId.Undefense, |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel |
| | | }; |
| | | residenceArmView.AddChidren(btnResidenceArmText); |
| | | #endregion |
| | | } |
| | | #region F3阶段 |
| | | |
| | | #region ---数据备份区域 |
| | | //residenceDataBackupView = new FrameLayout() |
| | | //{ |
| | |
| | | #region ---添加功能区域 |
| | | residenceAddFunctionView = new FrameLayout() |
| | | { |
| | | X = residenceMemberView.Right, |
| | | //X = Application.GetRealWidth(28 - 24), |
| | | Y = Application.GetRealHeight(68), |
| | | //X = residenceMemberView.Right, |
| | | X = Application.GetRealWidth(28 - 24), |
| | | Y = residenceManageView.Bottom, |
| | | Width = Application.GetRealWidth(64 + 48), |
| | | Height = Application.GetRealWidth(64), |
| | | }; |
| | |
| | | TextID = StringId.FunctionNotOpen, |
| | | }); |
| | | |
| | | #region F3阶段 |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | | #region ---安放区域 |
| | | //residenceArmView = new FrameLayout() |
| | | //{ |
| | | // X = Application.GetRealWidth(28 - 24), |
| | | // Y = Application.GetRealHeight(68), |
| | | // Width = Application.GetRealWidth(64 + 48), |
| | | // Height = Application.GetRealWidth(64), |
| | | //}; |
| | | //residenceInfoView.AddChidren(residenceArmView); |
| | | //btnResidenceArmIcon = new Button |
| | | //{ |
| | | // Gravity = Gravity.CenterHorizontal, |
| | | // Y = Application.GetRealHeight(5), |
| | | // Width = Application.GetMinRealAverage(30), |
| | | // Height = Application.GetMinRealAverage(30), |
| | | // UnSelectedImagePath = "PersonalCenter/ResidenceArmIcon.png", |
| | | //}; |
| | | //residenceArmView.AddChidren(btnResidenceArmIcon); |
| | | //btnResidenceArmText = new Button() |
| | | //{ |
| | | // Y = btnResidenceArmIcon.Bottom, |
| | | // Height = Application.GetRealHeight(29), |
| | | // TextID = StringId.Undefense, |
| | | // TextAlignment = TextAlignment.Center, |
| | | // TextColor = CSS_Color.FirstLevelTitleColor, |
| | | // TextSize = CSS_FontSize.PromptFontSize_FirstLevel |
| | | //}; |
| | | //residenceArmView.AddChidren(btnResidenceArmText); |
| | | residenceArmView = new FrameLayout() |
| | | { |
| | | X = Application.GetRealWidth(28 - 24), |
| | | Y = Application.GetRealHeight(68), |
| | | Width = Application.GetRealWidth(64 + 48), |
| | | Height = Application.GetRealWidth(64), |
| | | }; |
| | | residenceInfoView.AddChidren(residenceArmView); |
| | | btnResidenceArmIcon = new Button |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealHeight(5), |
| | | Width = Application.GetMinRealAverage(30), |
| | | Height = Application.GetMinRealAverage(30), |
| | | UnSelectedImagePath = "PersonalCenter/ResidenceArmIcon.png", |
| | | SelectedImagePath = "PersonalCenter/ResidenceDefenseIcon.png", |
| | | }; |
| | | residenceArmView.AddChidren(btnResidenceArmIcon); |
| | | btnResidenceArmText = new Button() |
| | | { |
| | | Y = btnResidenceArmIcon.Bottom, |
| | | Height = Application.GetRealHeight(29), |
| | | TextID = StringId.Undefense, |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel |
| | | }; |
| | | residenceArmView.AddChidren(btnResidenceArmText); |
| | | #endregion |
| | | } |
| | | #region F3阶段 |
| | | #region ---数据备份区域 |
| | | //residenceDataBackupView = new FrameLayout() |
| | | //{ |
| | |
| | | LoadEvent_SkipbtnAddFunctionPage(); |
| | | LoadEvent_SkipSmartSpeakerPage(); |
| | | } |
| | | if(DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | | LoadEvent_SecurityEvent(); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 安防部分事件 |
| | | /// </summary> |
| | | void LoadEvent_SecurityEvent() |
| | | { |
| | | if (btnResidenceArmIcon != null) |
| | | { |
| | | btnResidenceArmIcon.IsSelected = false; |
| | | foreach (var temp in FunctionList.List.securities) |
| | | { |
| | | if (temp.status == "enable") |
| | | { |
| | | btnResidenceArmIcon.IsSelected = true; |
| | | break; |
| | | } |
| | | } |
| | | btnResidenceArmIcon.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | var page = new ArmCenterPage(); |
| | | MainPage.BasePageView.AddChidren(page); |
| | | page.LoadPage(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | | } |
| | | if (btnResidenceArmText != null) |
| | | { |
| | | btnResidenceArmText.TextID = StringId.Undefense; |
| | | foreach (var temp in FunctionList.List.securities) |
| | | { |
| | | if (temp.status == "enable") |
| | | { |
| | | btnResidenceArmText.TextID = StringId.Defense; |
| | | break; |
| | | } |
| | | } |
| | | btnResidenceArmText.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | var page = new ArmCenterPage(); |
| | | MainPage.BasePageView.AddChidren(page); |
| | | page.LoadPage(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | | } |
| | | } |
| | | |
| | | #region 切换住宅 |
| | |
| | | |
| | | //布防功能 |
| | | iniDefenseView(); |
| | | |
| | | #if DEBUG |
| | | //告警目标 |
| | | iniAlarmView(); |
| | | #endif |
| | | |
| | | #region 底部区域 |
| | | var bottomView = new FrameLayout() |
| | |
| | | |
| | | btnConfrim.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (string.IsNullOrEmpty( securityAlarm.name )) |
| | | { |
| | | var tip = new Tip() |
| | | { |
| | | Text = "请输入安防名称", |
| | | CloseTime = 3, |
| | | Direction = AMPopTipDirection.None |
| | | }; |
| | | tip.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | |
| | | if (securityAlarm.input.Count == 0) |
| | | { |
| | | var tip = new Tip() |
| | |
| | | tip.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | if (securityAlarm.output.Count == 0) |
| | | { |
| | | var tip = new Tip() |
| | | { |
| | | Text = "请选择告警目标", |
| | | CloseTime = 3, |
| | | Direction = AMPopTipDirection.None |
| | | }; |
| | | tip.Show(MainPage.BaseView); |
| | | |
| | | return; |
| | | } |
| | | //if (securityAlarm.output.Count == 0) |
| | | //{ |
| | | // var tip = new Tip() |
| | | // { |
| | | // Text = "请选择告警目标", |
| | | // CloseTime = 3, |
| | | // Direction = AMPopTipDirection.None |
| | | // }; |
| | | // tip.Show(MainPage.BaseView); |
| | | // return; |
| | | //} |
| | | |
| | | var waitPage = new Loading(); |
| | | waitPage.Start(); |
| | |
| | | var code = securityAlarm.SaveInfo(); |
| | | if (code == StateCode.SUCCESS) |
| | | { |
| | | SecurityCenter.Security.GetSecurityAlarmList(); |
| | | Common.ApiUtlis.Ins.GetSecurityList(); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | this.RemoveFromParent(); |
| | |
| | | { |
| | | foreach (var target in securityAlarm.input) |
| | | { |
| | | if (target.GetFunction() != null) |
| | | { |
| | | inputTargetView.AddChidren(new InputRow(target.GetFunction().name, target.GetFunction().GetRoomListName(),target.StateText())); |
| | | } |
| | | } |
| | | inputTargetView.Height = Application.GetRealHeight(65 * securityAlarm.input.Count); |
| | | //if (outputTargetView != null) |
| | |
| | | btnDeploymentName.MouseUpEventHandler = eventHandler; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 添加安防 |
| | | /// </summary> |
| | | void LoadEvent_AddDefense() |
| | | { |
| | | var responsePack = new HttpServerRequest().AddSecurity(new List<SecurityAlarm>() { securityAlarm}); |
| | | if (responsePack.Code == StateCode.SUCCESS) |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | this.RemoveFromParent(); |
| | | }); |
| | | } |
| | | else |
| | | { |
| | | IMessageCommon.Current.ShowErrorInfoAlter(responsePack.Code); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | |
| | | Button btnState = new Button() |
| | | { |
| | | Width = Application.GetRealWidth(369), |
| | | Width = Application.GetRealWidth(360), |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | |
| | | //初始值 |
| | | functions = FunctionList.List.GetArmSensorList(); |
| | | } |
| | | |
| | | #if DEBUG |
| | | functions.AddRange(FunctionList.List.GetLightList()); |
| | | #endif |
| | | |
| | | foreach (var function in functions) |
| | | { |
| | | var input = securityAlarm.input.Find((obj) => obj.sid == function.sid); |
| | |
| | | { |
| | | input = new SecurityInput(); |
| | | input.sid = function.sid; |
| | | |
| | | input.condition = new List<SecurityInputCondition>() |
| | | { |
| | | new SecurityInputCondition() |
| | | { |
| | | key = "status", |
| | | value = "true", |
| | | } |
| | | }; |
| | | |
| | | if (function.spk == SPK.LightSwitch || function.spk == SPK.LightRGB || function.spk == SPK.LightDimming) |
| | | { |
| | | input.condition = new List<SecurityInputCondition>() |
| | | { |
| | | new SecurityInputCondition() |
| | | { |
| | | key = FunctionAttributeKey.OnOff, |
| | | value = "off", |
| | | } |
| | | }; |
| | | } |
| | | |
| | | } |
| | | else |
| | | { |
| | |
| | | if(btnChooseIcon.IsSelected) |
| | | { |
| | | input.addCondition = true; |
| | | if (input.condition.Count==0) |
| | | { |
| | | ShowStateDialog(input, btnState,btnChooseIcon); |
| | | } |
| | | //if (input.condition.Count==0) |
| | | //{ |
| | | // ShowStateDialog(input, btnState,btnChooseIcon,function.spk); |
| | | //} |
| | | } |
| | | else |
| | | { |
| | |
| | | }; |
| | | btnState.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | ShowStateDialog(input, btnState, btnChooseIcon); |
| | | //ShowStateDialog(input, btnState, btnChooseIcon, function.spk); |
| | | btnChooseIcon.IsSelected = !btnChooseIcon.IsSelected; |
| | | if (btnChooseIcon.IsSelected) |
| | | { |
| | | input.addCondition = true; |
| | | } |
| | | else |
| | | { |
| | | input.addCondition = false; |
| | | } |
| | | }; |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | private void ShowStateDialog(SecurityInput input,Button btnState,Button btnChoose = null) |
| | | private void ShowStateDialog(SecurityInput input,Button btnState,Button btnChoose ,string spk) |
| | | { |
| | | Dialog dialog = new Dialog(); |
| | | |
| | |
| | | value = "true", |
| | | } |
| | | }; |
| | | |
| | | if (spk == SPK.LightSwitch || spk == SPK.LightRGB || spk == SPK.LightDimming) |
| | | { |
| | | input.condition = new List<SecurityInputCondition>() |
| | | { |
| | | new SecurityInputCondition() |
| | | { |
| | | key = FunctionAttributeKey.OnOff, |
| | | value = "on", |
| | | } |
| | | }; |
| | | } |
| | | |
| | | |
| | | |
| | | input.addCondition = true; |
| | | if (btnChoose != null) |
| | | { |
| | |
| | | value = "false", |
| | | } |
| | | }; |
| | | |
| | | if (spk == SPK.LightSwitch || spk == SPK.LightRGB || spk == SPK.LightDimming) |
| | | { |
| | | input.condition = new List<SecurityInputCondition>() |
| | | { |
| | | new SecurityInputCondition() |
| | | { |
| | | key = FunctionAttributeKey.OnOff, |
| | | value = "off", |
| | | } |
| | | }; |
| | | } |
| | | |
| | | |
| | | input.addCondition = true; |
| | | if (btnChoose != null) |
| | | { |
| | |
| | | /// <summary> |
| | | /// 主窗体 |
| | | /// </summary> |
| | | FrameLayout bodyView; |
| | | public static ArmCenterPage bodyView; |
| | | /// <summary> |
| | | /// 自定义布防区域 |
| | | /// </summary> |
| | | HorizontalScrolViewLayout customDeploymentView; |
| | | |
| | | //安防状态背景图 |
| | | Button btnArmTipIcon; |
| | | /// <summary> |
| | | /// 当前布防名称 |
| | | /// </summary> |
| | | Button btnDefenseName; |
| | | |
| | | /// <summary> |
| | | /// 撤防区域 |
| | | /// </summary> |
| | | FrameLayout disarmView; |
| | | |
| | | public ArmCenterPage() |
| | | { |
| | |
| | | Height =Application.GetRealWidth(32), |
| | | }); |
| | | |
| | | //安防状态背景图 |
| | | Button btnArmTipIcon = new Button() |
| | | FrameLayout alarmIconBgView = new FrameLayout() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(198), |
| | | Height = Application.GetRealWidth(198), |
| | | }; |
| | | contentView.AddChidren(alarmIconBgView); |
| | | |
| | | btnArmTipIcon = new Button() |
| | | { |
| | | //Gravity = Gravity.CenterHorizontal, |
| | | //Width = Application.GetRealWidth(198), |
| | | //Height = Application.GetRealWidth(198), |
| | | UnSelectedImagePath = "FunctionIcon/ArmCenter/NoDefenseBigIcon.png", |
| | | SelectedImagePath = "FunctionIcon/ArmCenter/InDefenseBigIcon.png", |
| | | }; |
| | | contentView.AddChidren(btnArmTipIcon); |
| | | alarmIconBgView.AddChidren(btnArmTipIcon); |
| | | |
| | | btnDefenseName = new Button() |
| | | { |
| | | Y = Application.GetRealWidth(117), |
| | | Height = Application.GetRealHeight(81), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | TextColor = CSS_Color.MainBackgroundColor, |
| | | }; |
| | | alarmIconBgView.AddChidren(btnDefenseName); |
| | | |
| | | contentView.AddChidren(new Button() |
| | | { |
| | |
| | | |
| | | |
| | | #region 撤防区域 |
| | | var disarmView = new FrameLayout() |
| | | Button btnDisarm; |
| | | disarmView = new FrameLayout() |
| | | { |
| | | Height = 0, |
| | | }; |
| | | contentView.AddChidren(disarmView); |
| | | |
| | | var btnDisarm = new Button() |
| | | btnDisarm = new Button() |
| | | { |
| | | Width = Application.GetRealWidth(120), |
| | | Height = Application.GetRealHeight(44), |
| | | BackgroundColor = CSS_Color.WarningColor, |
| | | Y = Application.GetRealHeight(10), |
| | | Width = Application.GetRealWidth(148), |
| | | Height = Application.GetRealHeight(40), |
| | | BackgroundColor = CSS_Color.MainColor, |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.MainBackgroundColor, |
| | | Text = "撤防" |
| | | Text = "撤防", |
| | | Radius = (uint)Application.GetRealWidth(20), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | }; |
| | | disarmView.AddChidren(btnDisarm); |
| | | btnDisarm.MouseUpEventHandler = (sender, e) => { |
| | | if (SecurityCenter.Security.CurrentDefenseMode != null) |
| | | foreach (var temp in FunctionList.List.securities) |
| | | { |
| | | Control.Ins.ControlSecurity(SecurityCenter.Security.CurrentDefenseMode, "disable"); |
| | | if (temp.status == "enable") |
| | | { |
| | | Control.Ins.ControlSecurity(temp, "disable"); |
| | | break; |
| | | } |
| | | } |
| | | }; |
| | | |
| | |
| | | ScrollEnabled = false, |
| | | }; |
| | | contentView.AddChidren(customDeploymentView); |
| | | |
| | | iniCustomDeploymentView(); |
| | | |
| | | |
| | | #endregion |
| | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | ///刷新界面 |
| | | LoadEvent_RefreshSecurityStatus(); |
| | | |
| | | } |
| | | |
| | |
| | | |
| | | foreach (var mode in FunctionList.List.securities) |
| | | { |
| | | var armDiyView = new ArmDiyView("FunctionIcon/ArmCenter/AddDefenseIcon.png", "FunctionIcon/ArmCenter/AddDefenseIcon.png", |
| | | var armDiyView = new ArmDiyView("FunctionIcon/ArmCenter/AtHomeDefenseIcon.png", "FunctionIcon/ArmCenter/AtHomeDefenseIconOn.png", |
| | | mode.name); |
| | | customDeploymentView.AddChidren(armDiyView); |
| | | EventHandler<MouseEventArgs> event2 = (sender, e) => |
| | |
| | | ShowArmDialog(mode); |
| | | }; |
| | | armDiyView.SetClickEvent(event2); |
| | | if (mode.status == "enable") |
| | | { |
| | | armDiyView.LightingView(true); |
| | | } |
| | | } |
| | | |
| | | if (FunctionList.List.securities.Count < 4) |
| | |
| | | |
| | | dialog.Show(); |
| | | |
| | | if(alarm.status == "enable") |
| | | { |
| | | btnOpen.TextColor = CSS_Color.PromptingColor1; |
| | | btnOpen.Text = Language.StringByID(StringId.AlreadyOpened).Trim() ; |
| | | } |
| | | |
| | | btnOpen.MouseUpEventHandler = (sender, e) => { |
| | | if (alarm.status == "disable") |
| | | { |
| | | Control.Ins.ControlSecurity(alarm, "enable"); |
| | | }else |
| | | { |
| | | Control.Ins.ControlSecurity(alarm, "disable"); |
| | | } |
| | | dialog.Close(); |
| | | }; |
| | | |
| | |
| | | { |
| | | iniCustomDeploymentView(); |
| | | }; |
| | | var armSetPage = new ArmDeploymentSettingPage(alarm,refreshAction); |
| | | var armSetPage = new AddAlarmDeploymentPage(alarm,refreshAction); |
| | | MainPage.BasePageView.AddChidren(armSetPage); |
| | | armSetPage.LoadPage(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | |
| | | |
| | | } |
| | | |
| | | |
| | | public static void LoadEvent_RefreshSecurityStatus() |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | if (bodyView != null) |
| | | { |
| | | bodyView.iniCustomDeploymentView(); |
| | | bodyView.disarmView.Height = 0; |
| | | bodyView.btnArmTipIcon.IsSelected = false; |
| | | bodyView.btnDefenseName.Text = ""; |
| | | foreach (var temp in FunctionList.List.securities) |
| | | { |
| | | if (temp.status == "enable") |
| | | { |
| | | bodyView.disarmView.Height = Application.GetRealHeight(68); |
| | | bodyView.btnArmTipIcon.IsSelected = true; |
| | | bodyView.btnDefenseName.Text = temp.name; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | btnText.MouseUpEventHandler = eventHandler; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 点亮区域 |
| | | /// </summary> |
| | | public void LightingView(bool seleted) |
| | | { |
| | | btnIcon.IsSelected = seleted; |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | var code = securityAlarm.SaveInfo(); |
| | | if (code == StateCode.SUCCESS) |
| | | { |
| | | SecurityCenter.Security.GetSecurityAlarmList(); |
| | | Common.ApiUtlis.Ins.GetSecurityList(); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | this.RemoveFromParent(); |