|
|
@ -6,6 +6,7 @@ import com.dreamworks.boditech.driver.actuator.ActModuleIncubatorTemperature; |
|
|
|
import com.dreamworks.boditech.driver.actuator.ActModuleTestCardBoxCaseTemperature; |
|
|
|
import com.dreamworks.boditech.driver.actuator.ActuatorModule; |
|
|
|
import com.dreamworks.boditech.driver.entity.*; |
|
|
|
import com.dreamworks.boditech.driver.task.Executor; |
|
|
|
import com.dreamworks.boditech.entity.MdbTestTubeRackTestTask; |
|
|
|
import com.dreamworks.boditech.service.DeviceService; |
|
|
|
import com.dreamworks.boditech.utils.I18n; |
|
|
@ -133,54 +134,21 @@ public class DeviceController extends BaseController { |
|
|
|
return this.success(); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ResponseBody |
|
|
|
@PostMapping("/api/device/power-off") |
|
|
|
public ApiResponse powerOff() { |
|
|
|
DeviceService theDeviceService = this.deviceService; |
|
|
|
TimerTask timerTask = new TimerTask() { |
|
|
|
@Override |
|
|
|
public void run() { |
|
|
|
theDeviceService.powerOff(); |
|
|
|
} |
|
|
|
}; |
|
|
|
Timer timer = new Timer(); |
|
|
|
timer.schedule(timerTask, 1000); |
|
|
|
@PostMapping("/api/device/reboot") |
|
|
|
public ApiResponse reboot() { |
|
|
|
this.deviceService.reboot(); |
|
|
|
return this.success(); |
|
|
|
} |
|
|
|
|
|
|
|
@ResponseBody |
|
|
|
@PostMapping("/api/device/reboot") |
|
|
|
public ApiResponse reboot() { |
|
|
|
DeviceService theDeviceService = this.deviceService; |
|
|
|
TimerTask timerTask = new TimerTask() { |
|
|
|
@Override |
|
|
|
public void run() { |
|
|
|
theDeviceService.reboot(); |
|
|
|
} |
|
|
|
}; |
|
|
|
Timer timer = new Timer(); |
|
|
|
timer.schedule(timerTask, 1000); |
|
|
|
@PostMapping("/api/device/power-off") |
|
|
|
public ApiResponse powerOff() { |
|
|
|
// 这里只是同步一下系统状态,接口返回之后由前台提示可以拔电源了 ~~~~ |
|
|
|
this.deviceService.poweroff(); |
|
|
|
return this.success(); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ResponseBody |
|
|
|
@PostMapping("/api/device/status-get") |
|
|
|
public ApiResponse status() { |
|
|
@ -195,42 +163,17 @@ public class DeviceController extends BaseController { |
|
|
|
statusName = I18n.t("device.status.consumablesLoaded"); |
|
|
|
} |
|
|
|
if ( this.deviceService.isExecutorRunning() ) { |
|
|
|
// status = this.deviceService.getExecutorWorkingStatus(); |
|
|
|
status = "RUNNING"; |
|
|
|
statusName = "运行中"; |
|
|
|
Executor executor = this.deviceService.getTaskExecutor(); |
|
|
|
status = executor.getWorkingStatus(); |
|
|
|
statusName = I18n.t("device.status." + status); |
|
|
|
} |
|
|
|
return this.success(Map.of("status", status, "statusName", statusName)); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ResponseBody |
|
|
|
@PostMapping("/api/device/restore") |
|
|
|
public ApiResponse restore() { |
|
|
|
// 忘了这个时干嘛的了 ~~~~ 先留着, 确认后在处理 |
|
|
|
this.deviceService.reset(); |
|
|
|
return this.success(); |
|
|
|
} |
|
|
|