偏移计算
This commit is contained in:
parent
8455982258
commit
7c85579c86
@ -127,9 +127,7 @@ public class RealtimeDataLogic implements ServiceLogic {
|
|||||||
return new ServiceResult(false);
|
return new ServiceResult(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private CacheRealtimeData translate(RealtimeData realtimeData) throws InvocationTargetException, IllegalAccessException, InstantiationException {
|
||||||
|
|
||||||
private CacheRealtimeData translate(RealtimeData realtimeData) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException, NoSuchFieldException, InstantiationException {
|
|
||||||
|
|
||||||
Class<CacheRealtimeData> crdclz = CacheRealtimeData.class;
|
Class<CacheRealtimeData> crdclz = CacheRealtimeData.class;
|
||||||
Class<RealtimeData> rdclz = RealtimeData.class;
|
Class<RealtimeData> rdclz = RealtimeData.class;
|
||||||
|
|||||||
@ -24,7 +24,11 @@ public class CacheDataUtils {
|
|||||||
Object tarval;
|
Object tarval;
|
||||||
if (tarfield.getType().getSimpleName().equals("Integer")) {
|
if (tarfield.getType().getSimpleName().equals("Integer")) {
|
||||||
if (srcval.length() == 2) {
|
if (srcval.length() == 2) {
|
||||||
tarval = Integer.parseInt(srcval, 16);
|
tarval = Integer.valueOf(srcval, 16);
|
||||||
|
if (tarfield.getName().endsWith("Temperature")) {
|
||||||
|
tarval = (Integer) tarval - 50;
|
||||||
|
tarval = (Integer) tarval > 0 ? tarval : 0;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
tarval = HexUtils.reverseHexInt(srcval);
|
tarval = HexUtils.reverseHexInt(srcval);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user