| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using HDL_ON.Entity; |
| | | using Shared; |
| | | |
| | | namespace HDL_ON.UI.UI2.Intelligence.Automation |
| | |
| | | |
| | | public class LogicMethod |
| | | { |
| | | |
| | | private static LogicMethod logicMethod = null; |
| | | |
| | | public static LogicMethod CurrLogicMethod |
| | | { |
| | | get |
| | | { |
| | | if (logicMethod == null) |
| | | { |
| | | return new LogicMethod(); |
| | | } |
| | | return logicMethod; |
| | | } |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 表示是条件 |
| | | /// </summary> |
| | |
| | | /// <summary> |
| | | /// 移除所有"Logic"界面 |
| | | /// </summary> |
| | | public static void RemoveAllView() |
| | | public void RemoveAllView() |
| | | { |
| | | MainPage.BasePageView.RemoveViewByTag("Logic"); |
| | | } |
| | |
| | | /// <summary> Converts an array of bytes into a formatted string of hex digits (ex: E4 CA B2)</summary> |
| | | /// <param name="data"> The array of bytes to be translated into a string of hex digits. </param> |
| | | /// <returns> Returns a well formatted string of hex digits with spacing. </returns> |
| | | static string byteArrayToHexString(byte[] data) |
| | | public string byteArrayToHexString(byte[] data) |
| | | { |
| | | System.Text.StringBuilder sb = new System.Text.StringBuilder(); |
| | | foreach (byte b in data) |
| | |
| | | * @param i 一个int数字 |
| | | * @return byte[] |
| | | */ |
| | | public static byte[] int2ByteArray(int i) |
| | | public byte[] int2ByteArray(int i) |
| | | { |
| | | byte[] result = new byte[4]; |
| | | result[0] = (byte)((i >> 24) & 0xFF); |
| | |
| | | /// 获取时间戳 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | static int getTimeStamp() |
| | | public int getTimeStamp() |
| | | { |
| | | TimeSpan ts = DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0, 0); |
| | | return (int)ts.TotalSeconds; |
| | |
| | | /// <summary> |
| | | /// 生成逻辑sid方法 |
| | | /// </summary> |
| | | public static string NewSid() |
| | | public string NewSid() |
| | | { |
| | | string logicId = ""; |
| | | try |
| | |
| | | /// <param name="dic">Dictionary类</param> |
| | | /// <param name="key">健</param> |
| | | /// <param name="value">值</param> |
| | | public static void dictionary(Dictionary<string, string> dic, string key, string value) |
| | | public void dictionary(Dictionary<string, string> dic, string key, string value) |
| | | { |
| | | if (dic.ContainsKey(key)) //判断是否存在键值 |
| | | { |
| | |
| | | /// 获取网关房间列表 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public static List<HDL_ON.Entity.Room> GetGatewayRoomList() |
| | | public List<HDL_ON.Entity.Room> GetGatewayRoomList() |
| | | { |
| | | return HDL_ON.Entity.SpatialInfo.CurrentSpatial.RoomList; |
| | | } |
| | |
| | | /// 获取网关房间列表 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public static List<HDL_ON.Entity.Room> GetGatewayRoomList(string name) |
| | | public List<HDL_ON.Entity.Room> GetGatewayRoomList(string name) |
| | | { |
| | | List<Entity.Room> roomList = new List<Entity.Room>(); |
| | | Entity.Room room1 = new Entity.Room(); |
| | |
| | | /// 获取网关设备列表 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public static List<HDL_ON.Entity.Function> GetGatewayDeviceList() |
| | | public List<HDL_ON.Entity.Function> GetGatewayDeviceList() |
| | | { |
| | | return Entity.FunctionList.List.GetDeviceFunctionList(); |
| | | } |
| | | /// <summary> |
| | | /// 获取网关场景列表 |
| | | /// 获取场景列表 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public static List<HDL_ON.Entity.Scene> GetSceneList() |
| | | public List<HDL_ON.Entity.Scene> GetSceneList() |
| | | { |
| | | return HDL_ON.Entity.FunctionList.List.scenes; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取安防列表 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public List<HDL_ON.Entity.SecurityAlarm> GetSecurityList() |
| | | { |
| | | return FunctionList.List.securities; |
| | | } |
| | | /// <summary> |
| | | /// 获取房间的设备列表 |
| | | /// </summary> |
| | | /// <param name="room">当前房间</param> |
| | | /// <returns></returns> |
| | | public static List<HDL_ON.Entity.Function> GetRoomDevice(HDL_ON.Entity.Room room) |
| | | public List<HDL_ON.Entity.Function> GetRoomDevice(HDL_ON.Entity.Room room) |
| | | { |
| | | List<HDL_ON.Entity.Function> deviceLists = new List<Entity.Function>(); |
| | | List<HDL_ON.Entity.Function> lists = GetGatewayDeviceList(); |
| | |
| | | return deviceLists; |
| | | } |
| | | /// <summary> |
| | | /// 获取当个设备 |
| | | /// 获取设备(功能)对象 |
| | | /// </summary> |
| | | /// <param name="sid">设备唯一标识</param> |
| | | /// <returns></returns> |
| | | public static HDL_ON.Entity.Function GetDevice(string sid) |
| | | public HDL_ON.Entity.Function GetDevice(string sid) |
| | | { |
| | | HDL_ON.Entity.Function device = new Entity.Function() { name = "Unknown" }; |
| | | List<HDL_ON.Entity.Function> deviceLists = GetGatewayDeviceList(); |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取当个场景 |
| | | /// 获取场景对象 |
| | | /// </summary> |
| | | /// <param name="sid">场景唯一标识</param> |
| | | /// <returns></returns> |
| | | public static HDL_ON.Entity.Scene GetSecne(string sid) |
| | | public HDL_ON.Entity.Scene GetSecne(string sid) |
| | | { |
| | | HDL_ON.Entity.Scene scene = new Entity.Scene() { name = "Unknown" }; |
| | | List<HDL_ON.Entity.Scene> sceneLists = GetSceneList(); |
| | |
| | | return scene; |
| | | } |
| | | /// <summary> |
| | | /// 获取安防对象 |
| | | /// </summary> |
| | | /// <param name="sid">安防唯一标识</param> |
| | | /// <returns></returns> |
| | | public HDL_ON.Entity.SecurityAlarm GetSecurity(string sid) |
| | | { |
| | | HDL_ON.Entity.SecurityAlarm security = new Entity.SecurityAlarm() { name = "Unknown" }; |
| | | List<HDL_ON.Entity.SecurityAlarm> SecurityLists = GetSecurityList(); |
| | | for (int i = 0; i < SecurityLists.Count; i++) |
| | | { |
| | | var sce = SecurityLists[i]; |
| | | if (sce.sid == sid) |
| | | { |
| | | security = sce; |
| | | break; |
| | | } |
| | | } |
| | | return security; |
| | | } |
| | | /// <summary> |
| | | /// 获取房间名(即是=区域名称) |
| | | /// </summary> |
| | | /// <param name="device">设备</param> |
| | | /// <returns></returns> |
| | | public static string GetGetRoomName(HDL_ON.Entity.Function device) |
| | | public string GetGetRoomName(HDL_ON.Entity.Function device) |
| | | { |
| | | string roomName = ""; |
| | | List<HDL_ON.Entity.Room> roomLists = GetGatewayRoomList(); |
| | |
| | | |
| | | return roomName.TrimEnd(','); |
| | | } |
| | | #region 动一改四 |
| | | /// <summary> |
| | | /// 获取设备类型图标 |
| | | /// </summary> |
| | | /// <param name="functionType">设备类型</param> |
| | | /// <returns></returns> |
| | | public static string GetIconPath(FunctionType functionType) |
| | | public string GetIconPath(string functionType) |
| | | { |
| | | string strPath = ""; |
| | | switch (functionType) |
| | | { |
| | | case FunctionType.Relay: |
| | | case FunctionType.RGB: |
| | | case FunctionType.RGBW: |
| | | case FunctionType.ColorTemperature: |
| | | case FunctionType.Dimmer: |
| | | case SPK.LightSwitch: |
| | | case SPK.LightRGB: |
| | | case SPK.LightRGBW: |
| | | case SPK.LightCCT: |
| | | case SPK.LightDimming: |
| | | { |
| | | strPath = "LogicIcon/lightloguc.png"; |
| | | } |
| | | break; |
| | | case FunctionType.Curtain: |
| | | case FunctionType.RollingShutter: |
| | | case FunctionType.MotorCurtain: |
| | | case SPK.CurtainSwitch: |
| | | case SPK.CurtainRoller: |
| | | case SPK.CurtainTrietex: |
| | | { |
| | | strPath = "LogicIcon/curtainlogic.png"; |
| | | } |
| | | break; |
| | | case FunctionType.AC: |
| | | case SPK.AcStandard: |
| | | { |
| | | strPath = "LogicIcon/airconditionerlogic.png"; |
| | | } |
| | | break; |
| | | case FunctionType.FloorHeating: |
| | | case SPK.FloorHeatStandard: |
| | | { |
| | | strPath = "LogicIcon/heatlogic.png"; |
| | | } |
| | | break; |
| | | case SPK.AirFreshStandard: |
| | | { |
| | | strPath = "LogicIcon/heatlogic.png"; |
| | | } |
| | | break; |
| | | case SPK.SensorSmoke: |
| | | case SPK.SensorWater: |
| | | case SPK.SensorGas: |
| | | case SPK.SensorDryContact: |
| | | case SPK.SensorShanLan: |
| | | case SPK.SensorDuiShe: |
| | | case SPK.SensorPir: |
| | | case SPK.SensorDoorWindow: |
| | | case SPK.SensorUtrasonic: |
| | | case SPK.SenesorMegahealth: |
| | | case SPK.SensorEnvironment: |
| | | case SPK.SensorEnvironment2: |
| | | case SPK.SensorEnvironment3: |
| | | case SPK.SensorTemperature: |
| | | case SPK.SensorHumidity: |
| | | case SPK.SensorCO2: |
| | | case SPK.SensorPm25: |
| | | case SPK.SensorTVOC: |
| | | { |
| | | strPath = "LogicIcon/sensor.png"; |
| | | } |
| | | break; |
| | | |
| | |
| | | /// </summary> |
| | | /// <param name="deviceList">设备列表</param> |
| | | /// <returns></returns> |
| | | public static List<string> GetDeviceTypeList(List<HDL_ON.Entity.Function> deviceList) |
| | | public List<string> GetDeviceTypeList(List<HDL_ON.Entity.Function> deviceList) |
| | | { |
| | | List<string> deviceStrTypeList = new List<string>(); |
| | | deviceStrTypeList.Clear(); |
| | | var lightjosn = deviceList.Find((device) => device.functionType == FunctionType.Relay || device.functionType == FunctionType.Dimmer || device.functionType == FunctionType.ColorTemperature || device.functionType == FunctionType.RGB || device.functionType == FunctionType.RGBW); |
| | | var lightjosn = deviceList.Find((device) => |
| | | device.spk == SPK.LightSwitch |
| | | || device.spk == SPK.LightDimming |
| | | || device.spk == SPK.LightCCT |
| | | || device.spk == SPK.LightRGB |
| | | || device.spk == SPK.LightRGBW); |
| | | if (lightjosn != null) |
| | | { |
| | | deviceStrTypeList.Add(Language.StringByID(StringId.Lights)); |
| | | } |
| | | |
| | | var curtainjosn = deviceList.Find((device) => device.functionType == FunctionType.Curtain || device.functionType == FunctionType.MotorCurtain || device.functionType == FunctionType.RollingShutter); |
| | | var curtainjosn = deviceList.Find((device) => |
| | | device.spk == SPK.CurtainSwitch |
| | | || device.spk == SPK.CurtainTrietex |
| | | || device.spk == SPK.CurtainRoller); |
| | | if (curtainjosn != null) |
| | | { |
| | | deviceStrTypeList.Add(Language.StringByID(StringId.Curtain)); |
| | | } |
| | | |
| | | var ac = deviceList.Find((device) => device.functionType == FunctionType.AC); |
| | | var ac = deviceList.Find((device) => device.spk == SPK.AcStandard); |
| | | if (ac != null) |
| | | { |
| | | deviceStrTypeList.Add(Language.StringByID(StringId.AC)); |
| | | } |
| | | var floorHeating = deviceList.Find((device) => device.functionType == FunctionType.FloorHeating); |
| | | var floorHeating = deviceList.Find((device) => device.spk == SPK.FloorHeatStandard); |
| | | if (floorHeating != null) |
| | | { |
| | | deviceStrTypeList.Add(Language.StringByID(StringId.FloorHeating)); |
| | | } |
| | | var airFresh = deviceList.Find((device) => device.spk == SPK.AirFreshStandard); |
| | | if (airFresh != null) |
| | | { |
| | | deviceStrTypeList.Add(Language.StringByID(StringId.AirFresh)); |
| | | } |
| | | var sensor = deviceList.Find((device) => |
| | | device.spk == SPK.SensorWater |
| | | || device.spk == SPK.SensorGas |
| | | || device.spk == SPK.SensorSmoke |
| | | || device.spk == SPK.SensorDryContact |
| | | || device.spk == SPK.SensorShanLan |
| | | || device.spk == SPK.SensorDuiShe |
| | | || device.spk == SPK.SensorPir |
| | | || device.spk == SPK.SensorDoorWindow |
| | | || device.spk == SPK.SensorUtrasonic |
| | | || device.spk == SPK.SenesorMegahealth |
| | | || device.spk == SPK.SensorEnvironment |
| | | || device.spk == SPK.SensorEnvironment2 |
| | | || device.spk == SPK.SensorEnvironment3 |
| | | || device.spk == SPK.SensorTemperature |
| | | || device.spk == SPK.SensorHumidity |
| | | || device.spk == SPK.SensorCO2 |
| | | || device.spk == SPK.SensorPm25 |
| | | || device.spk == SPK.SensorTVOC |
| | | ); |
| | | if (sensor != null) |
| | | { |
| | | deviceStrTypeList.Add(Language.StringByID(StringId.Sensor)); |
| | | } |
| | | return deviceStrTypeList; |
| | | |
| | |
| | | /// </summary> |
| | | /// <param name="deviceType">设备类型(灯光类,窗帘类。)</param> |
| | | /// <returns></returns> |
| | | public static List<FunctionType> GetDeviceTypeFunctionList(string deviceType) |
| | | public List<string> GetDeviceTypeFunctionList(string deviceType) |
| | | { |
| | | List<FunctionType> functionTypeList = new List<FunctionType>(); |
| | | List<string> functionTypeList = new List<string>(); |
| | | if (deviceType == Language.StringByID(StringId.Lights)) |
| | | { |
| | | functionTypeList.Add(FunctionType.Relay); |
| | | functionTypeList.Add(FunctionType.Dimmer); |
| | | functionTypeList.Add(FunctionType.RGB); |
| | | functionTypeList.Add(FunctionType.RGBW); |
| | | functionTypeList.Add(FunctionType.ColorTemperature); |
| | | functionTypeList.Add(SPK.LightSwitch); |
| | | functionTypeList.Add(SPK.LightDimming); |
| | | functionTypeList.Add(SPK.LightRGB); |
| | | functionTypeList.Add(SPK.LightRGBW); |
| | | functionTypeList.Add(SPK.LightCCT); |
| | | } |
| | | else if (deviceType == Language.StringByID(StringId.Curtain)) |
| | | { |
| | | functionTypeList.Add(FunctionType.Curtain); |
| | | functionTypeList.Add(FunctionType.RollingShutter); |
| | | functionTypeList.Add(FunctionType.MotorCurtain); |
| | | functionTypeList.Add(SPK.CurtainSwitch); |
| | | functionTypeList.Add(SPK.CurtainRoller); |
| | | functionTypeList.Add(SPK.CurtainTrietex); |
| | | } |
| | | else if (deviceType == Language.StringByID(StringId.AC)) |
| | | { |
| | | functionTypeList.Add(FunctionType.AC); |
| | | functionTypeList.Add(SPK.AcStandard); |
| | | } |
| | | else if (deviceType == Language.StringByID(StringId.FloorHeating)) |
| | | { |
| | | functionTypeList.Add(FunctionType.FloorHeating); |
| | | functionTypeList.Add(SPK.FloorHeatStandard); |
| | | } |
| | | else if (deviceType == Language.StringByID(StringId.AirFresh)) |
| | | { |
| | | functionTypeList.Add(SPK.AirFreshStandard); |
| | | } |
| | | else if (deviceType == Language.StringByID(StringId.Sensor)) |
| | | { |
| | | functionTypeList.Add(SPK.SensorSmoke); |
| | | functionTypeList.Add(SPK.SensorWater); |
| | | functionTypeList.Add(SPK.SensorGas); |
| | | functionTypeList.Add(SPK.SensorDryContact); |
| | | functionTypeList.Add(SPK.SensorShanLan); |
| | | functionTypeList.Add(SPK.SensorDuiShe); |
| | | functionTypeList.Add(SPK.SensorPir); |
| | | functionTypeList.Add(SPK.SensorDoorWindow); |
| | | functionTypeList.Add(SPK.SensorUtrasonic); |
| | | functionTypeList.Add(SPK.SenesorMegahealth); |
| | | functionTypeList.Add(SPK.SensorEnvironment); |
| | | functionTypeList.Add(SPK.SensorEnvironment2); |
| | | functionTypeList.Add(SPK.SensorEnvironment3); |
| | | functionTypeList.Add(SPK.SensorTemperature); |
| | | functionTypeList.Add(SPK.SensorHumidity); |
| | | functionTypeList.Add(SPK.SensorCO2); |
| | | functionTypeList.Add(SPK.SensorPm25); |
| | | functionTypeList.Add(SPK.SensorTVOC); |
| | | |
| | | |
| | | } |
| | | return functionTypeList; |
| | | |
| | |
| | | /// 条件/目标支持设备 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public static List<FunctionType> GetSupportEquipment(string if_type) |
| | | public List<string> GetSupportEquipment(string if_type) |
| | | { |
| | | List<FunctionType> deviceTypeList = new List<FunctionType>(); |
| | | List<string> deviceTypeList = new List<string>(); |
| | | switch (if_type) |
| | | { |
| | | case condition_if: |
| | | { |
| | | deviceTypeList.Add(FunctionType.Relay); |
| | | deviceTypeList.Add(FunctionType.RGB); |
| | | deviceTypeList.Add(FunctionType.RGBW); |
| | | deviceTypeList.Add(FunctionType.Dimmer); |
| | | deviceTypeList.Add(FunctionType.ColorTemperature); |
| | | deviceTypeList.Add(FunctionType.Curtain); |
| | | deviceTypeList.Add(FunctionType.RollingShutter); |
| | | deviceTypeList.Add(FunctionType.MotorCurtain); |
| | | deviceTypeList.Add(FunctionType.AC); |
| | | deviceTypeList.Add(FunctionType.FloorHeating); |
| | | deviceTypeList.Add(SPK.LightSwitch); |
| | | deviceTypeList.Add(SPK.LightRGB); |
| | | deviceTypeList.Add(SPK.LightRGBW); |
| | | deviceTypeList.Add(SPK.LightDimming); |
| | | deviceTypeList.Add(SPK.LightCCT); |
| | | deviceTypeList.Add(SPK.CurtainSwitch); |
| | | deviceTypeList.Add(SPK.CurtainRoller); |
| | | deviceTypeList.Add(SPK.CurtainTrietex); |
| | | deviceTypeList.Add(SPK.AcStandard); |
| | | deviceTypeList.Add(SPK.FloorHeatStandard); |
| | | deviceTypeList.Add(SPK.SensorSmoke); |
| | | deviceTypeList.Add(SPK.SensorWater); |
| | | deviceTypeList.Add(SPK.SensorGas); |
| | | deviceTypeList.Add(SPK.SensorDryContact); |
| | | deviceTypeList.Add(SPK.SensorShanLan); |
| | | deviceTypeList.Add(SPK.SensorDuiShe); |
| | | deviceTypeList.Add(SPK.SensorPir); |
| | | deviceTypeList.Add(SPK.SensorDoorWindow); |
| | | deviceTypeList.Add(SPK.SensorUtrasonic); |
| | | deviceTypeList.Add(SPK.SenesorMegahealth); |
| | | deviceTypeList.Add(SPK.SensorEnvironment); |
| | | deviceTypeList.Add(SPK.SensorEnvironment2); |
| | | deviceTypeList.Add(SPK.SensorEnvironment3); |
| | | deviceTypeList.Add(SPK.SensorTemperature); |
| | | deviceTypeList.Add(SPK.SensorHumidity); |
| | | deviceTypeList.Add(SPK.SensorCO2); |
| | | deviceTypeList.Add(SPK.SensorPm25); |
| | | deviceTypeList.Add(SPK.SensorTVOC); |
| | | |
| | | } |
| | | break; |
| | | case target_if: |
| | | { |
| | | deviceTypeList.Add(FunctionType.Relay); |
| | | deviceTypeList.Add(FunctionType.RGB); |
| | | deviceTypeList.Add(FunctionType.RGBW); |
| | | deviceTypeList.Add(FunctionType.Dimmer); |
| | | deviceTypeList.Add(FunctionType.ColorTemperature); |
| | | deviceTypeList.Add(FunctionType.Curtain); |
| | | deviceTypeList.Add(FunctionType.RollingShutter); |
| | | deviceTypeList.Add(FunctionType.MotorCurtain); |
| | | deviceTypeList.Add(FunctionType.AC); |
| | | deviceTypeList.Add(FunctionType.FloorHeating); |
| | | deviceTypeList.Add(SPK.LightSwitch); |
| | | deviceTypeList.Add(SPK.LightRGB); |
| | | deviceTypeList.Add(SPK.LightRGBW); |
| | | deviceTypeList.Add(SPK.LightDimming); |
| | | deviceTypeList.Add(SPK.LightCCT); |
| | | deviceTypeList.Add(SPK.CurtainSwitch); |
| | | deviceTypeList.Add(SPK.CurtainRoller); |
| | | deviceTypeList.Add(SPK.CurtainTrietex); |
| | | deviceTypeList.Add(SPK.AcStandard); |
| | | deviceTypeList.Add(SPK.FloorHeatStandard); |
| | | deviceTypeList.Add(SPK.AirFreshStandard); |
| | | } |
| | | break; |
| | | } |
| | | return deviceTypeList; |
| | | } |
| | | #endregion |
| | | /// <summary> |
| | | /// 显示的设备列表 |
| | | /// </summary> |
| | | /// <param name="functionType">源数据列表1</param> |
| | | /// <param name="deviceList">源数据列表2</param> |
| | | /// <returns></returns> |
| | | public static List<Entity.Function> GetShowDeviceList(List<FunctionType> functionType, List<HDL_ON.Entity.Function> deviceList) |
| | | public List<Entity.Function> GetShowDeviceList(List<string> functionType, List<HDL_ON.Entity.Function> deviceList) |
| | | { |
| | | List<HDL_ON.Entity.Function> devList = new List<Entity.Function>(); |
| | | for (int i = 0; i < deviceList.Count; i++) |
| | | { |
| | | var dev = deviceList[i]; |
| | | if (functionType.Contains(dev.functionType)) |
| | | //过滤掉不需要显示的设备 |
| | | if (functionType.Contains(dev.spk)) |
| | | { |
| | | ///过滤掉不需要显示的设备 |
| | | devList.Add(dev); |
| | | } |
| | | |
| | |
| | | /// <param name="room">当前房间</param> |
| | | /// <param name="str">判断符(表示=输入设备和输出设备)</param> |
| | | /// <returns></returns> |
| | | public static List<Entity.Function> GetFunctionDeviceList(Entity.Room room, string str) |
| | | public List<Entity.Function> GetFunctionDeviceList(Entity.Room room, string str) |
| | | { |
| | | List<FunctionType> functionTypeList = GetSupportEquipment(str); |
| | | List<string> functionTypeList = GetSupportEquipment(str); |
| | | //返回房间设备列表 |
| | | var roomDeviceList = GetRoomDevice(room); |
| | | //返回最终支持显示出来的设备列表 |
| | | var list = GetShowDeviceList(functionTypeList, roomDeviceList); |
| | | return list; |
| | | } |
| | | /// <summary> |
| | | /// 网关ID(获取嘉乐网关ID) |
| | | /// </summary> |
| | | public string GatewayId |
| | | { |
| | | get |
| | | { |
| | | if (Entity.DB_ResidenceData.Instance.HomeGateway == null) |
| | | { |
| | | return DriverLayer.Control.Ins.GatewayId; |
| | | } |
| | | return Entity.DB_ResidenceData.Instance.HomeGateway.gatewayId; |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// 住宅ID |
| | | /// </summary> |
| | | public string HomeId |
| | | { |
| | | get |
| | | { |
| | | return Entity.DB_ResidenceData.Instance.CurrentRegion.id; |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// 是否为其他主用户分享过来的住宅 |
| | | /// </summary> |
| | | public bool IsOthreShare |
| | | { |
| | | get |
| | | { |
| | | return Entity.DB_ResidenceData.Instance.CurrentRegion.isOtherShare; |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | } |