This commit is contained in:
qinjie 2024-12-17 14:32:36 +08:00
commit 13dbc9eabb
3 changed files with 37 additions and 6 deletions

View File

@ -12,7 +12,7 @@ import java.util.HashSet;
import java.util.Set; import java.util.Set;
/** /**
* @author <a href="mailto:shilong.wang@alpha-ess.com">王仕龙</a> * @author <a href="mailto:scwsl@foxmail.com">王仕龙</a>
* 2024/12/9 12:34 * 2024/12/9 12:34
*/ */
@Service @Service

View File

@ -3,10 +3,8 @@ package com.isu.gaswellwatch.vo.command;
import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.isu.gaswellwatch.dto.modbus.ModbusCommandDto; import com.isu.gaswellwatch.dto.modbus.ModbusCommandDto;
import com.isu.gaswellwatch.vo.command.etc.CasPressureOptimization; import com.isu.gaswellwatch.vo.command.etc.*;
import com.isu.gaswellwatch.vo.command.etc.PlungerTimer; import com.isu.gaswellwatch.vo.command.knpcv1.mode.TimingMode;
import com.isu.gaswellwatch.vo.command.etc.SensorDelay;
import com.isu.gaswellwatch.vo.command.etc.TubPressureOptimization;
import com.isu.gaswellwatch.vo.command.knpcv1.mode.*; import com.isu.gaswellwatch.vo.command.knpcv1.mode.*;
import com.isu.gaswellwatch.vo.command.scss.*; import com.isu.gaswellwatch.vo.command.scss.*;
import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.NotBlank;
@ -39,9 +37,10 @@ import java.util.Objects;
@JsonSubTypes.Type(value = TimePressureMode.class, name = Command.KNPCV1_RUN_TIME_PRESSURE), @JsonSubTypes.Type(value = TimePressureMode.class, name = Command.KNPCV1_RUN_TIME_PRESSURE),
@JsonSubTypes.Type(value = SensorDelay.class, name = Command.ETC_SENSOR_DELAY), @JsonSubTypes.Type(value = SensorDelay.class, name = Command.ETC_SENSOR_DELAY),
@JsonSubTypes.Type(value = PlungerTimer.class, name = Command.ETC_PLUNGER_TIMER), @JsonSubTypes.Type(value = PlungerTimer.class, name = Command.ETC_PLUNGER_TIMER),
@JsonSubTypes.Type(value = com.isu.gaswellwatch.vo.command.etc.TimingMode.class, name = Command.ETC_TIMING_MODE), @JsonSubTypes.Type(value = TimeFormat.class, name = Command.ETC_TIME_FORMAT),
@JsonSubTypes.Type(value = TubPressureOptimization.class, name = Command.ETC_TUB_PRESSURE_OPTIMIZATION), @JsonSubTypes.Type(value = TubPressureOptimization.class, name = Command.ETC_TUB_PRESSURE_OPTIMIZATION),
@JsonSubTypes.Type(value = CasPressureOptimization.class, name = Command.ETC_CAS_PRESSURE_OPTIMIZATION), @JsonSubTypes.Type(value = CasPressureOptimization.class, name = Command.ETC_CAS_PRESSURE_OPTIMIZATION),
@JsonSubTypes.Type(value = com.isu.gaswellwatch.vo.command.etc.TimingMode.class, name = Command.ETC_TIMING_MODE),
@JsonSubTypes.Type(value = SystemInfo.class, name = Command.SCSS_SYSTEM_INFO), @JsonSubTypes.Type(value = SystemInfo.class, name = Command.SCSS_SYSTEM_INFO),
@JsonSubTypes.Type(value = ControlMode.class, name = Command.SCSS_CONTROL_MODE), @JsonSubTypes.Type(value = ControlMode.class, name = Command.SCSS_CONTROL_MODE),
@JsonSubTypes.Type(value = SimpleLogicMode.class, name = Command.SCSS_SIMPLE_LOGIC_MODE), @JsonSubTypes.Type(value = SimpleLogicMode.class, name = Command.SCSS_SIMPLE_LOGIC_MODE),
@ -99,6 +98,8 @@ public abstract class Command implements Serializable {
/* 点表类型SCSS end */ /* 点表类型SCSS end */
/* 点表类型ETC start */ /* 点表类型ETC start */
/* 设置ETC设备时间格式 */
public static final String ETC_TIME_FORMAT = "ETC.TIME_FORMAT";
/* 开关井 */ /* 开关井 */
public static final String ETC_TURN_ON_THE_WELL = "ETC.TURN_ON_THE_WELL"; public static final String ETC_TURN_ON_THE_WELL = "ETC.TURN_ON_THE_WELL";
public static final String ETC_TURN_OFF_THE_WELL = "ETC.TURN_OFF_THE_WELL"; public static final String ETC_TURN_OFF_THE_WELL = "ETC.TURN_OFF_THE_WELL";

View File

@ -0,0 +1,30 @@
package com.isu.gaswellwatch.vo.command.etc;
import com.isu.gaswellwatch.dto.modbus.ModbusCommandDto;
import com.isu.gaswellwatch.vo.command.Command;
import java.io.Serial;
import java.util.Collection;
import java.util.List;
/**
* @author <a href="mailto:scwsl@foxmail.com">王仕龙</a>
* 2024/12/15 12:18
*/
public class TimeFormat extends Command {
@Serial
private static final long serialVersionUID = -6432532154699093296L;
public TimeFormat() {
this.setCode("ETC.TIME_FORMAT");
}
@Override
protected Collection<ModbusCommandDto> builderModbusCommand() {
// 0:0007 Current Time Format 0-Seconds; 1-H:M:S
// 01 05 00 06 FF 00 6C 3B
return List.of(ModbusCommandDto.builder().command("01050006FF00").length(16).build());
}
}