.vs/HDL_APP_Project/xs/UserPrefs.xml
@@ -1,22 +1,15 @@ <Properties StartupConfiguration="{09712674-2A38-407B-B1E2-560B2C352F9A}|Default"> <MonoDevelop.Ide.ItemProperties.HDL-ON__iOS automaticSigning="False" PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneSimulatorTarget.26569F89-0BA9-4C06-81F2-764A3AF2E1B7" /> <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/DAL/DriverLayer/Control_Udp.cs"> <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/UI/UI2/1-HomePage/MessageCenterPage.cs"> <Files> <File FileName="HDL_ON/UI/UI2/3-Intelligence/Scene/CatchSceneAddPage.cs" Line="36" Column="20" /> <File FileName="HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs" /> <File FileName="HDL-ON_Android/Application.cs" /> <File FileName="HDL_ON/DAL/Server/HttpUtil.cs" /> <File FileName="HDL_ON/UI/MainPage.cs" /> <File FileName="HDL_ON/Common/R.cs" /> <File FileName="HDL-ON_Android/Assets/Language.ini" /> <File FileName="HDL_ON/UI/UI2/3-Intelligence/Scene/SceneFunctionListChoosePage.cs" Line="300" Column="56" /> <File FileName="HDL_ON/UI/UI2/3-Intelligence/Scene/SceneEditPage.cs" /> <File FileName="HDL_ON/UI/UI2/3-Intelligence/Scene/SceneAddPage.cs" /> <File FileName="HDL_ON/UI/UI2/3-Intelligence/Scene/CatchSceneCatchFunctionListPage.cs" Line="104" Column="56" /> <File FileName="HDL_ON/UI/UI2/3-Intelligence/IntelligencePage.cs" Line="634" Column="40" /> <File FileName="HDL_ON/DAL/DriverLayer/Control.cs" Line="300" Column="1" /> <File FileName="HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs" Line="147" Column="36" /> <File FileName="HDL_ON/DAL/DriverLayer/Control_Udp.cs" Line="159" Column="1" /> <File FileName="HDL_ON/UI/UI2/FuntionControlView/ArmCenter/ArmCenterPage.cs" Line="66" Column="1" /> <File FileName="HDL_ON/Common/ApiUtlis.cs" Line="367" Column="38" /> <File FileName="HDL_ON/Entity/FunctionList.cs" Line="143" Column="31" /> <File FileName="HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs" Line="565" Column="50" /> <File FileName="HDL_ON/Entity/Enumerative/MyEnum.cs" Line="171" Column="9" /> <File FileName="HDL_ON/Entity/Room.cs" Line="58" Column="23" /> <File FileName="HDL_ON/UI/BindingResidence/BindingResidencePage.cs" Line="1" Column="1" /> <File FileName="HDL_ON/UI/UI2/1-HomePage/MessageCenterPage.cs" Line="1" Column="1" /> </Files> <Pads> <Pad Id="ProjectPad"> @@ -25,32 +18,31 @@ <Node name="HDL_ON" expanded="True"> <Node name="Common" expanded="True" /> <Node name="DAL" expanded="True"> <Node name="DriverLayer" expanded="True"> <Node name="Control_Udp.cs" selected="True" /> </Node> <Node name="Server" expanded="True" /> </Node> <Node name="Entity" expanded="True"> <Node name="Enumerative" expanded="True" /> <Node name="Function" expanded="True" /> </Node> <Node name="UI" expanded="True"> <Node name="UI0-Public" expanded="True" /> <Node name="BindingResidence" expanded="True" /> <Node name="UI2" expanded="True"> <Node name="1-HomePage" expanded="True" /> <Node name="2-Classification" expanded="True" /> <Node name="3-Intelligence" expanded="True"> <Node name="Scene" expanded="True" /> <Node name="1-HomePage" expanded="True"> <Node name="MessageCenterPage.cs" selected="True" /> </Node> <Node name="4-PersonalCenter" expanded="True"> <Node name="MemberManagement" expanded="True" /> <Node name="FuntionControlView" expanded="True"> <Node name="ArmCenter" expanded="True" /> </Node> <Node name="FuntionControlView" expanded="True" /> </Node> </Node> </Node> <Node name="HDL-ON_Android" expanded="True"> <Node name="Assets" expanded="True" /> </Node> <Node name="HDL-ON_iOS" expanded="True" /> <Node name="HDL-ON_iOS" expanded="True"> <Node name="Other" expanded="True" /> <Node name="Resources" expanded="True" /> </Node> </Node> </State> </Pad> @@ -68,7 +60,6 @@ <BreakpointStore> <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Method.cs" relfile="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Method.cs" line="34" column="1" /> <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs" relfile="HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs" line="313" column="1" /> <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/3-Intelligence/Scene/CatchSceneCatchFunctionListPage.cs" relfile="HDL_ON/UI/UI2/3-Intelligence/Scene/CatchSceneCatchFunctionListPage.cs" line="210" column="1" /> </BreakpointStore> </MonoDevelop.Ide.DebuggingService.Breakpoints> <MultiItemStartupConfigurations /> HDL-ON_Android/Assets/Language.ini
@@ -328,7 +328,7 @@ 324=Scene delay 325=Delay setting 326=Delay 327=Catch Scene 327=Capture the scene 328=Film scene 329=General 330=Automatic mode @@ -426,8 +426,7 @@ 439=Real time power consumption: {0} kw 440=Next step 441=Please select all areas of capture status 442=Generate scene 442=Custom deployment 1000=Room Humidity 1001=V-chip @@ -1107,7 +1106,7 @@ 324=场景延时 325=延时设置 326=延时 327=捕获场景 327=捕捉场景 328=电影场景 329=普通 330=自动模式 @@ -1204,8 +1203,8 @@ 438=湿度:{0}% 空气:{1} 风速:{2}级 439=实时功耗: {0}kW 440=下一步 441=请选择捕获状态的区域 442=生成场景 441=请选择捕捉状态的区域 442=自定义布防 1000=室内湿度 1001=童锁 HDL-ON_iOS/HDL-ON_iOS.csproj
@@ -1219,6 +1219,18 @@ <BundleResource Include="Resources\Phone\FunctionIcon\Icon\HomeIcon\airFreshjinmao_blue.png" /> <BundleResource Include="Resources\Phone\FunctionIcon\Icon\HomeIcon\airFreshjinmao_white.png" /> <BundleResource Include="Resources\Phone\Public\RightSlideBackIcon.png" /> <BundleResource Include="Resources\Phone\FunctionIcon\ArmCenter\DisasterAlarmIcon.png" /> <BundleResource Include="Resources\Phone\FunctionIcon\ArmCenter\InDefenseBigIcon.png" /> <BundleResource Include="Resources\Phone\FunctionIcon\ArmCenter\AddDefenseIcon.png" /> <BundleResource Include="Resources\Phone\FunctionIcon\ArmCenter\HouseDefenseIcon.png" /> <BundleResource Include="Resources\Phone\FunctionIcon\ArmCenter\HolidayDefenseIcon.png" /> <BundleResource Include="Resources\Phone\FunctionIcon\ArmCenter\AtHomeDefenseIcon.png" /> <BundleResource Include="Resources\Phone\FunctionIcon\ArmCenter\AtHomeDefenseIconOn.png" /> <BundleResource Include="Resources\Phone\FunctionIcon\ArmCenter\NoDefenseBigIcon.png" /> <BundleResource Include="Resources\Phone\FunctionIcon\ArmCenter\HolidayDefenseIconOn.png" /> <BundleResource Include="Resources\Phone\FunctionIcon\ArmCenter\HouseDefenseIconOn.png" /> <BundleResource Include="Resources\Phone\FunctionIcon\ArmCenter\BurglarAlarmIcon.png" /> <BundleResource Include="Resources\Phone\FunctionIcon\ArmCenter\HistoryIcon.png" /> </ItemGroup> <ItemGroup> <ITunesArtwork Include="iTunesArtwork" /> HDL-ON_iOS/Resources/Language.ini
@@ -426,6 +426,7 @@ 439=Real time power consumption: {0} kw 440=Next step 441=Please select all areas of capture status 442=Custom deployment 1000=Room Humidity 1001=V-chip @@ -1105,7 +1106,7 @@ 324=场景延时 325=延时设置 326=延时 327=捕获场景 327=捕捉场景 328=电影场景 329=普通 330=自动模式 @@ -1202,7 +1203,8 @@ 438=湿度:{0}% 空气:{1} 风速:{2}级 439=实时功耗: {0}kW 440=下一步 441=请选择捕获状态的区域 441=请选择捕捉状态的区域 442=自定义布防 1000=室内湿度 1001=童锁 HDL-ON_iOS/Resources/Phone/FunctionIcon/ArmCenter/AddDefenseIcon.png
HDL-ON_iOS/Resources/Phone/FunctionIcon/ArmCenter/AtHomeDefenseIcon.png
HDL-ON_iOS/Resources/Phone/FunctionIcon/ArmCenter/AtHomeDefenseIconOn.png
HDL-ON_iOS/Resources/Phone/FunctionIcon/ArmCenter/BurglarAlarmIcon.png
HDL-ON_iOS/Resources/Phone/FunctionIcon/ArmCenter/DisasterAlarmIcon.png
HDL-ON_iOS/Resources/Phone/FunctionIcon/ArmCenter/HistoryIcon.png
HDL-ON_iOS/Resources/Phone/FunctionIcon/ArmCenter/HolidayDefenseIcon.png
HDL-ON_iOS/Resources/Phone/FunctionIcon/ArmCenter/HolidayDefenseIconOn.png
HDL-ON_iOS/Resources/Phone/FunctionIcon/ArmCenter/HouseDefenseIcon.png
HDL-ON_iOS/Resources/Phone/FunctionIcon/ArmCenter/HouseDefenseIconOn.png
HDL-ON_iOS/Resources/Phone/FunctionIcon/ArmCenter/InDefenseBigIcon.png
HDL-ON_iOS/Resources/Phone/FunctionIcon/ArmCenter/NoDefenseBigIcon.png
HDL_ON/Common/ApiUtlis.cs
@@ -106,26 +106,6 @@ } endTime = DateTime.Now.AddSeconds(5); MainPage.Log($"刷新个人信息成功"); //int count = 0; //while (count < 10) //{ // if (DB_ResidenceData.Instance.CheckWhetherGatewayIdIsNull()) // { // System.Threading.Thread.Sleep(200); // } // else // { // break; // } // count++; //} //if (DB_ResidenceData.Instance.CheckWhetherGatewayIdIsNull()) //{ // return; //} try { //===================房间======================= @@ -275,6 +255,8 @@ MainPage.Log($"读取云端场景数据失败:Code:{pack.Code}; Msg:{pack.message}"); } //===================读取安防列表========================== GetSecurityList(); //===================读取逻辑列表========================== UI.UI2.Intelligence.Automation.MainView.GetLogicList(); //===================读取可视对讲数据========================== @@ -371,5 +353,34 @@ } } } /// <summary> /// 获取安防列表 /// </summary> public void GetSecurityList() { var pack = Ins.HttpRequest.GetSecurityList(); if (pack.Code == StateCode.SUCCESS) { var packList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Security>>(pack.Data.ToString()); var sidList = new List<string>(); foreach (var function in packList) { sidList.Add(function.sid); } var infoListPack = Ins.httpRequest.GetSecurityInfo(sidList, new List<string>()); var infoList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Security>>(infoListPack.Data.ToString()); foreach (var function in infoList) { function.SaveFile(); FunctionList.List.IniFunctionList(function.savePath, true); } } else { MainPage.Log($"读取安防列表失败:Code:{pack.Code}; Msg:{pack.message}"); } } } } HDL_ON/Common/R.cs
@@ -4,6 +4,7 @@ { public static class StringId { public const int CustomDeployment = 443; public const int GenerateScene = 442; public const int ChooseCatchZone = 441; public const int NextStep = 440; HDL_ON/DAL/Server/HttpServerRequest.cs
@@ -2192,7 +2192,173 @@ #endregion #region Kaede --房间功能-------------------------- #region Kaede -- 安防接口____________________________ /// <summary> /// 获取安防列表 /// </summary> public ResponsePackNew GetSecurityList() { Dictionary<string, object> d = new Dictionary<string, object>(); d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID); d.Add("gatewayId", DB_ResidenceData.Instance.HomeGateway.gatewayId); var requestJson = HttpUtil.GetSignRequestJson(d); var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Security_List, requestJson); return pack; } /// <summary> /// 获取安防详情 /// </summary> /// <param name="sidList">安防sid集合</param> /// <param name="userSecurityIds">安防云端id</param> /// <returns></returns> public ResponsePackNew GetSecurityInfo(List<string> sidList, List<string> userSecurityIds) { Dictionary<string, object> d = new Dictionary<string, object>(); d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID); d.Add("gatewayId", DB_ResidenceData.Instance.HomeGateway.gatewayId); //sids userSecurityIds 不能同时为空 d.Add("sids", sidList); d.Add("userSecurityIds", userSecurityIds); var requestJson = HttpUtil.GetSignRequestJson(d); var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Security_Info, requestJson); return pack; } /// <summary> /// 添加安防 /// </summary> public ResponsePackNew AddSecurity(List<Security> securities) { Dictionary<string, object> d = new Dictionary<string, object>(); d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID); d.Add("gatewayId", DB_ResidenceData.Instance.HomeGateway.gatewayId); d.Add("securitys", securities); var requestJson = HttpUtil.GetSignRequestJson(d); var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Security_Add, requestJson); return pack; } /// <summary> /// 编辑安防 /// </summary> public ResponsePackNew EditSecurity(List<Security> securities) { Dictionary<string, object> d = new Dictionary<string, object>(); d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID); d.Add("gatewayId", DB_ResidenceData.Instance.HomeGateway.gatewayId); d.Add("securitys", securities); var requestJson = HttpUtil.GetSignRequestJson(d); var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Security_Edit, requestJson); return pack; } /// <summary> /// 删除安防 /// </summary> /// <param name="sidList">安防sid</param> /// <param name="userSecurityIds">安防云端id</param> /// <returns></returns> public ResponsePackNew DeleteSecurity(List<string> sidList, List<string> userSecurityIds) { Dictionary<string, object> d = new Dictionary<string, object>(); d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID); d.Add("gatewayId", DB_ResidenceData.Instance.HomeGateway.gatewayId); //sids userSecurityIds 不能同时为空 d.Add("sids", sidList); d.Add("userSecurityIds", userSecurityIds); var requestJson = HttpUtil.GetSignRequestJson(d); var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Security_Delete, requestJson); return pack; } /// <summary> /// 读取安防防区状态 /// </summary> /// <param name="sidList">安防sid</param> /// <param name="userSecurityIds">安防云端id</param> /// <returns></returns> public ResponsePackNew ReadSecurityStatus(List<string> sidList, List<string> userSecurityIds) { Dictionary<string, object> d = new Dictionary<string, object>(); d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID); d.Add("gatewayId", DB_ResidenceData.Instance.HomeGateway.gatewayId); //sids userSecurityIds 不能同时为空 d.Add("sids", sidList); d.Add("userSecurityIds", userSecurityIds); var requestJson = HttpUtil.GetSignRequestJson(d); var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Security_StatusRead, requestJson); return pack; } /// <summary> /// 设置安防防区状态 /// </summary> public ResponsePackNew SetSecurityStatus(List<SecurityState> securityStates) { Dictionary<string, object> d = new Dictionary<string, object>(); d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID); d.Add("securitys", securityStates); var requestJson = HttpUtil.GetSignRequestJson(d); var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Security_StatusSet, requestJson); return pack; } /// <summary> /// 安防bypass设置 /// </summary> public ResponsePackNew SetSecurityBypass(List<SecurityBypass> securityBypassStates) { Dictionary<string, object> d = new Dictionary<string, object>(); d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID); d.Add("securitys", securityBypassStates); var requestJson = HttpUtil.GetSignRequestJson(d); var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Security_BypassSet, requestJson); return pack; } /// <summary> /// 安防bypass读取 /// </summary> /// <param name="sidList">安防sid</param> /// <param name="userSecurityIds">安防云端id</param> /// <returns></returns> public ResponsePackNew ReadSecurityBypass(List<string> sidList, List<string> userSecurityIds) { Dictionary<string, object> d = new Dictionary<string, object>(); d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID); d.Add("gatewayId", DB_ResidenceData.Instance.HomeGateway.gatewayId); //sids userSecurityIds 不能同时为空 d.Add("sids", sidList); d.Add("userSecurityIds", userSecurityIds); var requestJson = HttpUtil.GetSignRequestJson(d); var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Security_BypassRead, requestJson); return pack; } /// <summary> /// 查询安防所有记录 /// </summary> public ResponsePackNew GetSecurityLogList(string pageSize,string pageNo) { Dictionary<string, object> d = new Dictionary<string, object>(); d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID); d.Add("pageSize", pageSize); d.Add("pageNo", pageNo); var requestJson = HttpUtil.GetSignRequestJson(d); var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Security_ListSecurityLog, requestJson); return pack; } /// <summary> /// 查询安防报警记录 /// </summary> public ResponsePackNew GetSecurityAlarmLogList(string pageSize, string pageNo) { Dictionary<string, object> d = new Dictionary<string, object>(); d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID); d.Add("pageSize", pageSize); d.Add("pageNo", pageNo); var requestJson = HttpUtil.GetSignRequestJson(d); var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Security_ListAlarmLog, requestJson); return pack; } #endregion #region Kaede --第三方品牌功能-------------------------- /// <summary> /// 获取第三方品牌列表 /// </summary> HDL_ON/DAL/Server/NewAPI.cs
@@ -427,6 +427,53 @@ #endregion #region Kaede -- 安防接口____________________________ /// <summary> /// 获取安防列表 /// </summary> public const string Api_Post_Security_List = "/home-wisdom/app/security/list"; /// <summary> /// 获取安防详情 /// </summary> public const string Api_Post_Security_Info = "/home-wisdom/app/security/info"; /// <summary> /// 添加安防 /// </summary> public const string Api_Post_Security_Add = "/home-wisdom/app/security/add"; /// <summary> /// 编辑安防 /// </summary> public const string Api_Post_Security_Edit = "/home-wisdom/app/security/update"; /// <summary> /// 删除安防 /// </summary> public const string Api_Post_Security_Delete = "/home-wisdom/app/security/delete"; /// <summary> /// 读取安防防区状态 /// </summary> public const string Api_Post_Security_StatusRead = "/home-wisdom/app/security/statusRead"; /// <summary> /// 设置安防防区状态 /// </summary> public const string Api_Post_Security_StatusSet = "/home-wisdom/app/security/statusSet"; /// <summary> /// 安防bypass设置 /// </summary> public const string Api_Post_Security_BypassSet = "/home-wisdom/app/security/bypassSet"; /// <summary> /// 安防bypass读取 /// </summary> public const string Api_Post_Security_BypassRead = "/home-wisdom/app/security/bypassRead"; /// <summary> /// 查询安防所有记录 /// </summary> public const string Api_Post_Security_ListSecurityLog = "/home-wisdom/app/security/listSecurityLog"; /// <summary> /// 查询安防报警记录 /// </summary> public const string Api_Post_Security_ListAlarmLog = "/home-wisdom/app/security/listAlarmLog"; #endregion #region ■ -- 房间、设备、场景分享___________________________ HDL_ON/Entity/Function/Security.cs
New file @@ -0,0 +1,234 @@ using System; using System.Collections.Generic; using HDL_ON.Common; namespace HDL_ON.Entity { public class Security { /// <summary> /// 安防sid /// </summary> public string sid; /// <summary> /// 安防名称 /// </summary> public string name; /// <summary> /// 安防延时 /// </summary> public string delay; /// <summary> /// 状态 enable布防、disable撒防 /// </summary> public string status; /// <summary> /// 类型 /// "all"--全宅布防, /// "normal"--普通模式, /// "all_day":24小时, /// "mute":静音 /// </summary> public string type; /// <summary> /// 更新时间 /// </summary> public string modifyTime; /// <summary> /// 安防输入条件 /// </summary> public List<SecurityInput> input = new List<SecurityInput>(); /// <summary> /// 安防输出 /// </summary> public List<SecurityOutput> output = new List<SecurityOutput>(); /// <summary> /// 安防通知配置 /// </summary> public SecurityNoticeConfig noticeConfig = new SecurityNoticeConfig(); /// <summary> /// 安防推送配置 /// </summary> public List<SecurityPushConfig> pushConfigs = new List<SecurityPushConfig>(); /// <summary> /// 数据存储文件名 /// </summary> [Newtonsoft.Json.JsonIgnore] public string savePath { get { return "SecurityData_" + sid; } } /// <summary> /// 保存文件 /// </summary> public void SaveFile() { var ssd = System.Text.Encoding.UTF8.GetBytes(Newtonsoft.Json.JsonConvert.SerializeObject(this)); FileUtlis.Files.WriteFileByBytes(savePath, ssd); } } /// <summary> /// 安防状态配置 /// </summary> public class SecurityState { /// <summary> /// 安防云端id /// </summary> public string userSecurityId; /// <summary> /// 网关id 网关id 如果传的是sid该字段需要传 /// </summary> public string gatewayId; /// <summary> /// 安防sid /// </summary> public string sid; /// <summary> /// 状态 enable布防、disable撒防 /// </summary> public string status; } /// <summary> /// 安防bypass设置对象 /// </summary> public class SecurityBypass { /// <summary> /// 安防云端id /// </summary> public string userSecurityId; /// <summary> /// 输入设备bypass状态列表 /// </summary> public List<SecurityBypassInput> input = new List<SecurityBypassInput>(); } /// <summary> /// 输入设备bypass状态 /// </summary> public class SecurityBypassInput { /// <summary> /// 设备sid /// </summary> public string sid; /// <summary> /// true:启用 /// false:停用(临时bypass) /// </summary> public string bypass; } /// <summary> /// 安防输入 /// </summary> public class SecurityInput { /// <summary> /// 输入条件(功能)的sid /// 输入设备sid /// </summary> public string sid; /// <summary> /// Bypass设置 true:启用中、false:临时bypass中 /// </summary> public string bypass; /// <summary> /// 安防输入条件 /// </summary> public List<SecurityInputCondition> condition = new List<SecurityInputCondition>(); } /// <summary> /// 安防输入条件 /// </summary> public class SecurityInputCondition { /// <summary> /// 属性(条件)名称 /// </summary> public string key; /// <summary> /// 操作(执行)条件 /// < 小于 > 大于 ==等于 /// </summary> public string comparator; /// <summary> /// 条件值类型 /// int \float\ string /// </summary> public string data_type = "string"; /// <summary> /// 值 /// </summary> public string value; } /// <summary> /// 安防输出 /// </summary> public class SecurityOutput { /// <summary> /// 控制目标类型 /// 设备:0,场景1,自动化2 /// </summary> public string target_type; /// <summary> /// 输出目标的sid /// </summary> public string sid; /// <summary> /// 安防输出状态 /// </summary> public List<SecurityOutputStatus> status = new List<SecurityOutputStatus>(); } /// <summary> /// 安防输出状态 /// </summary> public class SecurityOutputStatus { public string key; public string value; } /// <summary> /// 安防通知配置 /// </summary> public class SecurityNoticeConfig { /// <summary> /// 是否开启通知 /// </summary> public bool enable; /// <summary> /// 通知内容 /// </summary> public string noticeContent; } /// <summary> /// 安防推送配置 /// </summary> public class SecurityPushConfig { /// <summary> /// 推送方式 /// APP:app push /// SMS:短信 /// </summary> public string pushMethod; /// <summary> /// 推送目标 /// </summary> public List<string> pushTarget = new List<string>(); } } HDL_ON/Entity/FunctionList.cs
@@ -101,7 +101,6 @@ return Functions.FindAll((obj) => spkList.Contains(obj.spk)); } /// <summary> /// 红外宝列表 /// </summary> @@ -137,6 +136,11 @@ /// 场景列表 /// </summary> public List<Scene> scenes = new List<Scene>(); /// <summary> /// 安防列表 /// </summary> public List<Security> securities = new List<Security>(); /// <summary> /// 加载功能列表 @@ -176,13 +180,40 @@ } Functions.Add(tempFunction); } if (filePath.StartsWith("SceneData_")) else if (filePath.StartsWith("SceneData_")) { var sceneDataBytes = FileUtlis.Files.ReadFile(filePath); var sceneDataString = System.Text.Encoding.UTF8.GetString(sceneDataBytes); var tempScene = Newtonsoft.Json.JsonConvert.DeserializeObject<Scene>(sceneDataString); List.scenes.Add(tempScene); } else if (filePath.StartsWith("SecurityData_")) { var dataBytes = FileUtlis.Files.ReadFile(filePath); var dataString = System.Text.Encoding.UTF8.GetString(dataBytes); var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<Security>(dataString); if (temp == null) { MainPage.Log("null"); FileUtlis.Files.DeleteFile(filePath); return; } if (checkRepeat == true) { //检测重复 for (int i = 0; i < securities.Count; i++) { if (securities[i].sid == temp.sid) { //先移除掉再加 securities.RemoveAt(i); securities.Add(temp); return; } } } securities.Add(temp); } } /// <summary> HDL_ON/HDL_ON.projitems
@@ -397,6 +397,8 @@ <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Video\ObjectClass.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Scene\CatchSceneAddPage.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Scene\CatchSceneCatchFunctionListPage.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\ArmCenter\ArmCenterPage.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Entity\Function\Security.cs" /> </ItemGroup> <ItemGroup> <Folder Include="$(MSBuildThisFileDirectory)DAL\" /> @@ -440,6 +442,6 @@ <Folder Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Video\View\" /> <Folder Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Energy\" /> <Folder Include="$(MSBuildThisFileDirectory)DAL\ThirdPartySdk\" /> <Folder Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Arm\" /> <Folder Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\ArmCenter\" /> </ItemGroup> </Project> HDL_ON/UI/UI0-Public/TopViewDiv.cs
@@ -340,7 +340,7 @@ /// <summary> /// 成员顶部栏 /// </summary> public void LoadTopView_MemberTopView(Action callBack, Action action) public void LoadTopView_MemberTopView(Action addAction, Action action) { LoadTopView(); backAction = action; @@ -357,7 +357,30 @@ btnAddIcon.MouseUpEventHandler += (sender, e) => { callBack?.Invoke(); addAction?.Invoke(); }; } /// <summary> /// 安防中心顶部栏 /// </summary> public void LoadTopView_ArmCenter(Action skipAction)//(Action callBack, Action action) { //LoadTopView(); //backAction = action; var btnAddIcon = new Button() { X = Application.GetRealWidth(337), Y = Application.GetRealHeight(29), Width = Application.GetMinRealAverage(28), Height = Application.GetMinRealAverage(28), UnSelectedImagePath = "FunctionIcon/ArmCenter/HistoryIcon.png", }; contentView.AddChidren(btnAddIcon); btnAddIcon.MouseUpEventHandler += (sender, e) => { skipAction?.Invoke(); }; } } HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs
@@ -507,9 +507,7 @@ } break; case ShowFunction.SecurityCenter: #if DEBUG functionCount = 1; #endif functionCount = FunctionList.List.securities.Count; break; } HDL_ON/UI/UI2/3-Intelligence/Scene/CatchSceneAddPage.cs
@@ -1,5 +1,7 @@ using System; using System.Collections.Generic; using System.Threading; using HDL_ON.DAL.Server; using HDL_ON.Entity; using HDL_ON.UI.CSS; using Shared; @@ -19,6 +21,36 @@ private Button btnChooseZoneViewTitle; private VerticalScrolViewLayout functionListView; private Button btnComplete; #region 图标选择部分图标 /// <summary> /// 背景图选项区域 /// </summary> FrameLayout pictureOptionView; /// <summary> /// 背景图选项选择区域 /// </summary> VerticalScrolViewLayout optionView; /// <summary> /// 默认图库按钮 /// </summary> Button btnDefaultGallery; /// <summary> /// 拍照按钮 /// </summary> Button btnTakePicture; /// <summary> /// 相册按钮 /// </summary> Button btnAlbum; /// <summary> /// 取消按钮 /// </summary> Button btnCancel; #endregion /// <summary> /// 捕捉的区域列表 /// </summary> @@ -37,7 +69,6 @@ RemoveFromParent(); }; } public void LoadPage() { @@ -74,6 +105,14 @@ //2020-12-03 修改图片加载方法 ImageUtlis.Current.LoadLocalOrNetworkImages(scene.ImagePath, addSceneImageView); /// <summary> /// 修改场景背景事件 /// </summary> addSceneImageView.MouseUpEventHandler = (sender, e) => { LoadPictureOptionView(); }; #region 场景名称row sceneNameView = new FrameLayout() @@ -174,71 +213,6 @@ BackgroundColor = CSS_Color.BackgroundColor, }); #endregion #region 场景延时row /* if (DB_ResidenceData.Instance.GatewayType == 1) { FrameLayout sceneDelayRow = new FrameLayout() { Y = sceneNameView.Bottom, Height = Application.GetRealWidth(50), }; contentView.AddChidren(sceneDelayRow); Button btnSceneDelayRight = new Button() { X = Application.GetRealWidth(339), Gravity = Gravity.CenterVertical, Width = Application.GetMinRealAverage(16), Height = Application.GetMinRealAverage(16), UnSelectedImagePath = "Public/Right.png", }; sceneDelayRow.AddChidren(btnSceneDelayRight); var btnSceneDelayInfo = new Button() { Width = Application.GetRealWidth(327), TextAlignment = TextAlignment.CenterRight, TextColor = CSS_Color.PromptingColor1, TextSize = CSS_FontSize.PromptFontSize_FirstLevel, Text = scene.GetDelayText() }; sceneDelayRow.AddChidren(btnSceneDelayInfo); Button btnSceneDelayTitle = new Button() { X = Application.GetRealWidth(16), //Width = Application.GetRealWidth(90), TextAlignment = TextAlignment.CenterLeft, TextColor = CSS_Color.FirstLevelTitleColor, TextSize = CSS_FontSize.TextFontSize, TextID = StringId.SceneDelay, }; sceneDelayRow.AddChidren(btnSceneDelayTitle); btnSceneDelayTitle.MouseUpEventHandler = (sender, e) => { Action<string> action = (obj) => { scene.delay = obj; btnSceneDelayInfo.Text = scene.GetDelayText(); }; Dictionary<string, string> items = new Dictionary<string, string>(); items.Add("30", "30s"); items.Add("60", "1min"); items.Add("120", "2min"); items.Add("300", "5min"); new PublicAssmebly().SetSceneDelayDialog(items, action, scene.delay); }; contentView.AddChidren(new Button() { Y = sceneDelayRow.Bottom, Height = Application.GetRealHeight(8), BackgroundColor = CSS_Color.BackgroundColor, }); } */ #endregion #region 选择区域 FrameLayout chooseZoneView = new FrameLayout() @@ -273,8 +247,6 @@ BackgroundColor = CSS_Color.BackgroundColor, }; contentView.AddChidren(btnLine1); #endregion @@ -342,8 +314,6 @@ } }; } /// <summary> /// 加载功能列表 @@ -432,6 +402,273 @@ } } /// <summary> /// 加载图标选择选项 /// </summary> void LoadPictureOptionView() { var pView = new FrameLayout() { BackgroundColor = CSS_Color.DialogTransparentColor1, }; bodyView.AddChidren(pView); pictureOptionView = new FrameLayout() { Y = Application.GetRealHeight(445), Height = Application.GetRealHeight(250), AnimateSpeed = 0.3f, Animate = Animate.DownToUp, }; pView.AddChidren(pictureOptionView); optionView = new VerticalScrolViewLayout() { Gravity = Gravity.CenterHorizontal, Width = Application.GetRealWidth(343), Height = Application.GetRealHeight(150), BackgroundColor = CSS_Color.MainBackgroundColor, Radius = (uint)Application.GetRealWidth(12), }; pictureOptionView.AddChidren(optionView); btnDefaultGallery = new Button() { Height = Application.GetRealHeight(50), TextAlignment = TextAlignment.Center, TextColor = CSS_Color.TextualColor, SelectedTextColor = CSS_Color.MainColor, TextSize = CSS_FontSize.SubheadingFontSize, TextID = StringId.DefaultGallery, }; optionView.AddChidren(btnDefaultGallery); optionView.AddChidren(new Button() { Height = Application.GetRealHeight(1), Width = Application.GetRealWidth(343), BackgroundColor = CSS_Color.DividingLineColor }); btnTakePicture = new Button() { Height = Application.GetRealHeight(50), TextAlignment = TextAlignment.Center, TextColor = CSS_Color.TextualColor, SelectedTextColor = CSS_Color.MainColor, TextSize = CSS_FontSize.SubheadingFontSize, TextID = StringId.TakePicture, }; optionView.AddChidren(btnTakePicture); optionView.AddChidren(new Button() { Height = Application.GetRealHeight(1), Width = Application.GetRealWidth(343), BackgroundColor = CSS_Color.DividingLineColor }); btnAlbum = new Button() { Height = Application.GetRealHeight(50), TextAlignment = TextAlignment.Center, TextColor = CSS_Color.TextualColor, SelectedTextColor = CSS_Color.MainColor, TextSize = CSS_FontSize.SubheadingFontSize, TextID = StringId.Album, }; optionView.AddChidren(btnAlbum); optionView.AddChidren(new Button() { Height = Application.GetRealHeight(1), Width = Application.GetRealWidth(343), BackgroundColor = CSS_Color.DividingLineColor }); btnCancel = new Button() { Gravity = Gravity.CenterHorizontal, Y = Application.GetRealHeight(8) + optionView.Bottom, Width = Application.GetRealWidth(343), Height = Application.GetRealHeight(50), BackgroundColor = CSS_Color.MainBackgroundColor, Radius = (uint)Application.GetRealWidth(12), TextID = StringId.Cancel, TextColor = CSS_Color.WarningColor, TextSize = CSS_FontSize.SubheadingFontSize, }; pictureOptionView.AddChidren(btnCancel); LoadEvent_PictureOptionViewEventList(pView); } /// <summary> /// 加载背景图选择区域事件列表 /// </summary> void LoadEvent_PictureOptionViewEventList(FrameLayout pView) { pictureOptionView.MouseUpEventHandler = (sender, e) => { pictureOptionView.Parent.RemoveFromParent(); }; pView.MouseUpEventHandler = (sender, e) => { pictureOptionView.Parent.RemoveFromParent(); }; btnCancel.MouseUpEventHandler = (sender, e) => { pictureOptionView.Parent.RemoveFromParent(); }; btnTakePicture.MouseDownEventHandler = (sender, e) => { btnTakePicture.IsSelected = true; }; btnTakePicture.MouseUpEventHandler = (sender, e) => { btnTakePicture.IsSelected = false; var imageName = Guid.NewGuid().ToString(); CropImage.TakePicture((imagePath) => { CropImageCallBack(imagePath); }, imageName, 4, 3); pictureOptionView.Parent.RemoveFromParent(); }; btnAlbum.MouseDownEventHandler = (sender, e) => { btnAlbum.IsSelected = true; }; btnAlbum.MouseUpEventHandler = (sender, e) => { btnAlbum.IsSelected = false; //从相册选择图片裁剪 var imageName = Guid.NewGuid().ToString(); //var imageName = scene.sid; CropImage.SelectPicture((imagePath) => { CropImageCallBack(imagePath); }, imageName, 4, 3); //if (pageTitleId == StringId.EditScene) //{ // scene.SaveFunctionData(); //} pictureOptionView.Parent.RemoveFromParent(); }; btnDefaultGallery.MouseUpEventHandler = (sender, e) => { pictureOptionView.Parent.RemoveFromParent(); Action<string> action = (obj) => { scene.ImagePath = obj; addSceneImageView.ImageBytes = null;//解决有ImageBytes不加载ImagePath addSceneImageView.ImagePath = scene.ImagePath; }; var galleryPage = new GalleryPage(scene.ImagePath, action); MainPage.BasePageView.AddChidren(galleryPage); galleryPage.LoadPage(true); MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; }; } /// <summary> /// 裁剪完照片回调,统一处理 /// </summary> /// <param name="imagePath">裁剪后的真实路径</param> /// <param name="imageName">自定义的图片名称</param> void CropImageCallBack(string selectImagePath) { if (string.IsNullOrEmpty(selectImagePath) == true) { return; } //上传成功到回调 Action<string> uploadSuccessAction = (imageUrl) => { //2020-12-03 需要讲最新的图片路径同步到云端 scene.ImagePath = imageUrl; }; //上传图片到云端 UploadImage(selectImagePath, addSceneImageView, scene, uploadSuccessAction); } /// <summary> /// 上传图片方法 /// </summary> /// <param name="selectImagePath">裁剪后的图片路径</param> /// <param name="imageView"></param> /// <param name="uploadSuccessAction"></param> void UploadImage(string selectImagePath, ImageView imageView, Scene mScene, Action<string> uploadSuccessAction) { try { //MainPage.Log("SelectPicture 裁剪图片返回路径: " + selectImagePath); //1.读取裁剪后的图片,然后删除 var imageBytes = Shared.IO.FileUtils.ReadFile(selectImagePath); System.IO.File.Delete(selectImagePath); var waitPage = new Loading(); bodyView.AddChidren(waitPage); waitPage.Start(Language.StringByID(StringId.PleaseWait)); //开始上传 new Thread(() => { try { var newImageName = mScene.name.Trim() + ".png"; var uploadImageObj = new UploadImageObj() { prefix = "Scene" + Utlis.GetTimestamp(), fileName = newImageName, uid = mScene.sid, content = imageBytes, }; var imageUrl = ImageUtlis.Current.UploadImage(uploadImageObj); if (!string.IsNullOrEmpty(imageUrl) && imageUrl.Contains(newImageName)) { //上传成功 Application.RunOnMainThread(() => { //Utlis.WriteLine("上传成功:" + imageUrl); //1.2如果是自定义图片删除之前的 if (!string.IsNullOrEmpty(imageView.ImagePath) && !imageView.ImagePath.Contains("Classification/Room/Roombg")) { //Utlis.WriteLine("删除: " + imageView.ImagePath); System.IO.File.Delete(imageView.ImagePath); } //重命名保存 ImageUtlis.Current.WriteFileByBytes(imageUrl, imageBytes); imageView.ImagePath = null; imageView.ImageBytes = imageBytes; //上传成功 Utlis.ShowTip(Language.StringByID(StringId.UploadSuccessfully)); uploadSuccessAction?.Invoke(imageUrl); }); } else { //上传失败 Application.RunOnMainThread(() => { //上传失败 Utlis.ShowTip(Language.StringByID(StringId.UploadFailed)); }); } } catch (Exception ex) { } finally { Application.RunOnMainThread(() => { if (waitPage != null) { waitPage.RemoveFromParent(); waitPage = null; } }); } }) { IsBackground = true }.Start(); } catch { } } } } HDL_ON/UI/UI2/FuntionControlView/ArmCenter/ArmCenterPage.cs
New file @@ -0,0 +1,128 @@ using System; using HDL_ON.UI.CSS; using Shared; namespace HDL_ON.UI.UI2.FuntionControlView.ArmCenter { public class ArmCenterPage : FrameLayout { /// <summary> /// 主窗体 /// </summary> FrameLayout bodyView; public ArmCenterPage() { bodyView = this; } public void LoadPage() { Action skipAction = () => { }; new TopViewDiv(bodyView, Language.StringByID(StringId.Setting)).LoadTopView_ArmCenter(skipAction); VerticalScrolViewLayout contentView = new VerticalScrolViewLayout() { Height = Application.GetRealHeight(603), BackgroundColor = CSS_Color.MainBackgroundColor, ScrollEnabled = false, }; bodyView.AddChidren(contentView); contentView.AddChidren(new Button() { Height =Application.GetRealWidth(32), }); //安防状态背景图 Button 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); contentView.AddChidren(new Button() { Height = Application.GetRealWidth(16), }); //自定义布防标题 Button btnCustomDeploymentTitle = new Button() { X = Application.GetRealWidth(24), Height = Application.GetRealWidth(54), TextAlignment = TextAlignment.CenterLeft, IsBold = true, TextSize = CSS_FontSize.SubheadingFontSize, TextColor = CSS_Color.FirstLevelTitleColor, TextID = StringId.CustomDeployment, }; contentView.AddChidren(btnCustomDeploymentTitle); HorizontalScrolViewLayout customDeploymentView = new HorizontalScrolViewLayout() { X = Application.GetRealWidth(23), Height = Application.GetRealWidth(80), }; contentView.AddChidren(customDeploymentView); } } /// <summary> /// 安防自定义控件 /// </summary> public class ArmDiyView { public FrameLayout ArmDiyButton; /// <summary> /// /// </summary> /// <param name="IconPath">图片路径</param> /// <param name="Text">显示文本</param> public ArmDiyView(string UnSelectedIconPath, string SelectedIconPath, string Text) { ArmDiyButton = new FrameLayout() { Width = Application.GetRealWidth(82), Height = Application.GetRealWidth(80), }; Button btnIcon = new Button() { Gravity = Gravity.CenterHorizontal, Width = Application.GetRealWidth(40), Height = Application.GetRealWidth(40), UnSelectedImagePath = UnSelectedIconPath, SelectedImagePath = SelectedIconPath, }; ArmDiyButton.AddChidren(btnIcon); Button btnText = new Button() { Y = Application.GetRealWidth(40), Height = Application.GetRealWidth(41), Text = Text, TextAlignment = TextAlignment.Center, TextColor = CSS_Color.TextualColor, TextSize = CSS_FontSize.PromptFontSize_FirstLevel, }; ArmDiyButton.AddChidren(btnText); } } }