Browse Source

fix:保证多线程时间获取设备状态立即从内存中获取

master
白凤吉 5 days ago
parent
commit
317ef4ef96
  1. 14
      src/main/java/com/iflytop/handacid/app/core/state/ChannelState.java
  2. 2
      src/main/java/com/iflytop/handacid/app/core/state/DeviceState.java

14
src/main/java/com/iflytop/handacid/app/core/state/ChannelState.java

@ -17,31 +17,31 @@ import org.springframework.stereotype.Component;
@JsonIgnoreProperties(value = {"advisors", "frozen", "preFiltered", "proxyTargetClass", "targetSource", "exposeProxy", "advisorCount", "proxiedInterfaces", "targetClass"})
public class ChannelState {
@Schema(description = "通道code")
private ChannelCode channelCode;
private volatile ChannelCode channelCode;
@Schema(description = "当前通道状态")
private ChannelStateCode stateCode = ChannelStateCode.IDLE;
private volatile ChannelStateCode stateCode = ChannelStateCode.IDLE;
@Schema(description = "是否已预充")
private volatile boolean pre = false;
@Schema(description = "剩余容量(单位:mL)")
private Double remainingVolume;
private volatile Double remainingVolume;
@Schema(description = "溶液id")
private Long solutionId;
private volatile Long solutionId;
@Schema(description = "溶液名称")
private String solutionName;
private volatile String solutionName;
@Schema(description = "溶液浓度")
private String concentration;
private volatile String concentration;
@Schema(description = "是否选中")
private volatile boolean selected = false;
@Schema(description = "目标加液量(单位:mL)")
private Double targetVolume;
private volatile Double targetVolume;
public ChannelState(ChannelCode channelCode, Double remainingVolume, Long solutionId, String solutionName, String concentration) {
this.channelCode = channelCode;

2
src/main/java/com/iflytop/handacid/app/core/state/DeviceState.java

@ -35,7 +35,7 @@ public class DeviceState {
private volatile boolean emergencyStop = false;
@Schema(description = "当前登录用户")
private User currentUser;
private volatile User currentUser;
public JSONObject toJSON() {
JSONObject json = new JSONObject();

Loading…
Cancel
Save