白凤吉 2 months ago
parent
commit
c31727c8ea
  1. 13
      src/main/java/com/iflytop/gd/app/controller/SystemController.java
  2. 17
      src/main/java/com/iflytop/gd/app/controller/TestController.java

13
src/main/java/com/iflytop/gd/app/controller/SystemController.java

@ -24,19 +24,6 @@ public class SystemController {
private final SystemConfigService systemConfigService;
private final DeviceStateService deviceStateService;
@Operation(summary = "是否启动虚拟模式")
@PostMapping("/virtual")
public Result<?> changeVirtualMode(Boolean mode) {
deviceStateService.getDeviceState().setVirtual(mode);
return Result.success();
}
@Operation(summary = "模拟向硬件写入完毕")
@PostMapping("/initComplete")
public Result<?> setInitComplete(Boolean initComplete) {
deviceStateService.getDeviceState().setInitComplete(initComplete);
return Result.success();
}
@Operation(summary = "系统状态")
@GetMapping("/device-status")

17
src/main/java/com/iflytop/gd/app/controller/TestController.java

@ -36,6 +36,21 @@ public class TestController {
private final OtherModuleService otherModuleService;
private final DeviceEmergencyStopService deviceEmergencyStopService;
@Operation(summary = "启动虚拟模式")
@PostMapping("/virtual")
public Result<?> changeVirtualMode() {
deviceStateService.getDeviceState().setVirtual(true);
deviceStateService.getDeviceState().setInitComplete(true);
return Result.success();
}
@Operation(summary = "模拟向硬件写入完毕")
@PostMapping("/initComplete")
public Result<?> setInitComplete(Boolean initComplete) {
deviceStateService.getDeviceState().setInitComplete(initComplete);
return Result.success();
}
@Operation(summary = "获取所有传感器读数")
@GetMapping("/all-sensor")
public Result<List<AllSensorDTO>> getAllSensor() throws HardwareException {
@ -57,7 +72,6 @@ public class TestController {
return Result.success();
}
@Operation(summary = "获取指令互斥状态")
@GetMapping("/mutex-state")
public Result<CommandMutexState> getCommandMutexState() throws HardwareException {
@ -71,7 +85,6 @@ public class TestController {
return Result.success();
}
@Operation(summary = "触发急停")
@PostMapping("/press-emergency-stop")
public Result<?> pressEmergencyStop() throws Exception {

Loading…
Cancel
Save