Merge remote-tracking branch 'origin/develop' into develop
This commit is contained in:
commit
a101e251a3
|
@ -0,0 +1,33 @@
|
||||||
|
package com.isu.gaswellwatch.modbus.data.decode.impl;
|
||||||
|
|
||||||
|
import com.isu.gaswellwatch.modbus.data.ModbusMessage;
|
||||||
|
import com.isu.gaswellwatch.modbus.data.decode.DecodeHandler;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 无符号整数转换
|
||||||
|
*
|
||||||
|
* @author <a href="mailto:scwsl@foxmail.com">王仕龙</a>
|
||||||
|
* 2024/12/10 22:48
|
||||||
|
*/
|
||||||
|
@Component(UnsignedNumberDecodeHandler.NAME + DecodeHandler.DECODE_NAME)
|
||||||
|
public class UnsignedNumberDecodeHandler implements DecodeHandler {
|
||||||
|
public static final String NAME = "unsignedNumber";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String decode(Map<String, Object> commandPointMap, String value) {
|
||||||
|
if (StringUtils.isBlank(value)) {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
return String.valueOf(Integer.parseInt(value, 16));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void decode(Map<String, Object> commandPointMap, ModbusMessage.MessagePoint point) {
|
||||||
|
point.setValue(this.decode(commandPointMap, point.getOriginalValue()));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -17,7 +17,7 @@ import java.util.List;
|
||||||
/**
|
/**
|
||||||
* 套压模式
|
* 套压模式
|
||||||
*
|
*
|
||||||
* @author <a href="mailto:shilong.wang@alpha-ess.com">王仕龙</a>
|
* @author <a href="mailto:scwsl@foxmail.com">王仕龙</a>
|
||||||
* 2024/12/11 9:22
|
* 2024/12/11 9:22
|
||||||
*/
|
*/
|
||||||
@Getter
|
@Getter
|
||||||
|
|
|
@ -14,7 +14,7 @@ import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author <a href="mailto:shilong.wang@alpha-ess.com">王仕龙</a>
|
* @author <a href="mailto:scwsl@foxmail.com">王仕龙</a>
|
||||||
* 2024/12/11 9:20
|
* 2024/12/11 9:20
|
||||||
*/
|
*/
|
||||||
@Getter
|
@Getter
|
||||||
|
|
|
@ -14,7 +14,7 @@ import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author <a href="mailto:shilong.wang@alpha-ess.com">王仕龙</a>
|
* @author <a href="mailto:scwsl@foxmail.com">王仕龙</a>
|
||||||
* 2024/12/11 9:22
|
* 2024/12/11 9:22
|
||||||
*/
|
*/
|
||||||
@Getter
|
@Getter
|
||||||
|
|
|
@ -19,7 +19,7 @@ import java.util.List;
|
||||||
/**
|
/**
|
||||||
* 套压模式
|
* 套压模式
|
||||||
*
|
*
|
||||||
* @author <a href="mailto:shilong.wang@alpha-ess.com">王仕龙</a>
|
* @author <a href="mailto:scwsl@foxmail.com">王仕龙</a>
|
||||||
* 2024/12/10 17:01
|
* 2024/12/10 17:01
|
||||||
*/
|
*/
|
||||||
@Getter
|
@Getter
|
||||||
|
|
|
@ -16,7 +16,7 @@ import java.util.List;
|
||||||
/**
|
/**
|
||||||
* 采样间隔
|
* 采样间隔
|
||||||
*
|
*
|
||||||
* @author <a href="mailto:shilong.wang@alpha-ess.com">王仕龙</a>
|
* @author <a href="mailto:scwsl@foxmail.com">王仕龙</a>
|
||||||
* 2024/12/10 17:24
|
* 2024/12/10 17:24
|
||||||
*/
|
*/
|
||||||
@Getter
|
@Getter
|
||||||
|
|
|
@ -17,7 +17,7 @@ import java.util.List;
|
||||||
/**
|
/**
|
||||||
* 时间模式
|
* 时间模式
|
||||||
*
|
*
|
||||||
* @author <a href="mailto:shilong.wang@alpha-ess.com">王仕龙</a>
|
* @author <a href="mailto:scwsl@foxmail.com">王仕龙</a>
|
||||||
* 2024/12/10 16:57
|
* 2024/12/10 16:57
|
||||||
*/
|
*/
|
||||||
@Getter
|
@Getter
|
||||||
|
|
Loading…
Reference in New Issue