|
@ -1,6 +1,5 @@ |
|
|
package com.qyft.ms.app.front.cmd.business; |
|
|
package com.qyft.ms.app.front.cmd.business; |
|
|
|
|
|
|
|
|
import cn.hutool.json.JSONObject; |
|
|
|
|
|
import com.qyft.ms.app.device.status.DeviceStatus; |
|
|
import com.qyft.ms.app.device.status.DeviceStatus; |
|
|
import com.qyft.ms.app.service.SelfTestService; |
|
|
import com.qyft.ms.app.service.SelfTestService; |
|
|
import com.qyft.ms.system.common.annotation.CommandMapping; |
|
|
import com.qyft.ms.system.common.annotation.CommandMapping; |
|
@ -14,11 +13,7 @@ import lombok.RequiredArgsConstructor; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import org.springframework.stereotype.Component; |
|
|
import org.springframework.stereotype.Component; |
|
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
|
import java.util.List; |
|
|
|
|
|
import java.util.concurrent.CompletableFuture; |
|
|
import java.util.concurrent.CompletableFuture; |
|
|
import java.util.concurrent.ExecutionException; |
|
|
|
|
|
import java.util.concurrent.TimeUnit; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 设备自检指令 |
|
|
* 设备自检指令 |
|
@ -39,6 +34,22 @@ public class DeviceSelfTest extends BaseCommandHandler { |
|
|
CommandFuture overallDeviceStatusGetCommandFuture = deviceCommandService.sendCommand(form.getCmdId(), form.getCmdCode(), overallDeviceStatusGetCommand); |
|
|
CommandFuture overallDeviceStatusGetCommandFuture = deviceCommandService.sendCommand(form.getCmdId(), form.getCmdCode(), overallDeviceStatusGetCommand); |
|
|
commandWait(overallDeviceStatusGetCommandFuture); |
|
|
commandWait(overallDeviceStatusGetCommandFuture); |
|
|
|
|
|
|
|
|
|
|
|
boolean xAxisAtOrigin = overallDeviceStatusGetCommandFuture.getResponseResult().getJSONObject("data").getBool("xAxisAtOrigin"); |
|
|
|
|
|
boolean yAxisAtOrigin = overallDeviceStatusGetCommandFuture.getResponseResult().getJSONObject("data").getBool("yAxisAtOrigin"); |
|
|
|
|
|
boolean zAxisAtOrigin = overallDeviceStatusGetCommandFuture.getResponseResult().getJSONObject("data").getBool("zAxisAtOrigin"); |
|
|
|
|
|
|
|
|
|
|
|
selfTestService.getSelfTestStatus().setXAxisAtOrigin(xAxisAtOrigin); |
|
|
|
|
|
selfTestService.getSelfTestStatus().setYAxisAtOrigin(yAxisAtOrigin); |
|
|
|
|
|
selfTestService.getSelfTestStatus().setZAxisAtOrigin(zAxisAtOrigin); |
|
|
|
|
|
|
|
|
|
|
|
if (xAxisAtOrigin && yAxisAtOrigin && zAxisAtOrigin) { |
|
|
|
|
|
deviceStatus.setSelfTestCompleted(true); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/* DeviceCommand overallDeviceStatusGetCommand = DeviceCommandGenerator.overallDeviceStatusGet(); |
|
|
|
|
|
CommandFuture overallDeviceStatusGetCommandFuture = deviceCommandService.sendCommand(form.getCmdId(), form.getCmdCode(), overallDeviceStatusGetCommand); |
|
|
|
|
|
commandWait(overallDeviceStatusGetCommandFuture); |
|
|
|
|
|
|
|
|
CommandFuture motorXOriginCommandFuture = null; |
|
|
CommandFuture motorXOriginCommandFuture = null; |
|
|
CommandFuture motorYOriginCommandFuture = null; |
|
|
CommandFuture motorYOriginCommandFuture = null; |
|
|
CommandFuture motorZOriginCommandFuture = null; |
|
|
CommandFuture motorZOriginCommandFuture = null; |
|
@ -90,7 +101,7 @@ public class DeviceSelfTest extends BaseCommandHandler { |
|
|
deviceStatus.setSelfTestCompleted(true); |
|
|
deviceStatus.setSelfTestCompleted(true); |
|
|
} else { |
|
|
} else { |
|
|
throw new RuntimeException("自检未完成"); |
|
|
throw new RuntimeException("自检未完成"); |
|
|
} |
|
|
|
|
|
|
|
|
}*/ |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |