|
|
@ -79,32 +79,50 @@ public class HeatModuleService { |
|
|
|
return devicePosition.getPoint3D(); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 指定加热模块开启散热风扇 |
|
|
|
*/ |
|
|
|
public void fanStart(HeatModuleCode heatModuleCode) throws Exception { |
|
|
|
fanStart(null, null, heatModuleCode); |
|
|
|
} |
|
|
|
|
|
|
|
public void fanStart(String cmdId, String cmdCode, HeatModuleCode heatModuleId) throws Exception { |
|
|
|
/** |
|
|
|
* 指定加热模块开启散热风扇 |
|
|
|
*/ |
|
|
|
public void fanStart(String cmdId, String cmdCode, HeatModuleCode heatModuleCode) throws Exception { |
|
|
|
DeviceCommandBundle deviceCommand; |
|
|
|
switch (heatModuleId) { |
|
|
|
switch (heatModuleCode) { |
|
|
|
case heat_module_01 -> deviceCommand = DeviceCommandGenerator.fan1Open(); |
|
|
|
case heat_module_02 -> deviceCommand = DeviceCommandGenerator.fan2Open(); |
|
|
|
case heat_module_03 -> deviceCommand = DeviceCommandGenerator.fan3Open(); |
|
|
|
case heat_module_04 -> deviceCommand = DeviceCommandGenerator.fan4Open(); |
|
|
|
default -> throw new RuntimeException("heatId 未找到"); |
|
|
|
default -> throw new RuntimeException("heatModuleCode 未找到"); |
|
|
|
} |
|
|
|
CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdId, cmdCode, deviceCommand); |
|
|
|
CommandUtil.wait(deviceCommandFuture); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 指定加热模块关闭散热风扇 |
|
|
|
*/ |
|
|
|
public void fanClose(HeatModuleCode heatModuleCode) throws Exception { |
|
|
|
fanClose(null, null, heatModuleCode); |
|
|
|
} |
|
|
|
|
|
|
|
public void fanClose(String cmdId, String cmdCode, HeatModuleCode heatModuleId) throws Exception { |
|
|
|
/** |
|
|
|
* 指定加热模块关闭散热风扇 |
|
|
|
*/ |
|
|
|
public void fanClose(String cmdId, String cmdCode, HeatModuleCode heatModuleCode) throws Exception { |
|
|
|
DeviceCommandBundle deviceCommand; |
|
|
|
switch (heatModuleId) { |
|
|
|
switch (heatModuleCode) { |
|
|
|
case heat_module_01 -> deviceCommand = DeviceCommandGenerator.fan1Close(); |
|
|
|
case heat_module_02 -> deviceCommand = DeviceCommandGenerator.fan2Close(); |
|
|
|
case heat_module_03 -> deviceCommand = DeviceCommandGenerator.fan3Close(); |
|
|
|
case heat_module_04 -> deviceCommand = DeviceCommandGenerator.fan4Close(); |
|
|
|
default -> throw new RuntimeException("heatId 未找到"); |
|
|
|
default -> throw new RuntimeException("heatModuleCode 未找到"); |
|
|
|
} |
|
|
|
CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdId, cmdCode, deviceCommand); |
|
|
|
CommandUtil.wait(deviceCommandFuture); |
|
|
|
} |
|
|
|
|
|
|
|
} |