|
|
|
@ -1,12 +1,10 @@
|
|
|
|
|
package com.xydl.cac.service.impl;
|
|
|
|
|
package com.xydl.cac.iec;
|
|
|
|
|
|
|
|
|
|
import com.beanit.iec61850bean.*;
|
|
|
|
|
import com.xydl.cac.entity.IcdFile;
|
|
|
|
|
import com.xydl.cac.entity.IcdIed;
|
|
|
|
|
import com.xydl.cac.iec.IecClient;
|
|
|
|
|
import com.xydl.cac.iec.IecServer;
|
|
|
|
|
import com.xydl.cac.repository.*;
|
|
|
|
|
import com.xydl.cac.service.RealTimeService;
|
|
|
|
|
import com.xydl.cac.repository.IcdFileRepository;
|
|
|
|
|
import com.xydl.cac.repository.IcdIedRepository;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
@ -17,11 +15,9 @@ import java.util.HashMap;
|
|
|
|
|
import java.util.Iterator;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Service
|
|
|
|
|
@Slf4j
|
|
|
|
|
public class RealTimeServiceImpl implements RealTimeService {
|
|
|
|
|
|
|
|
|
|
public class RealTimeDataService {
|
|
|
|
|
@Resource
|
|
|
|
|
IcdFileRepository fileRepository;
|
|
|
|
|
@Resource
|
|
|
|
@ -31,7 +27,6 @@ public class RealTimeServiceImpl implements RealTimeService {
|
|
|
|
|
public static IecServer iecServer = null;
|
|
|
|
|
HashMap<String, IecClient> clientMap = new HashMap<>();
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void start() {
|
|
|
|
|
List<IcdFile> icdFileList = fileRepository.findAll();
|
|
|
|
|
if (CollectionUtils.isEmpty(icdFileList)) {
|
|
|
|
@ -56,7 +51,6 @@ public class RealTimeServiceImpl implements RealTimeService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@PreDestroy
|
|
|
|
|
@Override
|
|
|
|
|
public void stop() {
|
|
|
|
|
Iterator<String> it = clientMap.keySet().iterator();
|
|
|
|
|
while (it.hasNext()) {
|