Browse Source

增加开始加热、停止加热

master
白凤吉 6 months ago
parent
commit
82a8d5535d
  1. 29
      src/main/java/com/qyft/gd/device/service/DeviceService.java

29
src/main/java/com/qyft/gd/device/service/DeviceService.java

@ -269,6 +269,35 @@ public class DeviceService {
}
/**
* 开始加热
*
* @param temperature 温度值
*/
public boolean startHeating(int temperature) {
Map<String, Object> params = new HashMap<>();
params.put("temperature", temperature);
DeviceFeedback deviceFeedback = tcpClient.sendCommand("startHeating", params);
if (deviceFeedback == null || deviceFeedback.getError() != null) {
log.error("TCP startHeating 指令执行错误 {}", JSONUtil.toJsonStr(deviceFeedback));
return false;
}
return true;
}
/**
* 停止加热
*/
public boolean stopHeating() {
DeviceFeedback deviceFeedback = tcpClient.sendCommand("stopHeating");
if (deviceFeedback == null || deviceFeedback.getError() != null) {
log.error("TCP stopHeating 指令执行错误 {}", JSONUtil.toJsonStr(deviceFeedback));
return false;
}
return true;
}
/**
* 抬起托盘到指定高度
*
* @param distance 距离

Loading…
Cancel
Save