| | |
| | | |
| | | logicId = sOidBeginsWith + sTimeSpan; |
| | | |
| | | logicId += "0A"; |
| | | logicId += "0A01"; |
| | | //0A01 物模型为逻辑, 0001 表示 1 号逻辑功能 |
| | | int iTopLogicId = 1; |
| | | logicId += "15"; |
| | | logicId += "1501"; |
| | | //1501 物模型为逻辑, 0001 表示 1 号逻辑功能 |
| | | int maxId = 1; |
| | | |
| | | Random random = new Random(); |
| | | iTopLogicId = random.Next(0, 255); |
| | | iTopLogicId += random.Next(0, 255); |
| | | |
| | | logicId += iTopLogicId.ToString("X4");//逻辑号 两个byte |
| | | logicId += "1100"; |
| | | for (int i = 0; i < Logic.LogicList.Count; i++) |
| | | { |
| | | string s = Logic.LogicList[i].sid.Substring(20, 4); |
| | | int iThisSceneId = Convert.ToInt16(s, 16); |
| | | if (iThisSceneId > maxId) |
| | | maxId = iThisSceneId ; |
| | | } |
| | | |
| | | logicId += (maxId+1).ToString("X4");//逻辑号 两个byte |
| | | logicId += "0000"; |
| | | } |
| | | catch |
| | | { |
| | |
| | | } |
| | | return logicId; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 封装Dictionary对象 |
| | | /// </summary> |
| | |
| | | /// <returns></returns> |
| | | public static List<HDL_ON.Entity.Function> GetGatewayDeviceList() |
| | | { |
| | | |
| | | return HDL_ON.Entity.DB_ResidenceData.functionList.GetAllFunction(); |
| | | } |
| | | /// <summary> |
| | |
| | | switch (functionType) |
| | | { |
| | | case FunctionType.Relay: |
| | | case FunctionType.RGB: |
| | | case FunctionType.RGBW: |
| | | case FunctionType.ColorTemperature: |
| | | case FunctionType.Dimmer: |
| | | { |
| | | strPath = "LogicIcon/lightloguc.png"; |
| | | } |
| | | break; |
| | | case FunctionType.Curtain: |
| | | case FunctionType.RollingShutter: |
| | | case FunctionType.MotorCurtain: |
| | | { |
| | | strPath = "LogicIcon/curtainlogic.png"; |
| | | } |
| | | break; |
| | | case FunctionType.AC: |
| | | { |
| | | strPath = "LogicIcon/airconditionerlogic.png"; |
| | | } |
| | | break; |
| | | case FunctionType.FloorHeating: |
| | | { |
| | | strPath = "LogicIcon/heatlogic.png"; |
| | | } |
| | | break; |
| | | |
| | |
| | | { |
| | | 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.ColorTemperature || 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.MotorCurtain|| device.functionType == FunctionType.RollingShutter); |
| | | if (curtainjosn != null) |
| | | { |
| | | deviceStrTypeList.Add(Language.StringByID(StringId.Curtain)); |
| | |
| | | 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; |
| | | |
| | |
| | | { |
| | | functionTypeList.Add(FunctionType.Relay); |
| | | functionTypeList.Add(FunctionType.Dimmer); |
| | | functionTypeList.Add(FunctionType.RGB); |
| | | functionTypeList.Add(FunctionType.RGBW); |
| | | functionTypeList.Add(FunctionType.ColorTemperature); |
| | | } |
| | | else if (deviceType == Language.StringByID(StringId.Curtain)) |
| | | { |
| | | functionTypeList.Add(FunctionType.Curtain); |
| | | functionTypeList.Add(FunctionType.RollingShutter); |
| | | functionTypeList.Add(FunctionType.MotorCurtain); |
| | | } |
| | | else if (deviceType == Language.StringByID(StringId.AC)) |
| | | { |
| | | functionTypeList.Add(FunctionType.AC); |
| | | } |
| | | else if (deviceType == Language.StringByID(StringId.FloorHeating)) |
| | | { |
| | | functionTypeList.Add(FunctionType.FloorHeating); |
| | | } |
| | | return functionTypeList; |
| | | |
| | |
| | | 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); |
| | | } |
| | | 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); |
| | | } |
| | | break; |
| | | } |