|
|
@ -48,64 +48,35 @@ public class DeviceController extends BaseController { |
|
|
|
return this.success(); |
|
|
|
} |
|
|
|
|
|
|
|
@ResponseBody |
|
|
|
@PostMapping("/api/device/test-card-status-get") |
|
|
|
public ApiResponse testCardStatusGet() { |
|
|
|
return this.success(this.deviceService.device.testCards.getAllBoxes()); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ResponseBody |
|
|
|
@PostMapping("/api/device/buffer-tube-status-get") |
|
|
|
public ApiResponse bufferTubeStatusGet() { |
|
|
|
return this.success(this.deviceService.device.bufferTubes.getAllBoxes()); |
|
|
|
} |
|
|
|
|
|
|
|
@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); |
|
|
|
return this.success(); |
|
|
|
@PostMapping("/api/device/pipette-tip-box-status-get") |
|
|
|
public ApiResponse pipetteTipStatusGet() { |
|
|
|
return this.success(this.deviceService.device.pipetteTips.getAll()); |
|
|
|
} |
|
|
|
|
|
|
|
@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); |
|
|
|
return this.success(); |
|
|
|
@PostMapping("/api/device/large-buffer-tube-status-get") |
|
|
|
public ApiResponse largeBufferTubeStatusGet() { |
|
|
|
return this.success(this.deviceService.device.largeBufferTubes.getAll()); |
|
|
|
} |
|
|
|
|
|
|
|
@ResponseBody |
|
|
|
@PostMapping("/api/device/temperature-get") |
|
|
|
public ApiResponse temperatureGet() { |
|
|
|
Integer mid = ActuatorModule.TEST_CARD_BOX_CASE_TEMPERATURE; |
|
|
|
ActModuleTestCardBoxCaseTemperature module = (ActModuleTestCardBoxCaseTemperature)this.deviceService.device.getActuator(mid); |
|
|
|
Double temperature = module.getTemperature(); |
|
|
|
return this.success(Map.of( |
|
|
|
"testCardBoxCase", temperature |
|
|
|
)); |
|
|
|
@PostMapping("/api/device/test-card-update-by-box") |
|
|
|
public ApiResponse testCardUpdateByBox( @RequestBody ParamTestCardUpdateByBox update ) { |
|
|
|
this.deviceService.testCardUpdateByBox(update); |
|
|
|
return this.success(); |
|
|
|
} |
|
|
|
|
|
|
|
@ResponseBody |
|
|
@ -116,51 +87,21 @@ public class DeviceController extends BaseController { |
|
|
|
} |
|
|
|
|
|
|
|
@ResponseBody |
|
|
|
@PostMapping("/api/device/pipette-tip-box-status-get") |
|
|
|
public ApiResponse pipetteTipStatusGet() { |
|
|
|
return this.success(this.deviceService.device.pipetteTips.getAll()); |
|
|
|
} |
|
|
|
|
|
|
|
@ResponseBody |
|
|
|
@PostMapping("/api/device/buffer-tube-update-by-box") |
|
|
|
public ApiResponse bufferTubeUpdateByBox( @RequestBody ParamBufferTubeUpdateByBox param) { |
|
|
|
this.deviceService.bufferTubeUpdateByBox(param); |
|
|
|
this.deviceService.largeBufferTubeUpdate(param); |
|
|
|
return this.success(); |
|
|
|
} |
|
|
|
|
|
|
|
@ResponseBody |
|
|
|
@PostMapping("/api/device/status-get") |
|
|
|
public ApiResponse status() { |
|
|
|
String statusName = I18n.t("device.status.powerOn"); |
|
|
|
String status = "POWER_ON"; |
|
|
|
if ( this.deviceService.device.getIsReady() ) { |
|
|
|
status = "READY"; |
|
|
|
statusName = I18n.t("device.status.ready"); |
|
|
|
} |
|
|
|
if ( this.deviceService.device.testCards.getIsLoaded() ) { |
|
|
|
status = "CONSUMABLES_LOADED"; |
|
|
|
statusName = I18n.t("device.status.consumablesLoaded"); |
|
|
|
} |
|
|
|
if ( this.deviceService.isExecutorRunning() ) { |
|
|
|
// status = this.deviceService.getExecutorWorkingStatus(); |
|
|
|
status = "RUNNING"; |
|
|
|
statusName = "运行中"; |
|
|
|
} |
|
|
|
return this.success(Map.of("status", status, "statusName", statusName)); |
|
|
|
} |
|
|
|
|
|
|
|
@ResponseBody |
|
|
|
@PostMapping("/api/device/incubator-status-get") |
|
|
|
public ApiResponse incubatorStatusGet() { |
|
|
|
Device device = this.deviceService.device; |
|
|
|
ActIncubator incubator = (ActIncubator)device.getActuator(ActuatorModule.INCUBATOR_MOTOR); |
|
|
|
IncubatorSlot[] slots = incubator.getSlots(); |
|
|
|
|
|
|
|
ActModuleIncubatorTemperature temperatureMod = (ActModuleIncubatorTemperature)device.getActuator(ActuatorModule.INCUBATOR_TEMPERATURE); |
|
|
|
Double temperature = temperatureMod.getTemperature(); |
|
|
|
@PostMapping("/api/device/temperature-get") |
|
|
|
public ApiResponse temperatureGet() { |
|
|
|
Integer mid = ActuatorModule.TEST_CARD_BOX_CASE_TEMPERATURE; |
|
|
|
ActModuleTestCardBoxCaseTemperature module = (ActModuleTestCardBoxCaseTemperature)this.deviceService.device.getActuator(mid); |
|
|
|
Double temperature = module.getTemperature(); |
|
|
|
return this.success(Map.of( |
|
|
|
"temperature", temperature, |
|
|
|
"slots", slots |
|
|
|
"testCardBoxCase", temperature |
|
|
|
)); |
|
|
|
} |
|
|
|
|
|
|
@ -181,12 +122,14 @@ public class DeviceController extends BaseController { |
|
|
|
@ResponseBody |
|
|
|
@PostMapping("/api/device/pause") |
|
|
|
public ApiResponse pause() { |
|
|
|
this.deviceService.pause(); |
|
|
|
return this.success(); |
|
|
|
} |
|
|
|
|
|
|
|
@ResponseBody |
|
|
|
@PostMapping("/api/device/resume") |
|
|
|
public ApiResponse resume() { |
|
|
|
this.deviceService.resume(); |
|
|
|
return this.success(); |
|
|
|
} |
|
|
|
|
|
|
@ -204,30 +147,33 @@ public class DeviceController extends BaseController { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ResponseBody |
|
|
|
@PostMapping("/api/device/service-status-get") |
|
|
|
public ApiResponse serviceStatusGet() { |
|
|
|
String deviceConnection = this.deviceService.device.getConnectionStatus(); |
|
|
|
// @TODO : 想个办法获取数据库连接状态 |
|
|
|
String databaseConnection = "connected"; |
|
|
|
return this.success(Map.of( |
|
|
|
"deviceConnection", deviceConnection, |
|
|
|
"databaseConnection", databaseConnection |
|
|
|
)); |
|
|
|
@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); |
|
|
|
return this.success(); |
|
|
|
} |
|
|
|
|
|
|
|
@ResponseBody |
|
|
|
@PostMapping("/api/device/restore") |
|
|
|
public ApiResponse restore() { |
|
|
|
this.deviceService.reset(); |
|
|
|
@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); |
|
|
|
return this.success(); |
|
|
|
} |
|
|
|
|
|
|
@ -235,6 +181,26 @@ public class DeviceController extends BaseController { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ResponseBody |
|
|
|
@PostMapping("/api/device/status-get") |
|
|
|
public ApiResponse status() { |
|
|
|
String statusName = I18n.t("device.status.powerOn"); |
|
|
|
String status = "POWER_ON"; |
|
|
|
if ( this.deviceService.device.getIsReady() ) { |
|
|
|
status = "READY"; |
|
|
|
statusName = I18n.t("device.status.ready"); |
|
|
|
} |
|
|
|
if ( this.deviceService.device.testCards.getIsLoaded() ) { |
|
|
|
status = "CONSUMABLES_LOADED"; |
|
|
|
statusName = I18n.t("device.status.consumablesLoaded"); |
|
|
|
} |
|
|
|
if ( this.deviceService.isExecutorRunning() ) { |
|
|
|
// status = this.deviceService.getExecutorWorkingStatus(); |
|
|
|
status = "RUNNING"; |
|
|
|
statusName = "运行中"; |
|
|
|
} |
|
|
|
return this.success(Map.of("status", status, "statusName", statusName)); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -262,107 +228,51 @@ public class DeviceController extends BaseController { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ResponseBody |
|
|
|
@RequestMapping("/api/device/id-chip-status-get") |
|
|
|
public ApiResponse statusGet() { |
|
|
|
return this.success(Map.of( |
|
|
|
"status" , "OFFLINE" |
|
|
|
)); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ResponseBody |
|
|
|
@PostMapping("/api/device/test-card-load") |
|
|
|
public ApiResponse testCardLoad(@RequestHeader(name="IS-FS-READY",required = false) String isFsReady ) { |
|
|
|
// @TODO : 删除该标记 |
|
|
|
if ( "NO".equals(isFsReady) ) { |
|
|
|
return this.success(); |
|
|
|
} |
|
|
|
|
|
|
|
this.deviceService.testCardLoad(); |
|
|
|
return this.success(); |
|
|
|
} |
|
|
|
|
|
|
|
@ResponseBody |
|
|
|
@PostMapping("/api/device/test-card-update-by-box") |
|
|
|
public ApiResponse testCardUpdateByBox( @RequestBody ParamTestCardUpdateByBox update ) { |
|
|
|
this.deviceService.testCardUpdateByBox(update); |
|
|
|
return this.success(); |
|
|
|
} |
|
|
|
|
|
|
|
@ResponseBody |
|
|
|
@PostMapping("/api/device/test-card-status-get") |
|
|
|
public ApiResponse testCardStatusGet() { |
|
|
|
return this.success(this.deviceService.device.testCards.getAllBoxes()); |
|
|
|
} |
|
|
|
|
|
|
|
@ResponseBody |
|
|
|
@PostMapping("/api/device/buffer-tube-load") |
|
|
|
public ApiResponse bufferTubeLoad() { |
|
|
|
// List<CsmBufferTube> list = this.deviceService.bufferTubeLoad(); |
|
|
|
@PostMapping("/api/device/restore") |
|
|
|
public ApiResponse restore() { |
|
|
|
this.deviceService.reset(); |
|
|
|
return this.success(); |
|
|
|
} |
|
|
|
|
|
|
|
@ResponseBody |
|
|
|
@PostMapping("/api/device/buffer-tube-status-get") |
|
|
|
public ApiResponse bufferTubeStatusGet() { |
|
|
|
return this.success(this.deviceService.device.bufferTubes.getAllBoxes()); |
|
|
|
} |
|
|
|
@PostMapping("/api/device/incubator-status-get") |
|
|
|
public ApiResponse incubatorStatusGet() { |
|
|
|
Device device = this.deviceService.device; |
|
|
|
ActIncubator incubator = (ActIncubator)device.getActuator(ActuatorModule.INCUBATOR_MOTOR); |
|
|
|
IncubatorSlot[] slots = incubator.getSlots(); |
|
|
|
|
|
|
|
@ResponseBody |
|
|
|
@PostMapping("/api/device/large-buffer-tube-load") |
|
|
|
public ApiResponse largeBufferTubeLoad() { |
|
|
|
// List< CsmLargeBufferTube> list = this.deviceService.largeBufferTubeLoad(); |
|
|
|
return this.success(); |
|
|
|
ActModuleIncubatorTemperature temperatureMod = (ActModuleIncubatorTemperature)device.getActuator(ActuatorModule.INCUBATOR_TEMPERATURE); |
|
|
|
Double temperature = temperatureMod.getTemperature(); |
|
|
|
return this.success(Map.of( |
|
|
|
"temperature", temperature, |
|
|
|
"slots", slots |
|
|
|
)); |
|
|
|
} |
|
|
|
|
|
|
|
@ResponseBody |
|
|
|
@PostMapping("/api/device/large-buffer-tube-update") |
|
|
|
public ApiResponse largeBufferTubeUpdate(@RequestBody ParamLargeBufferTubeUpdate param) { |
|
|
|
this.deviceService.largeBufferTubeUpdate(param); |
|
|
|
return this.success(); |
|
|
|
@PostMapping("/api/device/service-status-get") |
|
|
|
public ApiResponse serviceStatusGet() { |
|
|
|
String deviceConnection = this.deviceService.device.getConnectionStatus(); |
|
|
|
// @TODO : 想个办法获取数据库连接状态 |
|
|
|
String databaseConnection = "connected"; |
|
|
|
return this.success(Map.of( |
|
|
|
"deviceConnection", deviceConnection, |
|
|
|
"databaseConnection", databaseConnection |
|
|
|
)); |
|
|
|
} |
|
|
|
|
|
|
|
@ResponseBody |
|
|
|
@PostMapping("/api/device/large-buffer-tube-status-get") |
|
|
|
public ApiResponse largeBufferTubeStatusGet() { |
|
|
|
return this.success(this.deviceService.device.largeBufferTubes.getAll()); |
|
|
|
@RequestMapping("/api/device/id-chip-status-get") |
|
|
|
public ApiResponse statusGet() { |
|
|
|
// @TODO : 这里硬件设备未安装,先这么返回 |
|
|
|
return this.success(Map.of("status" , "OFFLINE")); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ResponseBody |
|
|
|
@PostMapping("/api/device/trash-box-status-get") |
|
|
|
public ApiResponse trashBoxStatusGet() { |
|
|
|
return this.success(Map.of( |
|
|
|
"status", "EMPTY" |
|
|
|
)); |
|
|
|
// @TODO : 这里硬件设备未安装,先这么返回 |
|
|
|
return this.success(Map.of("status", "EMPTY")); |
|
|
|
} |
|
|
|
} |