瀏覽代碼

[修改] 按照修改文档进行修改

zishang 2 月之前
父節點
當前提交
c9a11e3714

+ 6 - 6
src/main/java/com/dc/datachange/core/connection/DDSStatusManger.java

@@ -31,12 +31,12 @@ public class DDSStatusManger {
             sendExecutor.sendInitialReq();
     }
 
-    @Async
-    @Scheduled(fixedDelay = 6000)
-    public void SDRStatus(){
-        if(status ==State.RUNNING)
-            sendExecutor.sendSDRStatusMsg();
-    }
+//    @Async
+//    @Scheduled(fixedDelay = 6000)
+//    public void SDRStatus(){
+//        if(status ==State.RUNNING)
+//            sendExecutor.sendSDRStatusMsg();
+//    }
 
     @Async
     @Bean

+ 3 - 1
src/main/java/com/dc/datachange/core/entity/message/receivedMessage/GroupParamsCtrl.java

@@ -23,11 +23,13 @@ public class GroupParamsCtrl extends ReceivedMessage implements RunningMessage{
             params.setIsOnline(value[1]);
             params.setStatus(value[2]);
             params.setLinkModel(value[3]);
+            params.setGroupID(Integer.valueOf(value[4]));
+            params.setTeamID(Integer.valueOf(value[5]));
             super.from = message.from;
 
             if((from.equals(PlatConstants.INTERFER_TASKSYS)
                     || from.equals(PlatConstants.RADAR_TASKSYS))
-                    && value.length==4){
+                    && value.length==6){
                 validate=true;
             }
         }catch (Exception e){

+ 11 - 0
src/main/java/com/dc/datachange/core/entity/message/sendMessage/GroupParamsCtrl.java

@@ -4,13 +4,24 @@ import Messenger.Message;
 import com.dc.datachange.core.common.MsgConstants;
 import com.dc.datachange.core.common.PlatConstants;
 import com.dc.datachange.core.entity.message.SendMessage;
+import com.dc.datachange.core.entity.networkGroup.NetworkGroup;
+import com.dc.datachange.core.entity.platformInfo.InterferPlatform;
+import com.dc.datachange.core.entity.platformInfo.Platform;
 import com.dc.datachange.core.entity.platformInfo.PlatformParams;
+import com.dc.datachange.core.entity.platformInfo.RadarPlatform;
+import com.dc.datachange.core.exchange.DataManager;
+import com.dc.datachange.utils.MessageUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
 
 public class GroupParamsCtrl extends SendMessage implements SelfMsg{
     private static final String subject = MsgConstants.GROUP_PARAMS_CTRL;
     private static final String from = PlatConstants.EXCHANGE_PLATFORM;
     private final PlatformParams params;
 
+
     public GroupParamsCtrl(PlatformParams params){
         this.params=params;
     }

+ 10 - 2
src/main/java/com/dc/datachange/core/entity/message/sendMessage/GroupParamsInitial.java

@@ -40,10 +40,18 @@ public class GroupParamsInitial extends SendMessage implements ReactiveMsg{
         stringBuilder.append(interferPlatforms.size()).append(" ")
                 .append(radarPlatforms.size()).append(" ");
         for(InterferPlatform interferPlatform: interferPlatforms){
-            stringBuilder.append("\n").append(MessageUtils.GetLineFromPlatFrom(interferPlatform));
+            stringBuilder.append("\n").append(MessageUtils.GetLineFromPlatFrom(interferPlatform))
+                    .append(" ")
+                    .append(interferPlatform.getGroupId() != null ? interferPlatform.getGroupId() : 0)
+                    .append(" ")
+                    .append(interferPlatform.getCollaborationNumber());
         }
         for(RadarPlatform radarPlatform: radarPlatforms){
-            stringBuilder.append("\n").append(MessageUtils.GetLineFromPlatFrom(radarPlatform));
+            stringBuilder.append("\n").append(MessageUtils.GetLineFromPlatFrom(radarPlatform))
+                    .append(" ")
+                    .append(radarPlatform.getGroupId() != null ? radarPlatform.getGroupId() : 0)
+                    .append(" ")
+                    .append(radarPlatform.getCollaborationNumber());
         }
         message.text=stringBuilder.toString();
         return message;

+ 20 - 10
src/main/java/com/dc/datachange/core/entity/message/sendMessage/NetGroupMsg.java

@@ -48,18 +48,28 @@ public class NetGroupMsg extends SendMessage implements ReactiveMsg, SelfMsg {
         List<NetworkGroup> networkGroups = dataManager.getAllData(NetworkGroup.class);
         List<NetworkGroup> interferGroups=networkGroups.stream().filter(NetworkGroup::isInterfer).collect(Collectors.toList());
         List<NetworkGroup> radarGroups=networkGroups.stream().filter(NetworkGroup::isRadar).collect(Collectors.toList());
-        if(interferGroups.size()==0 && radarGroups.size()==0){
+        if(interferGroups.isEmpty() && radarGroups.isEmpty() && networkGroups.isEmpty()){
             return null;
         }
-        //第一行
-        stringBuilder.append(interferGroups.size()).append(" ")
-                .append(radarGroups.size()).append(" ")
-                .append(version++);
-        for(NetworkGroup interferGroup: interferGroups){
-            stringBuilder.append("\n").append(MessageUtils.getLineFromNetworkGroup(interferGroup));
-        }
-        for(NetworkGroup radarGroup: radarGroups){
-            stringBuilder.append("\n").append(MessageUtils.getLineFromNetworkGroup(radarGroup));
+        if("合作条件".equals(networkGroups.get(0).getCoopModel())){
+            //第一行
+            stringBuilder.append(networkGroups.size()).append(" ")
+                    .append(networkGroups.size()).append(" ")
+                    .append(version++);
+            for(NetworkGroup networkGroup:networkGroups){
+                stringBuilder.append("\n").append(MessageUtils.getLineFromNetworkGroup(networkGroup));
+            }
+        }else{
+            //第一行
+            stringBuilder.append(interferGroups.size()).append(" ")
+                    .append(radarGroups.size()).append(" ")
+                    .append(version++);
+            for(NetworkGroup interferGroup: interferGroups){
+                stringBuilder.append("\n").append(MessageUtils.getLineFromNetworkGroup(interferGroup));
+            }
+            for(NetworkGroup radarGroup: radarGroups){
+                stringBuilder.append("\n").append(MessageUtils.getLineFromNetworkGroup(radarGroup));
+            }
         }
         message.text=stringBuilder.toString();
         return message;

+ 5 - 1
src/main/java/com/dc/datachange/core/entity/networkGroup/NetworkGroup.java

@@ -8,6 +8,7 @@ import com.dc.datachange.exception.IllegalTypeException;
 import com.dc.datachange.exception.NameDuplicatedException;
 import com.dc.datachange.exception.PlatChangeException;
 import com.dc.datachange.networkGroup.entity.RawGroup;
+import com.fasterxml.jackson.annotation.JsonIgnore;
 import lombok.Data;
 import lombok.NoArgsConstructor;
 
@@ -41,6 +42,8 @@ public class NetworkGroup {
 
     private List<HistoryMsg> historyMsg;
 
+    private String coopModel;
+
     public NetworkGroup(RawGroup rawGroup) {
         synchronized (NetworkGroup.class){
             if(nameSet.contains(rawGroup.getName())){
@@ -54,6 +57,7 @@ public class NetworkGroup {
             this.communication = rawGroup.isCommunication();
             this.platformSet = new HashSet<>();
             this.historyMsg = new ArrayList<>();
+            this.coopModel = rawGroup.getCoopModel();
         }
     }
 
@@ -80,7 +84,7 @@ public class NetworkGroup {
         return ((NetworkGroup) o).getId()==this.id;
     }
 
-    public Class<? extends Platform> getTypeClass(){
+    public Class<? extends Platform> resolveTypeClass(){
         if(this.type.equals("radar")){
             return RadarPlatform.class;
         }else if(this.type.equals("interference")){

+ 10 - 3
src/main/java/com/dc/datachange/core/entity/platformInfo/InterferPlatform.java

@@ -31,6 +31,12 @@ public class InterferPlatform extends Platform {
      * 2:实物
      */
     private String isPhysical;
+    /**
+     * 是否合作条件
+     * 1:非合作
+     * 2:合作
+     */
+    private String cooperationStatus;
     /**
      * 起始纬度
      * 0-90
@@ -54,9 +60,10 @@ public class InterferPlatform extends Platform {
             this.collaborationNumber = value[1];
             this.strategy = value[2];
             this.isPhysical = value[3];
-            this.latitude = value[4];
-            this.longitude = value[5];
-            this.height = value[6];
+            this.cooperationStatus = value[4];
+            this.latitude = value[5];
+            this.longitude = value[6];
+            this.height = value[7];
             this.groupId=null;
             this.params=new PlatformParams(id);
         }catch (Exception e){

+ 6 - 0
src/main/java/com/dc/datachange/core/entity/platformInfo/PlatformParams.java

@@ -5,6 +5,7 @@ import com.dc.datachange.core.entity.message.sendMessage.SelfMsg;
 import lombok.AllArgsConstructor;
 import lombok.Data;
 import lombok.NoArgsConstructor;
+import org.springframework.stereotype.Component;
 
 @Data
 @AllArgsConstructor
@@ -27,11 +28,16 @@ public class PlatformParams {
      */
     private String linkModel;
 
+    private Integer teamID;
+    private Integer groupID;
+
     public PlatformParams(Integer id){
         this.id=id;
         this.isOnline="开";
         this.status="非静默";
         this.linkModel="实时性";
+        this.teamID=0;
+        this.groupID=0;
     }
     @Override
     public String toString(){

+ 10 - 3
src/main/java/com/dc/datachange/core/entity/platformInfo/RadarPlatform.java

@@ -31,6 +31,12 @@ public class RadarPlatform extends Platform {
      * 2:实物
      */
     private String isPhysical;
+    /**
+     * 是否合作条件
+     * 1:非合作
+     * 2:合作
+     */
+    private String cooperationStatus;
     /**
      * 起始纬度
      * 0-90
@@ -53,9 +59,10 @@ public class RadarPlatform extends Platform {
             this.collaborationNumber = value[1];
             this.strategy = value[2];
             this.isPhysical = value[3];
-            this.latitude = value[4];
-            this.longitude = value[5];
-            this.height = value[6];
+            this.cooperationStatus = value[4];
+            this.latitude = value[5];
+            this.longitude = value[6];
+            this.height = value[7];
             this.groupId = null;
             this.params=new PlatformParams(id);
         }catch (Exception e){

+ 2 - 0
src/main/java/com/dc/datachange/core/exchange/SendExecutor.java

@@ -21,6 +21,7 @@ public class SendExecutor {
     private NetGroupMsg netGroupMsg;
     @Autowired
     private HeartBeatMsg heartBeatMsg;
+
     @Autowired
     private SDRStatusMsg SDRStatusMsg;
     private final Map<String, ReactiveMsg> msgMap=new HashMap<>();
@@ -52,6 +53,7 @@ public class SendExecutor {
     public void sendNetGroupMsg(){
         sendDDS(netGroupMsg);
     }
+
     public void sendSDRStatusMsg(){
         sendDDS(SDRStatusMsg);
     }

+ 21 - 0
src/main/java/com/dc/datachange/messageManager/controller/MessageController.java

@@ -2,20 +2,30 @@ package com.dc.datachange.messageManager.controller;
 
 import com.dc.datachange.core.entity.message.receivedMessage.CompIntelMsg;
 import com.dc.datachange.core.entity.message.receivedMessage.EleInterMsg;
+import com.dc.datachange.core.entity.message.receivedMessage.InitialMessage;
 import com.dc.datachange.core.entity.message.receivedMessage.RadarPulseMsg;
+import com.dc.datachange.core.entity.platformInfo.RadarPlatform;
 import com.dc.datachange.core.exchange.DataManager;
 import com.dc.datachange.utils.PageUtils;
 import com.dc.datachange.utils.R;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
 import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import javax.validation.constraints.NotBlank;
 import java.util.List;
+import java.util.Map;
 
 @RestController
 @RequestMapping("/message")
 public class MessageController {
+    private static final Logger logger = LoggerFactory.getLogger(MessageController.class);
+
     @Autowired
     private DataManager dataManager;
 
@@ -39,4 +49,15 @@ public class MessageController {
         PageUtils pageUtils = new PageUtils(list, dataManager.getCount(CompIntelMsg.class), limit, page);
         return R.ok().put("page", pageUtils);
     }
+
+    //获取合作状态,合作条件 or 非合作条件
+    @GetMapping("/getCooperationStatus")
+    public R getCooperationStatus() {
+        Map<Integer, RadarPlatform> map = dataManager.getMap(RadarPlatform.class);
+        logger.info(map.toString());
+        if (map.isEmpty()){
+            throw new RuntimeException("Radar platform is empty");
+        }
+        return R.ok().put("cooperationStatus", map.entrySet().iterator().next().getValue().getCooperationStatus());
+    }
 }

+ 72 - 24
src/main/java/com/dc/datachange/networkGroup/controller/NetworkController.java

@@ -21,11 +21,9 @@ import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
+import java.util.*;
 import java.util.stream.Collectors;
+import java.util.stream.Stream;
 
 import static com.dc.datachange.utils.MessageUtils.getEdgesFromPlatform;
 
@@ -117,26 +115,56 @@ public class NetworkController {
         if (networkGroup != null) {
             String oldParams = networkGroup.getParams();
             networkGroup.setParams(networkParams.getParams());
+            networkGroup.setCoopModel(networkParams.getCoopModel());
+            networkGroup.setMainStation(networkParams.getMainStation());
             if (networkParams.getPlatformSet() != null && !networkParams.getPlatformSet().isEmpty()) {
                 try {
-                    Set<Platform> collect = networkParams.getPlatformSet().stream()
-                            .map(x -> dataManager.getData(networkGroup.getTypeClass(), x))
-                            .peek(x ->{
-                                if(x.isGrouped() && !networkGroup.inSet(x.getId())){
-                                    throw new PlatUsedException();
-                                }
-                            })
-                            .collect(Collectors.toSet());
-                    if(collect.size()==networkParams.getPlatformSet().size() && !collect.contains(null)) {
-                        networkGroup.getPlatformSet().forEach(x->x.grouped(null));
-                        networkGroup.setPlatformSet(collect);
-                        collect.forEach(x->x.grouped(networkGroup.getId()));
-                        sendExecutor.sendNetGroupMsg();
-                        return R.ok();
-                    }
-                    else{
-                        networkGroup.setParams(oldParams);
-                        return R.error("存在错误类型的平台,修改已取消");
+                    if("合作条件".equals(networkParams.getCoopModel())){
+                        Set<Platform> collect = networkParams.getPlatformSet().stream()
+                                .flatMap(platformId ->
+                                        Stream.of(
+                                                    dataManager.getData(InterferPlatform.class, platformId),
+                                                    dataManager.getData(RadarPlatform.class, platformId)
+                                                )
+                                                .filter(Objects::nonNull) // 过滤 getData 返回的 null
+                                )
+                                .peek(x -> {
+                                    if(x.isGrouped() && !networkGroup.inSet(x.getId())){
+                                        throw new PlatUsedException();
+                                    }
+                                })
+                                .collect(Collectors.toSet());
+                        if(collect.size()==networkParams.getPlatformSet().size() && !collect.contains(null)) {
+                            networkGroup.getPlatformSet().forEach(x->x.grouped(null));
+                            networkGroup.setPlatformSet(collect);
+                            collect.forEach(x->x.grouped(networkGroup.getId()));
+                            sendExecutor.sendNetGroupMsg();
+                            return R.ok();
+                        }
+                        else{
+                            networkGroup.setParams(oldParams);
+                            return R.error("存在错误类型的平台,修改已取消");
+                        }
+                    } else{
+                        Set<Platform> collect = networkParams.getPlatformSet().stream()
+                                .map(x -> dataManager.getData(networkGroup.resolveTypeClass(), x))
+                                .peek(x ->{
+                                    if(x.isGrouped() && !networkGroup.inSet(x.getId())){
+                                        throw new PlatUsedException();
+                                    }
+                                })
+                                .collect(Collectors.toSet());
+                        if(collect.size()==networkParams.getPlatformSet().size() && !collect.contains(null)) {
+                            networkGroup.getPlatformSet().forEach(x->x.grouped(null));
+                            networkGroup.setPlatformSet(collect);
+                            collect.forEach(x->x.grouped(networkGroup.getId()));
+                            sendExecutor.sendNetGroupMsg();
+                            return R.ok();
+                        }
+                        else{
+                            networkGroup.setParams(oldParams);
+                            return R.error("存在错误类型的平台,修改已取消");
+                        }
                     }
                 } catch (IllegalTypeException e) {
                     e.printStackTrace();
@@ -154,6 +182,10 @@ public class NetworkController {
     public R deleteNetworkParams(@RequestParam Integer id){
         NetworkGroup networkGroup = dataManager.getData(NetworkGroup.class, id);
         networkGroup.setParams(null);
+        networkGroup.setMainStation(null);
+
+
+
         networkGroup.getPlatformSet().forEach(x->x.grouped(null));
         networkGroup.setPlatformSet(new HashSet<>());
         sendExecutor.sendNetGroupMsg();
@@ -165,13 +197,13 @@ public class NetworkController {
     @GetMapping("/getRadarStations")
     public R getRadarStations(){
         return R.ok().put("data",dataManager.getAllData(RadarPlatform.class).stream()
-                .map(x-> new StationVo(x.getId(),x.isGrouped()))
+                .map(x-> new StationVo(x.getId(), x.getCollaborationNumber(), x.isGrouped()))
                 .collect(Collectors.toList()));
     }
     @GetMapping("/getInterferStations")
     public R getInterperStations(){
         return R.ok().put("data",dataManager.getAllData(InterferPlatform.class).stream()
-                .map(x-> new StationVo(x.getId(),x.isGrouped()))
+                .map(x-> new StationVo(x.getId(),x.getCollaborationNumber(), x.isGrouped()))
                 .collect(Collectors.toList()));
     }
     @GetMapping("/getInterferChartInfo")
@@ -203,5 +235,21 @@ public class NetworkController {
         return R.ok().put("nodes",nodes).put("edges",edgeList);
     }
 
+    @GetMapping("/getChartInfo")
+    public R getChartInfo(){
+        List<NodeVo> nodes = Stream.concat(
+                        // 获取 RadarPlatform 数据流
+                        dataManager.getAllData(RadarPlatform.class).stream(),
+                        // 获取 InterferPlatform 数据流
+                        dataManager.getAllData(InterferPlatform.class).stream()
+                ).filter(Objects::nonNull) // 过滤 null 元素
+                .map(x -> new NodeVo(x.getId(), x.getId()))
+                .collect(Collectors.toList());
 
+        List<EdgeVo> edgeList =new ArrayList<>();
+        for(NetworkGroup networkGroup: dataManager.getAllData(NetworkGroup.class)){
+            getEdgesFromPlatform(edgeList, networkGroup.getPlatformSet());
+        }
+        return R.ok().put("nodes",nodes).put("edges",edgeList);
+    }
 }

+ 6 - 0
src/main/java/com/dc/datachange/networkGroup/entity/NetworkParams.java

@@ -19,12 +19,18 @@ public class NetworkParams {
     private Set<Integer> platformSet;
     private String type;
 
+    private String coopModel;
+
+    private String mainStation;
+
     public NetworkParams(NetworkGroup group){
         if(group!=null){
             this.type=group.getType();
             this.name=group.getName();
             this.id = group.getId();
             this.params= group.getParams();
+            this.coopModel= group.getCoopModel();
+            this.mainStation= group.getMainStation();
             this.platformSet = group.getPlatformSet()
                     .stream()
                     .map(Platform::getId)

+ 2 - 0
src/main/java/com/dc/datachange/networkGroup/entity/RawGroup.java

@@ -18,4 +18,6 @@ public class RawGroup {
     private String mainStation;
 
     private boolean communication;
+
+    private String coopModel;
 }

+ 5 - 3
src/main/java/com/dc/datachange/networkGroup/entity/StationVo.java

@@ -5,10 +5,12 @@ import lombok.Data;
 @Data
 public class StationVo {
     private Integer id;
+    private String teamID;
     private boolean disabled;
 
-    public StationVo(Integer id, boolean grouped) {
-        this.id=id;
-        this.disabled=grouped;
+    public StationVo(Integer id, String teamID,boolean grouped) {
+        this.id = id;
+        this.teamID = teamID;
+        this.disabled = grouped;
     }
 }

+ 219 - 219
src/main/java/com/dc/datachange/utils/Simulator.java

@@ -1,219 +1,219 @@
-package com.dc.datachange.utils;
-
-import Messenger.Message;
-import com.dc.datachange.core.common.ControlConstants;
-import com.dc.datachange.core.common.MsgConstants;
-import com.dc.datachange.core.common.PlatConstants;
-import com.dc.datachange.core.connection.DDSPublisher;
-import com.dc.datachange.core.entity.networkGroup.NetworkGroup;
-import com.dc.datachange.core.entity.platformInfo.InterferPlatform;
-import com.dc.datachange.core.entity.platformInfo.RadarPlatform;
-import com.dc.datachange.core.exchange.DataManager;
-import com.dc.datachange.networkGroup.controller.NetworkController;
-import com.dc.datachange.networkGroup.entity.NetworkParams;
-import com.dc.datachange.networkGroup.entity.RawGroup;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-
-@RestController
-@RequestMapping("/test")
-public class Simulator {
-    @Autowired
-    private DDSPublisher publisher;
-    @Autowired
-    private DataManager dataManager;
-    @Autowired
-    private NetworkController networkController;
-    private static Integer count=0;
-
-    @GetMapping("/add1")
-    public R addRadarPulse(){
-        count++;
-        publisher.sendMessage(
-                new Message(
-                        PlatConstants.RADAR_TASKSYS+" "+PlatConstants.EXCHANGE_PLATFORM+" "+PlatConstants.EXCHANGE_PLATFORM,
-                        MsgConstants.RADAR_PULSE,
-                        count,
-                        "雷达 空中 21 127 10000 5000 "+count,
-                        count));
-        return R.ok();
-    }
-    @GetMapping("/add2")
-    public R addEleInter(){
-        count++;
-        publisher.sendMessage(
-                new Message(
-                        PlatConstants.RADAR_TASKSYS+" "+PlatConstants.EXCHANGE_PLATFORM+" "+PlatConstants.EXCHANGE_PLATFORM,
-                        MsgConstants.ELECTRIC_INTERFERE,
-                        count,
-                        "宽带干扰 空中 区域A 宽带干扰 未知 否 "+count,
-                        count));
-        return R.ok();
-    }
-    @GetMapping("/add3")
-    public R addComprehen(){
-        count++;
-        publisher.sendMessage(
-                new Message(
-                        PlatConstants.RADAR_TASKSYS+" "+PlatConstants.EXCHANGE_PLATFORM+" "+PlatConstants.EXCHANGE_PLATFORM,
-                        MsgConstants.COMPREHEN_INTELL,
-                        count,
-                        "综合 "+count+" 否 在侦察完成后立刻启动干扰",
-                        count));
-        return R.ok();
-    }
-    @GetMapping("/init")
-    public R init() throws InterruptedException {
-        publisher.sendMessage(
-                new Message(PlatConstants.SUPPORT_PLATFORM,
-                    MsgConstants.INITIAL_MSG,
-                    count,
-                    "6 4\n"+
-                        "104 1 0 1 -1502143.7779720642 5459654.14635412 2925524.054455928\n" +
-                        "105 1 0 1 -1119974.522455073 5202530.972695272 3503886.1094705067\n" +
-                        "103 1 0 1 -1569497.379037304 4803025.549234323 3879026.548666874\n" +
-                        "106 1 0 1 -2853706.7751482297 3559878.3551225117 4441990.145821915\n" +
-                        "101 1 0 1 -2437977.331981979 5037635.193417693 3049012.3329436616\n" +
-                        "102 1 0 1 -2088875.7919909689 4487613.197114771 4008771.869184186\n" +
-                        "201 2 1 1 -2288875.7919909689 4187613.197114771 4058771.869184186\n" +
-                        "202 2 1 1 -2388875.7919909689 4287613.197114771 4108771.869184186\n" +
-                        "203 2 1 1 -2188875.7919909689 4387613.197114771 4208771.869184186\n" +
-                        "204 2 1 1 -2588875.7919909689 4487613.197114771 4078771.869184186",
-                        count));
-        this.addNet1();
-        this.addNet2();
-        this.addNet1();
-        this.addNet2();
-        Thread.sleep(1000);
-        R r = addParams(1, new ArrayList<Integer>() {{
-            add(104);
-            add(105);
-        }});
-        System.out.println(r.toString());
-        R r1 = addParams(2, new ArrayList<Integer>() {{
-            add(201);
-            add(202);
-            add(203);
-        }});
-        System.out.println(r1.toString());
-        return R.ok();
-    }
-    @GetMapping("/initError1")
-    public R initError1(){
-        return addParams(2,new ArrayList<Integer>(){{add(104);add(202);}});
-    }
-    @GetMapping("/initError2")
-    public R initError2(){
-        return addParams(2,new ArrayList<Integer>(){{add(104);add(1111);}});
-    }
-    @GetMapping("/init2")
-    public R init2(){
-        publisher.sendMessage(
-                new Message(PlatConstants.SUPPORT_PLATFORM+" "+PlatConstants.RADAR_TASKSYS,
-                        MsgConstants.INITIAL_MSG,
-                        count,
-                    "6 4\n" +
-                        "104 1 0 1 -1502143.7779720642 5459654.14635412 2925524.054455928\n" +
-                        "105 1 0 1 -1119974.522455073 5202530.972695272 3503886.1094705067\n" +
-                        "103 1 0 1 -1569497.379037304 4803025.549234323 3879026.548666874\n" +
-                        "106 1 0 1 -2853706.7751482297 3559878.3551225117 4441990.145821915\n" +
-                        "101 1 0 1 -2437977.331981979 5037635.193417693 3049012.3329436616\n" +
-                        "102 1 0 1 -2088875.7919909689 4487613.197114771 4008771.869184186\n" +
-                        "201 2 1 1 -2288875.7919909689 4187613.197114771 4058771.869184186\n" +
-                        "202 2 1 1 -2388875.7919909689 4287613.197114771 4108771.869184186\n" +
-                        "203 2 1 1 -2188875.7919909689 4387613.197114771 4208771.869184186\n" +
-                        "204 2 1 1 -2588875.7919909689 4487613.197114771 4078771.869184186",
-                        count));
-        return R.ok();
-    }
-    @GetMapping("/listInter")
-    public R listInter(){
-        return R.ok().put("data", dataManager.getList(InterferPlatform.class,1,100));
-    }
-
-    @GetMapping("/listRadar")
-    public R listRadar(){
-        return R.ok().put("data", dataManager.getList(RadarPlatform.class,1,100));
-    }
-    @GetMapping("/stop")
-    public R stop(){
-        publisher.sendMessage(new Message(
-                PlatConstants.SUPPORT_PLATFORM+" "+PlatConstants.EXCHANGE_PLATFORM,
-                MsgConstants.DAOTIAO_MSG,
-                count,
-                ControlConstants.CTRL_FINISH,
-                count));
-        return R.ok();
-    }
-    @GetMapping("/addNet1")
-    public R addNet1(){
-        count++;
-        NetworkGroup interference =new NetworkGroup(new RawGroup("interference", count.toString(), count.toString(), true));
-        dataManager.addData(interference.getId(),interference);
-        return R.ok();
-    }
-    @GetMapping("/addNet2")
-    public R addNet2(){
-        count++;
-        NetworkGroup radar = new NetworkGroup(new RawGroup("radar", count.toString(), count.toString(), true));
-        dataManager.addData(radar.getId(),radar);
-        return R.ok();
-    }
-    @GetMapping("/listNet")
-    public R listNet(){
-        return R.ok().put("data",dataManager.getList(NetworkGroup.class,1,100));
-    }
-    @GetMapping("/addParams")
-    public R addParams(Integer id, List<Integer> ids){
-        count++;
-        NetworkParams data = new NetworkParams();
-        data.setId(id);
-        data.setParams(count.toString());
-        data.setPlatformSet(new HashSet<>(ids));
-        return networkController.updateNetworkParams(data);
-    }
-    @GetMapping("/addMessage1")
-    public R addMessage1(Integer id1,Integer id2){
-        count++;
-
-        Message message = new Message(
-                id1 + " " + PlatConstants.EXCHANGE_PLATFORM + " " + id2,
-                MsgConstants.RADAR_PULSE,
-                count,
-                "雷达 空中 21 127 10000 5000 " + count,
-                count);
-        publisher.sendMessage(message);
-        return R.ok(message.toString());
-    }
-    @GetMapping("/addMessage2")
-    public R addMessage2(Integer id1,Integer id2){
-        count++;
-        Message message = new Message(
-                id1 + " " + PlatConstants.EXCHANGE_PLATFORM + " " + id2,
-                MsgConstants.ELECTRIC_INTERFERE,
-                count,
-                "宽带干扰 空中 区域A 宽带干扰 未知 否 " + count,
-                count);
-        publisher.sendMessage(message);
-        return R.ok(message.toString());
-    }
-    @GetMapping("/addMessage3")
-    public R addMessage3(Integer id1,Integer id2){
-        count++;
-
-        Message message = new Message(
-                id1 + " " + PlatConstants.EXCHANGE_PLATFORM + " " + id2,
-                MsgConstants.COMPREHEN_INTELL,
-                count,
-                "综合 " + count + " 否 在侦察完成后立刻启动干扰",
-                count);
-        publisher.sendMessage(message);
-        return R.ok(message.toString());
-    }
-}
+//package com.dc.datachange.utils;
+//
+//import Messenger.Message;
+//import com.dc.datachange.core.common.ControlConstants;
+//import com.dc.datachange.core.common.MsgConstants;
+//import com.dc.datachange.core.common.PlatConstants;
+//import com.dc.datachange.core.connection.DDSPublisher;
+//import com.dc.datachange.core.entity.networkGroup.NetworkGroup;
+//import com.dc.datachange.core.entity.platformInfo.InterferPlatform;
+//import com.dc.datachange.core.entity.platformInfo.RadarPlatform;
+//import com.dc.datachange.core.exchange.DataManager;
+//import com.dc.datachange.networkGroup.controller.NetworkController;
+//import com.dc.datachange.networkGroup.entity.NetworkParams;
+//import com.dc.datachange.networkGroup.entity.RawGroup;
+//import org.springframework.beans.factory.annotation.Autowired;
+//import org.springframework.web.bind.annotation.GetMapping;
+//import org.springframework.web.bind.annotation.RequestMapping;
+//import org.springframework.web.bind.annotation.RestController;
+//
+//import java.util.ArrayList;
+//import java.util.HashSet;
+//import java.util.List;
+//
+//@RestController
+//@RequestMapping("/test")
+//public class Simulator {
+//    @Autowired
+//    private DDSPublisher publisher;
+//    @Autowired
+//    private DataManager dataManager;
+//    @Autowired
+//    private NetworkController networkController;
+//    private static Integer count=0;
+//
+//    @GetMapping("/add1")
+//    public R addRadarPulse(){
+//        count++;
+//        publisher.sendMessage(
+//                new Message(
+//                        PlatConstants.RADAR_TASKSYS+" "+PlatConstants.EXCHANGE_PLATFORM+" "+PlatConstants.EXCHANGE_PLATFORM,
+//                        MsgConstants.RADAR_PULSE,
+//                        count,
+//                        "雷达 空中 21 127 10000 5000 "+count,
+//                        count));
+//        return R.ok();
+//    }
+//    @GetMapping("/add2")
+//    public R addEleInter(){
+//        count++;
+//        publisher.sendMessage(
+//                new Message(
+//                        PlatConstants.RADAR_TASKSYS+" "+PlatConstants.EXCHANGE_PLATFORM+" "+PlatConstants.EXCHANGE_PLATFORM,
+//                        MsgConstants.ELECTRIC_INTERFERE,
+//                        count,
+//                        "宽带干扰 空中 区域A 宽带干扰 未知 否 "+count,
+//                        count));
+//        return R.ok();
+//    }
+//    @GetMapping("/add3")
+//    public R addComprehen(){
+//        count++;
+//        publisher.sendMessage(
+//                new Message(
+//                        PlatConstants.RADAR_TASKSYS+" "+PlatConstants.EXCHANGE_PLATFORM+" "+PlatConstants.EXCHANGE_PLATFORM,
+//                        MsgConstants.COMPREHEN_INTELL,
+//                        count,
+//                        "综合 "+count+" 否 在侦察完成后立刻启动干扰",
+//                        count));
+//        return R.ok();
+//    }
+//    @GetMapping("/init")
+//    public R init() throws InterruptedException {
+//        publisher.sendMessage(
+//                new Message(PlatConstants.SUPPORT_PLATFORM,
+//                    MsgConstants.INITIAL_MSG,
+//                    count,
+//                    "6 4\n"+
+//                        "104 1 0 1 -1502143.7779720642 5459654.14635412 2925524.054455928\n" +
+//                        "105 1 0 1 -1119974.522455073 5202530.972695272 3503886.1094705067\n" +
+//                        "103 1 0 1 -1569497.379037304 4803025.549234323 3879026.548666874\n" +
+//                        "106 1 0 1 -2853706.7751482297 3559878.3551225117 4441990.145821915\n" +
+//                        "101 1 0 1 -2437977.331981979 5037635.193417693 3049012.3329436616\n" +
+//                        "102 1 0 1 -2088875.7919909689 4487613.197114771 4008771.869184186\n" +
+//                        "201 2 1 1 -2288875.7919909689 4187613.197114771 4058771.869184186\n" +
+//                        "202 2 1 1 -2388875.7919909689 4287613.197114771 4108771.869184186\n" +
+//                        "203 2 1 1 -2188875.7919909689 4387613.197114771 4208771.869184186\n" +
+//                        "204 2 1 1 -2588875.7919909689 4487613.197114771 4078771.869184186",
+//                        count));
+//        this.addNet1();
+//        this.addNet2();
+//        this.addNet1();
+//        this.addNet2();
+//        Thread.sleep(1000);
+//        R r = addParams(1, new ArrayList<Integer>() {{
+//            add(104);
+//            add(105);
+//        }});
+//        System.out.println(r.toString());
+//        R r1 = addParams(2, new ArrayList<Integer>() {{
+//            add(201);
+//            add(202);
+//            add(203);
+//        }});
+//        System.out.println(r1.toString());
+//        return R.ok();
+//    }
+//    @GetMapping("/initError1")
+//    public R initError1(){
+//        return addParams(2,new ArrayList<Integer>(){{add(104);add(202);}});
+//    }
+//    @GetMapping("/initError2")
+//    public R initError2(){
+//        return addParams(2,new ArrayList<Integer>(){{add(104);add(1111);}});
+//    }
+//    @GetMapping("/init2")
+//    public R init2(){
+//        publisher.sendMessage(
+//                new Message(PlatConstants.SUPPORT_PLATFORM+" "+PlatConstants.RADAR_TASKSYS,
+//                        MsgConstants.INITIAL_MSG,
+//                        count,
+//                    "6 4\n" +
+//                        "104 1 0 1 -1502143.7779720642 5459654.14635412 2925524.054455928\n" +
+//                        "105 1 0 1 -1119974.522455073 5202530.972695272 3503886.1094705067\n" +
+//                        "103 1 0 1 -1569497.379037304 4803025.549234323 3879026.548666874\n" +
+//                        "106 1 0 1 -2853706.7751482297 3559878.3551225117 4441990.145821915\n" +
+//                        "101 1 0 1 -2437977.331981979 5037635.193417693 3049012.3329436616\n" +
+//                        "102 1 0 1 -2088875.7919909689 4487613.197114771 4008771.869184186\n" +
+//                        "201 2 1 1 -2288875.7919909689 4187613.197114771 4058771.869184186\n" +
+//                        "202 2 1 1 -2388875.7919909689 4287613.197114771 4108771.869184186\n" +
+//                        "203 2 1 1 -2188875.7919909689 4387613.197114771 4208771.869184186\n" +
+//                        "204 2 1 1 -2588875.7919909689 4487613.197114771 4078771.869184186",
+//                        count));
+//        return R.ok();
+//    }
+//    @GetMapping("/listInter")
+//    public R listInter(){
+//        return R.ok().put("data", dataManager.getList(InterferPlatform.class,1,100));
+//    }
+//
+//    @GetMapping("/listRadar")
+//    public R listRadar(){
+//        return R.ok().put("data", dataManager.getList(RadarPlatform.class,1,100));
+//    }
+//    @GetMapping("/stop")
+//    public R stop(){
+//        publisher.sendMessage(new Message(
+//                PlatConstants.SUPPORT_PLATFORM+" "+PlatConstants.EXCHANGE_PLATFORM,
+//                MsgConstants.DAOTIAO_MSG,
+//                count,
+//                ControlConstants.CTRL_FINISH,
+//                count));
+//        return R.ok();
+//    }
+//    @GetMapping("/addNet1")
+//    public R addNet1(){
+//        count++;
+//        NetworkGroup interference =new NetworkGroup(new RawGroup("interference", count.toString(), count.toString(), true));
+//        dataManager.addData(interference.getId(),interference);
+//        return R.ok();
+//    }
+//    @GetMapping("/addNet2")
+//    public R addNet2(){
+//        count++;
+//        NetworkGroup radar = new NetworkGroup(new RawGroup("radar", count.toString(), count.toString(), true));
+//        dataManager.addData(radar.getId(),radar);
+//        return R.ok();
+//    }
+//    @GetMapping("/listNet")
+//    public R listNet(){
+//        return R.ok().put("data",dataManager.getList(NetworkGroup.class,1,100));
+//    }
+//    @GetMapping("/addParams")
+//    public R addParams(Integer id, List<Integer> ids){
+//        count++;
+//        NetworkParams data = new NetworkParams();
+//        data.setId(id);
+//        data.setParams(count.toString());
+//        data.setPlatformSet(new HashSet<>(ids));
+//        return networkController.updateNetworkParams(data);
+//    }
+//    @GetMapping("/addMessage1")
+//    public R addMessage1(Integer id1,Integer id2){
+//        count++;
+//
+//        Message message = new Message(
+//                id1 + " " + PlatConstants.EXCHANGE_PLATFORM + " " + id2,
+//                MsgConstants.RADAR_PULSE,
+//                count,
+//                "雷达 空中 21 127 10000 5000 " + count,
+//                count);
+//        publisher.sendMessage(message);
+//        return R.ok(message.toString());
+//    }
+//    @GetMapping("/addMessage2")
+//    public R addMessage2(Integer id1,Integer id2){
+//        count++;
+//        Message message = new Message(
+//                id1 + " " + PlatConstants.EXCHANGE_PLATFORM + " " + id2,
+//                MsgConstants.ELECTRIC_INTERFERE,
+//                count,
+//                "宽带干扰 空中 区域A 宽带干扰 未知 否 " + count,
+//                count);
+//        publisher.sendMessage(message);
+//        return R.ok(message.toString());
+//    }
+//    @GetMapping("/addMessage3")
+//    public R addMessage3(Integer id1,Integer id2){
+//        count++;
+//
+//        Message message = new Message(
+//                id1 + " " + PlatConstants.EXCHANGE_PLATFORM + " " + id2,
+//                MsgConstants.COMPREHEN_INTELL,
+//                count,
+//                "综合 " + count + " 否 在侦察完成后立刻启动干扰",
+//                count);
+//        publisher.sendMessage(message);
+//        return R.ok(message.toString());
+//    }
+//}