Browse Source

fix:修改设备状态

master
白凤吉 5 days ago
parent
commit
973c143054
  1. 4
      src/main/java/com/iflytop/handacid/app/core/state/ChannelState.java
  2. 4
      src/main/java/com/iflytop/handacid/app/core/state/DeviceState.java
  3. 16
      src/main/java/com/iflytop/handacid/app/model/bo/ChannelSolution.java

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

@ -3,6 +3,7 @@ package com.iflytop.handacid.app.core.state;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.iflytop.handacid.app.common.enums.ChannelCode;
import com.iflytop.handacid.app.common.enums.ChannelStateCode;
import com.iflytop.handacid.app.model.bo.ChannelSolution;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.RequiredArgsConstructor;
@ -25,4 +26,7 @@ public class ChannelState {
@Schema(description = "剩余容量(单位:mL)")
private Double remainingVolume;
@Schema(description = "通道配置的溶液")
private ChannelSolution solution;
}

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

@ -14,9 +14,6 @@ import java.util.Map;
@Data
@Component
public class DeviceState {
@Schema(description = "当前设备是否暂停")
private volatile boolean craftsPaused = false;
@Schema(description = "通道状态")
private final Map<Integer, ChannelState> channelStateMap = new HashMap<>();
@ -32,7 +29,6 @@ public class DeviceState {
public JSONObject toJSON() {
JSONObject json = new JSONObject();
json.putOnce("channelState", new ArrayList<>(channelStateMap.values()));
json.putOnce("craftsPaused", craftsPaused);
json.putOnce("virtual", virtual);
json.putOnce("emergencyStop", emergencyStop);
json.putOnce("currentUser", currentUser);

16
src/main/java/com/iflytop/handacid/app/model/bo/ChannelSolution.java

@ -0,0 +1,16 @@
package com.iflytop.handacid.app.model.bo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@Data
public class ChannelSolution {
private Long id;
@Schema(description = "溶液名称")
private String name;
@Schema(description = "溶液浓度")
private String concentration;
}
Loading…
Cancel
Save