|
@@ -173,21 +173,15 @@ public class Iec104Session {
|
|
|
|
|
|
private boolean sendPoints(ArrayList<Point> allPoints, boolean isContinous, String pointType) {
|
|
|
List<Point> pointList = new ArrayList<>();
|
|
|
- Iec104Message msg104 = new Iec104Message();
|
|
|
- msg104.setAcceptSeq(acceptSeq);
|
|
|
- msg104.setTransferReason((short)20);
|
|
|
|
|
|
int maxPointsPerMessage = 16;
|
|
|
if ("AI".equals(pointType.toUpperCase())) {
|
|
|
- msg104.setTypeIdentifier(TypeIdentifierEnum.shortFloatingPointTelemetry);
|
|
|
maxPointsPerMessage = iec104Config.getFrameAiMax();
|
|
|
} else {
|
|
|
- msg104.setTypeIdentifier(TypeIdentifierEnum.onePointTimeTeleindication);
|
|
|
maxPointsPerMessage = iec104Config.getFrameDiMax();
|
|
|
}
|
|
|
-
|
|
|
- msg104.setContinuous(isContinous);
|
|
|
- msg104.setTerminalAddress(publicAddress);
|
|
|
+
|
|
|
+ Iec104Message msg104 = createNewMessage(isContinous, pointType);
|
|
|
|
|
|
int firstMsgAddr = allPoints.get(0).getPointAddr();
|
|
|
msg104.setMessageAddress(firstMsgAddr);
|
|
@@ -204,7 +198,9 @@ public class Iec104Session {
|
|
|
|
|
|
if (i < aiList.size()-1) {
|
|
|
pointList = new ArrayList<>();
|
|
|
+ msg104 = createNewMessage(isContinous,pointType);
|
|
|
firstMsgAddr = allPoints.get(i+1).getPointAddr();
|
|
|
+
|
|
|
msg104.setMessageAddress(firstMsgAddr);
|
|
|
}
|
|
|
}
|
|
@@ -222,4 +218,19 @@ public class Iec104Session {
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
+ private Iec104Message createNewMessage(boolean isContinous, String pointType) {
|
|
|
+ Iec104Message msg104 = new Iec104Message();
|
|
|
+ msg104.setAcceptSeq(acceptSeq);
|
|
|
+ msg104.setTransferReason((short)20);
|
|
|
+ if ("AI".equals(pointType.toUpperCase())) {
|
|
|
+ msg104.setTypeIdentifier(TypeIdentifierEnum.shortFloatingPointTelemetry);
|
|
|
+ } else {
|
|
|
+ msg104.setTypeIdentifier(TypeIdentifierEnum.onePointTimeTeleindication);
|
|
|
+ }
|
|
|
+
|
|
|
+ msg104.setContinuous(isContinous);
|
|
|
+ msg104.setTerminalAddress(publicAddress);
|
|
|
+ return msg104;
|
|
|
+ }
|
|
|
+
|
|
|
}
|