|
@@ -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); //M_ME_TF_1
|
|
|
maxPointsPerMessage = iec104Config.getFrameAiMax();
|
|
|
} else {
|
|
|
- msg104.setTypeIdentifier(TypeIdentifierEnum.onePointTimeTeleindication); //M_SP_TB_1
|
|
|
maxPointsPerMessage = iec104Config.getFrameDiMax();
|
|
|
}
|
|
|
- //todo: 设置VSQ,可变结构描述限定词
|
|
|
- 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 {
|
|
|
//重置point列表缓存,消息地址,其它内容不变
|
|
|
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); //M_ME_TF_1
|
|
|
+ } else {
|
|
|
+ msg104.setTypeIdentifier(TypeIdentifierEnum.onePointTimeTeleindication); //M_SP_TB_1
|
|
|
+ }
|
|
|
+ //todo: 设置VSQ,可变结构描述限定词
|
|
|
+ msg104.setContinuous(isContinous);
|
|
|
+ msg104.setTerminalAddress(publicAddress);
|
|
|
+ return msg104;
|
|
|
+ }
|
|
|
+
|
|
|
}
|