大铁引导总锁和通过进路操作

This commit is contained in:
joylink_zhangsai 2021-04-28 15:40:20 +08:00
parent d9226d47b6
commit 1505ff4604
13 changed files with 156 additions and 62 deletions

View File

@ -3,6 +3,7 @@ package club.joylink.rtss.controller.simulation.rt;
import club.joylink.rtss.constants.MapPrdTypeEnum;
import club.joylink.rtss.simulation.cbtc.data.vo.SimulationVO;
import club.joylink.rtss.simulation.rt.RtSimulationService;
import club.joylink.rtss.simulation.rt.vo.SimulationBasicInfo;
import club.joylink.rtss.vo.LoginUserInfoVO;
import club.joylink.rtss.vo.UserVO;
import club.joylink.rtss.vo.client.map.MapVO;
@ -25,7 +26,7 @@ public class RtSimulationController {
@ApiOperation(value = "根据仿真group获取仿真基础信息")
@GetMapping("/{id}")
public SimulationVO getSimulationBasicInfo(@PathVariable String id) {
public SimulationBasicInfo getSimulationBasicInfo(@PathVariable String id) {
return rtSimulationService.getBasicInfo(id);
}

View File

@ -17,6 +17,7 @@ public class AtsSignal extends AtsDevice {
int level;
String lrId;
int delayTime;
int guideTime;
public AtsSignal(String id, String name) {
super(id, name);
@ -26,7 +27,7 @@ public class AtsSignal extends AtsDevice {
List<Object> buildMessage() {
return Arrays.asList(this.id, this.signalAspect,
this.convert(this.logic), this.convert(this.forceLight), this.convert(this.bl), this.convert(this.rbl),
this.level, this.lrId, this.delayTime);
this.level, this.lrId, this.delayTime, this.guideTime);
}
public boolean applyChange(CilSignal cilSignal) {
@ -72,6 +73,11 @@ public class AtsSignal extends AtsDevice {
stateList.set(8, this.delayTime);
change = true;
}
if (!Objects.equals(this.guideTime, cilSignal.getGuideTime())) {
this.guideTime = cilSignal.getGuideTime();
stateList.set(9, this.guideTime);
change = true;
}
return change;
}
}

View File

@ -57,9 +57,7 @@ public class CilApiService {
}
public boolean setRoute(RtSimulation simulation, String id) {
CilRepository repository = simulation.getRepository(CilRepository.NAME, CilRepository.class);
CilRoute cilRoute = repository.getRouteById(id);
return cilRouteLogicService.setRoute(simulation, cilRoute);
return cilRouteLogicService.setRoute(simulation, id);
}
public boolean cancelRoute(RtSimulation simulation, String signalId) {

View File

@ -3,7 +3,6 @@ package club.joylink.rtss.simulation.rt.CIL;
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
import club.joylink.rtss.simulation.rt.CIL.bo.*;
import club.joylink.rtss.simulation.rt.RtSimulation;
import club.joylink.rtss.simulation.rt.SRD.bo.SrSignal;
import club.joylink.rtss.simulation.rt.repo.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@ -29,9 +28,7 @@ public class CilRouteLogicService {
if (cilRoute.isDelayUnlocking()) {
this.monitorDelayUnlockingRoute(rtSimulation, cilRoute, cilRepository.getConfig());
}
if (cilRoute.isGl()) {
this.monitorGuide(rtSimulation, cilRoute);
}
this.monitorGuide(rtSimulation, cilRoute);
}
}
@ -40,6 +37,7 @@ public class CilRouteLogicService {
List<SwitchPosition> spList = commonRoute.getPathElement().getSpList();
spList.forEach(sp -> cilRepository.getSwitchById(sp.getCommonSwitch().getId()).setMgl(true)); //设置引导总锁
CilSignal cilSignal = cilRepository.getSignalById(commonRoute.getStart().getId());
cilSignal.updateLevel(CilSignal.LEVEL_2);
if (cilRepository.getSectionById(commonRoute.getPathElement().getStart().getId()).isAxcOccupy()) { //进路首区段占用
cilSignal.initGuideTime();
}
@ -50,6 +48,7 @@ public class CilRouteLogicService {
CommonRepository commonRepository = simulation.getRepository(CommonRepository.NAME, CommonRepository.class);
CilRepository cilRepository = simulation.getRepository(CilRepository.NAME, CilRepository.class);
List<CommonSignal> signals = commonRepository.querySignalsByDirection(right);
boolean find = false; //发现引导总锁
for (CommonSignal signal : signals) {
CilSignal cilSignal = cilRepository.getSignalById(signal.getId());
if (!StringUtils.hasText(cilSignal.getRouteId()))
@ -58,7 +57,6 @@ public class CilRouteLogicService {
List<SwitchPosition> spList = commonRepository.getRouteById(cilRoute.getId()).getPathElement().getSpList();
if (CollectionUtils.isEmpty(spList))
continue;
boolean find = false; //发现引导总锁
for (SwitchPosition sp : spList) {
CilSwitch cilSwitch = cilRepository.getSwitchById(sp.getCommonSwitch().getId());
if (cilSwitch.isMgl()) {
@ -67,9 +65,9 @@ public class CilRouteLogicService {
}
}
if (find)
return;
cilSignalLogicService.update2ForbiddenAspect(simulation, signal.getId());
}
cilRepository.getSwitches().forEach(cilSwitch -> cilSwitch.setMgl(false));
BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertTrue(find, "无引导总锁");
}
public void setGuide(RtSimulation simulation, String signalId, String routeId) {
@ -97,16 +95,22 @@ public class CilRouteLogicService {
throw BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.exception("参数缺失");
}
//执行
/* 进路锁闭,但因为区段占用导致无法开放信号 */
if (cilRoute != null) {
if (cilRoute.isLock() && cilSignal.isForbidAspect()) {
cilSignalLogicService.UpdateSignalDisplay(simulation, cilSignal, CilSignal.GUIDE, false);
if (cilRepository.getSectionById(commonRoute.getPathElement().getStart().getId()).isAxcOccupy()) { //进路首区段占用
//进路锁闭但因为区段占用导致无法开放信号
if (cilRoute.isLock()) {
if (cilSignal.isForbidAspect(commonSignal.isShunting())) {
cilSignalLogicService.UpdateSignalDisplay(simulation, cilSignal, CilSignal.GUIDE, false);
if (cilRepository.getSectionById(commonRoute.getPathElement().getStart().getId()).isAxcOccupy()) { //进路首区段占用
cilSignal.initGuideTime();
}
} else if (cilSignal.isGuideAspect() && cilSignal.getGuideTime() != 0) { //之前开放了引导信号重复点击续时间
cilSignal.initGuideTime();
} else {
throw BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.exception("信号正常开放,不能办理引导");
}
}
} else {
/* 进路不能锁闭,直接办理引导进路 */
//进路不能锁闭直接办理引导进路
List<CommonRoute> routes = commonRepository.getRoutesByStartSignal(cilSignal.getId());
Optional<CommonRoute> routeOptional = routes.stream().filter(cr -> {
List<SwitchPosition> spList = cr.getPathElement().getSpList();
@ -138,15 +142,15 @@ public class CilRouteLogicService {
cilRoute.setGl(false);
cilSignal.clearGuideTime();
if (cilSignal.isGuideAspect()) {
cilSignalLogicService.UpdateSignalDisplay(simulation, cilSignal, CilSignal.RED, false);
cilSignalLogicService.update2ForbiddenAspect(simulation, signalId);
}
} else {
BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertNotTrue(cilRoute.isDelayUnlocking(), "进路已在延时解锁中");
BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertNotTrue(cilRoute.isTrainIn(), "进路非空闲状态");
BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertTrue(cilSignalLogicService.isApproachOccupied(simulation, signalId),
"进路未接近锁闭");
BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertNotTrue(cilRoute.isTrainIn(), "进路非空闲状态");
//关闭信号
cilSignalLogicService.UpdateSignalDisplay(simulation, cilSignal, CilSignal.RED, false);
cilSignalLogicService.update2ForbiddenAspect(simulation, signalId);
//设置延时解锁
cilSignal.initDelayTime();
cilRoute.setDelayUnlocking(true);
@ -176,32 +180,34 @@ public class CilRouteLogicService {
/**
* 排列进路接口包括办理冲突检查和选出延续保护及一些初始化工作
*
* @param rtSimulation
* @param cilRoute
* @return 是否办理
*/
public boolean setRoute(RtSimulation rtSimulation, CilRoute cilRoute) {
public boolean setRoute(RtSimulation rtSimulation, String routeId) {
/* 检查 */
CilRepository cilRepository = rtSimulation.getRepository(CilRepository.NAME, CilRepository.class);
CilRoute cilRoute = cilRepository.getRouteById(routeId);
BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertNotTrue(cilRepository.isSupervised(cilRoute.getId()), "进路已经办理");
CommonRepository commonRepository = rtSimulation.getRepository(CommonRepository.NAME, CommonRepository.class);
CommonRoute commonRoute = commonRepository.getRouteById(cilRoute.getId());
if (!CollectionUtils.isEmpty(commonRoute.getMultiRouteAspectList())) {
for (CommonRoute.MultiRouteAspect mra : commonRoute.getMultiRouteAspectList()) {
check4SetRoute(cilRepository, mra.getRoute());
init4SetRoute(cilRoute, cilRepository, mra.getRoute());
CommonRoute subCommonRoute = mra.getRoute();
CilRoute subCilRoute = cilRepository.getRouteById(subCommonRoute.getId());
check4SetRoute(cilRepository, subCommonRoute);
init4SetRoute(subCilRoute, cilRepository, subCommonRoute);
CilSignal cilSignal = cilRepository.getSignalById(subCommonRoute.getStart().getId());
cilSignal.setRouteId(subCilRoute.getId());
}
} else {
check4SetRoute(cilRepository, commonRoute);
init4SetRoute(cilRoute, cilRepository, commonRoute);
CommonSignal commonSignal = commonRepository.getSignalById(commonRoute.getStart().getId());
CilSignal cilSignal = cilRepository.getSignalById(commonSignal.getId());
cilSignal.setRouteId(cilRoute.getId());
}
// 开始办理
cilRoute.startSetting(rtSimulation.getSystemTime());
cilRepository.addSupervisedRoute(cilRoute);
CommonSignal commonSignal = commonRepository.getSignalById(commonRoute.getStart().getId());
CilSignal cilSignal = cilRepository.getSignalById(commonSignal.getId());
cilSignal.setRouteId(cilRoute.getId());
return true;
}
@ -240,6 +246,12 @@ public class CilRouteLogicService {
* 进路办理条件检查
*/
private void check4SetRoute(CilRepository cilRepository, CommonRoute commonRoute) {
//敌对进路检查
List<CommonRoute> conflictingList = commonRoute.getConflictingList();
if (!CollectionUtils.isEmpty(conflictingList)) {
boolean nonSettingConflictingRoute = conflictingList.stream().noneMatch(cr -> cilRepository.isSupervised(cr.getId()));
BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertTrue(nonSettingConflictingRoute, "敌对进路已经办理");
}
// 道岔检查
List<SwitchPosition> spList = commonRoute.getPathElement().getSpList();
if (!CollectionUtils.isEmpty(spList)) {
@ -271,7 +283,7 @@ public class CilRouteLogicService {
// 关灯
CommonSignal commonSignal = commonRoute.getStart();
CilSignal cilSignal = cilRepository.getSignalById(commonSignal.getId());
cilSignalLogicService.UpdateSignalDisplay(rtSimulation, cilSignal, SrSignal.H, true);
cilSignalLogicService.update2ForbiddenAspect(rtSimulation, cilSignal.getId());
cilSignal.setRouteId(null);
/* 取消进路相关所有设备的锁闭状态 */
// 延续保护解锁
@ -358,20 +370,18 @@ public class CilRouteLogicService {
CilRepository cilRepository = rtSimulation.getRepository(CilRepository.NAME, CilRepository.class);
List<CommonRoute.MultiRouteAspect> routes = commonRoute.getMultiRouteAspectList();
if (!CollectionUtils.isEmpty(routes)) {
CommonRoute route = routes.get(0).getRoute();
System.out.println(route.getId());
for (SwitchPosition sp : route.getPathElement().getSpList()) {
System.out.println(sp.getCommonSwitch().getName() + ":" + sp.getPosition());
}
for (int i = routes.size() - 1; i >= 0; i--) {
CommonRoute.MultiRouteAspect mra = routes.get(i);
CommonRoute subCommonRoute = mra.getRoute();
CilRoute subCilRoute = cilRepository.getRouteById(subCommonRoute.getId());
CilSignal cilSignal = cilRepository.getSignalById(subCommonRoute.getStart().getId());
monitorRoute(rtSimulation, cilRepository, cilSignal, subCommonRoute, subCilRoute);
if (cilSignal.getSignalAspect() != mra.getSignalAspect()) {
lockRouteDevices(rtSimulation, cilRepository, subCilRoute, subCommonRoute);
try2OpenSignal4Route(rtSimulation, subCilRoute, subCommonRoute, cilSignal, subCommonRoute.getSignalAspect());
if (!cilRepository.isSupervised(subCilRoute.getId())) {
setRoute(rtSimulation, subCilRoute.getId());
if (i == 0) {
cilRepository.removeSupervisedRoute(cilRoute.getId());
}
}
break;
}
}
@ -379,21 +389,20 @@ public class CilRouteLogicService {
lockRouteDevices(rtSimulation, cilRepository, cilRoute, commonRoute);
CilSignal cilSignal = cilRepository.getSignalById(commonRoute.getStart().getId());
try2OpenSignal4Route(rtSimulation, cilRoute, commonRoute, cilSignal, commonRoute.getSignalAspect());
monitorRoute(rtSimulation, cilRepository, cilSignal, commonRoute, cilRoute);
monitorRoute(rtSimulation, commonRepository, cilRepository, cilSignal, commonRoute, cilRoute);
}
}
/**
* 监控进路目前只是信号显示
*/
private void monitorRoute(RtSimulation rtSimulation, CilRepository cilRepository, CilSignal cilSignal, CommonRoute commonRoute, CilRoute cilRoute) {
private void monitorRoute(RtSimulation rtSimulation, CommonRepository commonRepository, CilRepository cilRepository, CilSignal cilSignal, CommonRoute commonRoute, CilRoute cilRoute) {
//列车进入进路检查
boolean routeSectionOccupied = commonRoute.getPathElement().getAllSectionList()
.stream().anyMatch(cs -> cilRepository.getSectionById(cs.getId()).isAxcOccupy());
cilRoute.setTrainIn(routeSectionOccupied);
cilRoute.setTrainIn(this.isTrainIn(cilRepository, commonRoute));
if (!cilSignal.isGuideAspect()) { //非引导信号
CommonSignal commonSignal = commonRepository.getSignalById(cilSignal.getId());
//信号开放条件检查不通过时关闭信号
if (!cilSignal.isForbidAspect()) {
if (!cilSignal.isForbidAspect(commonSignal.isShunting())) {
if (!canOpenSignal(rtSimulation, cilRoute.getId())) {
cilSignalLogicService.try2UpdateSignalDisplay(rtSimulation, cilSignal, CilSignal.RED, false);
}
@ -496,6 +505,12 @@ public class CilRouteLogicService {
} else {
cilSignal.updateLevel(CilSignal.LEVEL_2);
}
} else {
if (commonRoute.getPathElement().getSpList().stream().allMatch(sp->cilRepository.getSwitchById(sp.getCommonSwitch().getId()).isMgl())) {
cilSignal.updateLevel(CilSignal.LEVEL_2);
} else {
cilSignal.updateLevel(CilSignal.LEVEL_1);
}
}
}
@ -546,7 +561,7 @@ public class CilRouteLogicService {
CommonSignal ps = flsElement.getPs();
if (ps != null) {
CilSignal cilSignal = cilRepository.getSignalById(ps.getId());
if (!cilSignal.isForbidAspect() || !cilSignal.isFl()) {
if (!cilSignal.isForbidAspect(ps.isShunting()) || !cilSignal.isFl()) {
return false;
}
}
@ -741,18 +756,25 @@ public class CilRouteLogicService {
CommonRepository commonRepository = rtSimulation.getRepository(CommonRepository.NAME, CommonRepository.class);
CilRepository cilRepository = rtSimulation.getRepository(CilRepository.NAME, CilRepository.class);
CommonRoute commonRoute = commonRepository.getRouteById(cilRoute.getId());
if (!CollectionUtils.isEmpty(commonRoute.getMultiRouteAspectList()))
return;
CilSignal cilSignal = cilRepository.getSignalById(commonRoute.getStart().getId());
if (cilSignal.isGuideAspect()) {
if (cilSignal.getGuideTime() != 0) { //引导信号的关闭只依赖时间
cilSignal.updateGuideTime();
if (cilSignal.getGuideTime() == 0) {
cilSignalLogicService.UpdateSignalDisplay(rtSimulation, cilSignal, CilSignal.RED, false);
cilSignalLogicService.update2ForbiddenAspect(rtSimulation, cilSignal.getId());
}
} else {
if (cilRepository.getSectionById(commonRoute.getPathElement().getStart().getId()).isAxcOccupy()) {
cilSignalLogicService.UpdateSignalDisplay(rtSimulation, cilSignal, CilSignal.RED, false);
cilSignalLogicService.update2ForbiddenAspect(rtSimulation, cilSignal.getId());
}
}
}
}
private boolean isTrainIn(CilRepository cilRepository, CommonRoute commonRoute) {
return commonRoute.getPathElement().getAllSectionList()
.stream().anyMatch(cs -> cilRepository.getSectionById(cs.getId()).isAxcOccupy());
}
}

View File

@ -22,6 +22,18 @@ public class CilSignalLogicService {
@Autowired
private CilRouteLogicService cilRouteLogicService;
public void update2ForbiddenAspect(RtSimulation simulation, String signalId) {
CommonRepository commonRepository = simulation.getRepository(CommonRepository.NAME, CommonRepository.class);
CilRepository cilRepository = simulation.getRepository(CilRepository.NAME, CilRepository.class);
CommonSignal commonSignal = commonRepository.getSignalById(signalId);
CilSignal cilSignal = cilRepository.getSignalById(signalId);
if (commonSignal.isShunting()) {
UpdateSignalDisplay(simulation, cilSignal, CilSignal.A, false);
} else {
UpdateSignalDisplay(simulation, cilSignal, CilSignal.RED, false);
}
}
/**
* 信号机接近区段占用
*/
@ -50,7 +62,8 @@ public class CilSignalLogicService {
CilRepository cilRepository = rtSimulation.getRepository(CilRepository.NAME, CilRepository.class);
CommonRepository commonRepository = rtSimulation.getRepository(CommonRepository.NAME, CommonRepository.class);
CilSignal cilSignal = cilRepository.getSignalById(signalId);
BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertTrue(cilSignal.isForbidAspect(),
CommonSignal commonSignal = commonRepository.getSignalById(signalId);
BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertTrue(cilSignal.isForbidAspect(commonSignal.isShunting()),
"信号未关闭,无需重开");
BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertHasText(cilSignal.getRouteId(), "无已办理的进路");
CommonRoute commonRoute = commonRepository.getRouteById(cilSignal.getRouteId());
@ -83,8 +96,10 @@ public class CilSignalLogicService {
}
if (signal.sufficientLevel(aspect, false)) {
srdApiService.changeSignalLight(rtSimulation, signal.getId(), aspect);
return true;
} else {
return false;
}
return true;
}
public void UpdateSignalDisplay(RtSimulation rtSimulation, CilSignal signal, int aspect, boolean ctcMode) {

View File

@ -101,7 +101,7 @@ public class CilRepository extends SimulationRepository {
public CilSignal getSignalById(String id) {
CilSignal cilSignal = this.signalMap.get(id);
BusinessExceptionAssertEnum.SYSTEM_EXCEPTION.assertNotNull(cilSignal);
BusinessExceptionAssertEnum.SYSTEM_EXCEPTION.assertNotNull(cilSignal, String.format("无id为[%s]的信号机", id));
return cilSignal;
}

View File

@ -5,7 +5,6 @@ import club.joylink.rtss.vo.client.map.MapSwitchVO;
import club.joylink.rtss.vo.client.map.MapVO;
import club.joylink.rtss.vo.client.map.newmap.*;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import java.util.*;

View File

@ -20,10 +20,10 @@ public class CilSignal extends CilDevice {
public static final int HH = 7; // 黄黄
public static final int HSH = 8; // 黄闪黄
public static final int BH = 9; // 白红
public static final int L = 10; //
public static final int A = 10; //
public static final int B = 11; //
public static final int HS = 12; // 红闪
boolean logic = true;
boolean logic;
boolean forceLight; // 强制点灯
@Setter
boolean bl; // 封锁
@ -49,10 +49,15 @@ public class CilSignal extends CilDevice {
super(id, name);
}
public CilSignal(String id, String name, int aspect) {
this(id, name);
this.signalAspect = aspect;
}
@Override
public void init() {
signalAspect = RED;
logic = true;
logic = false;
forceLight = false;
bl = false;
rbl = false;
@ -73,8 +78,12 @@ public class CilSignal extends CilDevice {
}
}
public boolean isForbidAspect() {
return this.signalAspect == RED;
public boolean isForbidAspect(boolean shunting) {
if (shunting) {
return this.signalAspect == A;
} else {
return this.signalAspect == RED;
}
}
public void updateLevel(int level) {

View File

@ -11,6 +11,7 @@ import club.joylink.rtss.simulation.rt.SRD.SrdLogicService;
import club.joylink.rtss.simulation.rt.repo.CommonRepoService;
import club.joylink.rtss.simulation.rt.repo.CommonRepository;
import club.joylink.rtss.simulation.rt.repo.CommonStation;
import club.joylink.rtss.simulation.rt.vo.SimulationBasicInfo;
import club.joylink.rtss.vo.UserVO;
import club.joylink.rtss.vo.client.map.MapVO;
import org.springframework.beans.factory.annotation.Autowired;
@ -80,12 +81,9 @@ public class RtSimulationService {
this.atsLogicService.init(rtSimulation, mapVO);
}
public SimulationVO getBasicInfo(String id) {
public SimulationBasicInfo getBasicInfo(String id) {
RtSimulation rtSimulation = simulationManager.getById(id, RtSimulation.class);
SimulationVO.SimulationVOBuilder builder = SimulationVO.builder();
builder.map(rtSimulation.mapVO.buildBasicInfo());
builder.prodType(rtSimulation.prdType != null ? rtSimulation.prdType.getCode() : null);
return builder.build();
return new SimulationBasicInfo(rtSimulation);
}
public MapVO getMapData(String id) {

View File

@ -50,7 +50,7 @@ public class CommonFls extends CommonDevice {
}
if (this.ps != null) {
CilSignal cilSignal = cilRepository.getSignalById(this.ps.getId());
if (cilSignal.isForbidAspect()) {
if (cilSignal.isForbidAspect(this.ps.isShunting())) {
cilSignal.flankLock();
} else {
flag = false;

View File

@ -1,6 +1,7 @@
package club.joylink.rtss.simulation.rt.repo;
import lombok.Getter;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.List;
@ -43,6 +44,15 @@ public class CommonRoute extends CommonDevice {
this.standList = new ArrayList<>();
}
public boolean isCombinedRoute() {
return !CollectionUtils.isEmpty(multiRouteAspectList);
}
public boolean contains(String routeId) {
return isCombinedRoute() && this.multiRouteAspectList
.stream().anyMatch(mra -> mra.getRoute().getId().equals(routeId));
}
@Getter
public static class MultiRouteAspect {
CommonRoute route;

View File

@ -0,0 +1,30 @@
package club.joylink.rtss.simulation.rt.vo;
import club.joylink.rtss.simulation.Simulation;
import club.joylink.rtss.simulation.rt.RtSimulation;
import club.joylink.rtss.vo.UserVO;
import club.joylink.rtss.vo.client.map.MapVO;
import lombok.Getter;
@Getter
public class SimulationBasicInfo {
private String id;
private int state;
private int speed;
private String prodType;
private MapVO map;
public SimulationBasicInfo(RtSimulation simulation) {
this.id = simulation.getId();
this.state = simulation.getState();
this.speed = simulation.getSpeed();
this.prodType = simulation.getPrdType() == null ? null : simulation.getPrdType().getCode();
if (simulation.getMapVO() != null) {
this.map = simulation.getMapVO().buildBasicInfo();
}
}
}

View File

@ -2,6 +2,7 @@ package club.joylink.rtss.vo.client.map.newmap;
import club.joylink.rtss.simulation.cbtc.data.map.Signal;
import club.joylink.rtss.vo.client.Point;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
@ -193,4 +194,9 @@ public class MapSignalNewVO {
@ApiModelProperty(value = "传输信号机关联的信号机")
private String linkSignalCode;
@JsonIgnore
public boolean isShunting() {
return Signal.SignalType.SHUNTING.equals(this.type);
}
}