| | |
| | | { |
| | | case Command.SetSingleLightACK: |
| | | var queryList = new List<Function>(); |
| | | queryList.AddRange(DB_ResidenceData.functionList.electricals); |
| | | queryList.AddRange(DB_ResidenceData.functionList.lights); |
| | | queryList.AddRange(FunctionList.List.electricals); |
| | | queryList.AddRange(FunctionList.List.lights); |
| | | foreach (var updataObj in queryList) |
| | | { |
| | | if (updataObj.GetBusId() == subnetID + "_" + deviceID + "_" + receiveBytes[0]) |
| | |
| | | case Command.ReadLightAllLoopBrightnessACK: |
| | | for (int i = 0; i < receiveBytes[0]; i++) |
| | | { |
| | | var light = DB_ResidenceData.functionList.lights.Find((obj) => obj.bus_Data.SubnetID == subnetID && obj.bus_Data.DeviceID == deviceID && obj.bus_Data.loopId == (i + 1)); |
| | | var light = FunctionList.List.lights.Find((obj) => obj.bus_Data.SubnetID == subnetID && obj.bus_Data.DeviceID == deviceID && obj.bus_Data.loopId == (i + 1)); |
| | | if (light != null) |
| | | { |
| | | if (light.functionType != FunctionType.RGB) |
| | |
| | | } |
| | | else |
| | | { |
| | | var e = DB_ResidenceData.functionList.electricals.Find((obj) => obj.bus_Data.SubnetID == subnetID && obj.bus_Data.DeviceID == deviceID && obj.bus_Data.loopId == i); |
| | | var e = FunctionList.List.electricals.Find((obj) => obj.bus_Data.SubnetID == subnetID && obj.bus_Data.DeviceID == deviceID && obj.bus_Data.loopId == i); |
| | | if (e != null) |
| | | { |
| | | var fan = e as Fan; |
| | |
| | | break; |
| | | case Command.SetLogicLoopColorACK: |
| | | case Command.ReadLogicLoopColorACK: |
| | | foreach (var rgb in DB_ResidenceData.functionList.lights) |
| | | foreach (var rgb in FunctionList.List.lights) |
| | | { |
| | | if (rgb.GetBusId() == subnetID + "_" + deviceID + "_" + receiveBytes[0]) |
| | | { |
| | |
| | | break; |
| | | case Command.SetCurtainModelStutasACK: |
| | | case Command.ReadCurtainStutasACK: |
| | | foreach (var curtain in DB_ResidenceData.functionList.curtains) |
| | | foreach (var curtain in FunctionList.List.curtains) |
| | | { |
| | | if (curtain.bus_Data.SubnetID == subnetID && curtain.bus_Data.DeviceID == deviceID) |
| | | { |
| | |
| | | break; |
| | | case Command.SetACModeACK: |
| | | case Command.ReadACModeACK: |
| | | foreach (var ac in DB_ResidenceData.functionList.aCs) |
| | | foreach (var ac in FunctionList.List.aCs) |
| | | { |
| | | if (ac.GetBusId() == subnetID + "_" + deviceID + "_" + receiveBytes[0]) |
| | | { |
| | |
| | | break; |
| | | case Command.ReadFloorHeatACK: |
| | | case Command.SetFloorHeatACK: |
| | | foreach (var fh in DB_ResidenceData.functionList.floorHeatings) |
| | | foreach (var fh in FunctionList.List.floorHeatings) |
| | | { |
| | | if (fh.GetBusId() == subnetID + "_" + deviceID + "_" + receiveBytes[0]) |
| | | { |
| | |
| | | case Command.ReadDeviceLoopInfoACK: |
| | | FunctionType dt = (FunctionType)(11 * 256 + receiveBytes[1]); |
| | | string tag = receiveBytes[1] + "_" + subnetID + "_" + deviceID + "_" + receiveBytes[2]; |
| | | foreach (var sensor in DB_ResidenceData.functionList.sensorsEnvironmentalScience) |
| | | foreach (var sensor in FunctionList.List.sensorsEnvironmentalScience) |
| | | { |
| | | if (sensor.bus_Data != null) |
| | | { |
| | |
| | | break; |
| | | case Command.New_Analog_Quantity_BROADCAST: |
| | | string tag1 = receiveBytes[1] + "_" + subnetID + "_" + deviceID + "_" + receiveBytes[2]; |
| | | foreach (var sensor in DB_ResidenceData.functionList.sensorsEnvironmentalScience) |
| | | foreach (var sensor in FunctionList.List.sensorsEnvironmentalScience) |
| | | { |
| | | if (sensor.bus_Data != null) |
| | | { |
| | |
| | | { |
| | | break; |
| | | } |
| | | foreach (var ac in DB_ResidenceData.functionList.aCs) |
| | | foreach (var ac in FunctionList.List.aCs) |
| | | { |
| | | if (ac.GetBusId() == subnetID + "_" + deviceID + "_" + reACPanel) |
| | | { |
| | |
| | | break; |
| | | case Command.ReadPanleTempACK://1944 |
| | | case Command.PanleBroadcastTemp: |
| | | foreach (var ac in DB_ResidenceData.functionList.aCs) |
| | | foreach (var ac in FunctionList.List.aCs) |
| | | { |
| | | if (ac.GetBusId() == subnetID + "_" + deviceID + "_" + receiveBytes[0]) |
| | | { |