17 changed files with 145 additions and 4 deletions
-
1build.gradle
-
13src/main/java/com/qyft/ms/app/common/constant/WebSocketMessageType.java
-
27src/main/java/com/qyft/ms/app/core/aspect/DeviceStatusAspect.java
-
7src/main/java/com/qyft/ms/app/device/spray/SprayTaskExecutor.java
-
61src/main/java/com/qyft/ms/app/device/status/DeviceStatus.java
-
3src/main/java/com/qyft/ms/app/device/status/SprayTask.java
-
3src/main/java/com/qyft/ms/app/front/cmd/business/DehumidifierStart.java
-
4src/main/java/com/qyft/ms/app/front/cmd/business/DehumidifierStop.java
-
3src/main/java/com/qyft/ms/app/front/cmd/business/MatrixSprayPause.java
-
2src/main/java/com/qyft/ms/app/front/cmd/business/MatrixSprayStart.java
-
7src/main/java/com/qyft/ms/app/front/cmd/business/MatrixSprayStop.java
-
4src/main/java/com/qyft/ms/app/front/cmd/business/NozzlePipelinePreFill.java
-
3src/main/java/com/qyft/ms/app/front/cmd/business/NozzlePipelinePreFillStop.java
-
3src/main/java/com/qyft/ms/app/front/cmd/business/NozzlePipelineWash.java
-
3src/main/java/com/qyft/ms/app/front/cmd/business/SyringePipelineWash.java
-
3src/main/java/com/qyft/ms/app/front/cmd/business/SyringePipelineWashStop.java
-
2src/main/java/com/qyft/ms/app/service/SelfTestService.java
@ -0,0 +1,27 @@ |
|||||
|
package com.qyft.ms.app.core.aspect; |
||||
|
|
||||
|
import com.qyft.ms.app.common.constant.WebSocketMessageType; |
||||
|
import com.qyft.ms.app.device.status.DeviceStatus; |
||||
|
import com.qyft.ms.system.service.WebSocketService; |
||||
|
import lombok.RequiredArgsConstructor; |
||||
|
import org.aspectj.lang.JoinPoint; |
||||
|
import org.aspectj.lang.annotation.After; |
||||
|
import org.aspectj.lang.annotation.Aspect; |
||||
|
import org.aspectj.lang.annotation.Pointcut; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
@Aspect |
||||
|
@Component |
||||
|
@RequiredArgsConstructor |
||||
|
public class DeviceStatusAspect { |
||||
|
private final WebSocketService webSocketService; |
||||
|
|
||||
|
@Pointcut("execution(* com.qyft.ms.app.device.status.DeviceStatus.set*(..))") |
||||
|
public void setterMethods() { |
||||
|
} |
||||
|
|
||||
|
@After("setterMethods()") |
||||
|
public void afterSetter(JoinPoint joinPoint) throws Throwable { |
||||
|
webSocketService.pushMsg(WebSocketMessageType.DEVICE_STATUS_CHANGE, DeviceStatus.getInstance()); |
||||
|
} |
||||
|
} |
@ -0,0 +1,61 @@ |
|||||
|
package com.qyft.ms.app.device.status; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* 设备运行状态 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class DeviceStatus { |
||||
|
|
||||
|
private DeviceStatus() { |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 设备是否正在进行的喷涂任务 |
||||
|
*/ |
||||
|
private volatile boolean spraying = false; |
||||
|
|
||||
|
/** |
||||
|
* 喷涂任务暂停状态 |
||||
|
*/ |
||||
|
private volatile boolean paused = false; |
||||
|
|
||||
|
/** |
||||
|
* 当前状态是否可以暂停 |
||||
|
*/ |
||||
|
private volatile boolean suspendable = false; |
||||
|
|
||||
|
/** |
||||
|
* 是否正在清洗注射器管路 |
||||
|
*/ |
||||
|
private volatile boolean cleaningSyringePipeline = false; |
||||
|
|
||||
|
/** |
||||
|
* 是否正在清洗喷嘴管路 |
||||
|
*/ |
||||
|
private volatile boolean cleaningNozzlePipeline = false; |
||||
|
|
||||
|
/** |
||||
|
* 是否正在预充 |
||||
|
*/ |
||||
|
private volatile boolean prefilling = false; |
||||
|
|
||||
|
/** |
||||
|
* 是否正在除湿 |
||||
|
*/ |
||||
|
private volatile boolean dehumidifierRunning = false; |
||||
|
|
||||
|
/** |
||||
|
* 是否完成自检 |
||||
|
*/ |
||||
|
private volatile boolean selfTestCompleted = false; |
||||
|
|
||||
|
private static class Holder { |
||||
|
private static final DeviceStatus INSTANCE = new DeviceStatus(); |
||||
|
} |
||||
|
|
||||
|
public static DeviceStatus getInstance() { |
||||
|
return DeviceStatus.Holder.INSTANCE; |
||||
|
} |
||||
|
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue