wei
2021-08-21 ec1d7cb35b99f01be0151c5b6f0c0fc2fa30ab95
安防功能
2个文件已添加
23个文件已修改
832 ■■■■■ 已修改文件
.vs/HDL_APP_Project/xs/UserPrefs.xml 56 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/Assets/Phone/PersonalCenter/ResidenceDefenseIcon.png 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/HDL-ON_Android.csproj 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/HDL-ON_iOS.csproj 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/Resources/Language.ini 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/Resources/Phone/PersonalCenter/ResidenceDefenseIcon.png 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Common/ApiUtlis.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Common/R.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Common/Utlis/FloorRoomSelectPopupView.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/DriverLayer/A_Protocol_Common.cs 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/DriverLayer/Control.cs 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/Mqtt/MqttClient.cs 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/Server/NewAPI.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Entity/Function/SecurityAlarm.cs 146 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Entity/FunctionList.cs 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI0-Public/TopViewDiv.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/1-HomePage/HomePage.cs 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPage.cs 181 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPageBLL.cs 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/ArmCenter/AddAlarmDeploymentPage.cs 63 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/ArmCenter/AddInputPage.cs 77 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/ArmCenter/ArmCenterPage.cs 119 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/ArmCenter/ArmDeploymentSettingPage.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
.vs/HDL_APP_Project/xs/UserPrefs.xml
@@ -1,50 +1,61 @@
<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>
@@ -64,15 +75,12 @@
  <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 />
HDL-ON_Android/Assets/Phone/PersonalCenter/ResidenceDefenseIcon.png
HDL-ON_Android/HDL-ON_Android.csproj
@@ -442,6 +442,7 @@
    <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" />
HDL-ON_iOS/HDL-ON_iOS.csproj
@@ -1330,6 +1330,7 @@
      <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" />
HDL-ON_iOS/Resources/Language.ini
@@ -486,6 +486,7 @@
498=Trigger delay
499=Add defense function
500=Add alarm target
501=Security alarm: {0} is triggered.
 
1000=Room Humidity
@@ -1581,6 +1582,7 @@
498=触发延时
499=添加布防功能
500=添加告警目标
501=安防报警:{0}被触发。
 
1000=室内湿度
1001=童锁
HDL-ON_iOS/Resources/Phone/PersonalCenter/ResidenceDefenseIcon.png
HDL_ON/Common/ApiUtlis.cs
@@ -362,7 +362,7 @@
            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)
                {
HDL_ON/Common/R.cs
@@ -4,6 +4,11 @@
{
    public static class StringId
    {
        /// <summary>
        /// 安防报警
        /// </summary>
        public const int SecurityAlarmTipString = 501;
        /// <summary>
        /// 添加告警目标
        /// </summary>
HDL_ON/Common/Utlis/FloorRoomSelectPopupView.cs
@@ -251,7 +251,7 @@
                    if (roomInfo.uid == this.nowShowSelectId)
                    {
                        btnFloorName.Text = roomInfo.floorName + roomInfo.roomName;
                        btnFloorName.Width = btnFloorName.GetTextWidth();
                        //btnFloorName.Width = btnFloorName.GetTextWidth();
                        return;
                    }
                }
@@ -264,7 +264,7 @@
                    if (floorInfo.uid == this.nowShowSelectId)
                    {
                        btnFloorName.Text = floorInfo.roomName;
                        btnFloorName.Width = btnFloorName.GetTextWidth();
                        //btnFloorName.Width = btnFloorName.GetTextWidth();
                    }
                }
            }
HDL_ON/DAL/DriverLayer/A_Protocol_Common.cs
@@ -141,5 +141,25 @@
                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";
            }
        }
    }
}
HDL_ON/DAL/DriverLayer/Control.cs
@@ -779,12 +779,24 @@
                    //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
HDL_ON/DAL/Mqtt/MqttClient.cs
@@ -237,6 +237,14 @@
                        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
@@ -244,7 +252,8 @@
                    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;
@@ -434,7 +443,32 @@
                                    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")
HDL_ON/DAL/Server/NewAPI.cs
@@ -466,7 +466,7 @@
        /// <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>
HDL_ON/Entity/Function/SecurityAlarm.cs
@@ -6,108 +6,17 @@
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>
@@ -125,7 +34,9 @@
        /// </summary>
        public string delay;
        /// <summary>
        /// 状态 enable布防、disable撒防
        /// 状态
        /// 布防:enable
        /// 撒防:disable
        /// </summary>
        public string status = "disable";
        /// <summary>
@@ -183,6 +94,8 @@
        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();
@@ -190,7 +103,8 @@
                if (pack.Code == StateCode.SUCCESS)
                {
                    SaveFile();
                }else
                }
                else
                {
                    sid = "";
                }
@@ -246,9 +160,9 @@
                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;
@@ -337,6 +251,11 @@
        /// 安防输入条件
        /// </summary>
        public List<SecurityInputCondition> condition = new List<SecurityInputCondition>();
        /// <summary>
        /// 判断条件
        /// </summary>
        public string comparator = "=";
        /// <summary>
        /// 加入输入条件
@@ -636,4 +555,23 @@
        /// </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";
    }
}
HDL_ON/Entity/FunctionList.cs
@@ -5,6 +5,7 @@
using HDL_ON.Common;
using HDL_ON.DAL;
using HDL_ON.DAL.Server;
using HDL_ON.DriverLayer;
using Shared;
namespace HDL_ON.Entity
@@ -172,13 +173,7 @@
        /// <summary>
        /// 安防列表
        /// </summary>
        public List<SecurityAlarm> securities
        {
            get
            {
                return SecurityCenter.Security.securityAlarmList;
            }
        }
        public List<SecurityAlarm> securities = new List<SecurityAlarm>();
        /// <summary>
@@ -439,6 +434,17 @@
                            //        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
                    {
HDL_ON/UI/UI0-Public/TopViewDiv.cs
@@ -376,7 +376,7 @@
                Height = Application.GetMinRealAverage(28),
                UnSelectedImagePath = "FunctionIcon/ArmCenter/HistoryIcon.png",
            };
            contentView.AddChidren(btnAddIcon);
            //contentView.AddChidren(btnAddIcon);
            btnAddIcon.MouseUpEventHandler += (sender, e) =>
            {
HDL_ON/UI/UI2/1-HomePage/HomePage.cs
@@ -387,7 +387,15 @@
                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);
HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs
@@ -34,7 +34,15 @@
            {
                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;
                }
            });
        }
HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs
@@ -725,10 +725,10 @@
                        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;
                }
HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPage.cs
@@ -85,18 +85,18 @@
        /// </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>
@@ -286,21 +286,21 @@
            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()
                {
@@ -445,36 +445,41 @@
                };
                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()
                //{
@@ -539,9 +544,9 @@
                #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),
                };
@@ -580,36 +585,40 @@
                    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()
                //{
HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPageBLL.cs
@@ -26,6 +26,55 @@
                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 切换住宅
HDL_ON/UI/UI2/FuntionControlView/ArmCenter/AddAlarmDeploymentPage.cs
@@ -153,8 +153,11 @@
            //布防功能
            iniDefenseView();
#if DEBUG
            //告警目标
            iniAlarmView();
#endif
            #region 底部区域
            var bottomView = new FrameLayout()
@@ -183,6 +186,18 @@
            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()
@@ -194,18 +209,17 @@
                    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();
@@ -216,7 +230,7 @@
                        var code = securityAlarm.SaveInfo();
                        if (code == StateCode.SUCCESS)
                        {
                            SecurityCenter.Security.GetSecurityAlarmList();
                            Common.ApiUtlis.Ins.GetSecurityList();
                            Application.RunOnMainThread(() =>
                            {
                                this.RemoveFromParent();
@@ -317,7 +331,10 @@
            {
                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)
@@ -469,24 +486,6 @@
            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);
            }
        }
    }
@@ -533,7 +532,7 @@
            Button btnState = new Button()
            {
                Width = Application.GetRealWidth(369),
                Width = Application.GetRealWidth(360),
                TextAlignment = TextAlignment.CenterRight,
                TextSize = CSS_FontSize.TextFontSize,
                TextColor = CSS_Color.FirstLevelTitleColor,
HDL_ON/UI/UI2/FuntionControlView/ArmCenter/AddInputPage.cs
@@ -150,6 +150,11 @@
                //初始值
                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);
@@ -157,6 +162,28 @@
                {
                    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
                {
@@ -222,10 +249,10 @@
                    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
                    {
@@ -234,7 +261,16 @@
                };
                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;
                    }
                };
@@ -258,7 +294,7 @@
        }
        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();
@@ -340,6 +376,21 @@
                        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)
                {
@@ -359,6 +410,20 @@
                        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)
                {
HDL_ON/UI/UI2/FuntionControlView/ArmCenter/ArmCenterPage.cs
@@ -10,11 +10,23 @@
        /// <summary>
        /// 主窗体
        /// </summary>
        FrameLayout bodyView;
        public static ArmCenterPage bodyView;
        /// <summary>
        /// 自定义布防区域
        /// </summary>
        HorizontalScrolViewLayout customDeploymentView;
        //安防状态背景图
        Button btnArmTipIcon;
        /// <summary>
        /// 当前布防名称
        /// </summary>
        Button btnDefenseName;
        /// <summary>
        /// 撤防区域
        /// </summary>
        FrameLayout disarmView;
        public ArmCenterPage()
        {
@@ -43,16 +55,33 @@
                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()
            {
@@ -61,26 +90,34 @@
            #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;
                    }
                }
            };
@@ -107,8 +144,6 @@
                ScrollEnabled = false,
            };
            contentView.AddChidren(customDeploymentView);
            iniCustomDeploymentView();
            #endregion
@@ -184,8 +219,8 @@
            ///刷新界面
            LoadEvent_RefreshSecurityStatus();
        }
@@ -198,7 +233,7 @@
            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) =>
@@ -206,6 +241,10 @@
                            ShowArmDialog(mode);
                        };
                armDiyView.SetClickEvent(event2);
                if (mode.status == "enable")
                {
                    armDiyView.LightingView(true);
                }
            }
            if (FunctionList.List.securities.Count < 4)
@@ -293,8 +332,20 @@
            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();  
            };
@@ -305,7 +356,7 @@
                {
                    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;
@@ -318,7 +369,29 @@
        }
        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;
                        }
                    }
                }
            });
        }
    }
@@ -369,6 +442,14 @@
            btnText.MouseUpEventHandler = eventHandler;
        }
        /// <summary>
        /// 点亮区域
        /// </summary>
        public void LightingView(bool seleted)
        {
            btnIcon.IsSelected = seleted;
        }
    }
HDL_ON/UI/UI2/FuntionControlView/ArmCenter/ArmDeploymentSettingPage.cs
@@ -216,7 +216,7 @@
                        var code = securityAlarm.SaveInfo();
                        if (code == StateCode.SUCCESS)
                        {
                            SecurityCenter.Security.GetSecurityAlarmList();
                            Common.ApiUtlis.Ins.GetSecurityList();
                            Application.RunOnMainThread(() =>
                            {
                                this.RemoveFromParent();