From 0f2e0147e8990e913d16d99bc1b94fb6bc53abd7 Mon Sep 17 00:00:00 2001 From: 陈嘉乐 <cjl@hdlchina.com.cn> Date: 星期四, 03 十二月 2020 15:35:42 +0800 Subject: [PATCH] 2020-12-03-1 --- HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs | 140 +++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 135 insertions(+), 5 deletions(-) diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs index 17ebb5e..8d56021 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs @@ -123,8 +123,81 @@ /// <returns></returns> public static List<HDL_ON.Entity.Function> GetGatewayDeviceList() { + List<HDL_ON.Entity.Function> list = new List<Entity.Function>(); + for (int i=0;i<10;i++) { + HDL_ON.Entity.Function function = new Entity.Function(); + switch (i) { + case 0: { + function.sid = "1234560001212121020182"; + function.name ="鐏厜"; + list.Add(function); + } + break; + case 1: { + + function.sid = "1234560001212121030182"; + function.name = "绐楀笜"; + list.Add(function); + } break; + case 2: { + function.sid = "1234560001212121040182"; + function.name = "绌鸿皟"; + list.Add(function); + } break; + case 3: + { + function.sid = "1234560001212121010282"; + function.name = "RGBW"; + list.Add(function); + } + break; + case 4: + { - return HDL_ON.Entity.DB_ResidenceData.functionList.GetAllFunction(); + function.sid = "1234560001212121010382"; + function.name = "CCT鐏�"; + list.Add(function); + } + break; + case 5: + { + function.sid = "1234560001212121010482"; + function.name = "寮�鍚堝笜"; + list.Add(function); + } + break; + case 6: + { + function.sid = "1234560001212121010582"; + function.name = "鍗峰笜"; + list.Add(function); + } + break; + case 7: + { + function.sid = "1234560001212121040282"; + function.name = "鍦扮儹"; + list.Add(function); + } + break; + case 8: + { + function.sid = "1234560001212121020282"; + function.name = "璋冨叧"; + list.Add(function); + } + break; + case 9: + { + function.sid = "1234560001212121020482"; + function.name = "RGB"; + list.Add(function); + } + break; + } + } + return list; + //return HDL_ON.Entity.DB_ResidenceData.functionList.GetAllFunction(); } /// <summary> /// 鑾峰彇缃戝叧鍦烘櫙鍒楄〃 @@ -145,7 +218,7 @@ List<HDL_ON.Entity.Function> lists = GetGatewayDeviceList(); foreach (var dev in lists) { - if (dev.roomIdList.Find((id) => id == room.sid) != null) + if (dev.roomIds.Find((id) => id == room.sid) != null) { deviceLists.Add(dev); } @@ -207,7 +280,7 @@ string roomName = ""; List<HDL_ON.Entity.Room> roomLists = GetGatewayRoomList(); - foreach (var dev in device.roomIdList) + foreach (var dev in device.roomIds) { var room = roomLists.Find((c) => c.sid == dev); if (room != null) @@ -229,8 +302,29 @@ switch (functionType) { case FunctionType.Relay: + case FunctionType.RGB: + case FunctionType.RGBW: + case FunctionType.CCT: + case FunctionType.Dimmer: { strPath = "LogicIcon/lightloguc.png"; + } + break; + case FunctionType.Curtain: + case FunctionType.RollerCurtain: + case FunctionType.TrietexCurtain: + { + strPath = "LogicIcon/curtainlogic.png"; + } + break; + case FunctionType.AC: + { + strPath = "LogicIcon/airconditionerlogic.png"; + } + break; + case FunctionType.FloorHeating: + { + strPath = "LogicIcon/heatlogic.png"; } break; @@ -246,13 +340,13 @@ { List<string> deviceStrTypeList = new List<string>(); deviceStrTypeList.Clear(); - var lightjosn = deviceList.Find((device) => device.functionType == FunctionType.Relay || device.functionType == FunctionType.Dimmer); + var lightjosn = deviceList.Find((device) => device.functionType == FunctionType.Relay || device.functionType == FunctionType.Dimmer|| device.functionType == FunctionType.CCT || device.functionType == FunctionType.RGB|| device.functionType == FunctionType.RGBW); if (lightjosn != null) { deviceStrTypeList.Add(Language.StringByID(StringId.Lights)); } - var curtainjosn = deviceList.Find((device) => device.functionType ==FunctionType.Curtain); + var curtainjosn = deviceList.Find((device) => device.functionType ==FunctionType.Curtain|| device.functionType == FunctionType.TrietexCurtain|| device.functionType == FunctionType.RollerCurtain); if (curtainjosn != null) { deviceStrTypeList.Add(Language.StringByID(StringId.Curtain)); @@ -262,6 +356,11 @@ if (ac != null) { deviceStrTypeList.Add(Language.StringByID(StringId.AC)); + } + var floorHeating = deviceList.Find((device) => device.functionType == FunctionType.FloorHeating); + if (ac != null) + { + deviceStrTypeList.Add(Language.StringByID(StringId.FloorHeating)); } return deviceStrTypeList; @@ -278,10 +377,23 @@ { functionTypeList.Add(FunctionType.Relay); functionTypeList.Add(FunctionType.Dimmer); + functionTypeList.Add(FunctionType.RGB); + functionTypeList.Add(FunctionType.RGBW); + functionTypeList.Add(FunctionType.CCT); } else if (deviceType == Language.StringByID(StringId.Curtain)) { functionTypeList.Add(FunctionType.Curtain); + functionTypeList.Add(FunctionType.RollerCurtain); + functionTypeList.Add(FunctionType.TrietexCurtain); + } + else if (deviceType == Language.StringByID(StringId.AC)) + { + functionTypeList.Add(FunctionType.AC); + } + else if (deviceType == Language.StringByID(StringId.FloorHeating)) + { + functionTypeList.Add(FunctionType.FloorHeating); } return functionTypeList; @@ -296,11 +408,29 @@ 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.CCT); + deviceTypeList.Add(FunctionType.Curtain); + deviceTypeList.Add(FunctionType.RollerCurtain); + deviceTypeList.Add(FunctionType.TrietexCurtain); + deviceTypeList.Add(FunctionType.AC); + deviceTypeList.Add(FunctionType.FloorHeating); } break; case target_if: { deviceTypeList.Add(FunctionType.Relay); + deviceTypeList.Add(FunctionType.RGB); + deviceTypeList.Add(FunctionType.RGBW); + deviceTypeList.Add(FunctionType.Dimmer); + deviceTypeList.Add(FunctionType.CCT); + deviceTypeList.Add(FunctionType.Curtain); + deviceTypeList.Add(FunctionType.RollerCurtain); + deviceTypeList.Add(FunctionType.TrietexCurtain); + deviceTypeList.Add(FunctionType.AC); + deviceTypeList.Add(FunctionType.FloorHeating); } break; } -- Gitblit v1.8.0