|
@@ -8,6 +8,7 @@ package com.example.backend.dds;/*
|
|
|
import DDS.*;
|
|
|
import OpenDDS.DCPS.*;
|
|
|
import OpenDDS.DCPS.transport.*;
|
|
|
+import com.example.backend.model.MessageStatus;
|
|
|
import com.example.backend.model.Position;
|
|
|
import org.omg.CORBA.StringSeqHolder;
|
|
|
import Messenger.*;
|
|
@@ -34,6 +35,7 @@ public class DataReaderListenerImpl extends DDS._DataReaderListenerLocalBase {
|
|
|
public Map<String, Position> radarPositionMap = new ConcurrentHashMap<>();
|
|
|
public Map<String, List<String>> coopTeamMap = new ConcurrentHashMap<>();
|
|
|
public final Map<String, List<com.example.backend.model.Message>> messageList = new ConcurrentHashMap<>();
|
|
|
+ public Map<String, MessageStatus> messageStatusMap = new ConcurrentHashMap<>();
|
|
|
|
|
|
private void initialize_counts() {
|
|
|
if (counts.size() > 0) {
|
|
@@ -161,6 +163,7 @@ public class DataReaderListenerImpl extends DDS._DataReaderListenerLocalBase {
|
|
|
}
|
|
|
}
|
|
|
if(mh.value.subject.equals("5")){
|
|
|
+ //收到雷达脉冲消息
|
|
|
String[] s = mh.value.from.split(" ");
|
|
|
String recivier = s[2];
|
|
|
String sender = s[0];
|
|
@@ -170,6 +173,7 @@ public class DataReaderListenerImpl extends DDS._DataReaderListenerLocalBase {
|
|
|
|
|
|
}
|
|
|
if(mh.value.subject.equals("6")){
|
|
|
+ //收到电子干扰消息
|
|
|
String[] s = mh.value.from.split(" ");
|
|
|
String recivier = s[2];
|
|
|
String sender = s[0];
|
|
@@ -179,6 +183,7 @@ public class DataReaderListenerImpl extends DDS._DataReaderListenerLocalBase {
|
|
|
|
|
|
}
|
|
|
if(mh.value.subject.equals("7")){
|
|
|
+ //收到综合情报消息
|
|
|
String[] s = mh.value.from.split(" ");
|
|
|
String recivier = s[2];
|
|
|
String sender = s[0];
|
|
@@ -204,6 +209,31 @@ public class DataReaderListenerImpl extends DDS._DataReaderListenerLocalBase {
|
|
|
}
|
|
|
isTeam = 1;
|
|
|
}
|
|
|
+ if(mh.value.subject.equals("9")){
|
|
|
+ //收到分组状态参数控制
|
|
|
+ String message = mh.value.text;
|
|
|
+ String[] s = message.split(" ");
|
|
|
+ MessageStatus m = new MessageStatus();
|
|
|
+ m.startUp = s[1];
|
|
|
+ m.quite = s[2];
|
|
|
+ m.mode = s[3];
|
|
|
+ messageStatusMap.put(s[0],m);
|
|
|
+ }
|
|
|
+ if(mh.value.subject.equals("10")){
|
|
|
+ //收到分组状态参数初始化
|
|
|
+ String message = mh.value.text;
|
|
|
+ String[] messageList = message.split("\n");
|
|
|
+ String[] countList = messageList[0].split(" ");
|
|
|
+ for(int i=1;i<=Integer.parseInt(countList[0]);i++){
|
|
|
+ String[] s = messageList[i].split(" ");
|
|
|
+ String platformID = s[0];
|
|
|
+ MessageStatus m = new MessageStatus();
|
|
|
+ m.startUp = s[1];
|
|
|
+ m.quite = s[2];
|
|
|
+ m.mode = s[3];
|
|
|
+ messageStatusMap.put(platformID,m);
|
|
|
+ }
|
|
|
+ }
|
|
|
if (invalid_count == true) {
|
|
|
System.out.println("ERROR: Invalid message.count (" + mh.value.count + ")");
|
|
|
}
|
|
@@ -270,6 +300,7 @@ public class DataReaderListenerImpl extends DDS._DataReaderListenerLocalBase {
|
|
|
this.radarPositionMap.clear();
|
|
|
this.coopTeamMap.clear();
|
|
|
this.messageList.clear();
|
|
|
+ this.messageStatusMap.clear();
|
|
|
this.isInit = 0;
|
|
|
this.isRecall = 0;
|
|
|
this.isTeam = 0;
|