新增ETC指令控制代码

This commit is contained in:
wangshilong 2024-12-11 13:52:29 +08:00
parent 7b6f9ff84e
commit 135282fe67
10 changed files with 426 additions and 14 deletions

View File

@ -85,19 +85,20 @@ public class EtcPersistenceHandler extends AbstractPersistenceHandler {
EtcPersistenceHandler.this.setValue(ps, newRow, 16, "minOpenWellTime", Types.VARCHAR); EtcPersistenceHandler.this.setValue(ps, newRow, 16, "minOpenWellTime", Types.VARCHAR);
EtcPersistenceHandler.this.setValue(ps, newRow, 17, "maxOpenWellTime", Types.VARCHAR); EtcPersistenceHandler.this.setValue(ps, newRow, 17, "maxOpenWellTime", Types.VARCHAR);
EtcPersistenceHandler.this.setValue(ps, newRow, 18, "maxCloseWellTime", Types.VARCHAR); EtcPersistenceHandler.this.setValue(ps, newRow, 18, "maxCloseWellTime", Types.VARCHAR);
EtcPersistenceHandler.this.setValue(ps, newRow, 19, "casPressureSwitch", Types.VARCHAR); EtcPersistenceHandler.this.setValue(ps, newRow, 19, "casPressureSwitch", Types.INTEGER);
EtcPersistenceHandler.this.setValue(ps, newRow, 20, "casPressureSensorRange", Types.VARCHAR); EtcPersistenceHandler.this.setValue(ps, newRow, 20, "casPressureSensorRange", Types.DECIMAL);
EtcPersistenceHandler.this.setValue(ps, newRow, 21, "openCasPressure", Types.VARCHAR); EtcPersistenceHandler.this.setValue(ps, newRow, 21, "openCasPressure", Types.DECIMAL);
EtcPersistenceHandler.this.setValue(ps, newRow, 22, "openResetCasPressure", Types.VARCHAR); EtcPersistenceHandler.this.setValue(ps, newRow, 22, "openResetCasPressure", Types.DECIMAL);
EtcPersistenceHandler.this.setValue(ps, newRow, 23, "openCasPressureStableTime", Types.VARCHAR); EtcPersistenceHandler.this.setValue(ps, newRow, 23, "openCasPressureStableTime", Types.VARCHAR);
EtcPersistenceHandler.this.setValue(ps, newRow, 24, "closeCasPressure", Types.VARCHAR); EtcPersistenceHandler.this.setValue(ps, newRow, 24, "closeCasPressure", Types.DECIMAL);
EtcPersistenceHandler.this.setValue(ps, newRow, 25, "closeTripCasPressure", Types.VARCHAR); EtcPersistenceHandler.this.setValue(ps, newRow, 25, "closeTripCasPressure", Types.DECIMAL);
EtcPersistenceHandler.this.setValue(ps, newRow, 26, "closeCasPressureStableTime", Types.VARCHAR); EtcPersistenceHandler.this.setValue(ps, newRow, 26, "closeCasPressureStableTime", Types.VARCHAR);
EtcPersistenceHandler.this.setValue(ps, newRow, 27, "tubPressureSwitch", Types.VARCHAR); EtcPersistenceHandler.this.setValue(ps, newRow, 27, "tubPressureSwitch", Types.VARCHAR);
EtcPersistenceHandler.this.setValue(ps, newRow, 28, "tubPressureSensorRange", Types.VARCHAR); EtcPersistenceHandler.this.setValue(ps, newRow, 28, "tubPressureSensorRange", Types.VARCHAR);
EtcPersistenceHandler.this.setValue(ps, newRow, 29, "openTubPressure", Types.VARCHAR); EtcPersistenceHandler.this.setValue(ps, newRow, 29, "openTubPressure", Types.VARCHAR);
EtcPersistenceHandler.this.setValue(ps, newRow, 30, "openResetTubPressure", Types.VARCHAR); EtcPersistenceHandler.this.setValue(ps, newRow, 30, "openResetTubPressure", Types.VARCHAR);
EtcPersistenceHandler.this.setValue(ps, newRow, 31, "openTubPressureStableTime", Types.VARCHAR); EtcPersistenceHandler.this.setValue(ps, newRow, 31, "openTubPressureStableTime", Types.VARCHAR);
EtcPersistenceHandler.this.setValue(ps, newRow, 32, "prePressure", Types.DECIMAL);
return ps.executeUpdate(); return ps.executeUpdate();
} }
}); });

View File

@ -3,8 +3,10 @@ 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.PlungerTimer; import com.isu.gaswellwatch.vo.command.etc.PlungerTimer;
import com.isu.gaswellwatch.vo.command.etc.SensorDelay; 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;
@ -37,6 +39,9 @@ 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 = TubPressureOptimization.class, name = Command.ETC_TUB_PRESSURE_OPTIMIZATION),
@JsonSubTypes.Type(value = CasPressureOptimization.class, name = Command.ETC_CAS_PRESSURE_OPTIMIZATION),
@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),
@ -100,6 +105,12 @@ public abstract class Command implements Serializable {
/* 模式指令*/ /* 模式指令*/
public static final String ETC_SENSOR_DELAY = "ETC.SENSOR_DELAY"; public static final String ETC_SENSOR_DELAY = "ETC.SENSOR_DELAY";
public static final String ETC_PLUNGER_TIMER = "ETC.PLUNGER_TIMER"; public static final String ETC_PLUNGER_TIMER = "ETC.PLUNGER_TIMER";
/* 计时器模式 */
public static final String ETC_TIMING_MODE = "ETC.TIMING_MODE";
/* 套压优化 */
public static final String ETC_CAS_PRESSURE_OPTIMIZATION = "ETC.CAS_PRESSURE_OPTIMIZATION";
/* 油压优化 */
public static final String ETC_TUB_PRESSURE_OPTIMIZATION = "ETC.TUB_PRESSURE_OPTIMIZATION";
/* 点表类型ETC end */ /* 点表类型ETC end */

View File

@ -0,0 +1,126 @@
package com.isu.gaswellwatch.vo.command.etc;
import com.isu.gaswellwatch.dto.modbus.ModbusCommandDto;
import com.isu.gaswellwatch.vo.command.Command;
import com.isu.gaswellwatch.vo.command.Timing;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.SuperBuilder;
import org.apache.commons.lang3.StringUtils;
import java.io.Serial;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
/**
* 套压模式
*
* @author <a href="mailto:shilong.wang@alpha-ess.com">王仕龙</a>
* 2024/12/11 9:22
*/
@Getter
@Setter
@SuperBuilder
public class CasPressureOptimization extends Command implements Timing {
@Serial
private static final long serialVersionUID = -8310428465448926269L;
/**
* 套压开关
* 261
*/
private boolean casPressureSwitch;
/**
* 套压PSI比例
* 262
*/
private BigDecimal casPressureSensorRange;
/**
* 开井套压
* 263
*/
private BigDecimal openCasPressure;
/**
* 复位套压
* 264
*/
private BigDecimal openResetCasPressure;
/**
* 稳定时间
* 265-267
*/
private String openCasPressureStableTime;
/**
* 关井套压
* 279
*/
private BigDecimal closeCasPressure;
/**
* 跳闸套压
* 280
*/
private BigDecimal closeTripCasPressure;
/**
* 稳定时长
* 281-283
*/
private String closeCasPressureStableTime;
public CasPressureOptimization() {
this.setCode("ETC.CAS_PRESSURE_OPTIMIZATION");
}
@Override
public boolean validate() {
return super.validate()
&& this.openCasPressure.compareTo(BigDecimal.ZERO) >= 0
&& this.closeCasPressure.compareTo(BigDecimal.ZERO) >= 0
&& StringUtils.isNotBlank(this.openCasPressureStableTime)
&& StringUtils.isNotBlank(this.closeCasPressureStableTime)
&& this.openResetCasPressure.compareTo(BigDecimal.ZERO) >= 0
&& this.closeTripCasPressure.compareTo(BigDecimal.ZERO) >= 0
&& this.casPressureSensorRange.compareTo(BigDecimal.ZERO) >= 0;
}
@Override
protected Collection<ModbusCommandDto> builderModbusCommand() {
List<ModbusCommandDto> resultList = new ArrayList<ModbusCommandDto>(6);
StringBuilder command = new StringBuilder(250);
// 261
// 地址码 功能码 起始地址 连续长度 连续字长
// 01 10 0105 0007 0E
command.append("0110010500070E");
command.append("000").append(this.casPressureSwitch ? 1 : 0);
command.append(Long.toHexString(this.casPressureSensorRange.longValue()));
command.append(Long.toHexString(this.openCasPressure.multiply(ONE_THOUSAND).longValue()));
command.append(Long.toHexString(this.openResetCasPressure.multiply(ONE_THOUSAND).longValue()));
command.append(this.toHexString(this.openCasPressureStableTime));
resultList.add(ModbusCommandDto.builder().command(command.toString()).length(16).build());
command.setLength(0);
// 279
// 地址码 功能码 起始地址 连续长度 连续字长
// 01 10 0117 0005 0A
command.append("0110011700050A");
command.append(Long.toHexString(this.closeCasPressure.multiply(ONE_THOUSAND).longValue()));
command.append(Long.toHexString(this.closeTripCasPressure.multiply(ONE_THOUSAND).longValue()));
command.append(this.toHexString(this.closeCasPressureStableTime));
resultList.add(ModbusCommandDto.builder().command(command.toString()).length(16).build());
return resultList;
}
public void setCloseCasPressureStableTime(String closeCasPressureStableTime) {
this.closeCasPressureStableTime = this.timingValidate(closeCasPressureStableTime, "closeCasPressureStableTime");
}
public void setOpenCasPressureStableTime(String openCasPressureStableTime) {
this.openCasPressureStableTime = this.timingValidate(openCasPressureStableTime, "openCasPressureStableTime");
}
}

View File

@ -0,0 +1,176 @@
package com.isu.gaswellwatch.vo.command.etc;
import com.isu.gaswellwatch.dto.modbus.ModbusCommandDto;
import com.isu.gaswellwatch.vo.command.Command;
import com.isu.gaswellwatch.vo.command.Timing;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.SuperBuilder;
import org.apache.commons.lang3.StringUtils;
import java.io.Serial;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
/**
* @author <a href="mailto:shilong.wang@alpha-ess.com">王仕龙</a>
* 2024/12/11 9:20
*/
@Getter
@Setter
@SuperBuilder
public class TimingMode extends Command implements Timing {
@Serial
private static final long serialVersionUID = -1400193679115160928L;
/**
* 最小关井时长
* 100 -> 3
*/
private String minCloseWellTime;
/**
* 目标上升时长
* 106 -> 3
*/
private String plungerRiseTime;
/**
* 最小开井时长
* 121 -> 3
*/
private String minOpenWellTime;
/**
* 最大开井时长
* 130 -> 3
*/
private String maxOpenWellTime;
/**
* 最大关井时长
* 136 -> 3
*/
private String maxCloseWellTime;
/**
* 柱塞未到达关井时长
* 到达传感器延时时间
* 139 -> 3
*/
private String arrivalSensorDelayTime;
/**
* 关井时长
* 142 -> 3
*/
private String wellShutInTime;
/**
* 开井时长
* 续流时间
* 145 -> 3
*/
private String afterFlowTime;
public TimingMode() {
this.setCode("ETC.TIMING_MODE");
}
@Override
public boolean validate() {
return super.validate()
&& StringUtils.isNotBlank(this.afterFlowTime)
&& StringUtils.isNotBlank(this.wellShutInTime)
&& StringUtils.isNotBlank(this.minOpenWellTime)
&& StringUtils.isNotBlank(this.maxOpenWellTime)
&& StringUtils.isNotBlank(this.plungerRiseTime)
&& StringUtils.isNotBlank(this.minCloseWellTime)
&& StringUtils.isNotBlank(this.maxCloseWellTime)
&& StringUtils.isNotBlank(this.arrivalSensorDelayTime);
}
@Override
protected Collection<ModbusCommandDto> builderModbusCommand() {
List<ModbusCommandDto> resultList = new ArrayList<ModbusCommandDto>(6);
StringBuilder command = new StringBuilder(250);
// 100
// 地址码 功能码 起始地址 连续长度 连续字长
// 01 10 0064 0003 06
command.append("011000640000306");
command.append(this.toHexString(this.minCloseWellTime));
resultList.add(ModbusCommandDto.builder().command(command.toString()).length(16).build());
command.setLength(0);
// 106
// 地址码 功能码 起始地址 连续长度 连续字长
// 01 10 006A 0003 06
command.append("0110006A0000306");
command.append(this.toHexString(this.plungerRiseTime));
resultList.add(ModbusCommandDto.builder().command(command.toString()).length(16).build());
command.setLength(0);
// 121
// 地址码 功能码 起始地址 连续长度 连续字长
// 01 10 0079 0003 06
command.append("0110006A0000306");
command.append(this.toHexString(this.minOpenWellTime));
resultList.add(ModbusCommandDto.builder().command(command.toString()).length(16).build());
command.setLength(0);
// 130
// 地址码 功能码 起始地址 连续长度 连续字长
// 01 10 0082 0003 06
command.append("011000820000306");
command.append(this.toHexString(this.maxOpenWellTime));
resultList.add(ModbusCommandDto.builder().command(command.toString()).length(16).build());
command.setLength(0);
// 136
// 地址码 功能码 起始地址 连续长度 连续字长
// 01 10 0088 0006 0C
command.append("01100088000060C");
command.append(this.toHexString(this.maxCloseWellTime));
command.append(this.toHexString(this.arrivalSensorDelayTime));
resultList.add(ModbusCommandDto.builder().command(command.toString()).length(16).build());
command.setLength(0);
// 142
// 地址码 功能码 起始地址 连续长度 连续字长
// 01 10 008E 0006 0C
command.append("0110008E000060C");
command.append(this.toHexString(this.wellShutInTime));
command.append(this.toHexString(this.afterFlowTime));
resultList.add(ModbusCommandDto.builder().command(command.toString()).length(16).build());
return resultList;
}
public void setMinCloseWellTime(String minCloseWellTime) {
this.minCloseWellTime = this.timingValidate(minCloseWellTime, "minCloseWellTime");
}
public void setMaxOpenWellTime(String maxOpenWellTime) {
this.maxOpenWellTime = this.timingValidate(maxOpenWellTime, "maxOpenWellTime");
}
public void setMinOpenWellTime(String minOpenWellTime) {
this.minOpenWellTime = this.timingValidate(minOpenWellTime, "minOpenWellTime");
}
public void setMaxCloseWellTime(String maxCloseWellTime) {
this.maxCloseWellTime = this.timingValidate(maxCloseWellTime, "maxCloseWellTime");
}
public void setArrivalSensorDelayTime(String arrivalSensorDelayTime) {
this.arrivalSensorDelayTime = this.timingValidate(arrivalSensorDelayTime, "arrivalSensorDelayTime");
}
public void setPlungerRiseTime(String plungerRiseTime) {
this.plungerRiseTime = this.timingValidate(plungerRiseTime, "plungerRiseTime");
}
public void setWellShutInTime(String wellShutInTime) {
this.wellShutInTime = this.timingValidate(wellShutInTime, "wellShutInTime");
}
public void setAfterFlowTime(String afterFlowTime) {
this.afterFlowTime = this.timingValidate(afterFlowTime, "afterFlowTime");
}
}

View File

@ -0,0 +1,82 @@
package com.isu.gaswellwatch.vo.command.etc;
import com.isu.gaswellwatch.dto.modbus.ModbusCommandDto;
import com.isu.gaswellwatch.vo.command.Command;
import com.isu.gaswellwatch.vo.command.Timing;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.SuperBuilder;
import org.apache.commons.lang3.StringUtils;
import java.io.Serial;
import java.math.BigDecimal;
import java.util.Collection;
import java.util.List;
/**
* @author <a href="mailto:shilong.wang@alpha-ess.com">王仕龙</a>
* 2024/12/11 9:22
*/
@Getter
@Setter
@SuperBuilder
public class TubPressureOptimization extends Command implements Timing {
@Serial
private static final long serialVersionUID = 6405657928042198221L;
/**
* 套压开关
*/
private boolean tubPressureSwitch;
/**
* 套压PSI比例
*/
private BigDecimal tubPressureSensorRange;
/**
* 开井套压
*/
private BigDecimal openTubPressure;
/**
* 复位套压
*/
private BigDecimal openResetTubPressure;
/**
* 稳定时间
*/
private String openTubPressureStableTime;
public TubPressureOptimization() {
this.setCode("ETC.TUB_PRESSURE_OPTIMIZATION");
}
@Override
public boolean validate() {
return super.validate()
&& this.openTubPressure.compareTo(BigDecimal.ZERO) >= 0
&& StringUtils.isNotBlank(this.openTubPressureStableTime)
&& this.openResetTubPressure.compareTo(BigDecimal.ZERO) >= 0
&& this.tubPressureSensorRange.compareTo(BigDecimal.ZERO) >= 0;
}
@Override
protected Collection<ModbusCommandDto> builderModbusCommand() {
StringBuilder command = new StringBuilder(250);
// 331
// 地址码 功能码 起始地址 连续长度 连续字长
// 01 10 014B 0007 0E
command.append("0110014B00070E");
command.append("000").append(this.tubPressureSwitch ? 1 : 0);
command.append(Long.toHexString(this.tubPressureSensorRange.longValue()));
command.append(Long.toHexString(this.openTubPressure.multiply(ONE_THOUSAND).longValue()));
command.append(Long.toHexString(this.openResetTubPressure.multiply(ONE_THOUSAND).longValue()));
command.append(this.toHexString(this.openTubPressureStableTime));
return List.of(ModbusCommandDto.builder().command(command.toString()).length(16).build());
}
public void setOpenTubPressureStableTime(String openTubPressureStableTime) {
this.openTubPressureStableTime = this.timingValidate(openTubPressureStableTime, "openTubPressureStableTime");
}
}

View File

@ -42,13 +42,13 @@ public class CasingMode extends Command implements Timing {
private BigDecimal wellClosePressureValue = BigDecimal.ZERO; private BigDecimal wellClosePressureValue = BigDecimal.ZERO;
/** /**
* 最小关井时间 * 最小关井时间
* 170 * 170 -> 224
*/ */
@NotBlank(message = "最小关井时间不能为空格式HH:mm:ss") @NotBlank(message = "最小关井时间不能为空格式HH:mm:ss")
private String minWellCloseTimeDuration; private String minWellCloseTimeDuration;
/** /**
* 最大关井时间 * 最大关井时间
* 172 * 172 -> 226
*/ */
@NotBlank(message = "最大关井时间不能为空格式HH:mm:ss") @NotBlank(message = "最大关井时间不能为空格式HH:mm:ss")
private String maxWellCloseTimeDuration; private String maxWellCloseTimeDuration;
@ -60,7 +60,7 @@ public class CasingMode extends Command implements Timing {
@Override @Override
protected Collection<ModbusCommandDto> builderModbusCommand() { protected Collection<ModbusCommandDto> builderModbusCommand() {
List<ModbusCommandDto> resultList = new ArrayList<ModbusCommandDto>(3); List<ModbusCommandDto> resultList = new ArrayList<ModbusCommandDto>(4);
// 地址码 功能码 起始地址 连续长度 连续字长 控制模式 // 地址码 功能码 起始地址 连续长度 连续字长 控制模式
// 01 10 0032 0002 04 6(00000006, 6套压()-套压()模式) // 01 10 0032 0002 04 6(00000006, 6套压()-套压()模式)
resultList.add(ModbusCommandDto.builder().command("0110003200020400000006").length(16).build()); resultList.add(ModbusCommandDto.builder().command("0110003200020400000006").length(16).build());
@ -82,11 +82,20 @@ public class CasingMode extends Command implements Timing {
command.setLength(0); command.setLength(0);
// 地址码 功能码 起始地址 连续长度 连续字长 // 地址码 功能码 起始地址 连续长度 连续字长
// 01 10 00AA 0004 08 // 01 10 00AA 0004 08
command.append("011000E0000204"); command.append("011000AA000204");
command.append(StringUtils.leftPad(Long.toHexString(this.toSeconds(this.minWellCloseTimeDuration)), 8, "0")); command.append(StringUtils.leftPad(Long.toHexString(this.toSeconds(this.minWellCloseTimeDuration)), 8, "0"));
command.append(StringUtils.leftPad(Long.toHexString(this.toSeconds(this.maxWellCloseTimeDuration)), 8, "0")); command.append(StringUtils.leftPad(Long.toHexString(this.toSeconds(this.maxWellCloseTimeDuration)), 8, "0"));
resultList.add(ModbusCommandDto.builder().command(command.toString()).length(16).build()); resultList.add(ModbusCommandDto.builder().command(command.toString()).length(16).build());
return resultList; return resultList;
} }
public void setMaxWellCloseTimeDuration(String maxWellCloseTimeDuration) {
this.maxWellCloseTimeDuration = this.timingValidate(maxWellCloseTimeDuration, "maxWellCloseTimeDuration");
}
public void setMinWellCloseTimeDuration(String minWellCloseTimeDuration) {
this.minWellCloseTimeDuration = this.timingValidate(minWellCloseTimeDuration, "minWellCloseTimeDuration");
}
} }

View File

@ -2,7 +2,6 @@ package com.isu.gaswellwatch.vo.command.scss;
import com.isu.gaswellwatch.dto.modbus.ModbusCommandDto; import com.isu.gaswellwatch.dto.modbus.ModbusCommandDto;
import com.isu.gaswellwatch.vo.command.Command; import com.isu.gaswellwatch.vo.command.Command;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
@ -57,7 +56,7 @@ public class SamplingInterval extends Command {
// 01 10 0054 0004 08 // 01 10 0054 0004 08
command.append("01100054000408"); command.append("01100054000408");
command.append(StringUtils.leftPad(Integer.toHexString(this.continuousSamplingIntervalDuration), 8, "0")); command.append(StringUtils.leftPad(Integer.toHexString(this.continuousSamplingIntervalDuration), 8, "0"));
command.append(StringUtils.leftPad(Integer.toHexString(this.sensorSignalEffectiveLevel.multiply(ONE_HUNDRED).intValue()), 8, "0")); command.append(StringUtils.leftPad(Integer.toHexString(this.sensorSignalEffectiveLevel.intValue()), 8, "0"));
return List.of(ModbusCommandDto.builder().command(command.toString()).length(16).build()); return List.of(ModbusCommandDto.builder().command(command.toString()).length(16).build());
} }
} }

View File

@ -89,3 +89,9 @@ SET `field` = 'prePressure'
WHERE `command_id` = 10102 WHERE `command_id` = 10102
and `field` = 'preTransmission'; and `field` = 'preTransmission';
INSERT INTO `command_points` (`id`, `command_id`, `field`, `name`, `details`, `start_address`, `step_size`, `factor`,
`precision`, `format`, `decode_name`)
VALUES (12031, 10202, 'prePressure', '输压', NULL, 31, 1, 1000.00, 3, NULL, 'factor');

View File

@ -11,6 +11,7 @@ CREATE TABLE `$TableName$`
`current_status_start_time` varchar(30) NULL DEFAULT NULL COMMENT '当前状态开始时间', `current_status_start_time` varchar(30) NULL DEFAULT NULL COMMENT '当前状态开始时间',
`cas_pressure` decimal(10, 1) NULL DEFAULT NULL COMMENT '套压', `cas_pressure` decimal(10, 1) NULL DEFAULT NULL COMMENT '套压',
`oil_pressure` decimal(10, 1) NULL DEFAULT NULL COMMENT '油压', `oil_pressure` decimal(10, 1) NULL DEFAULT NULL COMMENT '油压',
`pre_pressure` decimal(10, 1) NULL DEFAULT NULL COMMENT '输压',
`plunger_rise_time` varchar(10) NULL DEFAULT NULL COMMENT '柱塞上升时间', `plunger_rise_time` varchar(10) NULL DEFAULT NULL COMMENT '柱塞上升时间',
`arrival_sensor_delay_time` varchar(10) NULL DEFAULT NULL COMMENT '到达传感器延时时间', `arrival_sensor_delay_time` varchar(10) NULL DEFAULT NULL COMMENT '到达传感器延时时间',
`well_shut_in_time` varchar(10) NULL DEFAULT NULL COMMENT '关井时间', `well_shut_in_time` varchar(10) NULL DEFAULT NULL COMMENT '关井时间',

View File

@ -8,8 +8,8 @@ INSERT INTO `$TableName$` (`id`, `device_id`, `created_time`, `collection_time`,
`open_cas_pressure`, `open_reset_cas_pressure`, `open_cas_pressure_stable_time`, `open_cas_pressure`, `open_reset_cas_pressure`, `open_cas_pressure_stable_time`,
`close_cas_pressure`, `close_trip_cas_pressure`, `close_cas_pressure_stable_time`, `close_cas_pressure`, `close_trip_cas_pressure`, `close_cas_pressure_stable_time`,
`tub_pressure_switch`, `tub_pressure_sensor_range`, `open_tub_pressure`, `tub_pressure_switch`, `tub_pressure_sensor_range`, `open_tub_pressure`,
`open_reset_tub_pressure`, `open_tub_pressure_stable_time`) `open_reset_tub_pressure`, `open_tub_pressure_stable_time`, `pre_pressure`)
VALUES (?, ?, NOW(), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) VALUES (?, ?, NOW(), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
ON DUPLICATE KEY UPDATE receive_time=VALUES(receive_time), ON DUPLICATE KEY UPDATE receive_time=VALUES(receive_time),
solenoid_valve_status=VALUES(solenoid_valve_status), solenoid_valve_status=VALUES(solenoid_valve_status),
controller_current_status=VALUES(controller_current_status), controller_current_status=VALUES(controller_current_status),
@ -17,6 +17,7 @@ ON DUPLICATE KEY UPDATE receive_time=VALUES(receive_time),
current_status_start_time=VALUES(current_status_start_time), current_status_start_time=VALUES(current_status_start_time),
cas_pressure=VALUES(cas_pressure), cas_pressure=VALUES(cas_pressure),
oil_pressure=VALUES(oil_pressure), oil_pressure=VALUES(oil_pressure),
pre_pressure=VALUES(pre_pressure),
plunger_rise_time=VALUES(plunger_rise_time), plunger_rise_time=VALUES(plunger_rise_time),
arrival_sensor_delay_time=VALUES(arrival_sensor_delay_time), arrival_sensor_delay_time=VALUES(arrival_sensor_delay_time),
well_shut_in_time=VALUES(well_shut_in_time), well_shut_in_time=VALUES(well_shut_in_time),