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