12 changed files with 474 additions and 0 deletions
-
10src/main/java/com/qyft/ms/app/device/status/DeviceStatus.java
-
47src/main/java/com/qyft/ms/app/front/cmd/business/NozzleHeatStart.java
-
38src/main/java/com/qyft/ms/app/front/cmd/business/NozzleHeatStop.java
-
46src/main/java/com/qyft/ms/app/front/cmd/business/SlidePlatHeatStart.java
-
38src/main/java/com/qyft/ms/app/front/cmd/business/SlidePlatHeatStop.java
-
38src/main/java/com/qyft/ms/app/front/cmd/debug/NozzleHeatClose.java
-
46src/main/java/com/qyft/ms/app/front/cmd/debug/NozzleHeatGet.java
-
47src/main/java/com/qyft/ms/app/front/cmd/debug/NozzleHeatOpen.java
-
38src/main/java/com/qyft/ms/app/front/cmd/debug/SlidePlatHeatClose.java
-
40src/main/java/com/qyft/ms/app/front/cmd/debug/SlidePlatHeatGet.java
-
46src/main/java/com/qyft/ms/app/front/cmd/debug/SlidePlatHeatOpen.java
-
40src/main/java/com/qyft/ms/system/common/device/command/DeviceCommandGenerator.java
@ -0,0 +1,47 @@ |
|||||
|
package com.qyft.ms.app.front.cmd.business; |
||||
|
|
||||
|
import com.qyft.ms.app.device.status.DeviceStatus; |
||||
|
import com.qyft.ms.system.common.annotation.CommandMapping; |
||||
|
import com.qyft.ms.system.common.constant.CommandStatus; |
||||
|
import com.qyft.ms.system.common.device.command.DeviceCommandGenerator; |
||||
|
import com.qyft.ms.system.common.device.command.FrontResponseGenerator; |
||||
|
import com.qyft.ms.system.core.handler.BaseCommandHandler; |
||||
|
import com.qyft.ms.system.model.bo.DeviceCommand; |
||||
|
import com.qyft.ms.system.model.form.FrontCmdControlForm; |
||||
|
import com.qyft.ms.system.service.WebSocketService; |
||||
|
import com.qyft.ms.system.service.device.DeviceCommandService; |
||||
|
import lombok.RequiredArgsConstructor; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
import java.util.concurrent.CompletableFuture; |
||||
|
|
||||
|
/** |
||||
|
* 喷头加热 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@Component |
||||
|
@RequiredArgsConstructor |
||||
|
@CommandMapping("nozzle_heat_start") |
||||
|
public class NozzleHeatStart extends BaseCommandHandler { |
||||
|
|
||||
|
private final DeviceCommandService deviceCommandService; |
||||
|
private final DeviceStatus deviceStatus; |
||||
|
private final WebSocketService webSocketService; |
||||
|
|
||||
|
@Override |
||||
|
public CompletableFuture<Void> handle(FrontCmdControlForm form) { |
||||
|
Double temperature = form.getDoubleParam("temperature");//设置温度 |
||||
|
// 参数校验:humidity 必填 |
||||
|
if (temperature == null) { |
||||
|
webSocketService.pushCMDResponseMsg(FrontResponseGenerator.generateJson(form.getCmdId(), form.getCmdCode(), CommandStatus.DEVICE_ERROR, "参数 temperature 必填")); |
||||
|
throw new RuntimeException("参数 temperature 必填"); |
||||
|
} |
||||
|
return runAsync(() -> { |
||||
|
|
||||
|
DeviceCommand nozzleHeatStartCmd = DeviceCommandGenerator.nozzleHeatStart(temperature); // 生成喷头加热 |
||||
|
deviceCommandService.sendCommand(form.getCmdId(), form.getCmdCode(), nozzleHeatStartCmd);//发送指令 |
||||
|
deviceStatus.setNozzleHeating(true);//设置喷头加热状态 |
||||
|
}); |
||||
|
} |
||||
|
} |
@ -0,0 +1,38 @@ |
|||||
|
package com.qyft.ms.app.front.cmd.business; |
||||
|
|
||||
|
import com.qyft.ms.app.device.status.DeviceStatus; |
||||
|
import com.qyft.ms.system.common.annotation.CommandMapping; |
||||
|
import com.qyft.ms.system.common.device.command.DeviceCommandGenerator; |
||||
|
import com.qyft.ms.system.core.handler.BaseCommandHandler; |
||||
|
import com.qyft.ms.system.model.bo.DeviceCommand; |
||||
|
import com.qyft.ms.system.model.form.FrontCmdControlForm; |
||||
|
import com.qyft.ms.system.service.device.DeviceCommandService; |
||||
|
import lombok.RequiredArgsConstructor; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
import java.util.concurrent.CompletableFuture; |
||||
|
|
||||
|
/** |
||||
|
* 除湿指令处理 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@Component |
||||
|
@RequiredArgsConstructor |
||||
|
@CommandMapping("nozzle_heat_stop") |
||||
|
public class NozzleHeatStop extends BaseCommandHandler { |
||||
|
|
||||
|
private final DeviceCommandService deviceCommandService; |
||||
|
private final DeviceStatus deviceStatus; |
||||
|
|
||||
|
@Override |
||||
|
public CompletableFuture<Void> handle(FrontCmdControlForm form) { |
||||
|
return runAsync(() -> { |
||||
|
|
||||
|
DeviceCommand nozzleHeatStopCmd = DeviceCommandGenerator.nozzleHeatStop(); // 生成喷头加热关闭 |
||||
|
deviceCommandService.sendCommand(form.getCmdId(), form.getCmdCode(), nozzleHeatStopCmd);//发送指令 |
||||
|
deviceStatus.setNozzleHeating(false);//设置喷头加热状态 |
||||
|
|
||||
|
}); |
||||
|
} |
||||
|
} |
@ -0,0 +1,46 @@ |
|||||
|
package com.qyft.ms.app.front.cmd.business; |
||||
|
|
||||
|
import com.qyft.ms.app.device.status.DeviceStatus; |
||||
|
import com.qyft.ms.system.common.annotation.CommandMapping; |
||||
|
import com.qyft.ms.system.common.constant.CommandStatus; |
||||
|
import com.qyft.ms.system.common.device.command.DeviceCommandGenerator; |
||||
|
import com.qyft.ms.system.common.device.command.FrontResponseGenerator; |
||||
|
import com.qyft.ms.system.core.handler.BaseCommandHandler; |
||||
|
import com.qyft.ms.system.model.bo.DeviceCommand; |
||||
|
import com.qyft.ms.system.model.form.FrontCmdControlForm; |
||||
|
import com.qyft.ms.system.service.WebSocketService; |
||||
|
import com.qyft.ms.system.service.device.DeviceCommandService; |
||||
|
import lombok.RequiredArgsConstructor; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
import java.util.concurrent.CompletableFuture; |
||||
|
|
||||
|
/** |
||||
|
* 喷头加热 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@Component |
||||
|
@RequiredArgsConstructor |
||||
|
@CommandMapping("slide_plat_heat_start") |
||||
|
public class SlidePlatHeatStart extends BaseCommandHandler { |
||||
|
|
||||
|
private final DeviceCommandService deviceCommandService; |
||||
|
private final DeviceStatus deviceStatus; |
||||
|
private final WebSocketService webSocketService; |
||||
|
|
||||
|
@Override |
||||
|
public CompletableFuture<Void> handle(FrontCmdControlForm form) { |
||||
|
Double temperature = form.getDoubleParam("temperature");//温度 |
||||
|
if (temperature == null) { |
||||
|
webSocketService.pushCMDResponseMsg(FrontResponseGenerator.generateJson(form.getCmdId(), form.getCmdCode(), CommandStatus.DEVICE_ERROR, "参数 temperature 必填")); |
||||
|
throw new RuntimeException("参数 temperature 必填"); |
||||
|
} |
||||
|
return runAsync(() -> { |
||||
|
|
||||
|
DeviceCommand nozzleHeatStartCmd = DeviceCommandGenerator.slidePlatHeatStart(temperature); // 生成载玻台加热指令 |
||||
|
deviceCommandService.sendCommand(form.getCmdId(), form.getCmdCode(), nozzleHeatStartCmd);//发送指令 |
||||
|
deviceStatus.setSlidePlatHeating(true);//设置载玻台加热状态 |
||||
|
}); |
||||
|
} |
||||
|
} |
@ -0,0 +1,38 @@ |
|||||
|
package com.qyft.ms.app.front.cmd.business; |
||||
|
|
||||
|
import com.qyft.ms.app.device.status.DeviceStatus; |
||||
|
import com.qyft.ms.system.common.annotation.CommandMapping; |
||||
|
import com.qyft.ms.system.common.device.command.DeviceCommandGenerator; |
||||
|
import com.qyft.ms.system.core.handler.BaseCommandHandler; |
||||
|
import com.qyft.ms.system.model.bo.DeviceCommand; |
||||
|
import com.qyft.ms.system.model.form.FrontCmdControlForm; |
||||
|
import com.qyft.ms.system.service.device.DeviceCommandService; |
||||
|
import lombok.RequiredArgsConstructor; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
import java.util.concurrent.CompletableFuture; |
||||
|
|
||||
|
/** |
||||
|
* 除湿指令处理 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@Component |
||||
|
@RequiredArgsConstructor |
||||
|
@CommandMapping("slide_plat_heat_stop") |
||||
|
public class SlidePlatHeatStop extends BaseCommandHandler { |
||||
|
|
||||
|
private final DeviceCommandService deviceCommandService; |
||||
|
private final DeviceStatus deviceStatus; |
||||
|
|
||||
|
@Override |
||||
|
public CompletableFuture<Void> handle(FrontCmdControlForm form) { |
||||
|
return runAsync(() -> { |
||||
|
|
||||
|
DeviceCommand nozzleHeatStopCmd = DeviceCommandGenerator.slidePlatHeatStop(); // 生成载板加热关闭指令 |
||||
|
deviceCommandService.sendCommand(form.getCmdId(), form.getCmdCode(), nozzleHeatStopCmd);//发送指令 |
||||
|
deviceStatus.setSlidePlatHeating(false);//设置载玻台加热状态 |
||||
|
|
||||
|
}); |
||||
|
} |
||||
|
} |
@ -0,0 +1,38 @@ |
|||||
|
package com.qyft.ms.app.front.cmd.debug; |
||||
|
|
||||
|
import com.qyft.ms.app.device.status.DeviceStatus; |
||||
|
import com.qyft.ms.system.common.annotation.CommandMapping; |
||||
|
import com.qyft.ms.system.common.device.command.DeviceCommandGenerator; |
||||
|
import com.qyft.ms.system.core.handler.BaseCommandHandler; |
||||
|
import com.qyft.ms.system.model.bo.DeviceCommand; |
||||
|
import com.qyft.ms.system.model.form.FrontCmdControlForm; |
||||
|
import com.qyft.ms.system.service.device.DeviceCommandService; |
||||
|
import lombok.RequiredArgsConstructor; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
import java.util.concurrent.CompletableFuture; |
||||
|
|
||||
|
/** |
||||
|
* 除湿指令处理 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@Component |
||||
|
@RequiredArgsConstructor |
||||
|
@CommandMapping("nozzle_heat_close") |
||||
|
public class NozzleHeatClose extends BaseCommandHandler { |
||||
|
|
||||
|
private final DeviceCommandService deviceCommandService; |
||||
|
private final DeviceStatus deviceStatus; |
||||
|
|
||||
|
@Override |
||||
|
public CompletableFuture<Void> handle(FrontCmdControlForm form) { |
||||
|
return runAsync(() -> { |
||||
|
|
||||
|
DeviceCommand nozzleHeatStopCmd = DeviceCommandGenerator.nozzleHeatStop(); // 生成喷头加热关闭 |
||||
|
deviceCommandService.sendCommand(form.getCmdId(), form.getCmdCode(), nozzleHeatStopCmd);//发送指令 |
||||
|
deviceStatus.setNozzleHeating(false);//设置喷头加热状态 |
||||
|
|
||||
|
}); |
||||
|
} |
||||
|
} |
@ -0,0 +1,46 @@ |
|||||
|
package com.qyft.ms.app.front.cmd.debug; |
||||
|
|
||||
|
import cn.hutool.json.JSONObject; |
||||
|
import com.qyft.ms.app.device.status.DeviceStatus; |
||||
|
import com.qyft.ms.system.common.annotation.CommandMapping; |
||||
|
import com.qyft.ms.system.common.constant.CommandStatus; |
||||
|
import com.qyft.ms.system.common.device.command.CommandFuture; |
||||
|
import com.qyft.ms.system.common.device.command.DeviceCommandGenerator; |
||||
|
import com.qyft.ms.system.common.device.command.FrontResponseGenerator; |
||||
|
import com.qyft.ms.system.core.handler.BaseCommandHandler; |
||||
|
import com.qyft.ms.system.model.bo.DeviceCommand; |
||||
|
import com.qyft.ms.system.model.form.FrontCmdControlForm; |
||||
|
import com.qyft.ms.system.service.WebSocketService; |
||||
|
import com.qyft.ms.system.service.device.DeviceCommandService; |
||||
|
import lombok.RequiredArgsConstructor; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
import java.util.concurrent.CompletableFuture; |
||||
|
|
||||
|
/** |
||||
|
* 除湿指令处理 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@Component |
||||
|
@RequiredArgsConstructor |
||||
|
@CommandMapping("nozzle_heat_get") |
||||
|
public class NozzleHeatGet extends BaseCommandHandler { |
||||
|
|
||||
|
private final DeviceCommandService deviceCommandService; |
||||
|
private final WebSocketService webSocketService; |
||||
|
|
||||
|
@Override |
||||
|
public CompletableFuture<Void> handle(FrontCmdControlForm form) { |
||||
|
|
||||
|
return runAsync(() -> { |
||||
|
DeviceCommand nozzleHeatGetCmd = DeviceCommandGenerator.getNozzleHeat(); // 获取温度 |
||||
|
CommandFuture nozzleHeatGetFuture = deviceCommandService.sendCommand(form.getCmdId(), form.getCmdCode(), nozzleHeatGetCmd);//发送指令 |
||||
|
commandWait(nozzleHeatGetFuture); |
||||
|
|
||||
|
JSONObject result = nozzleHeatGetFuture.getResponseResult(); |
||||
|
Double nozzleHeat = result.getJSONObject("data").getDouble("temp"); |
||||
|
// webSocketService.pushCMDResponseMsg(FrontResponseGenerator.generateJson(form.getCmdId(), form.getCmdCode(), CommandStatus.DEVICE_ERROR, "设定湿度大于当前湿度,无需除湿")); |
||||
|
}); |
||||
|
} |
||||
|
} |
@ -0,0 +1,47 @@ |
|||||
|
package com.qyft.ms.app.front.cmd.debug; |
||||
|
|
||||
|
import com.qyft.ms.app.device.status.DeviceStatus; |
||||
|
import com.qyft.ms.system.common.annotation.CommandMapping; |
||||
|
import com.qyft.ms.system.common.constant.CommandStatus; |
||||
|
import com.qyft.ms.system.common.device.command.DeviceCommandGenerator; |
||||
|
import com.qyft.ms.system.common.device.command.FrontResponseGenerator; |
||||
|
import com.qyft.ms.system.core.handler.BaseCommandHandler; |
||||
|
import com.qyft.ms.system.model.bo.DeviceCommand; |
||||
|
import com.qyft.ms.system.model.form.FrontCmdControlForm; |
||||
|
import com.qyft.ms.system.service.WebSocketService; |
||||
|
import com.qyft.ms.system.service.device.DeviceCommandService; |
||||
|
import lombok.RequiredArgsConstructor; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
import java.util.concurrent.CompletableFuture; |
||||
|
|
||||
|
/** |
||||
|
* 喷头加热 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@Component |
||||
|
@RequiredArgsConstructor |
||||
|
@CommandMapping("nozzle_heat_open") |
||||
|
public class NozzleHeatOpen extends BaseCommandHandler { |
||||
|
|
||||
|
private final DeviceCommandService deviceCommandService; |
||||
|
private final DeviceStatus deviceStatus; |
||||
|
private final WebSocketService webSocketService; |
||||
|
|
||||
|
@Override |
||||
|
public CompletableFuture<Void> handle(FrontCmdControlForm form) { |
||||
|
Double temperature = form.getDoubleParam("temperature");//设置温度 |
||||
|
// 参数校验:humidity 必填 |
||||
|
if (temperature == null) { |
||||
|
webSocketService.pushCMDResponseMsg(FrontResponseGenerator.generateJson(form.getCmdId(), form.getCmdCode(), CommandStatus.DEVICE_ERROR, "参数 temperature 必填")); |
||||
|
throw new RuntimeException("参数 temperature 必填"); |
||||
|
} |
||||
|
return runAsync(() -> { |
||||
|
|
||||
|
DeviceCommand nozzleHeatStartCmd = DeviceCommandGenerator.nozzleHeatStart(temperature); // 生成喷头加热 |
||||
|
deviceCommandService.sendCommand(form.getCmdId(), form.getCmdCode(), nozzleHeatStartCmd);//发送指令 |
||||
|
deviceStatus.setNozzleHeating(true);//设置喷头加热状态 |
||||
|
}); |
||||
|
} |
||||
|
} |
@ -0,0 +1,38 @@ |
|||||
|
package com.qyft.ms.app.front.cmd.debug; |
||||
|
|
||||
|
import com.qyft.ms.app.device.status.DeviceStatus; |
||||
|
import com.qyft.ms.system.common.annotation.CommandMapping; |
||||
|
import com.qyft.ms.system.common.device.command.DeviceCommandGenerator; |
||||
|
import com.qyft.ms.system.core.handler.BaseCommandHandler; |
||||
|
import com.qyft.ms.system.model.bo.DeviceCommand; |
||||
|
import com.qyft.ms.system.model.form.FrontCmdControlForm; |
||||
|
import com.qyft.ms.system.service.device.DeviceCommandService; |
||||
|
import lombok.RequiredArgsConstructor; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
import java.util.concurrent.CompletableFuture; |
||||
|
|
||||
|
/** |
||||
|
* 载玻台关闭加热 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@Component |
||||
|
@RequiredArgsConstructor |
||||
|
@CommandMapping("slide_plat_heat_close") |
||||
|
public class SlidePlatHeatClose extends BaseCommandHandler { |
||||
|
|
||||
|
private final DeviceCommandService deviceCommandService; |
||||
|
private final DeviceStatus deviceStatus; |
||||
|
|
||||
|
@Override |
||||
|
public CompletableFuture<Void> handle(FrontCmdControlForm form) { |
||||
|
return runAsync(() -> { |
||||
|
|
||||
|
DeviceCommand nozzleHeatStopCmd = DeviceCommandGenerator.slidePlatHeatStop(); // 生成载板加热关闭指令 |
||||
|
deviceCommandService.sendCommand(form.getCmdId(), form.getCmdCode(), nozzleHeatStopCmd);//发送指令 |
||||
|
deviceStatus.setSlidePlatHeating(false);//设置载玻台加热状态 |
||||
|
|
||||
|
}); |
||||
|
} |
||||
|
} |
@ -0,0 +1,40 @@ |
|||||
|
package com.qyft.ms.app.front.cmd.debug; |
||||
|
|
||||
|
import cn.hutool.json.JSONObject; |
||||
|
import com.qyft.ms.system.common.annotation.CommandMapping; |
||||
|
import com.qyft.ms.system.common.device.command.CommandFuture; |
||||
|
import com.qyft.ms.system.common.device.command.DeviceCommandGenerator; |
||||
|
import com.qyft.ms.system.core.handler.BaseCommandHandler; |
||||
|
import com.qyft.ms.system.model.bo.DeviceCommand; |
||||
|
import com.qyft.ms.system.model.form.FrontCmdControlForm; |
||||
|
import com.qyft.ms.system.service.device.DeviceCommandService; |
||||
|
import lombok.RequiredArgsConstructor; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
import java.util.concurrent.CompletableFuture; |
||||
|
|
||||
|
/** |
||||
|
* 载玻台获取温度指令处理 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@Component |
||||
|
@RequiredArgsConstructor |
||||
|
@CommandMapping("slide_plat_heat_get") |
||||
|
public class SlidePlatHeatGet extends BaseCommandHandler { |
||||
|
|
||||
|
private final DeviceCommandService deviceCommandService; |
||||
|
|
||||
|
@Override |
||||
|
public CompletableFuture<Void> handle(FrontCmdControlForm form) { |
||||
|
return runAsync(() -> { |
||||
|
|
||||
|
DeviceCommand slidePlatHeatStopCmd = DeviceCommandGenerator.getSlidePlatHeat(); // 生成指令 |
||||
|
CommandFuture slidePlatHeatGetFuture = deviceCommandService.sendCommand(form.getCmdId(), form.getCmdCode(), slidePlatHeatStopCmd);//发送指令 |
||||
|
|
||||
|
JSONObject result = slidePlatHeatGetFuture.getResponseResult(); |
||||
|
Double slidePlatHeat = result.getJSONObject("data").getDouble("temp"); |
||||
|
// webSocketService.pushCMDResponseMsg(FrontResponseGenerator.generateJson(form.getCmdId(), form.getCmdCode(), CommandStatus.DEVICE_ERROR, "设定湿度大于当前湿度,无需除湿")); |
||||
|
}); |
||||
|
} |
||||
|
} |
@ -0,0 +1,46 @@ |
|||||
|
package com.qyft.ms.app.front.cmd.debug; |
||||
|
|
||||
|
import com.qyft.ms.app.device.status.DeviceStatus; |
||||
|
import com.qyft.ms.system.common.annotation.CommandMapping; |
||||
|
import com.qyft.ms.system.common.constant.CommandStatus; |
||||
|
import com.qyft.ms.system.common.device.command.DeviceCommandGenerator; |
||||
|
import com.qyft.ms.system.common.device.command.FrontResponseGenerator; |
||||
|
import com.qyft.ms.system.core.handler.BaseCommandHandler; |
||||
|
import com.qyft.ms.system.model.bo.DeviceCommand; |
||||
|
import com.qyft.ms.system.model.form.FrontCmdControlForm; |
||||
|
import com.qyft.ms.system.service.WebSocketService; |
||||
|
import com.qyft.ms.system.service.device.DeviceCommandService; |
||||
|
import lombok.RequiredArgsConstructor; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
import java.util.concurrent.CompletableFuture; |
||||
|
|
||||
|
/** |
||||
|
* 载玻台加热开始 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@Component |
||||
|
@RequiredArgsConstructor |
||||
|
@CommandMapping("slide_plat_heat_open") |
||||
|
public class SlidePlatHeatOpen extends BaseCommandHandler { |
||||
|
|
||||
|
private final DeviceCommandService deviceCommandService; |
||||
|
private final DeviceStatus deviceStatus; |
||||
|
private final WebSocketService webSocketService; |
||||
|
|
||||
|
@Override |
||||
|
public CompletableFuture<Void> handle(FrontCmdControlForm form) { |
||||
|
Double temperature = form.getDoubleParam("temperature");//温度 |
||||
|
if (temperature == null) { |
||||
|
webSocketService.pushCMDResponseMsg(FrontResponseGenerator.generateJson(form.getCmdId(), form.getCmdCode(), CommandStatus.DEVICE_ERROR, "参数 temperature 必填")); |
||||
|
throw new RuntimeException("参数 temperature 必填"); |
||||
|
} |
||||
|
return runAsync(() -> { |
||||
|
|
||||
|
DeviceCommand nozzleHeatStartCmd = DeviceCommandGenerator.slidePlatHeatStart(temperature); // 生成载玻台加热指令 |
||||
|
deviceCommandService.sendCommand(form.getCmdId(), form.getCmdCode(), nozzleHeatStartCmd);//发送指令 |
||||
|
deviceStatus.setSlidePlatHeating(true);//设置载玻台加热状态 |
||||
|
}); |
||||
|
} |
||||
|
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue