Merge remote-tracking branch 'origin/test' into dev
# Conflicts: # src/main/java/club/joylink/rtss/simulation/cbtc/CI/CiApiServiceImpl.java # src/main/java/club/joylink/rtss/simulation/cbtc/data/map/Switch.java # src/main/java/club/joylink/rtss/simulation/cbtc/data/vr/VirtualRealitySwitch.java
This commit is contained in:
commit
4f4040c772
@ -11,7 +11,8 @@ public enum MapPrdTypeEnum {
|
||||
SCHEDULING("05", "派班工作站"),
|
||||
ISCS("06", "ISCS工作站"),
|
||||
BIG_SCREEN("07", "大屏工作站"),
|
||||
RUN_PLAN_MAKE("08", "运行图编制工作站")
|
||||
RUN_PLAN_MAKE("08", "运行图编制工作站"),
|
||||
DEPOT_IL("09", "车辆段联锁工作站"),
|
||||
;
|
||||
|
||||
private String code;
|
||||
|
@ -34,8 +34,10 @@ public enum Project {
|
||||
ZZWW,
|
||||
/** 郑州共赢测试 */
|
||||
ZZWWTEST,
|
||||
/** 中航锐创(第三方教学合作) */
|
||||
/** 中航锐创(第三方教学合作,第三方登录) */
|
||||
RICHOR,
|
||||
/** 中航锐创(实训室,连设备,设备登录) */
|
||||
RICHOR_JOINT,
|
||||
;
|
||||
|
||||
public static boolean isDefault(Project project) {
|
||||
|
@ -26,6 +26,8 @@ public enum ProjectDeviceType {
|
||||
IBP,
|
||||
/** PLC网关 */
|
||||
PLC_GATEWAY,
|
||||
/** 单元控制器 */
|
||||
DCU,
|
||||
/* -----------plc device end---------- */
|
||||
|
||||
/* -----------client device start---------- */
|
||||
@ -65,6 +67,7 @@ public enum ProjectDeviceType {
|
||||
PSL,
|
||||
IBP,
|
||||
SWITCH,
|
||||
SIGNAL);
|
||||
SIGNAL,
|
||||
DCU);
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,34 @@
|
||||
package club.joylink.rtss.controller;
|
||||
|
||||
import club.joylink.rtss.services.draftData.DraftMapDataHandleService;
|
||||
import club.joylink.rtss.services.publishData.PublishMapDataHandler;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 地图数据处理
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/api/mapData/handle")
|
||||
public class MapDataHandleController {
|
||||
|
||||
@Autowired
|
||||
private DraftMapDataHandleService draftMapDataHandleService;
|
||||
@Autowired
|
||||
private PublishMapDataHandler publishMapDataHandler;
|
||||
|
||||
@PutMapping("")
|
||||
public void dataHandle() {
|
||||
this.publishMapDataHandler.dataHandle();
|
||||
}
|
||||
|
||||
@PutMapping("/xian3")
|
||||
public void overlapSetHandle() {
|
||||
this.publishMapDataHandler.xian3Handle();
|
||||
}
|
||||
|
||||
}
|
@ -11,6 +11,7 @@ import club.joylink.rtss.vo.client.validGroup.DraftMapCreateCheck;
|
||||
import club.joylink.rtss.vo.client.validGroup.DraftMapCreateFromCheck;
|
||||
import club.joylink.rtss.vo.client.validGroup.DraftMapPublishCheck;
|
||||
import club.joylink.rtss.vo.map.*;
|
||||
import club.joylink.rtss.vo.map.logic.*;
|
||||
import club.joylink.rtss.vo.map.query.MapAutoReentryQueryVO;
|
||||
import club.joylink.rtss.vo.map.query.MapDestinationCodeDefinitionQueryVO;
|
||||
import club.joylink.rtss.vo.map.query.MapParkTimeQueryVO;
|
||||
@ -104,9 +105,6 @@ public class DraftMapController {
|
||||
this.iDraftMapService.updateCheckConfig(id, checkConfig);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存地图元素信息
|
||||
*/
|
||||
/**
|
||||
*保存地图草稿对象数据
|
||||
*/
|
||||
@ -123,6 +121,14 @@ public class DraftMapController {
|
||||
return this.draftMapCiDataGenerator.generate(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成车辆段联锁数据
|
||||
*/
|
||||
@PostMapping(path = "/{id}/ci/generateAndSaveDepot")
|
||||
public int generateAndSaveDepot(@PathVariable Long id, String stationCode) {
|
||||
return this.draftMapCiDataGenerator.generateDepot(id, stationCode);
|
||||
}
|
||||
|
||||
/**
|
||||
*草稿地图导出
|
||||
*/
|
||||
@ -148,9 +154,6 @@ public class DraftMapController {
|
||||
iDraftMapService.createFrom(draftMapVO.getId(), draftMapVO.getName(), user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除地图草稿
|
||||
*/
|
||||
/**
|
||||
*删除地图草稿
|
||||
*/
|
||||
@ -159,6 +162,11 @@ public class DraftMapController {
|
||||
iDraftMapService.deleteMap(id, user);
|
||||
}
|
||||
|
||||
@DeleteMapping(path = "/delete/all")
|
||||
public void clearAllMap(@RequestAttribute AccountVO user) {
|
||||
this.iDraftMapService.deleteAllUserDraftMap(user);
|
||||
}
|
||||
|
||||
/**
|
||||
*数据校验
|
||||
*/
|
||||
|
@ -2,7 +2,7 @@ package club.joylink.rtss.controller.draft;
|
||||
|
||||
import club.joylink.rtss.services.draftData.DraftMapFlankProtectionService;
|
||||
import club.joylink.rtss.vo.client.PageVO;
|
||||
import club.joylink.rtss.vo.map.MapRouteFlankProtectionNewVO;
|
||||
import club.joylink.rtss.vo.map.logic.MapRouteFlankProtectionNewVO;
|
||||
import club.joylink.rtss.vo.map.query.MapRouteFlankProtectionQueryVO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -2,7 +2,7 @@ package club.joylink.rtss.controller.draft;
|
||||
|
||||
import club.joylink.rtss.services.draftData.DraftMapFlsService;
|
||||
import club.joylink.rtss.vo.client.PageVO;
|
||||
import club.joylink.rtss.vo.map.MapRouteFlankProtectionNewVO;
|
||||
import club.joylink.rtss.vo.map.logic.MapRouteFlankProtectionNewVO;
|
||||
import club.joylink.rtss.vo.map.query.MapRouteFlankProtectionQueryVO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -2,7 +2,7 @@ package club.joylink.rtss.controller.draft;
|
||||
|
||||
import club.joylink.rtss.services.draftData.DraftMapOverlapService;
|
||||
import club.joylink.rtss.vo.client.PageVO;
|
||||
import club.joylink.rtss.vo.map.MapOverlapVO;
|
||||
import club.joylink.rtss.vo.map.logic.MapOverlapVO;
|
||||
import club.joylink.rtss.vo.map.query.MapOverlapQueryVO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -3,8 +3,7 @@ package club.joylink.rtss.controller.draft;
|
||||
import club.joylink.rtss.services.draftData.DraftMapOverrunService;
|
||||
import club.joylink.rtss.vo.client.PageVO;
|
||||
import club.joylink.rtss.vo.client.map.MapRouteOverrunQueryVO;
|
||||
import club.joylink.rtss.vo.map.MapRouteNewVO;
|
||||
import club.joylink.rtss.vo.map.MapRouteOverrunVO;
|
||||
import club.joylink.rtss.vo.map.logic.MapRouteOverrunVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
package club.joylink.rtss.controller.draft;
|
||||
|
||||
import club.joylink.rtss.services.draftData.ParkTimeService;
|
||||
import club.joylink.rtss.vo.map.MapStationParkingTimeVO;
|
||||
import club.joylink.rtss.vo.map.logic.MapStationParkingTimeVO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
@ -3,7 +3,7 @@ package club.joylink.rtss.controller.draft;
|
||||
import club.joylink.rtss.services.draftData.DraftMapRouteService;
|
||||
import club.joylink.rtss.vo.client.PageVO;
|
||||
import club.joylink.rtss.vo.client.map.MapRouteQueryVO;
|
||||
import club.joylink.rtss.vo.map.MapRouteNewVO;
|
||||
import club.joylink.rtss.vo.map.logic.MapRouteNewVO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
@ -1,7 +1,7 @@
|
||||
package club.joylink.rtss.controller.draft;
|
||||
|
||||
import club.joylink.rtss.services.draftData.RunLevelService;
|
||||
import club.joylink.rtss.vo.map.MapStationRunLevelVO;
|
||||
import club.joylink.rtss.vo.map.logic.MapStationRunLevelVO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
@ -3,7 +3,7 @@ package club.joylink.rtss.controller.draft;
|
||||
import club.joylink.rtss.services.draftData.DraftMapSignalApproachSectionService;
|
||||
import club.joylink.rtss.services.draftData.SignalApproachSectionGenerator;
|
||||
import club.joylink.rtss.vo.client.PageVO;
|
||||
import club.joylink.rtss.vo.map.MapSignalApproachSectionVO;
|
||||
import club.joylink.rtss.vo.map.logic.MapSignalApproachSectionVO;
|
||||
import club.joylink.rtss.vo.map.query.MapSASQueryVO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -2,7 +2,7 @@ package club.joylink.rtss.controller.draft;
|
||||
|
||||
import club.joylink.rtss.services.draftData.DraftMapRunLevelService;
|
||||
import club.joylink.rtss.vo.client.PageVO;
|
||||
import club.joylink.rtss.vo.map.MapStationRunLevelVO;
|
||||
import club.joylink.rtss.vo.map.logic.MapStationRunLevelVO;
|
||||
import club.joylink.rtss.vo.map.query.MapRunLevelQueryVO;
|
||||
import club.joylink.rtss.vo.map.validate.RunLevelCreateCheck;
|
||||
import club.joylink.rtss.vo.map.validate.RunLevelUpdateCheck;
|
||||
|
@ -230,4 +230,10 @@ public class DeviceController {
|
||||
AccountVO accountVO) {
|
||||
this.deviceService.addOrUpdateSdyDeviceConfig(accountVO);
|
||||
}
|
||||
|
||||
@PostMapping("/richor/addOrUpdate")
|
||||
public void addOrUpdateRichorDeviceConfig(@RequestAttribute(name = AuthenticateInterceptor.LOGIN_USER_KEY)
|
||||
AccountVO accountVO) {
|
||||
this.deviceService.addOrUpdateRichorDeviceConfig(accountVO);
|
||||
}
|
||||
}
|
||||
|
@ -14,6 +14,10 @@ import club.joylink.rtss.vo.client.map.MapCopyOption;
|
||||
import club.joylink.rtss.vo.client.map.MapInfoUpdateVO;
|
||||
import club.joylink.rtss.vo.client.validGroup.MapInfoSortCheck;
|
||||
import club.joylink.rtss.vo.map.*;
|
||||
import club.joylink.rtss.vo.map.graph.MapPSDVO;
|
||||
import club.joylink.rtss.vo.map.graph.MapSectionNewVO;
|
||||
import club.joylink.rtss.vo.map.graph.MapStationNewVO;
|
||||
import club.joylink.rtss.vo.map.graph.MapStationStandNewVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
@ -13,7 +13,7 @@ import club.joylink.rtss.vo.client.runplan.user.RunPlanRoutingVO;
|
||||
import club.joylink.rtss.vo.client.validGroup.RunPlanCreateCheck;
|
||||
import club.joylink.rtss.vo.client.validGroup.RunPlanNameCheck;
|
||||
import club.joylink.rtss.vo.client.validGroup.ValidList;
|
||||
import club.joylink.rtss.vo.map.MapStationRunLevelVO;
|
||||
import club.joylink.rtss.vo.map.logic.MapStationRunLevelVO;
|
||||
import club.joylink.rtss.vo.runplan.RunPlanInputData;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
@ -28,7 +28,7 @@ import club.joylink.rtss.vo.client.simulationv1.RunAsPlanParam;
|
||||
import club.joylink.rtss.vo.client.simulationv1.SimulationLogPagedQueryVO;
|
||||
import club.joylink.rtss.vo.client.simulationv1.SimulationMemberVO;
|
||||
import club.joylink.rtss.vo.client.simulationv1.SimulationUserVO;
|
||||
import club.joylink.rtss.vo.map.MapStationNewVO;
|
||||
import club.joylink.rtss.vo.map.graph.MapStationNewVO;
|
||||
import club.joylink.rtss.vo.map.MapVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
@ -25,17 +25,11 @@ public class ModbusTestController {
|
||||
|
||||
/**
|
||||
* 测试modbustcp写网关(使用功能码05:写单线圈)
|
||||
* @param code
|
||||
* @param addr
|
||||
* @param val
|
||||
* @param accountVO
|
||||
* @return
|
||||
*/
|
||||
@Role(SuperAdmin)
|
||||
@PostMapping("/writeCoil")
|
||||
public void modbusWriteSingleCoil(String code,
|
||||
int addr, boolean val,
|
||||
@RequestAttribute(name = AuthenticateInterceptor.LOGIN_USER_KEY) AccountVO accountVO) {
|
||||
int addr, boolean val) {
|
||||
this.modbusTcpTestService.writeSingleCoil(this.plcGatewayConnectManager.getChannel(code), addr, val);
|
||||
}
|
||||
|
||||
|
@ -15,6 +15,8 @@ import club.joylink.rtss.vo.client.PageVO;
|
||||
import club.joylink.rtss.vo.client.TreeNode;
|
||||
import club.joylink.rtss.vo.client.map.*;
|
||||
import club.joylink.rtss.vo.map.*;
|
||||
import club.joylink.rtss.vo.map.graph.MapSectionNewVO;
|
||||
import club.joylink.rtss.vo.map.logic.*;
|
||||
import club.joylink.rtss.vo.map.query.MapAutoReentryQueryVO;
|
||||
import club.joylink.rtss.vo.map.query.MapDestinationCodeDefinitionQueryVO;
|
||||
import club.joylink.rtss.vo.map.query.MapParkTimeQueryVO;
|
||||
@ -395,6 +397,15 @@ public class DraftMapService implements IDraftMapService {
|
||||
draftMapDAO.deleteByPrimaryKey(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteAllUserDraftMap(AccountVO user) {
|
||||
DraftMapExample example = new DraftMapExample();
|
||||
example.createCriteria()
|
||||
.andAuthorIdEqualTo(user.getId());
|
||||
List<DraftMap> maps = this.draftMapDAO.selectByExample(example);
|
||||
maps.forEach(map -> this.deleteMap(map.getId(), user));
|
||||
}
|
||||
|
||||
private void confirmDraftMapNameNotExist(DraftMap map) {
|
||||
BusinessExceptionAssertEnum.DATA_UNIQUE_PROPERTY_REPEAT.assertNotTrue(checkDraftMapNameExist(map));
|
||||
}
|
||||
|
@ -5,7 +5,11 @@ import club.joylink.rtss.vo.client.PageQueryVO;
|
||||
import club.joylink.rtss.vo.client.PageVO;
|
||||
import club.joylink.rtss.vo.client.TreeNode;
|
||||
import club.joylink.rtss.vo.client.map.*;
|
||||
import club.joylink.rtss.vo.map.*;
|
||||
import club.joylink.rtss.vo.map.Map3dDataVO;
|
||||
import club.joylink.rtss.vo.map.MapCheckConfig;
|
||||
import club.joylink.rtss.vo.map.MapGraphDataNewVO;
|
||||
import club.joylink.rtss.vo.map.MapVO;
|
||||
import club.joylink.rtss.vo.map.logic.*;
|
||||
import club.joylink.rtss.vo.map.query.MapAutoReentryQueryVO;
|
||||
import club.joylink.rtss.vo.map.query.MapDestinationCodeDefinitionQueryVO;
|
||||
import club.joylink.rtss.vo.map.query.MapParkTimeQueryVO;
|
||||
@ -136,6 +140,12 @@ public interface IDraftMapService {
|
||||
*/
|
||||
void deleteMap(Long id, AccountVO user);
|
||||
|
||||
/**
|
||||
* 清空用户所有草稿地图数据
|
||||
* @param user
|
||||
*/
|
||||
void deleteAllUserDraftMap(AccountVO user);
|
||||
|
||||
/**
|
||||
* 创建联动道岔关系
|
||||
* @param vo
|
||||
|
@ -11,6 +11,10 @@ import club.joylink.rtss.vo.client.map.MapCopyOption;
|
||||
import club.joylink.rtss.vo.client.map.MapDataVO;
|
||||
import club.joylink.rtss.vo.client.map.MapInfoUpdateVO;
|
||||
import club.joylink.rtss.vo.map.*;
|
||||
import club.joylink.rtss.vo.map.graph.MapPSDVO;
|
||||
import club.joylink.rtss.vo.map.graph.MapSectionNewVO;
|
||||
import club.joylink.rtss.vo.map.graph.MapStationNewVO;
|
||||
import club.joylink.rtss.vo.map.graph.MapStationStandNewVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -60,6 +64,12 @@ public interface IMapService {
|
||||
*/
|
||||
MapVO getMapDetail(Long id);
|
||||
|
||||
/**
|
||||
* 清除地图缓存
|
||||
* @param id
|
||||
*/
|
||||
void removeCache(Long id);
|
||||
|
||||
/**
|
||||
* 获取地图基本信息
|
||||
* @param id
|
||||
|
@ -5,7 +5,7 @@ import club.joylink.rtss.vo.LoginUserInfoVO;
|
||||
import club.joylink.rtss.vo.client.PageVO;
|
||||
import club.joylink.rtss.vo.client.map.MapRoutingSectionVO;
|
||||
import club.joylink.rtss.vo.client.runplan.*;
|
||||
import club.joylink.rtss.vo.map.MapStationRunLevelVO;
|
||||
import club.joylink.rtss.vo.map.logic.MapStationRunLevelVO;
|
||||
import club.joylink.rtss.vo.map.MapVO;
|
||||
import club.joylink.rtss.vo.runplan.RunPlanInputData;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
@ -34,6 +34,11 @@ import club.joylink.rtss.vo.client.runplan.RunPlanVO;
|
||||
import club.joylink.rtss.vo.client.runplan.user.RunPlanRoutingVO;
|
||||
import club.joylink.rtss.vo.client.schedulingNew.SchedulingPlanNewVO;
|
||||
import club.joylink.rtss.vo.map.*;
|
||||
import club.joylink.rtss.vo.map.graph.MapPSDVO;
|
||||
import club.joylink.rtss.vo.map.graph.MapSectionNewVO;
|
||||
import club.joylink.rtss.vo.map.graph.MapStationNewVO;
|
||||
import club.joylink.rtss.vo.map.graph.MapStationStandNewVO;
|
||||
import club.joylink.rtss.vo.map.logic.MapRoutingDataVO;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@ -266,6 +271,11 @@ public class MapService implements IMapService {
|
||||
return mapVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeCache(Long id) {
|
||||
this.iCacheService.remove(BusinessConsts.CachePrefix.Map + id);
|
||||
}
|
||||
|
||||
private MapDataVO getMapData(Long mapId, String version) {
|
||||
Objects.requireNonNull(mapId, "mapId不能为空");
|
||||
MapDataExample example = new MapDataExample();
|
||||
@ -708,7 +718,7 @@ public class MapService implements IMapService {
|
||||
}
|
||||
if (update) {
|
||||
this.mapInfoDAO.updateByPrimaryKey(mapInfo);
|
||||
this.iCacheService.remove(BusinessConsts.CachePrefix.Map + id);
|
||||
this.removeCache(id);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -200,8 +200,10 @@ public class ReleaseService implements IReleaseService {
|
||||
|
||||
if (!CollectionUtils.isEmpty(releaseVO.getRunPlanTemplateList())) {
|
||||
//删除旧的运行图相关数据
|
||||
List<RunPlanTemplate> runPlanTemplates = releaseVO.getRunPlanTemplateList();
|
||||
for (RunPlanTemplate runPlanTemplate : runPlanTemplates) {
|
||||
RunPlanTemplateExample runPlanTemplateExample = new RunPlanTemplateExample();
|
||||
runPlanTemplateExample.createCriteria().andMapIdEqualTo(mapId);
|
||||
List<RunPlanTemplate> oldRunPlans = runPlanTemplateDAO.selectByExample(runPlanTemplateExample);
|
||||
for (RunPlanTemplate runPlanTemplate : oldRunPlans) {
|
||||
iRunPlanTemplateService.deletePlan(runPlanTemplate.getId(), user);
|
||||
}
|
||||
// //删除旧的运行图加载数据
|
||||
@ -218,6 +220,7 @@ public class ReleaseService implements IReleaseService {
|
||||
// runPlanTemplateDAO.deleteByExample(runPlanTemplateExample);
|
||||
//插入新的模板运行图数据并记录id变化
|
||||
Map<Long, Long> runPlanTemplateIdMap = new HashMap<>();
|
||||
List<RunPlanTemplate> runPlanTemplates = releaseVO.getRunPlanTemplateList();
|
||||
for (RunPlanTemplate template : runPlanTemplates) {
|
||||
long oldId = template.getId();
|
||||
template.setId(null);
|
||||
|
@ -22,6 +22,11 @@ import club.joylink.rtss.vo.client.runplan.*;
|
||||
import club.joylink.rtss.vo.client.runplan.user.RunPlanRoutingVO;
|
||||
import club.joylink.rtss.vo.client.runplan.user.RunPlanRunlevelVO;
|
||||
import club.joylink.rtss.vo.map.*;
|
||||
import club.joylink.rtss.vo.map.graph.MapSectionNewVO;
|
||||
import club.joylink.rtss.vo.map.graph.MapStationNewVO;
|
||||
import club.joylink.rtss.vo.map.graph.MapStationStandNewVO;
|
||||
import club.joylink.rtss.vo.map.logic.MapRoutingDataVO;
|
||||
import club.joylink.rtss.vo.map.logic.MapStationRunLevelVO;
|
||||
import club.joylink.rtss.vo.runplan.RunPlanInputData;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
|
@ -122,37 +122,20 @@ public class VirtualRealityIbpService implements IVirtualRealityIbpService {
|
||||
break;
|
||||
case KM: {
|
||||
element.setOn(true);
|
||||
List<VirtualRealityIbp.IbpElement> key;
|
||||
if (element.getUp()) {
|
||||
key = ibp.query(VirtualRealityIbp.Mean.SXYS, element.getUp());
|
||||
} else {
|
||||
key = ibp.query(VirtualRealityIbp.Mean.XXYS, element.getUp());
|
||||
}
|
||||
if (key.stream().allMatch(VirtualRealityIbp.IbpElement::isOn)) {
|
||||
stands.forEach(stand -> ciApiService.openScreenDoor(simulation, stand.getCode()));
|
||||
}
|
||||
stands.forEach(stand -> ciApiService.openScreenDoor(simulation, stand.getCode()));
|
||||
break;
|
||||
}
|
||||
case GM: {
|
||||
element.setOn(true);
|
||||
List<VirtualRealityIbp.IbpElement> key;
|
||||
if (element.getUp() != null) {
|
||||
if (element.getUp()) {
|
||||
key = ibp.query(VirtualRealityIbp.Mean.SXYS, element.getUp());
|
||||
} else {
|
||||
key = ibp.query(VirtualRealityIbp.Mean.XXYS, element.getUp());
|
||||
}
|
||||
} else {
|
||||
key = ibp.queryByType(VirtualRealityIbp.Type.KEY);
|
||||
}
|
||||
if (key.stream().allMatch(VirtualRealityIbp.IbpElement::isOn)) {
|
||||
stands.forEach(stand -> ciApiService.closeScreenDoor(simulation, stand.getCode()));
|
||||
}
|
||||
stands.forEach(stand -> ciApiService.closeScreenDoor(simulation, stand.getCode()));
|
||||
break;
|
||||
}
|
||||
case XXYS:
|
||||
case SXYS:
|
||||
element.setOn(!element.isOn());
|
||||
stands.forEach(stand -> {
|
||||
stand.getPsd().getVirtualScreenDoor().setIbpControl(true);
|
||||
});
|
||||
break;
|
||||
case AXLE_RESET:
|
||||
element.setOn(true);
|
||||
|
@ -1,9 +1,9 @@
|
||||
package club.joylink.rtss.services.check;
|
||||
|
||||
import club.joylink.rtss.vo.map.MapGraphDataNewVO;
|
||||
import club.joylink.rtss.vo.map.MapSectionNewVO;
|
||||
import club.joylink.rtss.vo.map.MapSwitchVO;
|
||||
import club.joylink.rtss.vo.map.MapVO;
|
||||
import club.joylink.rtss.vo.map.graph.MapSectionNewVO;
|
||||
import club.joylink.rtss.vo.map.graph.MapSwitchVO;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
@ -14,4 +14,10 @@ public interface DraftMapCiDataGenerator {
|
||||
*/
|
||||
CiGenerateResultVO generate(Long mapId);
|
||||
|
||||
/**
|
||||
* 生成车辆段联锁
|
||||
* @param mapId
|
||||
* @return
|
||||
*/
|
||||
int generateDepot(Long mapId, String stationCode);
|
||||
}
|
||||
|
@ -1,14 +1,21 @@
|
||||
package club.joylink.rtss.services.draftData;
|
||||
|
||||
import club.joylink.rtss.entity.DraftMapRoute;
|
||||
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
|
||||
import club.joylink.rtss.simulation.cbtc.build.SimulationBuilder;
|
||||
import club.joylink.rtss.simulation.cbtc.constant.SignalAspect;
|
||||
import club.joylink.rtss.simulation.cbtc.constant.SignalModel;
|
||||
import club.joylink.rtss.simulation.cbtc.data.CalculateService;
|
||||
import club.joylink.rtss.simulation.cbtc.data.map.*;
|
||||
import club.joylink.rtss.simulation.cbtc.data.support.RoutePath;
|
||||
import club.joylink.rtss.simulation.cbtc.exception.SimulationException;
|
||||
import club.joylink.rtss.simulation.cbtc.exception.SimulationExceptionType;
|
||||
import club.joylink.rtss.util.JsonUtils;
|
||||
import club.joylink.rtss.vo.map.*;
|
||||
import club.joylink.rtss.vo.map.CiGenerateResultVO;
|
||||
import club.joylink.rtss.vo.map.MapCiGenerateConfig;
|
||||
import club.joylink.rtss.vo.map.MapRoutingSectionNewVO;
|
||||
import club.joylink.rtss.vo.map.MapVO;
|
||||
import club.joylink.rtss.vo.map.logic.*;
|
||||
import lombok.Getter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -28,6 +35,10 @@ public class DraftMapCiDataGeneratorImpl implements DraftMapCiDataGenerator {
|
||||
|
||||
@Autowired
|
||||
private DraftMapService draftMapService;
|
||||
|
||||
@Autowired
|
||||
private DraftMapRouteService draftMapRouteService;
|
||||
|
||||
@Autowired
|
||||
private RoutingGenerator routingGenerator;
|
||||
|
||||
@ -91,6 +102,69 @@ public class DraftMapCiDataGeneratorImpl implements DraftMapCiDataGenerator {
|
||||
return result.convert2VO();
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public int generateDepot(Long mapId, String stationCode) {
|
||||
// 先校验地图基础数据
|
||||
MapVO mapVO = this.draftMapService.getDraftMapData(mapId);
|
||||
SimulationBuilder.SimulationDeviceBuildResult buildResult = SimulationBuilder.checkAndBuildBasicMapData(mapVO);
|
||||
BusinessExceptionAssertEnum.DATA_ERROR.assertCollectionEmpty(buildResult.getErrMsgList(),
|
||||
String.format("地图基础数据有错误: %s", JsonUtils.writeValueAsString(buildResult.getErrMsgList())));
|
||||
MapCiGenerateConfig generateConfig = mapVO.getGraphDataNew().getGenerateConfig();
|
||||
Map<String, MapElement> deviceMap = buildResult.getDeviceMap();
|
||||
// 处理旧数据
|
||||
List<MapRouteNewVO> routeList = this.draftMapRouteService.queryAllRoutes(mapId);
|
||||
List<Long> deletingList = new ArrayList<>();
|
||||
Integer routeCodeIndex = routeList.stream().peek(mapRouteNewVO -> {
|
||||
if (mapRouteNewVO.getStationCode().equals(stationCode)) {
|
||||
deletingList.add(mapRouteNewVO.getId());
|
||||
}
|
||||
}).map(MapRouteNewVO::getCode)
|
||||
.map(c -> Integer.parseInt(c.substring(CodeGenerator.Prefix_Route.length())))
|
||||
.max(Integer::compareTo).orElse(0);
|
||||
// 联锁关系数据生成
|
||||
List<String> errorList = new ArrayList<>();
|
||||
List<Route> generatedRouteList = new ArrayList<>();
|
||||
CodeGenerator routeCodeGenerator = CodeGenerator.getRouteCodeGenerator(routeCodeIndex);
|
||||
// 获取所有信号机
|
||||
List<Signal> signalList = deviceMap.values().stream()
|
||||
.filter(mapElement -> mapElement.getDeviceType().equals(MapElement.DeviceType.SIGNAL))
|
||||
.map(mapElement -> ((Signal) mapElement))
|
||||
.filter(signal -> signal.getInterlockStation().getCode().equals(stationCode))
|
||||
.collect(Collectors.toList());
|
||||
log.info(String.format("共有信号机[%s]个", signalList.size()));
|
||||
signalList.sort((signal1, signal2) -> {
|
||||
String s1 = signal1.getShowName();
|
||||
String s2 = signal2.getShowName();
|
||||
return s1.length() != s2.length() ? s1.length() - s2.length() : s1.compareTo(s2);
|
||||
});
|
||||
for (Signal signal : signalList) {
|
||||
// 列车兼调车信号机、调车信号机
|
||||
if (signal.getType().equals(Signal.SignalType.SHUNTING2)) {
|
||||
signal.setType(Signal.SignalType.SHUNTING);
|
||||
generatedRouteList.addAll(this.generateRouteDepot(signal, routeCodeGenerator, generateConfig, errorList));
|
||||
signal.setType(Signal.SignalType.SHUNTING2);
|
||||
generatedRouteList.addAll(this.generateRouteDepot(signal, routeCodeGenerator, generateConfig, errorList));
|
||||
} else if (signal.getType().equals(Signal.SignalType.SHUNTING)) {
|
||||
generatedRouteList.addAll(this.generateRouteDepot(signal, routeCodeGenerator, generateConfig, errorList));
|
||||
}
|
||||
}
|
||||
log.info(String.format("生成一般进路[%s]条", generatedRouteList.size()));
|
||||
// // 进路敌对关系构建
|
||||
this.buildRouteConflict(generatedRouteList);
|
||||
|
||||
if (!CollectionUtils.isEmpty(errorList)) {
|
||||
for (String errMsg : errorList) {
|
||||
log.warn(String.format("联锁数据生成警告信息:[%s]", errMsg));
|
||||
}
|
||||
}
|
||||
// 删除旧数据,保存新数据
|
||||
this.draftMapRouteService.deleteRoutes(deletingList);
|
||||
this.draftMapRouteService.createRoutes(mapId, generatedRouteList.stream()
|
||||
.map(MapRouteNewVO::fromBO).collect(Collectors.toList()));
|
||||
return generatedRouteList.size();
|
||||
}
|
||||
|
||||
/**
|
||||
* 唯一编码生成器
|
||||
*/
|
||||
@ -519,7 +593,7 @@ public class DraftMapCiDataGeneratorImpl implements DraftMapCiDataGenerator {
|
||||
clone.setInterlockStation(route.getInterlockStation());
|
||||
clone.setStart(route.getStart());
|
||||
clone.setDestination(route.getDestination());
|
||||
clone.setOpenGreen(route.isOpenGreen());
|
||||
clone.setAspect(route.getAspect());
|
||||
clone.setSectionList(route.getSectionList());
|
||||
clone.setSwitchList(route.getSwitchList());
|
||||
clone.setPsdList(route.getPsdList());
|
||||
@ -644,6 +718,73 @@ public class DraftMapCiDataGeneratorImpl implements DraftMapCiDataGenerator {
|
||||
return routeList;
|
||||
}
|
||||
|
||||
private List<Route> generateRouteDepot(Signal start, CodeGenerator routeCodeGenerator,
|
||||
MapCiGenerateConfig config, List<String> errorList) {
|
||||
boolean right = start.isRight();
|
||||
Section startSection = start.getSection().getSectionOf(right);
|
||||
List<SectionPath> routePathList = new ArrayList<>();
|
||||
getRoutePathOfDepot(start, startSection, new SectionPath(right), routePathList, config, errorList);
|
||||
return buildRouteFromPathDepot(start, routeCodeGenerator, routePathList, config, errorList);
|
||||
}
|
||||
|
||||
private List<Route> buildRouteFromPathDepot(Signal startSignal, CodeGenerator routeCodeGenerator, List<SectionPath> routePathList,
|
||||
MapCiGenerateConfig config, List<String> errorList) {
|
||||
boolean right = startSignal.isRight();
|
||||
List<Route> routeList = new ArrayList<>();
|
||||
if (!CollectionUtils.isEmpty(routePathList)) {
|
||||
for (SectionPath sectionPath : routePathList) {
|
||||
Section lastSection = sectionPath.getLastSection();
|
||||
Signal.SignalType startSignalType = startSignal.getType();
|
||||
// 终端信号机
|
||||
Signal endSignal = lastSection.getSignalOf(right);
|
||||
Signal.SignalType endSignalType = Objects.nonNull(endSignal) ? endSignal.getType() : null;
|
||||
// 反向信号机
|
||||
Signal endOpSignal = lastSection.getSignalOf(!right);
|
||||
Signal.SignalType endOpSignalType = Objects.nonNull(endOpSignal) ? endOpSignal.getType() : null;
|
||||
Section nextSection = lastSection.getSectionOf(right);
|
||||
// 下个区段反向信号机
|
||||
Signal nextOpSignal = Objects.nonNull(nextSection) ? nextSection.getSignalOf(!right) : null;
|
||||
Signal clickEnd;
|
||||
|
||||
SignalAspect signalAspect;
|
||||
if (startSignalType.equals(endSignalType) && Signal.SignalType.SHUNTING2.equals(startSignalType)) {
|
||||
// 列车进路
|
||||
signalAspect = SignalAspect.Y;
|
||||
if (Objects.nonNull(endOpSignal) && endOpSignalType.equals(startSignalType)) {
|
||||
clickEnd = endOpSignal;
|
||||
} else {
|
||||
clickEnd = endSignal;
|
||||
}
|
||||
} else {
|
||||
// 调车进路
|
||||
signalAspect = SignalAspect.W;
|
||||
if (Objects.nonNull(nextOpSignal)) {
|
||||
// 下个区段反向信号机存在,则使用
|
||||
clickEnd = nextOpSignal;
|
||||
} else if ((Objects.isNull(nextSection) || Signal.SignalType.BLOCKING.equals(endSignalType))
|
||||
&& Objects.nonNull(endOpSignal) && sectionPath.getSectionList().size() > 1) {
|
||||
// 尽头/阻挡信号机,使用反向信号机,过滤列车兼调车信号机至尽头
|
||||
clickEnd = endOpSignal;
|
||||
} else {
|
||||
// 其余设置为终端信号机,可能为null
|
||||
clickEnd = endSignal;
|
||||
}
|
||||
}
|
||||
|
||||
String endName = Objects.nonNull(endSignal) ? endSignal.getShowName() : lastSection.getName();
|
||||
// 构建进路
|
||||
String code = routeCodeGenerator.next();
|
||||
String name = String.format("%s-%s", startSignal.getShowName(), endName);
|
||||
Route route = this.buildRouteDepot(code, name, startSignal, endSignal, clickEnd, sectionPath, signalAspect);
|
||||
routeList.add(route);
|
||||
}
|
||||
} else {
|
||||
errorList.add(String.format("以[%s(%s)]为始端信号(%s)的进路未搜索到", startSignal.getShowName(),
|
||||
startSignal.getCode(), startSignal.getType()));
|
||||
}
|
||||
return routeList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询距给给定信号机最近的信号机
|
||||
*
|
||||
@ -1187,7 +1328,7 @@ public class DraftMapCiDataGeneratorImpl implements DraftMapCiDataGenerator {
|
||||
tbRoute.setSwitchList(route.getSwitchList());
|
||||
tbRoute.setSetOverlapInCtc(route.isSetOverlapInCtc());
|
||||
tbRoute.setOverlap(route.getOverlap());
|
||||
tbRoute.setOpenGreen(route.isOpenGreen());
|
||||
tbRoute.setAspect(route.getAspect());
|
||||
// 根据信号机和区段是否同向,设置进路联锁自排和是否车队模式
|
||||
tbRoute.setFlt(route.isFlt());
|
||||
tbRoute.setArs(route.isArs());
|
||||
@ -1288,19 +1429,18 @@ public class DraftMapCiDataGeneratorImpl implements DraftMapCiDataGenerator {
|
||||
route.setSectionList(sectionPath.getSectionList());
|
||||
route.setSwitchList(sectionPath.getSwitchList());
|
||||
route.setOverlap(routeOverlap);
|
||||
if (alwaysGreen) { // 进路始端信号机是否总是开绿灯
|
||||
route.setOpenGreen(true);
|
||||
} else { // 根据进路道岔是否有反位,设置开绿灯/黄灯
|
||||
boolean greenOpen = true;
|
||||
if (!CollectionUtils.isEmpty(sectionPath.getSwitchList())) {
|
||||
for (SwitchElement switchElement : sectionPath.getSwitchList()) {
|
||||
if (!switchElement.isNormal()) {
|
||||
greenOpen = false;
|
||||
break;
|
||||
}
|
||||
SignalModel signalModel = start.getSignalModel();
|
||||
switch (signalModel) {
|
||||
case RGY:{
|
||||
route.setAspect(SignalAspect.G);
|
||||
if (!alwaysGreen && sectionPath.containRpSwitch()) {
|
||||
route.setAspect(SignalAspect.Y);
|
||||
}
|
||||
break;
|
||||
}
|
||||
route.setOpenGreen(greenOpen);
|
||||
case BW:
|
||||
route.setAspect(SignalAspect.W);
|
||||
break;
|
||||
}
|
||||
route.setTurnBack(false);
|
||||
// 根据信号机和区段是否同向,设置进路联锁自排和是否车队模式
|
||||
@ -1356,6 +1496,24 @@ public class DraftMapCiDataGeneratorImpl implements DraftMapCiDataGenerator {
|
||||
return route;
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建车辆段进路
|
||||
*/
|
||||
private Route buildRouteDepot(String code, String name, Signal start, Signal end,
|
||||
Signal endButton, SectionPath sectionPath, SignalAspect signalAspect) {
|
||||
Route route = new Route(code, name);
|
||||
route.setInterlockStation(start.getInterlockStation());
|
||||
route.setStart(start);
|
||||
route.setDestination(end);
|
||||
route.setDestinationButtonSignal(endButton);
|
||||
route.setSectionList(sectionPath.getSectionList());
|
||||
route.setSwitchList(sectionPath.getSwitchList());
|
||||
route.setAspect(signalAspect);
|
||||
route.setPsdList(Collections.emptyList());
|
||||
route.setEspList(Collections.emptyList());
|
||||
return route;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据路径创建延续保护
|
||||
*
|
||||
@ -1763,6 +1921,121 @@ public class DraftMapCiDataGeneratorImpl implements DraftMapCiDataGenerator {
|
||||
}
|
||||
}
|
||||
|
||||
private void getRoutePathOfDepot(Signal startSignal, Section section,
|
||||
SectionPath tempPath, List<SectionPath> routePathList,
|
||||
MapCiGenerateConfig config, List<String> errorList) {
|
||||
boolean right = startSignal.isRight();
|
||||
if (!CollectionUtils.isEmpty(tempPath.getSectionList())) {
|
||||
Signal signal = tempPath.getLastSection().getSignalOf(right);
|
||||
if (startSignal.getType().equals(Signal.SignalType.SHUNTING2)) {
|
||||
// 同向类型相同信号机, // 列车兼调车信号机 -> 列车兼调车信号机
|
||||
if (Objects.nonNull(signal) && signal.getType().equals(startSignal.getType())) {
|
||||
routePathList.add(tempPath);
|
||||
return;
|
||||
}
|
||||
if (Objects.isNull(section)) {
|
||||
Signal lastSignal = tempPath.getLastSection().getSignalOf(!right);
|
||||
if (Objects.nonNull(lastSignal) && lastSignal.getType().equals(startSignal.getType())) {
|
||||
routePathList.add(tempPath);
|
||||
}
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
// 同向类型相同信号机
|
||||
if (Objects.nonNull(signal)) {
|
||||
// 调车信号机 -> 调车信号机, 过滤只有一个区段的情况(进段信号机 -> 调车信号机)
|
||||
if (signal.getType().equals(startSignal.getType())) {
|
||||
if (tempPath.getSectionList().size() > 1) {
|
||||
routePathList.add(tempPath);
|
||||
}
|
||||
return;
|
||||
}
|
||||
// 调车信号机 -> 列车兼调车信号机, 存在只有一个区段的情况
|
||||
if (signal.getType().equals(Signal.SignalType.SHUNTING2)) {
|
||||
routePathList.add(tempPath);
|
||||
return;
|
||||
}
|
||||
// 调车信号机 -> 阻挡信号机
|
||||
if (signal.getType().equals(Signal.SignalType.BLOCKING)) {
|
||||
routePathList.add(tempPath);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (Objects.isNull(section)) {
|
||||
// 尽头有反向信号机
|
||||
if (Objects.nonNull(tempPath.getLastSection().getSignalOf(!right))) {
|
||||
routePathList.add(tempPath);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
tempPath.addSection(section);
|
||||
if (section.isSwitchTrack()) {
|
||||
Switch relSwitch = section.getRelSwitch();
|
||||
Switch linkedSwitch = relSwitch.queryLinkedSwitch();
|
||||
if (relSwitch.isA(section)) {
|
||||
// 路径存在两种情况,道岔定位从A->B和道岔反位从A->C
|
||||
// 产生分化递归
|
||||
SectionPath npPath = tempPath.cloneNew();// 定位路径
|
||||
npPath.addSection(relSwitch.getB());
|
||||
npPath.addSwitchElement(new SwitchElement(relSwitch, true));
|
||||
// 没有侧防,且联动道岔存在
|
||||
if (!config.isGenerateFls() && Objects.nonNull(linkedSwitch)) {
|
||||
npPath.addSwitchElement(new SwitchElement(linkedSwitch, true));
|
||||
}
|
||||
getRoutePathOfDepot(startSignal, relSwitch.getB().getSectionOf(right), npPath, routePathList, config, errorList);
|
||||
SectionPath rpPath = tempPath.cloneNew();// 反位路径
|
||||
rpPath.addSection(relSwitch.getC());
|
||||
rpPath.addSwitchElement(new SwitchElement(relSwitch, false));
|
||||
// 如果是同一道岔计轴,添加另一道岔定位
|
||||
Switch otherSwitch = relSwitch.queryAxleRelatedOtherSwitch();
|
||||
if (!config.isGenerateFls() && Objects.nonNull(otherSwitch) && relSwitch.isBConnectTo(otherSwitch)) {
|
||||
rpPath.addSwitchElement(new SwitchElement(otherSwitch, true));
|
||||
// 另一道岔联动道岔也需要
|
||||
Switch otherLinkSwitch = otherSwitch.queryLinkedSwitch();
|
||||
if (otherLinkSwitch != null) {
|
||||
rpPath.addSwitchElement(new SwitchElement(otherLinkSwitch, true));
|
||||
}
|
||||
}
|
||||
getRoutePathOfDepot(startSignal, relSwitch.getC().getSectionOf(right), rpPath, routePathList, config, errorList);
|
||||
} else if (relSwitch.isB(section)) {
|
||||
// 只有一条路径,从B->A,道岔定位
|
||||
tempPath.addSection(relSwitch.getA());
|
||||
tempPath.addSwitchElement(new SwitchElement(relSwitch, true));
|
||||
// 没有侧防,且联动道岔存在
|
||||
if (!config.isGenerateFls() && Objects.nonNull(linkedSwitch)) {
|
||||
tempPath.addSwitchElement(new SwitchElement(linkedSwitch, true));
|
||||
}
|
||||
getRoutePathOfDepot(startSignal, relSwitch.getA().getSectionOf(right), tempPath, routePathList, config, errorList);
|
||||
} else if (relSwitch.isC(section)) {
|
||||
// 只有一条路径,从C->A,道岔反位
|
||||
tempPath.addSection(relSwitch.getA());
|
||||
tempPath.addSwitchElement(new SwitchElement(relSwitch, false));
|
||||
// 如果是同一道岔计轴,添加另一道岔定位
|
||||
Switch otherSwitch = relSwitch.queryAxleRelatedOtherSwitch();
|
||||
if (!config.isGenerateFls() && Objects.nonNull(otherSwitch)) {
|
||||
tempPath.addSwitchElement(new SwitchElement(otherSwitch, true));
|
||||
// 另一道岔联动道岔也需要
|
||||
Switch otherLinkSwitch = otherSwitch.queryLinkedSwitch();
|
||||
if (otherLinkSwitch != null) {
|
||||
tempPath.addSwitchElement(new SwitchElement(otherLinkSwitch, true));
|
||||
}
|
||||
}
|
||||
getRoutePathOfDepot(startSignal, relSwitch.getA().getSectionOf(right), tempPath, routePathList, config, errorList);
|
||||
} else {
|
||||
errorList.add(String.format("地图基础数据有错误:区段[%s(%s)]关联了道岔[%s(%s)],却不是此道岔的关联区段",
|
||||
section.getName(), section.getCode(),
|
||||
relSwitch.getName(), relSwitch.getCode()));
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
// 非道岔区段
|
||||
Section next = section.getSectionOf(right);
|
||||
getRoutePathOfDepot(startSignal, next, tempPath, routePathList, config, errorList);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成接近区段
|
||||
*
|
||||
|
@ -14,4 +14,6 @@ public interface DraftMapDataHandleService {
|
||||
void handleDoublePathRoute(Long mapId);
|
||||
|
||||
void handleSignalApproach(Long mapId);
|
||||
|
||||
void handleRouteSignalAspect();
|
||||
}
|
||||
|
@ -8,11 +8,19 @@ import club.joylink.rtss.entity.*;
|
||||
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
|
||||
import club.joylink.rtss.services.IDraftMapService;
|
||||
import club.joylink.rtss.simulation.cbtc.build.SimulationBuilder;
|
||||
import club.joylink.rtss.simulation.cbtc.constant.SignalAspect;
|
||||
import club.joylink.rtss.simulation.cbtc.data.map.*;
|
||||
import club.joylink.rtss.simulation.rt.repo.CommonRepository;
|
||||
import club.joylink.rtss.simulation.rt.repo.CommonRepositoryBuilder;
|
||||
import club.joylink.rtss.util.JsonUtils;
|
||||
import club.joylink.rtss.vo.map.*;
|
||||
import club.joylink.rtss.vo.map.graph.MapSectionNewVO;
|
||||
import club.joylink.rtss.vo.map.graph.MapSignalNewVO;
|
||||
import club.joylink.rtss.vo.map.graph.MapStationStandNewVO;
|
||||
import club.joylink.rtss.vo.map.graph.MapSwitchVO;
|
||||
import club.joylink.rtss.vo.map.graph.Point;
|
||||
import club.joylink.rtss.vo.map.logic.MapRouteNewVO;
|
||||
import club.joylink.rtss.vo.map.logic.MapSignalApproachSectionVO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -32,7 +40,8 @@ public class DraftMapDataHandleServiceImpl implements DraftMapDataHandleService
|
||||
|
||||
@Autowired
|
||||
private DraftMapRouteDAO draftMapRouteDAO;
|
||||
|
||||
@Autowired
|
||||
private DraftMapRouteService draftMapRouteService;
|
||||
@Autowired
|
||||
private DraftMapOverlapDAO draftMapOverlapDAO;
|
||||
@Autowired
|
||||
@ -230,6 +239,24 @@ public class DraftMapDataHandleServiceImpl implements DraftMapDataHandleService
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleRouteSignalAspect() {
|
||||
List<DraftMap> all = this.draftMapDAO.selectByExample(null);
|
||||
for (DraftMap draftMap : all) {
|
||||
Long mapId = draftMap.getId();
|
||||
List<MapRouteNewVO> allRoutes = this.draftMapRouteService.queryAllRoutes(mapId);
|
||||
for (MapRouteNewVO route : allRoutes) {
|
||||
if (route.isGreenOpen()) {
|
||||
route.setAspect(SignalAspect.G);
|
||||
} else {
|
||||
route.setAspect(SignalAspect.Y);
|
||||
}
|
||||
DraftMapRoute draft = route.convert2Draft();
|
||||
this.draftMapRouteDAO.updateByPrimaryKeyWithBLOBs(draft);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void calculateSectionLengthThroughStationKmPostVal(MapVO mapVO) {
|
||||
SimulationBuilder.SimulationDeviceBuildResult buildResult = SimulationBuilder.checkAndBuildBasicMapData(mapVO);
|
||||
for (String errMsg : buildResult.getErrMsgList()) {
|
||||
|
@ -1,7 +1,7 @@
|
||||
package club.joylink.rtss.services.draftData;
|
||||
|
||||
import club.joylink.rtss.vo.client.PageVO;
|
||||
import club.joylink.rtss.vo.map.MapRouteFlankProtectionNewVO;
|
||||
import club.joylink.rtss.vo.map.logic.MapRouteFlankProtectionNewVO;
|
||||
import club.joylink.rtss.vo.map.query.MapRouteFlankProtectionQueryVO;
|
||||
|
||||
public interface DraftMapFlankProtectionService {
|
||||
|
@ -5,7 +5,7 @@ import club.joylink.rtss.entity.DraftMapRouteFlankProtection;
|
||||
import club.joylink.rtss.entity.DraftMapRouteFlankProtectionExample;
|
||||
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
|
||||
import club.joylink.rtss.vo.client.PageVO;
|
||||
import club.joylink.rtss.vo.map.MapRouteFlankProtectionNewVO;
|
||||
import club.joylink.rtss.vo.map.logic.MapRouteFlankProtectionNewVO;
|
||||
import club.joylink.rtss.vo.map.query.MapRouteFlankProtectionQueryVO;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
|
@ -1,7 +1,7 @@
|
||||
package club.joylink.rtss.services.draftData;
|
||||
|
||||
import club.joylink.rtss.vo.client.PageVO;
|
||||
import club.joylink.rtss.vo.map.MapRouteFlankProtectionNewVO;
|
||||
import club.joylink.rtss.vo.map.logic.MapRouteFlankProtectionNewVO;
|
||||
import club.joylink.rtss.vo.map.query.MapRouteFlankProtectionQueryVO;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -5,7 +5,7 @@ import club.joylink.rtss.entity.DraftMapRouteFlankProtection;
|
||||
import club.joylink.rtss.entity.DraftMapRouteFlankProtectionExample;
|
||||
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
|
||||
import club.joylink.rtss.vo.client.PageVO;
|
||||
import club.joylink.rtss.vo.map.MapRouteFlankProtectionNewVO;
|
||||
import club.joylink.rtss.vo.map.logic.MapRouteFlankProtectionNewVO;
|
||||
import club.joylink.rtss.vo.map.query.MapRouteFlankProtectionQueryVO;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
|
@ -1,7 +1,7 @@
|
||||
package club.joylink.rtss.services.draftData;
|
||||
|
||||
import club.joylink.rtss.vo.client.PageVO;
|
||||
import club.joylink.rtss.vo.map.MapOverlapVO;
|
||||
import club.joylink.rtss.vo.map.logic.MapOverlapVO;
|
||||
import club.joylink.rtss.vo.map.query.MapOverlapQueryVO;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -5,7 +5,7 @@ import club.joylink.rtss.entity.DraftMapOverlap;
|
||||
import club.joylink.rtss.entity.DraftMapOverlapExample;
|
||||
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
|
||||
import club.joylink.rtss.vo.client.PageVO;
|
||||
import club.joylink.rtss.vo.map.MapOverlapVO;
|
||||
import club.joylink.rtss.vo.map.logic.MapOverlapVO;
|
||||
import club.joylink.rtss.vo.map.query.MapOverlapQueryVO;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
|
@ -2,7 +2,7 @@ package club.joylink.rtss.services.draftData;
|
||||
|
||||
import club.joylink.rtss.vo.client.PageVO;
|
||||
import club.joylink.rtss.vo.client.map.MapRouteOverrunQueryVO;
|
||||
import club.joylink.rtss.vo.map.MapRouteOverrunVO;
|
||||
import club.joylink.rtss.vo.map.logic.MapRouteOverrunVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -6,7 +6,7 @@ import club.joylink.rtss.entity.DraftMapRouteOverrunExample;
|
||||
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
|
||||
import club.joylink.rtss.vo.client.PageVO;
|
||||
import club.joylink.rtss.vo.client.map.MapRouteOverrunQueryVO;
|
||||
import club.joylink.rtss.vo.map.MapRouteOverrunVO;
|
||||
import club.joylink.rtss.vo.map.logic.MapRouteOverrunVO;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -2,7 +2,7 @@ package club.joylink.rtss.services.draftData;
|
||||
|
||||
import club.joylink.rtss.vo.client.PageVO;
|
||||
import club.joylink.rtss.vo.client.map.MapRouteQueryVO;
|
||||
import club.joylink.rtss.vo.map.MapRouteNewVO;
|
||||
import club.joylink.rtss.vo.map.logic.MapRouteNewVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -13,13 +13,17 @@ public interface DraftMapRouteService {
|
||||
|
||||
List<MapRouteNewVO> queryAllRoutes(Long id);
|
||||
|
||||
void update(Long id, String routeCode, MapRouteNewVO routeNewVO);
|
||||
void update(Long mapId, String routeCode, MapRouteNewVO routeNewVO);
|
||||
|
||||
void deleteRoute(Long id, String code);
|
||||
|
||||
void deleteRoutes(List<Long> ids);
|
||||
|
||||
void deleteStandHoldList(Long mapId);
|
||||
|
||||
void setSetOverlapInCtcFalse(Long mapId);
|
||||
|
||||
void createRoute(long draftMapId, MapRouteNewVO routeNewVO);
|
||||
|
||||
void createRoutes(Long draftMapId, List<MapRouteNewVO> routeList);
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ import club.joylink.rtss.simulation.rt.repo.CommonRepositoryBuilder;
|
||||
import club.joylink.rtss.vo.client.PageVO;
|
||||
import club.joylink.rtss.vo.client.map.MapRouteQueryVO;
|
||||
import club.joylink.rtss.vo.map.MapGraphDataNewVO;
|
||||
import club.joylink.rtss.vo.map.MapRouteNewVO;
|
||||
import club.joylink.rtss.vo.map.logic.MapRouteNewVO;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -106,11 +106,11 @@ public class DraftMapRouteServiceImpl implements DraftMapRouteService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(Long id, String routeCode, MapRouteNewVO routeNewVO) {
|
||||
public void update(Long mapId, String routeCode, MapRouteNewVO routeNewVO) {
|
||||
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertHasText(routeNewVO.getName());
|
||||
DraftMapRouteExample example = new DraftMapRouteExample();
|
||||
example.createCriteria()
|
||||
.andMapIdEqualTo(id)
|
||||
.andMapIdEqualTo(mapId)
|
||||
.andCodeEqualTo(routeCode);
|
||||
List<DraftMapRoute> draftMapRoutes = this.draftMapRouteDAO.selectByExampleWithBLOBs(example);
|
||||
BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertCollectionNotEmpty(draftMapRoutes);
|
||||
@ -154,6 +154,16 @@ public class DraftMapRouteServiceImpl implements DraftMapRouteService {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteRoutes(List<Long> ids) {
|
||||
if (CollectionUtils.isEmpty(ids)) {
|
||||
return;
|
||||
}
|
||||
DraftMapRouteExample example = new DraftMapRouteExample();
|
||||
example.createCriteria().andIdIn(ids);
|
||||
this.draftMapRouteDAO.deleteByExample(example);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteStandHoldList(Long mapId) {
|
||||
List<MapRouteNewVO> mapRouteNewVOS = queryAllRoutes(mapId);
|
||||
@ -190,4 +200,12 @@ public class DraftMapRouteServiceImpl implements DraftMapRouteService {
|
||||
routeNewVO.setCode(code);
|
||||
draftMapRouteDAO.insert(routeNewVO.convert2Draft());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createRoutes(Long draftMapId, List<MapRouteNewVO> routeList) {
|
||||
routeList.forEach(mapRouteNewVO -> {
|
||||
mapRouteNewVO.setMapId(draftMapId);
|
||||
draftMapRouteDAO.insert(mapRouteNewVO.convert2Draft());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
package club.joylink.rtss.services.draftData;
|
||||
|
||||
import club.joylink.rtss.vo.client.PageVO;
|
||||
import club.joylink.rtss.vo.map.MapStationRunLevelVO;
|
||||
import club.joylink.rtss.vo.map.logic.MapStationRunLevelVO;
|
||||
import club.joylink.rtss.vo.map.query.MapRunLevelQueryVO;
|
||||
|
||||
public interface DraftMapRunLevelService {
|
||||
|
@ -11,8 +11,8 @@ import club.joylink.rtss.simulation.cbtc.data.map.MapElement;
|
||||
import club.joylink.rtss.simulation.cbtc.data.map.Section;
|
||||
import club.joylink.rtss.vo.client.PageVO;
|
||||
import club.joylink.rtss.vo.client.map.MapDataVO;
|
||||
import club.joylink.rtss.vo.map.MapRoutingDataVO;
|
||||
import club.joylink.rtss.vo.map.MapStationRunLevelVO;
|
||||
import club.joylink.rtss.vo.map.logic.MapRoutingDataVO;
|
||||
import club.joylink.rtss.vo.map.logic.MapStationRunLevelVO;
|
||||
import club.joylink.rtss.vo.map.MapVO;
|
||||
import club.joylink.rtss.vo.map.query.MapRunLevelQueryVO;
|
||||
import com.github.pagehelper.Page;
|
||||
|
@ -1,6 +1,16 @@
|
||||
package club.joylink.rtss.services.draftData;
|
||||
|
||||
import club.joylink.rtss.vo.map.*;
|
||||
import club.joylink.rtss.vo.map.logic.MapAutoReentryVO;
|
||||
import club.joylink.rtss.vo.map.logic.MapAutoSignalNewVO;
|
||||
import club.joylink.rtss.vo.map.logic.MapDestinationCodeDefinitionVO;
|
||||
import club.joylink.rtss.vo.map.logic.MapOverlapVO;
|
||||
import club.joylink.rtss.vo.map.logic.MapRouteFlankProtectionNewVO;
|
||||
import club.joylink.rtss.vo.map.logic.MapRouteNewVO;
|
||||
import club.joylink.rtss.vo.map.logic.MapRoutingDataVO;
|
||||
import club.joylink.rtss.vo.map.logic.MapSignalApproachSectionVO;
|
||||
import club.joylink.rtss.vo.map.logic.MapStationParkingTimeVO;
|
||||
import club.joylink.rtss.vo.map.logic.MapStationRunLevelVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -4,6 +4,16 @@ import club.joylink.rtss.dao.*;
|
||||
import club.joylink.rtss.entity.*;
|
||||
import club.joylink.rtss.util.JsonUtils;
|
||||
import club.joylink.rtss.vo.map.*;
|
||||
import club.joylink.rtss.vo.map.logic.MapAutoReentryVO;
|
||||
import club.joylink.rtss.vo.map.logic.MapAutoSignalNewVO;
|
||||
import club.joylink.rtss.vo.map.logic.MapDestinationCodeDefinitionVO;
|
||||
import club.joylink.rtss.vo.map.logic.MapOverlapVO;
|
||||
import club.joylink.rtss.vo.map.logic.MapRouteFlankProtectionNewVO;
|
||||
import club.joylink.rtss.vo.map.logic.MapRouteNewVO;
|
||||
import club.joylink.rtss.vo.map.logic.MapRoutingDataVO;
|
||||
import club.joylink.rtss.vo.map.logic.MapSignalApproachSectionVO;
|
||||
import club.joylink.rtss.vo.map.logic.MapStationParkingTimeVO;
|
||||
import club.joylink.rtss.vo.map.logic.MapStationRunLevelVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
@ -1,7 +1,7 @@
|
||||
package club.joylink.rtss.services.draftData;
|
||||
|
||||
import club.joylink.rtss.vo.client.PageVO;
|
||||
import club.joylink.rtss.vo.map.MapSignalApproachSectionVO;
|
||||
import club.joylink.rtss.vo.map.logic.MapSignalApproachSectionVO;
|
||||
import club.joylink.rtss.vo.map.query.MapSASQueryVO;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -7,7 +7,7 @@ import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
|
||||
import club.joylink.rtss.simulation.rt.repo.CommonRepository;
|
||||
import club.joylink.rtss.simulation.rt.repo.CommonRepositoryBuilder;
|
||||
import club.joylink.rtss.vo.client.PageVO;
|
||||
import club.joylink.rtss.vo.map.MapSignalApproachSectionVO;
|
||||
import club.joylink.rtss.vo.map.logic.MapSignalApproachSectionVO;
|
||||
import club.joylink.rtss.vo.map.MapVO;
|
||||
import club.joylink.rtss.vo.map.query.MapSASQueryVO;
|
||||
import com.github.pagehelper.Page;
|
||||
|
@ -7,7 +7,7 @@ import club.joylink.rtss.simulation.cbtc.build.SimulationBuilder;
|
||||
import club.joylink.rtss.simulation.cbtc.data.map.MapElement;
|
||||
import club.joylink.rtss.simulation.cbtc.data.map.Section;
|
||||
import club.joylink.rtss.util.JsonUtils;
|
||||
import club.joylink.rtss.vo.map.MapStationParkingTimeVO;
|
||||
import club.joylink.rtss.vo.map.logic.MapStationParkingTimeVO;
|
||||
import club.joylink.rtss.vo.map.MapVO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -3,7 +3,7 @@ package club.joylink.rtss.services.draftData;
|
||||
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
|
||||
import club.joylink.rtss.simulation.rt.repo.*;
|
||||
import club.joylink.rtss.vo.map.MapCISwitchVO;
|
||||
import club.joylink.rtss.vo.map.MapRouteNewVO;
|
||||
import club.joylink.rtss.vo.map.logic.MapRouteNewVO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
package club.joylink.rtss.services.draftData;
|
||||
|
||||
import club.joylink.rtss.simulation.cbtc.data.map.*;
|
||||
import club.joylink.rtss.vo.map.MapRoutingDataVO;
|
||||
import club.joylink.rtss.vo.map.logic.MapRoutingDataVO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
@ -175,7 +175,9 @@ public class RoutingGenerator {
|
||||
}
|
||||
}
|
||||
if (!finish) {
|
||||
queryList.add(route.getDestination());
|
||||
if (route.getDestination() != null) {
|
||||
queryList.add(route.getDestination());
|
||||
}
|
||||
}
|
||||
}
|
||||
for (Signal next : queryList) {
|
||||
|
@ -9,9 +9,9 @@ import club.joylink.rtss.simulation.cbtc.data.map.MapElement;
|
||||
import club.joylink.rtss.simulation.cbtc.data.map.Section;
|
||||
import club.joylink.rtss.simulation.cbtc.data.support.RoutePath;
|
||||
import club.joylink.rtss.util.JsonUtils;
|
||||
import club.joylink.rtss.vo.map.MapRoutingDataVO;
|
||||
import club.joylink.rtss.vo.map.logic.MapRoutingDataVO;
|
||||
import club.joylink.rtss.vo.map.MapRoutingSectionNewVO;
|
||||
import club.joylink.rtss.vo.map.MapStationRunLevelVO;
|
||||
import club.joylink.rtss.vo.map.logic.MapStationRunLevelVO;
|
||||
import club.joylink.rtss.vo.map.MapVO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -2,7 +2,7 @@ package club.joylink.rtss.services.draftData;
|
||||
|
||||
import club.joylink.rtss.simulation.rt.repo.*;
|
||||
import club.joylink.rtss.vo.map.MapSectionPathVO;
|
||||
import club.joylink.rtss.vo.map.MapSignalApproachSectionVO;
|
||||
import club.joylink.rtss.vo.map.logic.MapSignalApproachSectionVO;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
@ -179,4 +179,6 @@ public interface DeviceService {
|
||||
void addOrUpdateGzbDeviceConfig(AccountVO accountVO);
|
||||
|
||||
void addOrUpdateSdyDeviceConfig(AccountVO accountVO);
|
||||
|
||||
void addOrUpdateRichorDeviceConfig(AccountVO accountVO);
|
||||
}
|
||||
|
@ -12,6 +12,10 @@ import club.joylink.rtss.vo.client.PageVO;
|
||||
import club.joylink.rtss.vo.client.project.*;
|
||||
import club.joylink.rtss.vo.client.project.gzb.GzbSignalConfigVO;
|
||||
import club.joylink.rtss.vo.client.project.gzb.GzbSwitchConfigVO;
|
||||
import club.joylink.rtss.vo.client.project.richor.RichorDcuConfigVO;
|
||||
import club.joylink.rtss.vo.client.project.richor.RichorIbpConfigVO;
|
||||
import club.joylink.rtss.vo.client.project.richor.RichorPsdConfigVO;
|
||||
import club.joylink.rtss.vo.client.project.richor.RichorPslConfigVO;
|
||||
import club.joylink.rtss.vo.client.project.sdy.SdyPsdConfigVO;
|
||||
import club.joylink.rtss.vo.client.project.sdy.SdyPslConfigVO;
|
||||
import club.joylink.rtss.vo.client.project.xty.XtyPsdConfigVO;
|
||||
@ -378,6 +382,78 @@ public class DeviceServiceImpl implements DeviceService {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addOrUpdateRichorDeviceConfig(AccountVO accountVO) {
|
||||
// 删除旧配置
|
||||
ProjectDeviceExample example = new ProjectDeviceExample();
|
||||
example.createCriteria()
|
||||
.andProjectCodeEqualTo(Project.RICHOR_JOINT.name())
|
||||
.andTypeIn(ProjectDeviceType.PlcDeviceList().stream()
|
||||
.map(Enum::name).collect(Collectors.toList()));
|
||||
this.projectDeviceDAO.deleteByExample(example);
|
||||
// 保存新配置
|
||||
List<ProjectDevice> list = this.buildRichorProjectDevices(accountVO);
|
||||
for (ProjectDevice projectDevice : list) {
|
||||
this.projectDeviceDAO.insert(projectDevice);
|
||||
}
|
||||
}
|
||||
|
||||
private List<ProjectDevice> buildRichorProjectDevices(AccountVO accountVO) {
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
List<ProjectDevice> list = new ArrayList<>();
|
||||
// PLC网关
|
||||
ProjectDevice plcGateway = new ProjectDevice();
|
||||
plcGateway.setProjectCode(Project.RICHOR_JOINT.name());
|
||||
plcGateway.setCode("richorJoint-gateway");
|
||||
plcGateway.setType(ProjectDeviceType.PLC_GATEWAY.name());
|
||||
plcGateway.setCreator(accountVO.getId());
|
||||
plcGateway.setCreateTime(now);
|
||||
PlcGatewayConfigVO plcGatewayConfigVO = new PlcGatewayConfigVO(0, 144);
|
||||
plcGateway.setConfig(plcGatewayConfigVO.toJson());
|
||||
list.add(plcGateway);
|
||||
// 屏蔽门
|
||||
ProjectDevice psd = new ProjectDevice();
|
||||
psd.setProjectCode(Project.RICHOR_JOINT.name());
|
||||
psd.setCode("richorJoint-psd");
|
||||
psd.setType(ProjectDeviceType.PSD.name());
|
||||
psd.setCreator(accountVO.getId());
|
||||
psd.setCreateTime(now);
|
||||
RichorPsdConfigVO psdConfigVO = new RichorPsdConfigVO();
|
||||
psd.setConfig(psdConfigVO.toJson());
|
||||
list.add(psd);
|
||||
// IBP盘
|
||||
ProjectDevice ibp = new ProjectDevice();
|
||||
ibp.setProjectCode(Project.RICHOR_JOINT.name());
|
||||
ibp.setCode("richorJoint-ibp");
|
||||
ibp.setType(ProjectDeviceType.IBP.name());
|
||||
ibp.setCreator(accountVO.getId());
|
||||
ibp.setCreateTime(now);
|
||||
RichorIbpConfigVO ibpConfigVO = new RichorIbpConfigVO();
|
||||
ibp.setConfig(ibpConfigVO.toJson());
|
||||
list.add(ibp);
|
||||
// PSL
|
||||
ProjectDevice psl = new ProjectDevice();
|
||||
psl.setProjectCode(Project.RICHOR_JOINT.name());
|
||||
psl.setCode("richorJoint-psl");
|
||||
psl.setType(ProjectDeviceType.PSL.name());
|
||||
psl.setCreator(accountVO.getId());
|
||||
psl.setCreateTime(now);
|
||||
RichorPslConfigVO pslConfigVO = new RichorPslConfigVO();
|
||||
psl.setConfig(pslConfigVO.toJson());
|
||||
list.add(psl);
|
||||
// // DCU
|
||||
// ProjectDevice dcu = new ProjectDevice();
|
||||
// dcu.setProjectCode(Project.RICHOR_JOINT.name());
|
||||
// dcu.setCode("richorJoint-dcu");
|
||||
// dcu.setType(ProjectDeviceType.DCU.name());
|
||||
// dcu.setCreator(accountVO.getId());
|
||||
// dcu.setCreateTime(now);
|
||||
// RichorDcuConfigVO dcuConfigVO = new RichorDcuConfigVO();
|
||||
// dcu.setConfig(dcuConfigVO.toJson());
|
||||
// list.add(dcu);
|
||||
return list;
|
||||
}
|
||||
|
||||
private List<ProjectDevice> buildSdyProjectDevices(AccountVO accountVO) {
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
List<ProjectDevice> list = new ArrayList<>();
|
||||
|
@ -1,7 +1,7 @@
|
||||
package club.joylink.rtss.services.psl;
|
||||
|
||||
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
|
||||
import club.joylink.rtss.simulation.cbtc.CI.service.StandService;
|
||||
import club.joylink.rtss.simulation.cbtc.CI.device.CiStandService;
|
||||
import club.joylink.rtss.simulation.cbtc.GroupSimulationService;
|
||||
import club.joylink.rtss.simulation.cbtc.Simulation;
|
||||
import club.joylink.rtss.simulation.cbtc.constant.SimulationConstants;
|
||||
@ -10,6 +10,7 @@ import club.joylink.rtss.simulation.cbtc.data.map.PSD;
|
||||
import club.joylink.rtss.simulation.cbtc.data.map.Stand;
|
||||
import club.joylink.rtss.simulation.cbtc.data.vr.VirtualRealityPsl;
|
||||
import club.joylink.rtss.simulation.cbtc.data.vr.VirtualRealityScreenDoor;
|
||||
import club.joylink.rtss.simulation.cbtc.device.virtual.VirtualRealityDeviceService;
|
||||
import club.joylink.rtss.simulation.cbtc.event.SimulationPslStatusEvent;
|
||||
import club.joylink.rtss.vo.client.psl.PslStatus;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -30,7 +31,9 @@ public class VirtualRealityPslService implements IVirtualRealityPslService{
|
||||
private ApplicationContext applicationContext;
|
||||
|
||||
@Autowired
|
||||
private StandService standService;
|
||||
private CiStandService standService;
|
||||
@Autowired
|
||||
private VirtualRealityDeviceService virtualRealityDeviceService;
|
||||
|
||||
@Override
|
||||
public PslStatus getStatus(String group, String standCode) {
|
||||
@ -68,13 +71,13 @@ public class VirtualRealityPslService implements IVirtualRealityPslService{
|
||||
// vrPsl.setKmButton(!vrPsl.isKmButton());
|
||||
// if (vrPsl.isKmButton())
|
||||
if (vrPsl.isYxjzKey() && vrPsd.isLockAndClose())
|
||||
standService.controlVrPSD(simulation, vrPsd, true);
|
||||
this.virtualRealityDeviceService.control(simulation, vrPsd, VirtualRealityScreenDoor.Operation.K);
|
||||
break;
|
||||
case GM:
|
||||
// vrPsl.setGmButton(!vrPsl.isGmButton());
|
||||
// if (vrPsl.isGmButton())
|
||||
if (vrPsl.isYxjzKey() && vrPsd.isOpen2End())
|
||||
standService.controlVrPSD(simulation, vrPsd, false);
|
||||
this.virtualRealityDeviceService.control(simulation, vrPsd, VirtualRealityScreenDoor.Operation.G);
|
||||
break;
|
||||
case SD:
|
||||
vrPsl.setSdButton(!vrPsl.isSdButton());
|
||||
|
@ -0,0 +1,169 @@
|
||||
package club.joylink.rtss.services.publishData;
|
||||
|
||||
import club.joylink.rtss.constants.MapStatus;
|
||||
import club.joylink.rtss.dao.MapDataDAO;
|
||||
import club.joylink.rtss.dao.MapInfoDAO;
|
||||
import club.joylink.rtss.entity.MapDataWithBLOBs;
|
||||
import club.joylink.rtss.entity.MapInfo;
|
||||
import club.joylink.rtss.entity.MapInfoExample;
|
||||
import club.joylink.rtss.services.IMapService;
|
||||
import club.joylink.rtss.simulation.cbtc.constant.SignalAspect;
|
||||
import club.joylink.rtss.simulation.cbtc.constant.SignalModel;
|
||||
import club.joylink.rtss.simulation.cbtc.data.map.Signal;
|
||||
import club.joylink.rtss.util.JsonUtils;
|
||||
import club.joylink.rtss.util.VersionUtil;
|
||||
import club.joylink.rtss.vo.map.MapCheckConfig;
|
||||
import club.joylink.rtss.vo.map.MapGraphDataNewVO;
|
||||
import club.joylink.rtss.vo.map.MapLogicDataNewVO;
|
||||
import club.joylink.rtss.vo.map.MapVO;
|
||||
import club.joylink.rtss.vo.map.graph.MapSignalNewVO;
|
||||
import club.joylink.rtss.vo.map.logic.MapRouteNewVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
public class PublishMapDataHandler {
|
||||
@Autowired
|
||||
private IMapService iMapService;
|
||||
@Autowired
|
||||
private MapInfoDAO mapInfoDAO;
|
||||
@Autowired
|
||||
private MapDataDAO mapDataDAO;
|
||||
|
||||
public List<MapInfo> queryMapInfos() {
|
||||
MapInfoExample example = new MapInfoExample();
|
||||
example.createCriteria().andStatusNotEqualTo(MapStatus.Delete.getCode());
|
||||
List<MapInfo> mapInfos = this.mapInfoDAO.selectByExample(example);
|
||||
return mapInfos;
|
||||
}
|
||||
|
||||
public void dataHandle() {
|
||||
List<MapInfo> mapInfos = this.queryMapInfos();
|
||||
for (MapInfo mapInfo : mapInfos) {
|
||||
this.handle(mapInfo);
|
||||
}
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public void handle(MapInfo mapInfo) {
|
||||
Long mapId = mapInfo.getId();
|
||||
MapVO detail = this.iMapService.getMapDetail(mapId);
|
||||
MapGraphDataNewVO graphDataNew = detail.getGraphDataNew();
|
||||
List<MapSignalNewVO> signalList = graphDataNew.getSignalList();
|
||||
for (MapSignalNewVO signal : signalList) {
|
||||
Signal.SignalType type = signal.getType();
|
||||
switch (type) {
|
||||
case PROTECTION:
|
||||
case PASSING:
|
||||
signal.setSignalModel(SignalModel.RGY.name());
|
||||
break;
|
||||
case BLOCKING:
|
||||
signal.setSignalModel(SignalModel.R.name());
|
||||
break;
|
||||
case SHUNTING:
|
||||
signal.setSignalModel(SignalModel.BW.name());
|
||||
break;
|
||||
case ARRIVAL:
|
||||
signal.setSignalModel(SignalModel.YGRYW.name());
|
||||
break;
|
||||
case EXIT:
|
||||
signal.setSignalModel(SignalModel.YGRGW.name());
|
||||
break;
|
||||
}
|
||||
}
|
||||
MapLogicDataNewVO logicDataNew = detail.getLogicDataNew();
|
||||
List<MapRouteNewVO> routeList = logicDataNew.getRouteList();
|
||||
for (MapRouteNewVO route : routeList) {
|
||||
if (route.isGreenOpen()) {
|
||||
route.setAspect(SignalAspect.G);
|
||||
} else {
|
||||
route.setAspect(SignalAspect.Y);
|
||||
}
|
||||
}
|
||||
//地图数据
|
||||
MapDataWithBLOBs mapData = new MapDataWithBLOBs();
|
||||
mapData.setMapId(mapId);
|
||||
mapData.setGraphData(JsonUtils.writeValueAsString(graphDataNew));
|
||||
mapData.setLogicData(JsonUtils.writeValueAsString(detail.getLogicDataNew()));
|
||||
if (detail.getCheckConfig() != null) {
|
||||
mapData.setCheckConfig(detail.getCheckConfig().toJson());
|
||||
} else {
|
||||
mapData.setCheckConfig(new MapCheckConfig().toJson());
|
||||
}
|
||||
mapData.setVersion(VersionUtil.generateNext(this.iMapService.findMapVersion(mapId)));
|
||||
mapData.setNote("处理进路信号显示");
|
||||
mapData.setTime(LocalDateTime.now());
|
||||
mapData.setUserId(1L);
|
||||
mapDataDAO.insert(mapData);
|
||||
// 更新地图当前使用的地图数据版本
|
||||
MapInfo map = new MapInfo();
|
||||
map.setId(mapId);
|
||||
map.setVersion(mapData.getVersion());
|
||||
mapInfoDAO.updateByPrimaryKeySelective(map);
|
||||
this.iMapService.removeCache(mapId);
|
||||
}
|
||||
|
||||
public void xian3Handle() {
|
||||
MapInfoExample example = new MapInfoExample();
|
||||
example.createCriteria()
|
||||
.andLineCodeEqualTo("11")
|
||||
.andStatusNotEqualTo(MapStatus.Delete.getCode());
|
||||
List<MapInfo> mapInfos = this.mapInfoDAO.selectByExample(example);
|
||||
for (MapInfo mapInfo : mapInfos) {
|
||||
handleSignal(mapInfo);
|
||||
}
|
||||
}
|
||||
|
||||
private void handleSignal(MapInfo mapInfo) {
|
||||
Long mapId = mapInfo.getId();
|
||||
MapVO detail = this.iMapService.getMapDetail(mapId);
|
||||
MapGraphDataNewVO graphDataNew = detail.getGraphDataNew();
|
||||
List<MapSignalNewVO> signalList = graphDataNew.getSignalList();
|
||||
MapLogicDataNewVO logicDataNew = detail.getLogicDataNew();
|
||||
List<MapRouteNewVO> routeList = logicDataNew.getRouteList();
|
||||
Map<String, MapRouteNewVO> routeMap = new HashMap<>();
|
||||
for (MapRouteNewVO mapRouteNewVO : routeList) {
|
||||
if (mapRouteNewVO.getEndSignalCode() != null) {
|
||||
if (!routeMap.containsKey(mapRouteNewVO.getEndSignalCode())) {
|
||||
routeMap.put(mapRouteNewVO.getEndSignalCode(), mapRouteNewVO);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (MapSignalNewVO signalVO : signalList) {
|
||||
MapRouteNewVO route = routeMap.get(signalVO.getCode());
|
||||
if (route != null) {
|
||||
signalVO.setCtcSetOverlap(route.isSetOverlapInCtc());
|
||||
}
|
||||
}
|
||||
//地图数据
|
||||
MapDataWithBLOBs mapData = new MapDataWithBLOBs();
|
||||
mapData.setMapId(mapId);
|
||||
mapData.setGraphData(JsonUtils.writeValueAsString(graphDataNew));
|
||||
mapData.setLogicData(JsonUtils.writeValueAsString(detail.getLogicDataNew()));
|
||||
if (detail.getCheckConfig() != null) {
|
||||
mapData.setCheckConfig(detail.getCheckConfig().toJson());
|
||||
} else {
|
||||
mapData.setCheckConfig(new MapCheckConfig().toJson());
|
||||
}
|
||||
mapData.setVersion(VersionUtil.generateNext(this.iMapService.findMapVersion(mapId)));
|
||||
mapData.setNote("处理信号机CTC级别是否办理延续保护");
|
||||
mapData.setTime(LocalDateTime.now());
|
||||
mapData.setUserId(1L);
|
||||
mapDataDAO.insert(mapData);
|
||||
// 更新地图当前使用的地图数据版本
|
||||
MapInfo map = new MapInfo();
|
||||
map.setId(mapId);
|
||||
map.setVersion(mapData.getVersion());
|
||||
mapInfoDAO.updateByPrimaryKeySelective(map);
|
||||
this.iMapService.removeCache(mapId);
|
||||
}
|
||||
}
|
@ -4,7 +4,7 @@ import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
|
||||
import club.joylink.rtss.vo.client.runplan.RunPlanImport;
|
||||
import club.joylink.rtss.vo.client.runplan.RunPlanTripTimeVO;
|
||||
import club.joylink.rtss.vo.client.runplan.RunPlanTripVO;
|
||||
import club.joylink.rtss.vo.map.MapStationNewVO;
|
||||
import club.joylink.rtss.vo.map.graph.MapStationNewVO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
|
@ -6,7 +6,7 @@ import club.joylink.rtss.vo.client.runplan.RunPlanArrivalTime;
|
||||
import club.joylink.rtss.vo.client.runplan.RunPlanImport;
|
||||
import club.joylink.rtss.vo.client.runplan.RunPlanTripTimeVO;
|
||||
import club.joylink.rtss.vo.client.runplan.RunPlanTripVO;
|
||||
import club.joylink.rtss.vo.map.MapStationNewVO;
|
||||
import club.joylink.rtss.vo.map.graph.MapStationNewVO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
|
@ -5,7 +5,7 @@ import club.joylink.rtss.vo.client.runplan.RunPlanArrivalTime;
|
||||
import club.joylink.rtss.vo.client.runplan.RunPlanImport;
|
||||
import club.joylink.rtss.vo.client.runplan.RunPlanTripTimeVO;
|
||||
import club.joylink.rtss.vo.client.runplan.RunPlanTripVO;
|
||||
import club.joylink.rtss.vo.map.MapStationNewVO;
|
||||
import club.joylink.rtss.vo.map.graph.MapStationNewVO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
|
@ -3,7 +3,7 @@ package club.joylink.rtss.services.runplan.importReal;
|
||||
import club.joylink.rtss.vo.client.runplan.RunPlanImport;
|
||||
import club.joylink.rtss.vo.client.runplan.RunPlanTripTimeVO;
|
||||
import club.joylink.rtss.vo.client.runplan.RunPlanTripVO;
|
||||
import club.joylink.rtss.vo.map.MapStationNewVO;
|
||||
import club.joylink.rtss.vo.map.graph.MapStationNewVO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -6,7 +6,7 @@ import club.joylink.rtss.vo.client.runplan.RunPlanArrivalTime;
|
||||
import club.joylink.rtss.vo.client.runplan.RunPlanImport;
|
||||
import club.joylink.rtss.vo.client.runplan.RunPlanTripTimeVO;
|
||||
import club.joylink.rtss.vo.client.runplan.RunPlanTripVO;
|
||||
import club.joylink.rtss.vo.map.MapStationNewVO;
|
||||
import club.joylink.rtss.vo.map.graph.MapStationNewVO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
|
@ -5,7 +5,7 @@ import club.joylink.rtss.vo.client.runplan.RunPlanArrivalTime;
|
||||
import club.joylink.rtss.vo.client.runplan.RunPlanImport;
|
||||
import club.joylink.rtss.vo.client.runplan.RunPlanTripTimeVO;
|
||||
import club.joylink.rtss.vo.client.runplan.RunPlanTripVO;
|
||||
import club.joylink.rtss.vo.map.MapStationNewVO;
|
||||
import club.joylink.rtss.vo.map.graph.MapStationNewVO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
|
@ -6,7 +6,7 @@ import club.joylink.rtss.vo.client.runplan.RunPlanArrivalTime;
|
||||
import club.joylink.rtss.vo.client.runplan.RunPlanImport;
|
||||
import club.joylink.rtss.vo.client.runplan.RunPlanTripTimeVO;
|
||||
import club.joylink.rtss.vo.client.runplan.RunPlanTripVO;
|
||||
import club.joylink.rtss.vo.map.MapStationNewVO;
|
||||
import club.joylink.rtss.vo.map.graph.MapStationNewVO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
|
@ -6,9 +6,9 @@ import club.joylink.rtss.vo.client.runplan.RunPlanArrivalTime;
|
||||
import club.joylink.rtss.vo.client.runplan.RunPlanImport;
|
||||
import club.joylink.rtss.vo.client.runplan.RunPlanTripTimeVO;
|
||||
import club.joylink.rtss.vo.client.runplan.RunPlanTripVO;
|
||||
import club.joylink.rtss.vo.map.MapSectionNewVO;
|
||||
import club.joylink.rtss.vo.map.MapStationNewVO;
|
||||
import club.joylink.rtss.vo.map.MapStationStandNewVO;
|
||||
import club.joylink.rtss.vo.map.graph.MapSectionNewVO;
|
||||
import club.joylink.rtss.vo.map.graph.MapStationNewVO;
|
||||
import club.joylink.rtss.vo.map.graph.MapStationStandNewVO;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.util.*;
|
||||
|
@ -6,7 +6,7 @@ import club.joylink.rtss.vo.client.runplan.RunPlanArrivalTime;
|
||||
import club.joylink.rtss.vo.client.runplan.RunPlanImport;
|
||||
import club.joylink.rtss.vo.client.runplan.RunPlanTripTimeVO;
|
||||
import club.joylink.rtss.vo.client.runplan.RunPlanTripVO;
|
||||
import club.joylink.rtss.vo.map.MapStationNewVO;
|
||||
import club.joylink.rtss.vo.map.graph.MapStationNewVO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
|
@ -6,7 +6,7 @@ import club.joylink.rtss.vo.client.runplan.RunPlanArrivalTime;
|
||||
import club.joylink.rtss.vo.client.runplan.RunPlanImport;
|
||||
import club.joylink.rtss.vo.client.runplan.RunPlanTripTimeVO;
|
||||
import club.joylink.rtss.vo.client.runplan.RunPlanTripVO;
|
||||
import club.joylink.rtss.vo.map.MapStationNewVO;
|
||||
import club.joylink.rtss.vo.map.graph.MapStationNewVO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
|
@ -5,7 +5,7 @@ import club.joylink.rtss.vo.client.runplan.RunPlanArrivalTime;
|
||||
import club.joylink.rtss.vo.client.runplan.RunPlanImport;
|
||||
import club.joylink.rtss.vo.client.runplan.RunPlanTripTimeVO;
|
||||
import club.joylink.rtss.vo.client.runplan.RunPlanTripVO;
|
||||
import club.joylink.rtss.vo.map.MapStationNewVO;
|
||||
import club.joylink.rtss.vo.map.graph.MapStationNewVO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
|
@ -6,7 +6,7 @@ import club.joylink.rtss.vo.client.runplan.RunPlanArrivalTime;
|
||||
import club.joylink.rtss.vo.client.runplan.RunPlanImport;
|
||||
import club.joylink.rtss.vo.client.runplan.RunPlanTripTimeVO;
|
||||
import club.joylink.rtss.vo.client.runplan.RunPlanTripVO;
|
||||
import club.joylink.rtss.vo.map.MapStationNewVO;
|
||||
import club.joylink.rtss.vo.map.graph.MapStationNewVO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
|
@ -4,7 +4,7 @@ import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
|
||||
import club.joylink.rtss.vo.client.runplan.RunPlanImport;
|
||||
import club.joylink.rtss.vo.client.runplan.RunPlanTripTimeVO;
|
||||
import club.joylink.rtss.vo.client.runplan.RunPlanTripVO;
|
||||
import club.joylink.rtss.vo.map.MapStationNewVO;
|
||||
import club.joylink.rtss.vo.map.graph.MapStationNewVO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
|
@ -13,6 +13,10 @@ import club.joylink.rtss.vo.client.training.definition.OperateDefinitionVO;
|
||||
import club.joylink.rtss.vo.client.training.definition.OperatePlaceholderVO;
|
||||
import club.joylink.rtss.vo.client.training.definition.OperateStepVO;
|
||||
import club.joylink.rtss.vo.map.*;
|
||||
import club.joylink.rtss.vo.map.graph.MapAutomaticRouteButtonVO;
|
||||
import club.joylink.rtss.vo.map.graph.MapCycleButtonVO;
|
||||
import club.joylink.rtss.vo.map.graph.MapTotalGuideLockButtonVO;
|
||||
import club.joylink.rtss.vo.map.graph.MapTurnBackStrategyVO;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@ -26,6 +30,11 @@ public interface GeneratorNew {
|
||||
|
||||
List<TrainingNewVO> generate(GenerateConfig config, Simulation simulationData, OperateDefinitionVO operateDefinitionVO);
|
||||
|
||||
default void resetSimulation(Simulation simulation) {
|
||||
simulation.reset();
|
||||
simulation.getRepository().vrDeviceReset();
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建实训数据
|
||||
*
|
||||
|
@ -7,8 +7,8 @@ import club.joylink.rtss.services.training.generatornew.annotation.GeneratorSele
|
||||
import club.joylink.rtss.simulation.cbtc.ATS.operation.Operation;
|
||||
import club.joylink.rtss.simulation.cbtc.Simulation;
|
||||
import club.joylink.rtss.simulation.cbtc.data.map.Station;
|
||||
import club.joylink.rtss.vo.client.training.definition.OperateDefinitionVO;
|
||||
import club.joylink.rtss.vo.client.training.TrainingNewVO;
|
||||
import club.joylink.rtss.vo.client.training.definition.OperateDefinitionVO;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@ -51,7 +51,7 @@ public class ControlGeneratorNew implements GeneratorNew {
|
||||
}
|
||||
trainingVOList.add(build(config, simulation, station, null,operateDefinitionVO));
|
||||
// 仿真重置
|
||||
simulation.reset();
|
||||
this.resetSimulation(simulation);
|
||||
}
|
||||
return trainingVOList;
|
||||
}
|
||||
|
@ -8,8 +8,8 @@ import club.joylink.rtss.simulation.cbtc.ATS.operation.Operation;
|
||||
import club.joylink.rtss.simulation.cbtc.Simulation;
|
||||
import club.joylink.rtss.simulation.cbtc.data.map.Section;
|
||||
import club.joylink.rtss.simulation.cbtc.data.vr.VirtualRealitySectionAxleCounter;
|
||||
import club.joylink.rtss.vo.client.training.definition.OperateDefinitionVO;
|
||||
import club.joylink.rtss.vo.client.training.TrainingNewVO;
|
||||
import club.joylink.rtss.vo.client.training.definition.OperateDefinitionVO;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
@ -126,7 +126,7 @@ public class SectionGeneratorNew implements GeneratorNew {
|
||||
}
|
||||
trainingVOList.add(this.build(config, simulation, section, null, operateDefinitionVO));
|
||||
// 仿真重置
|
||||
simulation.reset();
|
||||
this.resetSimulation(simulation);
|
||||
}
|
||||
return trainingVOList;
|
||||
}
|
||||
|
@ -16,7 +16,6 @@ import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@GeneratorSelectorNew(operateObject = Operation.Object.Signal)
|
||||
@ -38,14 +37,14 @@ public class SignalGeneratorNew implements GeneratorNew {
|
||||
.stream().filter(mapCycleButtonVO -> mapCycleButtonVO.getCycleCode().equals(cycle.getCode()))
|
||||
.forEach(button -> {
|
||||
trainingVOList.add(this.build(config, simulation, cycle,button, operateDefinitionVO));
|
||||
simulation.reset();
|
||||
this.resetSimulation(simulation);
|
||||
});
|
||||
continue;
|
||||
}else {
|
||||
trainingVOList.add(this.build(config, simulation, cycle,null, operateDefinitionVO));
|
||||
}
|
||||
// 仿真重置
|
||||
simulation.reset();
|
||||
this.resetSimulation(simulation);
|
||||
}
|
||||
return trainingVOList;
|
||||
}
|
||||
@ -59,14 +58,14 @@ public class SignalGeneratorNew implements GeneratorNew {
|
||||
.stream().filter(mapCycleButtonVO -> mapCycleButtonVO.getCycleCode().equals(cycle.getCode()))
|
||||
.forEach(button -> {
|
||||
trainingVOList.add(this.build(config, simulation, cycle,button, operateDefinitionVO));
|
||||
simulation.reset();
|
||||
this.resetSimulation(simulation);
|
||||
});
|
||||
continue;
|
||||
}else{
|
||||
trainingVOList.add(this.build(config, simulation, cycle,null, operateDefinitionVO));
|
||||
}
|
||||
// 仿真重置
|
||||
simulation.reset();
|
||||
this.resetSimulation(simulation);
|
||||
}
|
||||
return trainingVOList;
|
||||
}
|
||||
@ -95,7 +94,7 @@ public class SignalGeneratorNew implements GeneratorNew {
|
||||
}
|
||||
trainingVOList.add(this.build(config, simulation, route,null, operateDefinitionVO));
|
||||
// 仿真重置
|
||||
simulation.reset();
|
||||
this.resetSimulation(simulation);
|
||||
}
|
||||
}
|
||||
continue;
|
||||
@ -107,7 +106,7 @@ public class SignalGeneratorNew implements GeneratorNew {
|
||||
routeList.forEach(route -> route.setAtsControl(false));
|
||||
}
|
||||
trainingVOList.add(this.build(config, simulation, signal,null, operateDefinitionVO));
|
||||
simulation.reset();
|
||||
this.resetSimulation(simulation);
|
||||
continue;
|
||||
} else {
|
||||
for (Route route : routeList) {
|
||||
@ -125,7 +124,7 @@ public class SignalGeneratorNew implements GeneratorNew {
|
||||
}
|
||||
trainingVOList.add(this.build(config, simulation, signal,null, operateDefinitionVO));
|
||||
// 仿真重置
|
||||
simulation.reset();
|
||||
this.resetSimulation(simulation);
|
||||
|
||||
}
|
||||
}
|
||||
@ -135,7 +134,7 @@ public class SignalGeneratorNew implements GeneratorNew {
|
||||
if (!CollectionUtils.isEmpty(routeList)) {
|
||||
if (routeLikeHa1 || operateDefinitionVO.onlyOperateSignal()) {
|
||||
trainingVOList.add(this.build(config, simulation, signal, null, operateDefinitionVO));
|
||||
simulation.reset();
|
||||
this.resetSimulation(simulation);
|
||||
continue;
|
||||
} else {
|
||||
for (Route route : routeList) {
|
||||
@ -149,7 +148,7 @@ public class SignalGeneratorNew implements GeneratorNew {
|
||||
}
|
||||
trainingVOList.add(this.build(config, simulation, route,null, operateDefinitionVO));
|
||||
// 仿真重置
|
||||
simulation.reset();
|
||||
this.resetSimulation(simulation);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -171,7 +170,7 @@ public class SignalGeneratorNew implements GeneratorNew {
|
||||
deviceStatusModifyTool.openRouteDirect(simulation, route);
|
||||
trainingVOList.add(this.build(config, simulation, route, null, operateDefinitionVO));
|
||||
// 仿真重置
|
||||
simulation.reset();
|
||||
this.resetSimulation(simulation);
|
||||
}
|
||||
}
|
||||
continue;
|
||||
@ -186,7 +185,7 @@ public class SignalGeneratorNew implements GeneratorNew {
|
||||
// todo 在接近区段设置一辆列车
|
||||
trainingVOList.add(this.build(config, simulation, signal, null, operateDefinitionVO));
|
||||
// 仿真重置
|
||||
simulation.reset();
|
||||
this.resetSimulation(simulation);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
@ -200,7 +199,7 @@ public class SignalGeneratorNew implements GeneratorNew {
|
||||
this.deviceStatusModifyTool.openRouteDirect(simulation, route);
|
||||
trainingVOList.add(this.build(config, simulation, signal,null, operateDefinitionVO));
|
||||
// 仿真重置
|
||||
simulation.reset();
|
||||
this.resetSimulation(simulation);
|
||||
}
|
||||
}
|
||||
continue;
|
||||
@ -216,7 +215,7 @@ public class SignalGeneratorNew implements GeneratorNew {
|
||||
this.deviceStatusModifyTool.closeSignalDirectly(route.getStart());
|
||||
trainingVOList.add(this.build(config, simulation, signal,null, operateDefinitionVO));
|
||||
// 仿真重置
|
||||
simulation.reset();
|
||||
this.resetSimulation(simulation);
|
||||
}
|
||||
}
|
||||
continue;
|
||||
@ -235,7 +234,7 @@ public class SignalGeneratorNew implements GeneratorNew {
|
||||
}
|
||||
trainingVOList.add(this.build(config, simulation, signal, null, operateDefinitionVO));
|
||||
// 仿真重置
|
||||
simulation.reset();
|
||||
this.resetSimulation(simulation);
|
||||
} else {
|
||||
for (Route route : routeList) {
|
||||
if (route.isGuide()) { // 引导进路不生成Signal_Cancel_CI_Auto_Trigger
|
||||
@ -244,7 +243,7 @@ public class SignalGeneratorNew implements GeneratorNew {
|
||||
route.setAtsControl(false);
|
||||
trainingVOList.add(this.build(config, simulation, route,null, operateDefinitionVO));
|
||||
// 仿真重置
|
||||
simulation.reset();
|
||||
this.resetSimulation(simulation);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -265,14 +264,14 @@ public class SignalGeneratorNew implements GeneratorNew {
|
||||
.stream().filter(automaticRouteButtonVO -> automaticRouteButtonVO.getAutomaticRouteCode().equals(route.getCode()))
|
||||
.forEach(button -> {
|
||||
trainingVOList.add(this.build(config, simulation, route.getStart(), button, operateDefinitionVO));
|
||||
simulation.reset();
|
||||
this.resetSimulation(simulation);
|
||||
});
|
||||
continue;
|
||||
} else {
|
||||
trainingVOList.add(this.build(config, simulation, route.getStart(), null, operateDefinitionVO));
|
||||
}
|
||||
// 仿真重置
|
||||
simulation.reset();
|
||||
this.resetSimulation(simulation);
|
||||
}
|
||||
}
|
||||
continue;
|
||||
@ -291,14 +290,14 @@ public class SignalGeneratorNew implements GeneratorNew {
|
||||
.stream().filter(automaticRouteButtonVO -> automaticRouteButtonVO.getAutomaticRouteCode().equals(route.getCode()))
|
||||
.forEach(button -> {
|
||||
trainingVOList.add(this.build(config, simulation,signal, button, operateDefinitionVO));
|
||||
simulation.reset();
|
||||
this.resetSimulation(simulation);
|
||||
});
|
||||
continue;
|
||||
} else {
|
||||
trainingVOList.add(this.build(config, simulation, signal,null, operateDefinitionVO));
|
||||
}
|
||||
// 仿真重置
|
||||
simulation.reset();
|
||||
this.resetSimulation(simulation);
|
||||
}
|
||||
}
|
||||
continue;
|
||||
@ -315,13 +314,13 @@ public class SignalGeneratorNew implements GeneratorNew {
|
||||
}
|
||||
trainingVOList.add(this.build(config, simulation, signal, null, operateDefinitionVO));
|
||||
// 仿真重置
|
||||
simulation.reset();
|
||||
this.resetSimulation(simulation);
|
||||
} else {
|
||||
for (Route route : arcRouteList) {
|
||||
route.setCiControl(true);
|
||||
trainingVOList.add(this.build(config, simulation, signal,null, operateDefinitionVO));
|
||||
// 仿真重置
|
||||
simulation.reset();
|
||||
this.resetSimulation(simulation);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -351,76 +350,76 @@ public class SignalGeneratorNew implements GeneratorNew {
|
||||
deviceStatusModifyTool.loadManualTrainOfGroup(simulation, "001",signal.getSection(),signal.isRight());
|
||||
if(operateDefinitionVO.onlyOperateSignal()){
|
||||
trainingVOList.add(this.build(config, simulation, signal,null, operateDefinitionVO));
|
||||
simulation.reset();
|
||||
this.resetSimulation(simulation);
|
||||
break;
|
||||
}
|
||||
trainingVOList.add(this.build(config, simulation, route,null, operateDefinitionVO));
|
||||
// 仿真重置
|
||||
simulation.reset();
|
||||
this.resetSimulation(simulation);
|
||||
}
|
||||
// }
|
||||
continue;
|
||||
}
|
||||
case Signal_Close_Guide: {
|
||||
// 若信号可开放引导信号,生成实训,背景设置为开放引导进路/开放引导信号
|
||||
if (signal.isCallOn()) {
|
||||
if (!CollectionUtils.isEmpty(routeList)) {
|
||||
for (Route route : routeList) {
|
||||
if (!route.isTurnBack()) {
|
||||
this.deviceStatusModifyTool.openGuideRouteDirect(simulation, route);
|
||||
trainingVOList.add(this.build(config, simulation, signal, null, operateDefinitionVO));
|
||||
// 仿真重置
|
||||
simulation.reset();
|
||||
}
|
||||
}
|
||||
} else if (Objects.nonNull(signal.getAutoSignal())) { // 信号机是自动信号
|
||||
this.deviceStatusModifyTool.openGuideSignalDirectly(signal);
|
||||
trainingVOList.add(this.build(config, simulation, signal, null, operateDefinitionVO));
|
||||
// 仿真重置
|
||||
simulation.reset();
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
case Signal_Cancel_Guide: {
|
||||
// 若信号可开放引导信号,生成实训,背景设置为开放引导进路/开放引导信号
|
||||
// case Signal_Close_Guide: {
|
||||
// // 若信号可开放引导信号,生成实训,背景设置为开放引导进路/开放引导信号
|
||||
// if (signal.isCallOn()) {
|
||||
if (!CollectionUtils.isEmpty(routeList)) {
|
||||
for (Route route : routeList) {
|
||||
if (routeLikeHa1 &&
|
||||
!route.isGuide()) {
|
||||
// 对于类似ATP、地面、引导类进路线路,非引导进路跳过
|
||||
continue;
|
||||
}
|
||||
if (!route.isTurnBack()) {
|
||||
this.deviceStatusModifyTool.openGuideRouteDirect(simulation, route);
|
||||
if(operateDefinitionVO.onlyOperateSignal()){
|
||||
trainingVOList.add(this.build(config, simulation, signal,null, operateDefinitionVO));
|
||||
simulation.reset();
|
||||
break;
|
||||
}
|
||||
trainingVOList.add(this.build(config, simulation, route,null, operateDefinitionVO));
|
||||
// 仿真重置
|
||||
simulation.reset();
|
||||
}
|
||||
}
|
||||
// }
|
||||
// else if(Objects.nonNull(signal.getAutoSignal())) { // 信号机是自动信号
|
||||
// if (!CollectionUtils.isEmpty(routeList)) {
|
||||
// for (Route route : routeList) {
|
||||
// if (!route.isTurnBack()) {
|
||||
// this.deviceStatusModifyTool.openGuideRouteDirect(simulation, route);
|
||||
// trainingVOList.add(this.build(config, simulation, signal, null, operateDefinitionVO));
|
||||
// // 仿真重置
|
||||
// this.resetSimulation(simulation);
|
||||
// }
|
||||
// }
|
||||
// } else if (Objects.nonNull(signal.getAutoSignal())) { // 信号机是自动信号
|
||||
// this.deviceStatusModifyTool.openGuideSignalDirectly(signal);
|
||||
// trainingVOList.add(this.build(config, simulation, signal, operateDefinitionVO));
|
||||
// trainingVOList.add(this.build(config, simulation, signal, null, operateDefinitionVO));
|
||||
// // 仿真重置
|
||||
// simulation.reset();
|
||||
// this.resetSimulation(simulation);
|
||||
// }
|
||||
}
|
||||
continue;
|
||||
}
|
||||
// }
|
||||
// continue;
|
||||
// }
|
||||
// case Signal_Cancel_Guide: {
|
||||
// // 若信号可开放引导信号,生成实训,背景设置为开放引导进路/开放引导信号
|
||||
//// if (signal.isCallOn()) {
|
||||
// if (!CollectionUtils.isEmpty(routeList)) {
|
||||
// for (Route route : routeList) {
|
||||
// if (routeLikeHa1 &&
|
||||
// !route.isGuide()) {
|
||||
// // 对于类似ATP、地面、引导类进路线路,非引导进路跳过
|
||||
// continue;
|
||||
// }
|
||||
// if (!route.isTurnBack()) {
|
||||
// this.deviceStatusModifyTool.openGuideRouteDirect(simulation, route);
|
||||
// if(operateDefinitionVO.onlyOperateSignal()){
|
||||
// trainingVOList.add(this.build(config, simulation, signal,null, operateDefinitionVO));
|
||||
// this.resetSimulation(simulation);
|
||||
// break;
|
||||
// }
|
||||
// trainingVOList.add(this.build(config, simulation, route,null, operateDefinitionVO));
|
||||
// // 仿真重置
|
||||
// this.resetSimulation(simulation);
|
||||
// }
|
||||
// }
|
||||
//// }
|
||||
//// else if(Objects.nonNull(signal.getAutoSignal())) { // 信号机是自动信号
|
||||
//// this.deviceStatusModifyTool.openGuideSignalDirectly(signal);
|
||||
//// trainingVOList.add(this.build(config, simulation, signal, operateDefinitionVO));
|
||||
//// // 仿真重置
|
||||
//// this.resetSimulation(simulation);
|
||||
//// }
|
||||
// }
|
||||
// continue;
|
||||
// }
|
||||
default:
|
||||
// 其他操作,不生成
|
||||
continue;
|
||||
}
|
||||
trainingVOList.add(this.build(config, simulation, signal,null, operateDefinitionVO));
|
||||
// 仿真重置
|
||||
simulation.reset();
|
||||
this.resetSimulation(simulation);
|
||||
}
|
||||
return trainingVOList;
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ import club.joylink.rtss.vo.client.training.TrainingStepVO;
|
||||
import club.joylink.rtss.vo.client.training.definition.OperateDefinitionVO;
|
||||
import club.joylink.rtss.vo.client.training.definition.OperatePlaceholderVO;
|
||||
import club.joylink.rtss.vo.client.training.definition.OperateStepVO;
|
||||
import club.joylink.rtss.vo.map.MapTempSpeedLimitVO;
|
||||
import club.joylink.rtss.vo.map.graph.MapTempSpeedLimitVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@ -36,7 +36,7 @@ public class SpeedLimitGeneratorNew implements GeneratorNew {
|
||||
List<MapTempSpeedLimitVO> tempSpeedLimitList = simulation.getBuildParams().getMap().getGraphDataNew().getTempSpeedLimitList();
|
||||
tempSpeedLimitList.forEach(mapTempSpeedLimitVO -> {
|
||||
trainingVOList.add(this.build(config, simulation,null,mapTempSpeedLimitVO, operateDefinitionVO));
|
||||
simulation.reset();
|
||||
this.resetSimulation(simulation);
|
||||
});
|
||||
break;
|
||||
}
|
||||
|
@ -1,28 +1,23 @@
|
||||
package club.joylink.rtss.services.training.generatornew.base;
|
||||
|
||||
import club.joylink.rtss.constants.MapPrdTypeEnum;
|
||||
import club.joylink.rtss.services.training.data.GenerateConfig;
|
||||
import club.joylink.rtss.services.training.generatornew.GeneratorNew;
|
||||
import club.joylink.rtss.services.training.generatornew.annotation.GeneratorSelectorNew;
|
||||
import club.joylink.rtss.simulation.cbtc.ATS.operation.Operation;
|
||||
import club.joylink.rtss.simulation.cbtc.Simulation;
|
||||
import club.joylink.rtss.simulation.cbtc.constant.TrainType;
|
||||
import club.joylink.rtss.simulation.cbtc.data.SimulationDataRepository;
|
||||
import club.joylink.rtss.simulation.cbtc.data.map.Route;
|
||||
import club.joylink.rtss.simulation.cbtc.data.map.Section;
|
||||
import club.joylink.rtss.simulation.cbtc.data.map.Stand;
|
||||
import club.joylink.rtss.constants.MapPrdTypeEnum;
|
||||
import club.joylink.rtss.simulation.cbtc.data.support.RoutePath;
|
||||
import club.joylink.rtss.simulation.cbtc.data.support.SectionPosition;
|
||||
import club.joylink.rtss.simulation.cbtc.data.vo.TrainInfo;
|
||||
import club.joylink.rtss.simulation.cbtc.data.vr.VirtualRealityDevice;
|
||||
import club.joylink.rtss.simulation.cbtc.data.vr.VirtualRealityTrain;
|
||||
import club.joylink.rtss.simulation.cbtc.tool.DeviceStatusModifyTool;
|
||||
import club.joylink.rtss.vo.client.training.definition.OperateDefinitionVO;
|
||||
import club.joylink.rtss.vo.client.training.TrainingNewVO;
|
||||
import club.joylink.rtss.vo.client.training.definition.OperateDefinitionVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@GeneratorSelectorNew(operateObject = Operation.Object.Stand)
|
||||
@ -108,7 +103,7 @@ public class StandGeneratorNew implements GeneratorNew {
|
||||
}
|
||||
trainingVOList.add(this.build(config, simulation, stand,null, operateDefinitionVO));
|
||||
// 仿真重置
|
||||
simulation.reset();
|
||||
this.resetSimulation(simulation);
|
||||
}
|
||||
return trainingVOList;
|
||||
}
|
||||
|
@ -8,8 +8,8 @@ import club.joylink.rtss.simulation.cbtc.ATS.operation.Operation;
|
||||
import club.joylink.rtss.simulation.cbtc.Simulation;
|
||||
import club.joylink.rtss.simulation.cbtc.data.map.*;
|
||||
import club.joylink.rtss.simulation.cbtc.tool.DeviceStatusModifyTool;
|
||||
import club.joylink.rtss.vo.client.training.definition.OperateDefinitionVO;
|
||||
import club.joylink.rtss.vo.client.training.TrainingNewVO;
|
||||
import club.joylink.rtss.vo.client.training.definition.OperateDefinitionVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
@ -113,7 +113,7 @@ public class StationGeneratorNew implements GeneratorNew {
|
||||
.stream().filter(turnBackStrategyO -> turnBackStrategyO.getStationCode().equals(station.getCode()))
|
||||
.forEach(button -> {
|
||||
trainingVOList.add(this.build(config, simulation, station,button, operateDefinitionVO));
|
||||
simulation.reset();
|
||||
this.resetSimulation(simulation);
|
||||
});
|
||||
continue;
|
||||
}
|
||||
@ -141,7 +141,7 @@ public class StationGeneratorNew implements GeneratorNew {
|
||||
aSwitch -> Objects.equals(aSwitch.getDeviceStation(), station)).collect(Collectors.toList());
|
||||
collect.forEach(aSwitch -> aSwitch.setFault(Switch.SwitchFault.SPLIT));
|
||||
trainingVOList.add(this.build(config, simulation, station, button, operateDefinitionVO));
|
||||
simulation.reset();
|
||||
this.resetSimulation(simulation);
|
||||
});
|
||||
continue;
|
||||
}
|
||||
@ -170,7 +170,7 @@ public class StationGeneratorNew implements GeneratorNew {
|
||||
List<Switch> switchList1 = simulation.getRepository().getSwitchList();
|
||||
switchList1.stream().filter(aSwitch -> Objects.equals(aSwitch.getDeviceStation(), station)).forEach(aSwitch -> aSwitch.setSingleLock(true));
|
||||
trainingVOList.add(this.build(config, simulation, station, button, operateDefinitionVO));
|
||||
simulation.reset();
|
||||
this.resetSimulation(simulation);
|
||||
});
|
||||
continue;
|
||||
}
|
||||
@ -180,7 +180,7 @@ public class StationGeneratorNew implements GeneratorNew {
|
||||
switchList1.stream().filter(aSwitch -> Objects.equals(aSwitch.getDeviceStation(), station)).forEach(aSwitch -> aSwitch.setSingleLock(true));
|
||||
trainingVOList.add(this.build(config, simulation, station, null, operateDefinitionVO));
|
||||
// 仿真重置
|
||||
simulation.reset();
|
||||
this.resetSimulation(simulation);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -195,7 +195,7 @@ public class StationGeneratorNew implements GeneratorNew {
|
||||
List<Switch> switchList1 = simulation.getRepository().getSwitchList();
|
||||
switchList1.stream().filter(aSwitch -> Objects.equals(aSwitch.getDeviceStation(), station)).forEach(aSwitch -> aSwitch.setSingleLock(true));
|
||||
trainingVOList.add(this.build(config, simulation, station, button, operateDefinitionVO));
|
||||
simulation.reset();
|
||||
this.resetSimulation(simulation);
|
||||
});
|
||||
return;
|
||||
}
|
||||
@ -205,7 +205,7 @@ public class StationGeneratorNew implements GeneratorNew {
|
||||
switchList1.stream().filter(aSwitch -> Objects.equals(aSwitch.getDeviceStation(), station)).forEach(aSwitch -> aSwitch.setSingleLock(true));
|
||||
trainingVOList.add(this.build(config, simulation, station, null, operateDefinitionVO));
|
||||
// 仿真重置
|
||||
simulation.reset();
|
||||
this.resetSimulation(simulation);
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -227,7 +227,7 @@ public class StationGeneratorNew implements GeneratorNew {
|
||||
}
|
||||
trainingVOList.add(build(config, simulation, station,null, operateDefinitionVO));
|
||||
// 仿真重置
|
||||
simulation.reset();
|
||||
this.resetSimulation(simulation);
|
||||
}
|
||||
// List<Station> tbStationList = simulation.getRepository().getStationList()
|
||||
// .stream()
|
||||
@ -238,7 +238,7 @@ public class StationGeneratorNew implements GeneratorNew {
|
||||
// station.setControlMode(Station.ControlMode.Center);
|
||||
// trainingVOList.add(build(config, simulation, station,null, operateDefinitionVO));
|
||||
// // 仿真重置
|
||||
// simulation.reset();
|
||||
// this.resetSimulation(simulation);
|
||||
// }
|
||||
// });
|
||||
return trainingVOList;
|
||||
|
@ -9,8 +9,8 @@ import club.joylink.rtss.simulation.cbtc.Simulation;
|
||||
import club.joylink.rtss.simulation.cbtc.data.map.Switch;
|
||||
import club.joylink.rtss.simulation.cbtc.data.vr.VirtualRealitySectionAxleCounter;
|
||||
import club.joylink.rtss.simulation.cbtc.tool.DeviceStatusModifyTool;
|
||||
import club.joylink.rtss.vo.client.training.definition.OperateDefinitionVO;
|
||||
import club.joylink.rtss.vo.client.training.TrainingNewVO;
|
||||
import club.joylink.rtss.vo.client.training.definition.OperateDefinitionVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@ -116,7 +116,7 @@ public class SwitchGeneratorNew implements GeneratorNew {
|
||||
}
|
||||
trainingVOList.add(this.build(config, simulation, aSwitch, null,operateDefinitionVO));
|
||||
// 仿真重置
|
||||
simulation.reset();
|
||||
this.resetSimulation(simulation);
|
||||
}
|
||||
return trainingVOList;
|
||||
}
|
||||
|
@ -32,7 +32,7 @@ public abstract class Simulation<U extends SimulationUser, M extends Simulation
|
||||
*/
|
||||
private volatile int speed;
|
||||
public static final int MIN_SPEED = 1;
|
||||
public static final int MAX_SPEED = 10;
|
||||
public static final int MAX_SPEED = 100;
|
||||
/**
|
||||
* 仿真系统时间
|
||||
*/
|
||||
|
@ -1,6 +1,6 @@
|
||||
package club.joylink.rtss.simulation.cbtc.ATP.ground;
|
||||
|
||||
import club.joylink.rtss.simulation.cbtc.CI.CiApiService;
|
||||
import club.joylink.rtss.simulation.cbtc.CI.device.CiSignalControlService;
|
||||
import club.joylink.rtss.simulation.cbtc.Simulation;
|
||||
import club.joylink.rtss.simulation.cbtc.data.CalculateService;
|
||||
import club.joylink.rtss.simulation.cbtc.data.SimulationDataRepository;
|
||||
@ -8,14 +8,16 @@ import club.joylink.rtss.simulation.cbtc.data.map.MapConfig;
|
||||
import club.joylink.rtss.simulation.cbtc.data.map.Section;
|
||||
import club.joylink.rtss.simulation.cbtc.data.map.Signal;
|
||||
import club.joylink.rtss.simulation.cbtc.data.support.SectionPosition;
|
||||
import club.joylink.rtss.simulation.cbtc.data.support.SignalApproachMessage;
|
||||
import club.joylink.rtss.simulation.cbtc.data.vr.VirtualRealityTrain;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@ -26,55 +28,36 @@ import java.util.stream.Collectors;
|
||||
public class AtpSectionService {
|
||||
|
||||
@Autowired
|
||||
private CiApiService ciApiService;
|
||||
private CiSignalControlService signalControlService;
|
||||
|
||||
/**
|
||||
* 收集列车接近信号机消息并发送给CI
|
||||
*/
|
||||
public Map<VirtualRealityTrain, Signal> collectAndSendSignalApproachMessage2CI(Simulation simulation,
|
||||
List<VirtualRealityTrain> onlineTrainList,
|
||||
Map<String, List<Section>> trainAtpSectionMap) {
|
||||
List<SignalApproachMessage> signalApproachMessageList = new ArrayList<>(); // 信号机列车接近信息
|
||||
public void changeSignalModeByTrainApproach(Simulation simulation,
|
||||
List<VirtualRealityTrain> onlineTrainList,
|
||||
Map<String, List<Section>> trainAtpSectionMap) {
|
||||
List<Signal> signalList = simulation.getRepository().getSignalList();
|
||||
Map<VirtualRealityTrain, Signal> nctApproachSignalMap = new HashMap<>();
|
||||
signalList.forEach(signal -> {
|
||||
// if (!signal.isNormalOpen()) {
|
||||
// for (VirtualRealityTrain train : onlineTrainList) {
|
||||
// List<Section> atpSectionList = trainAtpSectionMap.get(train.getGroupNumber());
|
||||
// List<Section> physicalList = this.convert2PhysicalSectionList(atpSectionList);
|
||||
// if (!train.isCBTC() && signal.containsApproachPhysicalSection(physicalList)) { //非通信车在物理接近区段上
|
||||
// nctApproachSignalMap.put(train, signal);
|
||||
// }
|
||||
// }
|
||||
// return;
|
||||
// }
|
||||
SignalApproachMessage.ApproachMessage approachMsg = SignalApproachMessage.ApproachMessage.NULL;
|
||||
int a = 0; // 列车接近信号消息:0-无车接近,1-通信车接近,2-非通信车接近
|
||||
for (VirtualRealityTrain train : onlineTrainList) {
|
||||
List<Section> atpSectionList = trainAtpSectionMap.get(train.getGroupNumber());
|
||||
List<Section> physicalList = this.convert2PhysicalSectionList(atpSectionList);
|
||||
if (train.isCommunicable() && signal.containsApproachAtpSection(atpSectionList)) { //通信车在atp接近区段上
|
||||
approachMsg = SignalApproachMessage.ApproachMessage.CBTC;
|
||||
} else if (!train.isCommunicable() && signal.containsApproachPhysicalSection(physicalList)) { //非通信车在物理接近区段上
|
||||
approachMsg = SignalApproachMessage.ApproachMessage.NCT;
|
||||
nctApproachSignalMap.put(train, signal);
|
||||
if (train.isCommunicable() && signal.containsApproachAtpSection(atpSectionList)) { //存在通信车接近,继续
|
||||
a = 1;
|
||||
} else if (!train.isCommunicable() && signal.containsApproachPhysicalSection(physicalList)) { //存在非通信车接近,结束
|
||||
a = 2;
|
||||
break;
|
||||
}
|
||||
|
||||
/*if (!Objects.equals(SignalApproachMessage.ApproachMessage.NCT, approachMsg)) { // 不为非通信车占用时
|
||||
if (!SignalApproachMessage.ApproachMessage.CBTC.equals(approachMsg) &&
|
||||
train.isCBTC() && signal.containsApproachAtpSection(atpSectionList)) {
|
||||
approachMsg = SignalApproachMessage.ApproachMessage.CBTC;
|
||||
} else if (!train.isCBTC() && signal.containsApproachPhysicalSection(physicalList)) {
|
||||
approachMsg = SignalApproachMessage.ApproachMessage.NCT;
|
||||
nctApproachSignalMap.put(train, signal);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
String signalCode = signal.getCode();
|
||||
signalApproachMessageList.add(new SignalApproachMessage(signalCode, approachMsg));
|
||||
if (1 == a) { // 只有通信车接近
|
||||
signal.changeToCbtcMode();
|
||||
this.signalControlService.controlLightOfSignal(simulation, signal);
|
||||
} else if (2 == a) { // 有非通信车接近
|
||||
signal.changeToBackupMode();
|
||||
this.signalControlService.controlLightOfSignal(simulation, signal);
|
||||
}
|
||||
signal.updateApproachLock();//更新信号机接近锁闭状态
|
||||
});
|
||||
this.ciApiService.handleSignalApproachMessage(simulation, signalApproachMessageList);
|
||||
return nctApproachSignalMap;
|
||||
}
|
||||
|
||||
private List<Section> convert2PhysicalSectionList(List<Section> sectionList) {
|
||||
|
@ -5,7 +5,6 @@ import club.joylink.rtss.simulation.cbtc.CI.CiApiService;
|
||||
import club.joylink.rtss.simulation.cbtc.Simulation;
|
||||
import club.joylink.rtss.simulation.cbtc.data.SimulationDataRepository;
|
||||
import club.joylink.rtss.simulation.cbtc.data.map.Section;
|
||||
import club.joylink.rtss.simulation.cbtc.data.map.Signal;
|
||||
import club.joylink.rtss.simulation.cbtc.data.map.Switch;
|
||||
import club.joylink.rtss.simulation.cbtc.data.vr.VirtualRealityTrain;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -81,9 +80,8 @@ public class GroundAtpApiServiceImpl implements GroundAtpApiService {
|
||||
section.nonCommunicateTrainOccupy(train.isRight());
|
||||
}
|
||||
}));
|
||||
// 信号机接近信息、停稳信息通知
|
||||
Map<VirtualRealityTrain, Signal> nctApproachSignalMap =
|
||||
this.atpSectionService.collectAndSendSignalApproachMessage2CI(simulation, onlineTrainList, trainAtpSectionMap);
|
||||
// 信号机接近信息
|
||||
this.atpSectionService.changeSignalModeByTrainApproach(simulation, onlineTrainList, trainAtpSectionMap);
|
||||
|
||||
// 移除下线列车区段占用
|
||||
this.atpSectionService.removeOfflineTrainOccupySections(simulation, onlineTrainList);
|
||||
@ -104,7 +102,7 @@ public class GroundAtpApiServiceImpl implements GroundAtpApiService {
|
||||
.forEach(aSwitch -> aSwitch.ctcOccupy());
|
||||
|
||||
// 发送区段状态
|
||||
this.atsApiService.handleDeviceStatus(simulation, repository.getSectionList());
|
||||
// this.atsApiService.handleDeviceStatus(simulation, repository.getSectionList());
|
||||
// 为ctc列车计算移动授权
|
||||
this.maService.calculateMaOfCtcTrains(simulation);
|
||||
}
|
||||
|
@ -190,6 +190,8 @@ public class MaService {
|
||||
break;
|
||||
}
|
||||
case Closed_Section:
|
||||
case UnLock_Section:
|
||||
case Reverse_Lock_Section:
|
||||
case Fault_Route:{
|
||||
Section section = (Section) this.device;
|
||||
eoa = new SectionPosition(section, right ? 0 : section.getLen());
|
||||
@ -313,6 +315,10 @@ public class MaService {
|
||||
ZC_Boundary,
|
||||
/** 关闭的区段 */
|
||||
Closed_Section,
|
||||
/** 进路锁闭反向的区段 */
|
||||
Reverse_Lock_Section,
|
||||
/** 未锁闭的区段 */
|
||||
UnLock_Section,
|
||||
/** 进路联锁条件不再完备 */
|
||||
Fault_Route,
|
||||
/** 站台问题(屏蔽门或紧急停车) */
|
||||
@ -344,7 +350,7 @@ public class MaService {
|
||||
public void calculateAndUpdateItcMa(Simulation simulation, VirtualRealityTrain train, Responder responder) {
|
||||
Ma ma = null;
|
||||
Signal signal = responder.getSignal();
|
||||
if (signal.isNormalOpen()) {
|
||||
if (signal.isMainAspect()) {
|
||||
if (signal.isAutoSignal()) {
|
||||
boolean right = signal.isRight();
|
||||
Section section = signal.getSection().getNextRunningSectionOf(right);
|
||||
@ -371,7 +377,7 @@ public class MaService {
|
||||
boolean right = train.isRight();
|
||||
Signal signal = section.getSignalOf(right);
|
||||
if (signal != null) { // 车头所在区段前方信号机开放
|
||||
if (signal.isNormalOpen()) {
|
||||
if (signal.isMainAspect()) {
|
||||
Float distance = CalculateService.calculateDistance(headPosition, new SectionPosition(section, signal.getOffset()), right);
|
||||
if (distance != null) { // 此处距离为暂时的估计值,
|
||||
Route lockedRoute = signal.getLockedRoute();
|
||||
@ -417,19 +423,19 @@ public class MaService {
|
||||
ma = this.checkAndUpdateMa(ma, new Ma(train, section, MaType.Fault_Route));
|
||||
}
|
||||
// 反向锁闭区段
|
||||
if (right != route.getStart().isRight()) { // 列车方向和区段进路方向相反
|
||||
if (front && right != route.getStart().isRight()) { // 列车方向和区段进路方向相反
|
||||
Signal aheadSignal = section.getSignalOf(right);
|
||||
if (aheadSignal == null || aheadSignal.getLockedRoute() == null ||
|
||||
!aheadSignal.getLockedRoute().isOpen()) {
|
||||
ma = this.checkAndUpdateMa(ma, new Ma(train, section, MaType.Closed_Section));
|
||||
!aheadSignal.getLockedRoute().isOpenMain()) {
|
||||
ma = this.checkAndUpdateMa(ma, new Ma(train, section, MaType.Reverse_Lock_Section));
|
||||
}
|
||||
}
|
||||
} else if(front) {
|
||||
if (!section.isRouteLock() && !section.isOverlapLock()) {//列车前方区段未锁闭
|
||||
if (!section.isRouteLock() && !section.isOverlapLock() && !section.isLogicOverlapLock()) {//列车前方区段未锁闭
|
||||
Signal aheadSignal = section.getSignalOf(right);
|
||||
if (aheadSignal == null || aheadSignal.getLockedRoute() == null ||
|
||||
!aheadSignal.getLockedRoute().isOpen()) {
|
||||
ma = this.checkAndUpdateMa(ma, new Ma(train, section, MaType.Closed_Section));
|
||||
!aheadSignal.getLockedRoute().isOpenMain()) {
|
||||
ma = this.checkAndUpdateMa(ma, new Ma(train, section, MaType.UnLock_Section));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -444,7 +450,7 @@ public class MaService {
|
||||
Section next = section.getNextRunningSectionOf(right);
|
||||
if (front) { // 车头前方
|
||||
Signal signal = section.getSignalOf(right);
|
||||
if (signal != null && !signal.isNormalOpen()) {
|
||||
if (signal != null && !signal.isMainAspect()) {
|
||||
// 限制信号机
|
||||
if (signal.isOverlapLock()) {
|
||||
ma = this.checkAndUpdateMa(ma, new Ma(train, signal, MaType.Limit_Signal_With_Overlap));
|
||||
@ -542,7 +548,7 @@ public class MaService {
|
||||
switchFault = true;
|
||||
break;
|
||||
} else {
|
||||
RouteFls fls = route.getRouteFlsOfSwitch(aSwitch);
|
||||
RouteFls fls = route.queryRouteFlsOfSwitch(aSwitch);
|
||||
if (fls != null) {
|
||||
List<RouteFls.FlsElement> level1List = fls.getLevel1List();
|
||||
for (RouteFls.FlsElement flsElement : level1List) {
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -10,7 +10,6 @@ import club.joylink.rtss.simulation.cbtc.data.map.*;
|
||||
import club.joylink.rtss.simulation.cbtc.data.plan.RealRun;
|
||||
import club.joylink.rtss.simulation.cbtc.data.status.*;
|
||||
import club.joylink.rtss.simulation.cbtc.data.vo.*;
|
||||
import club.joylink.rtss.simulation.cbtc.data.vr.VirtualRealityTrain;
|
||||
import club.joylink.rtss.simulation.cbtc.event.SimulationOperationMessageEvent;
|
||||
import club.joylink.rtss.simulation.cbtc.member.SimulationMember;
|
||||
import club.joylink.rtss.vo.client.SocketMessageVO;
|
||||
@ -39,93 +38,36 @@ public class ATSMessageCollectAndDispatcher {
|
||||
@Autowired
|
||||
private ApplicationContext applicationContext;
|
||||
|
||||
public void run(Simulation simulation) {
|
||||
// long start = System.currentTimeMillis();
|
||||
this.trainTracking(simulation);
|
||||
// 收集设备状态
|
||||
List<DeviceStatusVO> filterList = this.collect(simulation);
|
||||
if (CollectionUtils.isEmpty(filterList)) {
|
||||
return;
|
||||
}
|
||||
// 构建并发送设备状态消息
|
||||
SocketMessageVO deviceStatusMessage =
|
||||
SocketMessageFactory.build(WebSocketMessageType.Simulation_DeviceStatus,
|
||||
simulation.getId(), filterList);
|
||||
Set<String> sessions = simulation.getSimulationUserIds();
|
||||
// System.out.println(String.format("发送用户数:[%s], 发送状态条数:[%s]",
|
||||
// sessions.size(), filterList.size()));
|
||||
this.stompMessageService.sendToUser(sessions, deviceStatusMessage);
|
||||
// long end = System.currentTimeMillis();
|
||||
// System.out.println(String.format("收集并发送设备状态用时: [%s ms]", (end - start)));
|
||||
}
|
||||
|
||||
private void trainTracking(Simulation simulation) {
|
||||
SimulationDataRepository repository = simulation.getRepository();
|
||||
List<VirtualRealityTrain> onlineTrainList = repository.getOnlineTrainList();
|
||||
onlineTrainList.forEach(train -> {
|
||||
TrainInfo trainInfo = repository.findSupervisedTrainByGroup(train.getGroupNumber());
|
||||
if (Objects.nonNull(trainInfo)) {
|
||||
trainInfo.tracking(train);
|
||||
}
|
||||
});
|
||||
}
|
||||
// public void run(Simulation simulation) {
|
||||
//// long start = System.currentTimeMillis();
|
||||
//// this.trainTracking(simulation);
|
||||
// // 收集设备状态
|
||||
//// List<DeviceStatusVO> filterList = this.collect(simulation);
|
||||
//// if (CollectionUtils.isEmpty(filterList)) {
|
||||
//// return;
|
||||
//// }
|
||||
//// // 构建并发送设备状态消息
|
||||
//// SocketMessageVO deviceStatusMessage =
|
||||
//// SocketMessageFactory.build(WebSocketMessageType.Simulation_DeviceStatus,
|
||||
//// simulation.getId(), filterList);
|
||||
//// Set<String> sessions = simulation.getSimulationUserIds();
|
||||
////// System.out.println(String.format("发送用户数:[%s], 发送状态条数:[%s]",
|
||||
////// sessions.size(), filterList.size()));
|
||||
//// this.stompMessageService.sendToUser(sessions, deviceStatusMessage);
|
||||
//// long end = System.currentTimeMillis();
|
||||
//// System.out.println(String.format("收集并发送设备状态用时: [%s ms]", (end - start)));
|
||||
// }
|
||||
|
||||
/**
|
||||
* 收集当前所有设备(除区段和道岔)状态
|
||||
* 收集仿真所有设备状态并发送给仿真用户
|
||||
*/
|
||||
private List<DeviceStatusVO> collect(Simulation simulation) {
|
||||
List<DeviceStatusVO> totalList = new ArrayList<>();
|
||||
SimulationDataRepository repository = simulation.getRepository();
|
||||
Map<String, ? extends MapElement> deviceMap = repository.getDeviceMap();
|
||||
deviceMap.values().forEach(device -> {
|
||||
if (Objects.equals(device.getDeviceType(), MapElement.DeviceType.SECTION) ||
|
||||
Objects.equals(device.getDeviceType(), MapElement.DeviceType.SWITCH)) {
|
||||
return;
|
||||
}
|
||||
DeviceStatus deviceStatus = repository.findStatusByCode(device.getCode());
|
||||
if (Objects.isNull(deviceStatus)) {
|
||||
deviceStatus = this.buildDeviceStatus(device);
|
||||
if (Objects.nonNull(deviceStatus)) {
|
||||
repository.addDeviceInfo(deviceStatus);
|
||||
totalList.add(deviceStatus.convert2VO(device));
|
||||
}
|
||||
} else {
|
||||
DeviceStatusVO statusVO =this.buildDeviceStatusVO(device);
|
||||
if (deviceStatus.compareAndChange(device,statusVO)) {
|
||||
totalList.add(statusVO);
|
||||
}
|
||||
}
|
||||
});
|
||||
// 列车状态
|
||||
List<TrainInfo> trainList = repository.getSuperviseTrainList();
|
||||
trainList.forEach(train -> {
|
||||
TrainStatus trainStatus = repository.findStatusByCode(train.getGroupNumber(), TrainStatus.class);
|
||||
if (Objects.isNull(trainStatus)) {
|
||||
trainStatus = new TrainStatus(train);
|
||||
repository.addDeviceInfo(trainStatus);
|
||||
totalList.add(trainStatus.convert2VO(train));
|
||||
} else {
|
||||
DeviceStatusVO statusVO = new TrainStatusVO(train);
|
||||
if (trainStatus.compareAndChange(train,statusVO)) {
|
||||
totalList.add(statusVO);
|
||||
}
|
||||
}
|
||||
});
|
||||
// 回库删除的列车状态
|
||||
List<TrainStatus> inboundTrainList = new ArrayList<>();
|
||||
List<TrainStatus> trainStatusList = repository.getTrainStatusList();
|
||||
if (!CollectionUtils.isEmpty(trainStatusList)) {
|
||||
for (TrainStatus trainStatus : trainStatusList) {
|
||||
TrainInfo trainInfo = repository.findSupervisedTrainByGroup(trainStatus.getGroupNumber());
|
||||
if (Objects.isNull(trainInfo)) {
|
||||
totalList.add(TrainStatusVO.buildDispose(trainStatus.getGroupNumber()));
|
||||
inboundTrainList.add(trainStatus);
|
||||
repository.deleteDeviceStatus(trainStatus.getCode());
|
||||
}
|
||||
}
|
||||
}
|
||||
this.joylink3DMessageService.handleTrainInbound(simulation, inboundTrainList);
|
||||
return totalList;
|
||||
public void collectAllAndSend(Simulation simulation) {
|
||||
List<DeviceStatusVO> deviceStatuses = collectAll(simulation);
|
||||
// 构建并发送设备状态消息
|
||||
SocketMessageVO<List<DeviceStatusVO>> deviceStatusMessage =
|
||||
SocketMessageFactory.buildSimulationDeviceStatusesMessage(simulation.getId(), deviceStatuses);
|
||||
Set<String> sessions = simulation.getSimulationUserIds();
|
||||
this.stompMessageService.sendToUser(sessions, deviceStatusMessage);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -182,18 +124,6 @@ public class ATSMessageCollectAndDispatcher {
|
||||
return totalList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 收集仿真所有设备状态并发送给仿真用户
|
||||
*/
|
||||
public void collectAllAndSend(Simulation simulation) {
|
||||
List<DeviceStatusVO> deviceStatuses = collectAll(simulation);
|
||||
// 构建并发送设备状态消息
|
||||
SocketMessageVO<List<DeviceStatusVO>> deviceStatusMessage =
|
||||
SocketMessageFactory.buildSimulationDeviceStatusesMessage(simulation.getId(), deviceStatuses);
|
||||
Set<String> sessions = simulation.getSimulationUserIds();
|
||||
this.stompMessageService.sendToUser(sessions, deviceStatusMessage);
|
||||
}
|
||||
|
||||
public void collectDeviceStatusAndSend(Simulation simulation, List<? extends MapElement> deviceList) {
|
||||
if (!CollectionUtils.isEmpty(deviceList)) {
|
||||
List<Object> filterList = new ArrayList<>();
|
||||
@ -350,6 +280,6 @@ public class ATSMessageCollectAndDispatcher {
|
||||
|
||||
public void addJobs(Simulation simulation) {
|
||||
simulation.addJob(SimulationModule.SYNC_TIME.name(), () -> this.syncTime(simulation), SimulationConstants.SYNC_TIME_RATE);
|
||||
simulation.addFixedRateJob(SimulationModule.MESSAGE.name(), () -> this.run(simulation), SimulationConstants.SEND_CLIENT_RATE);
|
||||
simulation.addFixedRateJob(SimulationModule.MESSAGE.name(), () -> this.collectAllAndSend(simulation), SimulationConstants.SEND_CLIENT_RATE);
|
||||
}
|
||||
}
|
||||
|
@ -1,23 +1,20 @@
|
||||
package club.joylink.rtss.simulation.cbtc.ATS;
|
||||
|
||||
import club.joylink.rtss.simulation.cbtc.Simulation;
|
||||
import club.joylink.rtss.simulation.cbtc.data.map.MapElement;
|
||||
import club.joylink.rtss.vo.AccountVO;
|
||||
import club.joylink.rtss.vo.client.runplan.RunPlanServiceConfigVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* ATS系统接口
|
||||
*/
|
||||
public interface AtsApiService {
|
||||
|
||||
/**
|
||||
* 处理设备状态
|
||||
* @param simulation
|
||||
* @param deviceList
|
||||
*/
|
||||
void handleDeviceStatus(Simulation simulation, List<? extends MapElement> deviceList);
|
||||
// /**
|
||||
// * 处理设备状态
|
||||
// * @param simulation
|
||||
// * @param deviceList
|
||||
// */
|
||||
// void handleDeviceStatus(Simulation simulation, List<? extends MapElement> deviceList);
|
||||
|
||||
/**
|
||||
* 添加车次计划(加线)
|
||||
|
@ -4,7 +4,6 @@ import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
|
||||
import club.joylink.rtss.services.IRunPlanDraftService;
|
||||
import club.joylink.rtss.simulation.cbtc.Simulation;
|
||||
import club.joylink.rtss.simulation.cbtc.build.RunPlanBuilder;
|
||||
import club.joylink.rtss.simulation.cbtc.data.map.MapElement;
|
||||
import club.joylink.rtss.simulation.cbtc.data.plan.TripPlan;
|
||||
import club.joylink.rtss.simulation.cbtc.event.SimulationTripPlanChangeEvent;
|
||||
import club.joylink.rtss.util.JsonUtils;
|
||||
@ -36,11 +35,11 @@ public class AtsApiServiceImpl implements AtsApiService {
|
||||
|
||||
@Autowired
|
||||
private ApplicationContext applicationContext;
|
||||
|
||||
@Override
|
||||
public void handleDeviceStatus(Simulation simulation, List<? extends MapElement> deviceList) {
|
||||
this.atsMessageCollectAndDispatcher.collectDeviceStatusAndSend(simulation, deviceList);
|
||||
}
|
||||
//
|
||||
// @Override
|
||||
// public void handleDeviceStatus(Simulation simulation, List<? extends MapElement> deviceList) {
|
||||
// this.atsMessageCollectAndDispatcher.collectDeviceStatusAndSend(simulation, deviceList);
|
||||
// }
|
||||
|
||||
@Override
|
||||
public void addTripPlan(Simulation simulation, RunPlanServiceConfigVO serviceConfig, AccountVO user) {
|
||||
|
@ -157,8 +157,6 @@ public class Operation {
|
||||
Signal_Set_CI_Auto_Trigger(),
|
||||
/** 取消联锁自动触发 */
|
||||
Signal_Cancel_CI_Auto_Trigger(),
|
||||
/** 关闭进路引导信号 */
|
||||
Signal_Close_Guide,
|
||||
/** 设置自动折返进路 */
|
||||
Signal_Set_Auto_Turn_Back,
|
||||
/** 取消自动折返进路 */
|
||||
@ -171,8 +169,6 @@ public class Operation {
|
||||
Signal_Cancel_Guide_Initialization,
|
||||
/** 办理引导 */
|
||||
Signal_Set_Guide,
|
||||
/** 取消引导 */
|
||||
Signal_Cancel_Guide,
|
||||
|
||||
//--------------------------- 站台操作 ---------------------------
|
||||
/** 设置跳停 */
|
||||
@ -412,6 +408,10 @@ public class Operation {
|
||||
Driver_Change_Head,
|
||||
/** 列车车门开关 */
|
||||
Driver_Door_On_Off,
|
||||
/** 列车门模式 */
|
||||
Driver_Door_Mode,
|
||||
/** 列车门选择 */
|
||||
Driver_Door_Selection,
|
||||
|
||||
//--------------------------- 方向杆 ---------------------------
|
||||
/** 方向转换 */
|
||||
|
@ -1,15 +1,11 @@
|
||||
package club.joylink.rtss.simulation.cbtc.ATS.operation.handler;
|
||||
|
||||
import club.joylink.rtss.simulation.cbtc.ATP.ground.GroundAtpApiService;
|
||||
import club.joylink.rtss.simulation.cbtc.ATP.ground.ZCLogicLoop;
|
||||
import club.joylink.rtss.simulation.cbtc.ATS.operation.Operation;
|
||||
import club.joylink.rtss.simulation.cbtc.ATS.operation.annotation.OperateHandler;
|
||||
import club.joylink.rtss.simulation.cbtc.ATS.operation.annotation.OperateHandlerMapping;
|
||||
import club.joylink.rtss.simulation.cbtc.CI.CiApiService;
|
||||
import club.joylink.rtss.simulation.cbtc.Simulation;
|
||||
import club.joylink.rtss.simulation.cbtc.constant.ControlGear;
|
||||
import club.joylink.rtss.simulation.cbtc.constant.DriveMode;
|
||||
import club.joylink.rtss.simulation.cbtc.data.map.Stand;
|
||||
import club.joylink.rtss.simulation.cbtc.data.vr.VirtualRealityTrain;
|
||||
import club.joylink.rtss.simulation.cbtc.exception.SimulationException;
|
||||
import club.joylink.rtss.simulation.cbtc.exception.SimulationExceptionType;
|
||||
@ -18,7 +14,6 @@ import club.joylink.rtss.simulation.cbtc.onboard.ATP.ATPService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
@ -34,12 +29,6 @@ public class DriverOperateHandler {
|
||||
@Autowired
|
||||
private ATPService ATPService;
|
||||
|
||||
@Autowired
|
||||
private ZCLogicLoop zcLogicLoop;
|
||||
|
||||
@Autowired
|
||||
private GroundAtpApiService groundAtpApiService;
|
||||
|
||||
@OperateHandlerMapping(type = Operation.Type.Driver_Force_Change)
|
||||
public void changeTrainForce(Simulation simulation, String groupNumber, Float percent) {
|
||||
Objects.requireNonNull(percent);
|
||||
@ -171,5 +160,33 @@ public class DriverOperateHandler {
|
||||
ATPService.openOrCloseDoor(simulation, train, right, open);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置门模式
|
||||
*
|
||||
* @param groupNumber 车组号
|
||||
*/
|
||||
@OperateHandlerMapping(type = Operation.Type.Driver_Door_Mode)
|
||||
public void setDriverDoorMode(Simulation simulation, String groupNumber,
|
||||
VirtualRealityTrain.DoorMode doorMode) {
|
||||
if (Objects.isNull(doorMode)) {
|
||||
throw new SimulationException(SimulationExceptionType.Illegal_Argument, "门模式不能为空");
|
||||
}
|
||||
VirtualRealityTrain train = simulation.getRepository().getOnlineTrainBy(groupNumber);
|
||||
train.setDoorMode(doorMode);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置门选择
|
||||
*
|
||||
* @param groupNumber 车组号
|
||||
*/
|
||||
@OperateHandlerMapping(type = Operation.Type.Driver_Door_Selection)
|
||||
public void setDriverDoorSelection(Simulation simulation, String groupNumber,
|
||||
VirtualRealityTrain.DoorSelection doorSelection) {
|
||||
if (Objects.isNull(doorSelection)) {
|
||||
throw new SimulationException(SimulationExceptionType.Illegal_Argument, "门选择不能为空");
|
||||
}
|
||||
VirtualRealityTrain train = simulation.getRepository().getOnlineTrainBy(groupNumber);
|
||||
train.setDoorSelection(doorSelection);
|
||||
}
|
||||
}
|
||||
|
@ -50,11 +50,10 @@ public class SignalOperateHandler {
|
||||
@OperateHandlerMapping(type = Operation.Type.Signal_Cancel_Route)
|
||||
public void cancelRoute(Simulation simulation, String signalCode) {
|
||||
//是否接近区段占用仍执行取消进路
|
||||
if (simulation.getRepository().getConfig().isSignalForceCancelRoute()) {
|
||||
Route route = this.ciApiService.findLockedRouteByStartSignal(simulation, signalCode);
|
||||
if (Objects.nonNull(route)) {
|
||||
this.ciApiService.forceUnlockRoute(simulation, route.getCode());
|
||||
}
|
||||
Route route = this.ciApiService.findLockedRouteByStartSignal(simulation, signalCode);
|
||||
if (route != null && route.isApproachLock() &&
|
||||
simulation.getRepository().getConfig().isSignalForceCancelRoute()) {
|
||||
this.ciApiService.humanCancel(simulation, route.getCode());
|
||||
return;
|
||||
}
|
||||
this.atsRouteService.cancelRoute(simulation, signalCode);
|
||||
@ -258,14 +257,6 @@ public class SignalOperateHandler {
|
||||
// this.iciSubsystem.openGuideSignalCheckRoute(simulation, signalCode);
|
||||
// }
|
||||
|
||||
/**
|
||||
* 关闭进路引导信号
|
||||
*/
|
||||
@OperateHandlerMapping(type = Operation.Type.Signal_Close_Guide)
|
||||
public void closeGuide(Simulation simulation, String signalCode) {
|
||||
this.ciApiService.closeGuideSignal(simulation, signalCode);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置自动折返进路
|
||||
*/
|
||||
@ -314,11 +305,4 @@ public class SignalOperateHandler {
|
||||
ciApiService.setGuide(simulation, signalCode, routeCode);
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消引导
|
||||
*/
|
||||
@OperateHandlerMapping(type = Operation.Type.Signal_Cancel_Guide)
|
||||
public void cancelGuide(Simulation simulation, String signalCode, String routeCode) {
|
||||
ciApiService.cancelGuide(simulation, signalCode);
|
||||
}
|
||||
}
|
||||
|
@ -8,6 +8,7 @@ import club.joylink.rtss.simulation.cbtc.ATS.operation.annotation.OperateHandler
|
||||
import club.joylink.rtss.simulation.cbtc.ATS.service.AtsSectionService;
|
||||
import club.joylink.rtss.simulation.cbtc.CI.CiApiService;
|
||||
import club.joylink.rtss.simulation.cbtc.Simulation;
|
||||
import club.joylink.rtss.simulation.cbtc.constant.SwitchIndication;
|
||||
import club.joylink.rtss.simulation.cbtc.data.SimulationDataRepository;
|
||||
import club.joylink.rtss.simulation.cbtc.data.map.Switch;
|
||||
import club.joylink.rtss.simulation.cbtc.data.vr.VirtualRealitySwitch;
|
||||
@ -52,7 +53,7 @@ public class SwitchOperateHandler {
|
||||
throw new SimulationException(SimulationExceptionType.Operation_Handle_FAIL,
|
||||
"道岔锁闭或占用,无法转动");
|
||||
}
|
||||
if (aSwitch.isNormalPosition()) {
|
||||
if (aSwitch.isPosN()) {
|
||||
throw new SimulationException(SimulationExceptionType.Operation_Handle_FAIL,
|
||||
"道岔已经在定位,无需转动");
|
||||
}
|
||||
@ -73,7 +74,7 @@ public class SwitchOperateHandler {
|
||||
throw new SimulationException(SimulationExceptionType.Operation_Handle_FAIL,
|
||||
"道岔锁闭或占用,无法转动");
|
||||
}
|
||||
if (aSwitch.isReversePosition()) {
|
||||
if (aSwitch.isPosR()) {
|
||||
throw new SimulationException(SimulationExceptionType.Operation_Handle_FAIL,
|
||||
"道岔已经在反位,无需转动");
|
||||
}
|
||||
@ -256,14 +257,17 @@ public class SwitchOperateHandler {
|
||||
@OperateHandlerMapping(type = Operation.Type.Switch_Hook_Lock)
|
||||
public void switchHookLock(Simulation simulation, String switchCode, Boolean normal) {
|
||||
VirtualRealitySwitch vrSwitch = simulation.getRepository().getVRByCode(switchCode, VirtualRealitySwitch.class);
|
||||
vrSwitch.setNormal(normal);
|
||||
vrSwitch.setReverse(!normal);
|
||||
if (normal) {
|
||||
vrSwitch.setP(SwitchIndication.N);
|
||||
} else {
|
||||
vrSwitch.setP(SwitchIndication.R);
|
||||
}
|
||||
}
|
||||
|
||||
/** 强行转岔 */
|
||||
@OperateHandlerMapping(type = Operation.Type.Switch_Force_Turn)
|
||||
public void switchForceTurn(Simulation simulation, String switchCode, Boolean normal) {
|
||||
ciApiService.switchForceTurn(simulation, switchCode, normal);
|
||||
ciApiService.switchForceTurn(simulation, switchCode);
|
||||
}
|
||||
|
||||
/** 挤岔恢复 */
|
||||
|
@ -2,13 +2,11 @@ package club.joylink.rtss.simulation.cbtc.ATS.operation.service;
|
||||
|
||||
import club.joylink.rtss.simulation.cbtc.ATS.operation.vo.FaultParam;
|
||||
import club.joylink.rtss.simulation.cbtc.Simulation;
|
||||
import club.joylink.rtss.simulation.cbtc.communication.vo.ControllableDevice;
|
||||
import club.joylink.rtss.simulation.cbtc.communication.vo.PsdSwitch;
|
||||
import club.joylink.rtss.simulation.cbtc.communication.vo.fault.DeviceFaultInfo;
|
||||
import club.joylink.rtss.simulation.cbtc.data.map.MayOutOfOrderDevice;
|
||||
import club.joylink.rtss.simulation.cbtc.data.map.Stand;
|
||||
import club.joylink.rtss.simulation.cbtc.data.vr.VirtualRealityScreenDoor;
|
||||
import club.joylink.rtss.simulation.cbtc.event.SimulationDeviceControlEvent;
|
||||
import club.joylink.rtss.simulation.cbtc.device.virtual.VirtualRealityDeviceService;
|
||||
import club.joylink.rtss.simulation.cbtc.event.SimulationDeviceFaultOverEvent;
|
||||
import club.joylink.rtss.simulation.cbtc.event.SimulationDeviceFaultSetEvent;
|
||||
import club.joylink.rtss.simulation.cbtc.exception.SimulationException;
|
||||
@ -24,6 +22,8 @@ public class StandFaultService implements DeviceFaultService {
|
||||
|
||||
@Autowired
|
||||
private ApplicationContext applicationContext;
|
||||
@Autowired
|
||||
private VirtualRealityDeviceService virtualRealityDeviceService;
|
||||
|
||||
@Override
|
||||
public void setFault(Simulation simulation, MayOutOfOrderDevice device, FaultParam param) {
|
||||
@ -35,15 +35,11 @@ public class StandFaultService implements DeviceFaultService {
|
||||
VirtualRealityScreenDoor vrPsd = ((Stand) device).getPsd().getVirtualScreenDoor();
|
||||
switch (fault) {
|
||||
case PSD_CANNOT_BE_CLOSED:{
|
||||
ControllableDevice ctrlMsg = new PsdSwitch(vrPsd, true);
|
||||
SimulationDeviceControlEvent event = new SimulationDeviceControlEvent(this, simulation, ctrlMsg);
|
||||
this.applicationContext.publishEvent(event);
|
||||
this.virtualRealityDeviceService.control(simulation, vrPsd, VirtualRealityScreenDoor.Operation.K);
|
||||
break;
|
||||
}
|
||||
case PSD_CANNOT_BE_OPENED:{
|
||||
ControllableDevice ctrlMsg = new PsdSwitch(vrPsd, false);
|
||||
SimulationDeviceControlEvent event = new SimulationDeviceControlEvent(this, simulation, ctrlMsg);
|
||||
this.applicationContext.publishEvent(event);
|
||||
this.virtualRealityDeviceService.control(simulation, vrPsd, VirtualRealityScreenDoor.Operation.G);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -59,15 +55,11 @@ public class StandFaultService implements DeviceFaultService {
|
||||
VirtualRealityScreenDoor vrPsd = ((Stand) device).getPsd().getVirtualScreenDoor();
|
||||
switch (fault) {
|
||||
case PSD_CANNOT_BE_CLOSED:{
|
||||
ControllableDevice ctrlMsg = new PsdSwitch(vrPsd, !vrPsd.isSettingClose());
|
||||
SimulationDeviceControlEvent event = new SimulationDeviceControlEvent(this, simulation, ctrlMsg);
|
||||
this.applicationContext.publishEvent(event);
|
||||
this.virtualRealityDeviceService.control(simulation, vrPsd, VirtualRealityScreenDoor.Operation.G);
|
||||
break;
|
||||
}
|
||||
case PSD_CANNOT_BE_OPENED: {
|
||||
ControllableDevice ctrlMsg = new PsdSwitch(vrPsd, vrPsd.isSettingOpen());
|
||||
SimulationDeviceControlEvent event = new SimulationDeviceControlEvent(this, simulation, ctrlMsg);
|
||||
this.applicationContext.publishEvent(event);
|
||||
this.virtualRealityDeviceService.control(simulation, vrPsd, VirtualRealityScreenDoor.Operation.K);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -3,7 +3,7 @@ package club.joylink.rtss.simulation.cbtc.ATS.service;
|
||||
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
|
||||
import club.joylink.rtss.simulation.cbtc.ATS.data.AtsAlarm;
|
||||
import club.joylink.rtss.simulation.cbtc.CI.CiApiService;
|
||||
import club.joylink.rtss.simulation.cbtc.CI.service.RouteService;
|
||||
import club.joylink.rtss.simulation.cbtc.CI.device.CiRouteService;
|
||||
import club.joylink.rtss.simulation.cbtc.Simulation;
|
||||
import club.joylink.rtss.simulation.cbtc.data.SimulationDataRepository;
|
||||
import club.joylink.rtss.simulation.cbtc.data.map.Cycle;
|
||||
@ -29,7 +29,7 @@ import java.util.stream.Collectors;
|
||||
public class AtsRouteService {
|
||||
|
||||
@Autowired
|
||||
private RouteService routeService;
|
||||
private CiRouteService routeService;
|
||||
|
||||
@Autowired
|
||||
private CiApiService ciApiService;
|
||||
@ -146,7 +146,7 @@ public class AtsRouteService {
|
||||
collect = fltRoutes;
|
||||
}
|
||||
Route route = collect.get(0);
|
||||
Route.CheckFailMessage message = routeService.setting(simulation, route);
|
||||
Route.CheckFailMessage message = routeService.setRoute(simulation, route);
|
||||
BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertNull(message, route.debugStr() + "无法办理");
|
||||
route.setFleetMode(true);
|
||||
}
|
||||
@ -167,7 +167,7 @@ public class AtsRouteService {
|
||||
}
|
||||
lockedRoute.setFleetMode(false);
|
||||
if (simulation.getRepository().getConfig().isCancelRouteWhenCancelFlt()) {
|
||||
routeService.cancelWithoutCheck(simulation, lockedRoute);
|
||||
routeService.unlockRoute(simulation, lockedRoute);
|
||||
}
|
||||
}
|
||||
|
||||
@ -261,9 +261,7 @@ public class AtsRouteService {
|
||||
* 总取消
|
||||
*/
|
||||
public void totalCancel(Simulation simulation, String signalCode) {
|
||||
// if (cycleCode != null) { //如果是取消自动折返
|
||||
// this.cancelAutoTurnBack(simulation, cycleCode);
|
||||
// } else {
|
||||
// todo 总取消操作有很多种操作方式,对应不同的按钮,此处都用信号机编号可能不妥
|
||||
Signal signal = simulation.getRepository().getByCode(signalCode, Signal.class);
|
||||
Route lockedRoute = signal.getLockedRoute();
|
||||
if (lockedRoute == null) {
|
||||
@ -271,46 +269,26 @@ public class AtsRouteService {
|
||||
String.format("信号机[%s(%s)]没有已锁闭进路,无需取消进路", signal.getName(), signal.getCode()));
|
||||
}
|
||||
if (!signal.isApproachLock()) { //当接近区段未被占用
|
||||
if (signal.isGuideOpen()) { //如果引导信号开启中
|
||||
this.ciApiService.closeGuideSignal(simulation, signalCode);
|
||||
} else {
|
||||
this.cancelRoute(simulation, signalCode);
|
||||
// this.ciApiService.cancelFleetRoute(simulation, signalCode);
|
||||
}
|
||||
this.cancelRoute(simulation, signalCode);
|
||||
} else {
|
||||
// boolean trainStop = true;
|
||||
// for (TrainStatus trainStatus : approachTrainList) {
|
||||
// if (trainStatus.getSpeed() != 0) {
|
||||
// trainStop = false;
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// if (!trainStop) { //如果占用接近区段的列车没停稳
|
||||
// throw new SimulationException(SimulationExceptionType.Operation_Handle_FAIL,
|
||||
// String.format("进路[%s(%s)]接近区段列车没停稳", lockedRoute.getName(), lockedRoute.getCode()));
|
||||
// }
|
||||
if (signal.isGuideOpen()) { //如果引导信号开启中
|
||||
this.ciApiService.closeGuideSignal(simulation, signalCode);
|
||||
} else if (signal.isClose()) { //如果信号灯关了
|
||||
routeService.cancelWithoutCheck(simulation, lockedRoute);
|
||||
this.ciApiService.cancelFleetRoute(simulation, lockedRoute.getCode());
|
||||
} else {
|
||||
this.ciApiService.closeSignal(simulation, signalCode);
|
||||
}
|
||||
this.routeService.unlockRoute(simulation, lockedRoute);
|
||||
this.ciApiService.cancelFleetRoute(simulation, lockedRoute.getCode());
|
||||
// if (signal.isGuideAspect()) { //如果引导信号开启中
|
||||
// this.ciApiService.closeGuideSignal(simulation, signalCode);
|
||||
// } else if (signal.isClose()) { //如果信号灯关了
|
||||
// } else {
|
||||
// this.ciApiService.closeSignal(simulation, signalCode);
|
||||
// }
|
||||
}
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void cancelRoute(Simulation simulation, String signalCode) {
|
||||
Route route = this.ciApiService.findLockedRouteByStartSignal(simulation, signalCode);
|
||||
if (Objects.nonNull(route)) {
|
||||
SimulationDataRepository repository = simulation.getRepository();
|
||||
BusinessExceptionAssertEnum.OPERATION_FAIL.assertNotTrue(
|
||||
routeService.isApproachLock(repository, route), "进路接近锁闭,无法取消");
|
||||
route.isApproachLock(), "进路接近锁闭,无法取消");
|
||||
BusinessExceptionAssertEnum.OPERATION_FAIL.assertNotTrue(
|
||||
route.getStart().isGuideOpen(), "引导进路,需要人解进路");
|
||||
route.getStart().isGuideAspect(), "引导进路,需要人解进路");
|
||||
BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertNotTrue(route.isFleetMode(),
|
||||
String.format("进路[%s]已开启自动通过进路,无法取消", route.debugStr()));
|
||||
this.ciApiService.unlockRoute(simulation, route.getCode());
|
||||
|
@ -11,7 +11,6 @@ import club.joylink.rtss.simulation.cbtc.data.map.*;
|
||||
import club.joylink.rtss.simulation.cbtc.data.status.StationStatus;
|
||||
import club.joylink.rtss.simulation.cbtc.data.support.StationTurnBackStrategyOption;
|
||||
import club.joylink.rtss.simulation.cbtc.data.vo.ControlTransferReplyVO;
|
||||
import club.joylink.rtss.simulation.cbtc.data.vr.VirtualRealitySignal;
|
||||
import club.joylink.rtss.simulation.cbtc.exception.SimulationException;
|
||||
import club.joylink.rtss.simulation.cbtc.exception.SimulationExceptionType;
|
||||
import club.joylink.rtss.simulation.cbtc.member.SimulationMember;
|
||||
@ -371,15 +370,16 @@ public class AtsStationService {
|
||||
List<Signal> signalList = simulation.getRepository().getSignalList().stream()
|
||||
.filter(signal -> station.equals(signal.getInterlockStation())).collect(Collectors.toList());
|
||||
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertCollectionNotEmpty(signalList, station.debugStr() + "下无信号机");
|
||||
// todo 信号显示变为aspect一个字段,此处逻辑不再适用
|
||||
if (!signalList.get(0).isForcePhysical()) {
|
||||
signalList.forEach(signal -> {
|
||||
VirtualRealitySignal virtualSignal = signal.getVirtualSignal();
|
||||
if (virtualSignal != null) {
|
||||
virtualSignal.apply(signal.isGreenOpen(), signal.isYellowOpen(), signal.isRedOpen());
|
||||
}
|
||||
signal.changeLightType(false);
|
||||
signal.setForcePhysical(true);
|
||||
});
|
||||
// signalList.forEach(signal -> {
|
||||
// VirtualRealitySignal virtualSignal = signal.getVirtualSignal();
|
||||
// if (virtualSignal != null) {
|
||||
// virtualSignal.apply(signal.isGreenOpen(), signal.isYellowOpen(), signal.isRedOpen());
|
||||
// }
|
||||
// signal.changeLightType(false);
|
||||
// signal.setForcePhysical(true);
|
||||
// });
|
||||
} else {
|
||||
signalList.forEach(signal -> signal.setForcePhysical(false));
|
||||
}
|
||||
|
@ -2,8 +2,7 @@ package club.joylink.rtss.simulation.cbtc.ATS.service;
|
||||
|
||||
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
|
||||
import club.joylink.rtss.simulation.cbtc.ATP.ground.MaService;
|
||||
import club.joylink.rtss.simulation.cbtc.CI.CILogicLoop;
|
||||
import club.joylink.rtss.simulation.cbtc.CI.service.RouteService;
|
||||
import club.joylink.rtss.simulation.cbtc.CI.CiLogic;
|
||||
import club.joylink.rtss.simulation.cbtc.Simulation;
|
||||
import club.joylink.rtss.simulation.cbtc.SimulationLifeCycleService;
|
||||
import club.joylink.rtss.simulation.cbtc.constant.RunLevel;
|
||||
@ -51,14 +50,11 @@ public class AtsTrainLoadService {
|
||||
@Autowired
|
||||
private DeviceStatusModifyTool deviceStatusModifyTool;
|
||||
|
||||
@Autowired
|
||||
private RouteService routeService;
|
||||
|
||||
@Autowired
|
||||
private VRDeviceLogicLoop vrDeviceLogicLoop;
|
||||
|
||||
@Autowired
|
||||
private CILogicLoop ciLogicLoop;
|
||||
private CiLogic ciLogic;
|
||||
@Autowired
|
||||
private AtsTrainMonitorService atsTrainMonitorService;
|
||||
@Autowired
|
||||
@ -409,12 +405,10 @@ public class AtsTrainLoadService {
|
||||
// this.updateTrainSpeed(simulation);
|
||||
// 更新列车占用计轴区段
|
||||
this.vrDeviceLogicLoop.updateTrainOccupySection(simulation);
|
||||
// 计轴占用处理
|
||||
this.ciLogicLoop.getStatusFromVRDevice(simulation);
|
||||
// 联锁相关逻辑
|
||||
this.ciLogic.run(simulation);
|
||||
// ATS监控逻辑
|
||||
this.atsTrainMonitorService.monitor(simulation);
|
||||
// 进路解锁逻辑
|
||||
this.ciLogicLoop.routeLogic(simulation);
|
||||
MapConfig config = simulation.getRepository().getConfig();
|
||||
if (RunLevel.ITC.equals(config.getRunMode())) {
|
||||
for (VirtualRealityTrain train : simulation.getRepository().getAllVrTrain()) {
|
||||
@ -607,9 +601,9 @@ public class AtsTrainLoadService {
|
||||
// 排列好进路
|
||||
this.deviceStatusModifyTool.openRouteDirect(simulation, route);
|
||||
// 进路设置为正常解锁
|
||||
this.routeService.normalUnlockStart(simulation, route);
|
||||
// 根据列车位置直接进路正常解锁
|
||||
this.deviceStatusModifyTool.routeUnlockByEndSection(route, tailPosition.getSection());
|
||||
this.ciLogic.trainUnlockStart(simulation, route);
|
||||
// // 根据列车位置直接进路正常解锁
|
||||
// this.deviceStatusModifyTool.routeUnlockByEndSection(route, tailPosition.getSection());
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -621,7 +615,7 @@ public class AtsTrainLoadService {
|
||||
SimulationDataRepository repository = simulation.getRepository();
|
||||
int loadedNum = 0;
|
||||
for (TrainLoadParam2 trainLoadParam2 : trainLoadList) {
|
||||
if (loadedNum > num) {
|
||||
if (loadedNum == num) {
|
||||
break;
|
||||
}
|
||||
TripPlan tripPlan = trainLoadParam2.getTripPlan();
|
||||
|
@ -3,7 +3,6 @@ package club.joylink.rtss.simulation.cbtc.ATS.service;
|
||||
import club.joylink.rtss.simulation.cbtc.ATS.service.ars.AtsTriggerRouteService;
|
||||
import club.joylink.rtss.simulation.cbtc.ATS.service.stage.AtsRealRunRecordService;
|
||||
import club.joylink.rtss.simulation.cbtc.ATS.service.stage.AtsTrainStageHandler;
|
||||
import club.joylink.rtss.simulation.cbtc.CI.CiApiService;
|
||||
import club.joylink.rtss.simulation.cbtc.Simulation;
|
||||
import club.joylink.rtss.simulation.cbtc.constant.SimulationConstants;
|
||||
import club.joylink.rtss.simulation.cbtc.data.SimulationDataRepository;
|
||||
@ -41,8 +40,6 @@ public class AtsTrainMonitorService {
|
||||
private AtsStandService atsStandService;
|
||||
@Autowired
|
||||
private OnboardAtpApiService onboardAtpApiService;
|
||||
@Autowired
|
||||
private CiApiService ciApiService;
|
||||
|
||||
/**
|
||||
* 列车监控逻辑
|
||||
@ -113,7 +110,6 @@ public class AtsTrainMonitorService {
|
||||
// 停车点停车
|
||||
this.trainParking(simulation, trainInfo, headSection.getStation(), headSection);
|
||||
this.onboardAtpApiService.parkingInPlace(simulation, vrTrain, headSection);
|
||||
this.ciApiService.handleTrainStopMessage(simulation, vrTrain);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -419,11 +419,11 @@ public class AtsTrainService {
|
||||
}
|
||||
// 站台停靠
|
||||
Signal tdSignal = headSection.getSignalOf(trainRight); // 列车方向信号机
|
||||
if (Objects.nonNull(tdSignal) && tdSignal.isNormalOpen()) {
|
||||
if (Objects.nonNull(tdSignal) && tdSignal.isMainAspect()) {
|
||||
base = headSection.getNextRunningSectionOf(trainRight);
|
||||
} else {
|
||||
Signal trdSignal = headSection.getSignalOf(!trainRight);
|
||||
if (Objects.nonNull(trdSignal) && trdSignal.isNormalOpen()) {
|
||||
if (Objects.nonNull(trdSignal) && trdSignal.isMainAspect()) {
|
||||
right = !trainRight;
|
||||
base = headSection.getNextRunningSectionOf(right);
|
||||
}
|
||||
@ -431,7 +431,7 @@ public class AtsTrainService {
|
||||
} else if (stop) {
|
||||
// 列车停车中
|
||||
Signal trdSignal = headSection.getSignalOf(!trainRight);
|
||||
if (Objects.nonNull(trdSignal) && trdSignal.isNormalOpen()) {
|
||||
if (Objects.nonNull(trdSignal) && trdSignal.isMainAspect()) {
|
||||
right = !trainRight;
|
||||
}
|
||||
if (headSection.isNormalStandTrack() || headSection.isTransferTrack()) {
|
||||
@ -449,7 +449,7 @@ public class AtsTrainService {
|
||||
break;
|
||||
}
|
||||
Signal signal = base.getSignalOf(right);
|
||||
if (Objects.nonNull(signal) && !signal.isNormalOpen()) {
|
||||
if (Objects.nonNull(signal) && !signal.isMainAspect()) {
|
||||
nextTarget = base;
|
||||
break;
|
||||
}
|
||||
|
@ -4,17 +4,17 @@ import club.joylink.rtss.simulation.cbtc.ATS.data.AtsAlarm;
|
||||
import club.joylink.rtss.simulation.cbtc.ATS.service.alarm.AtsAlarmService;
|
||||
import club.joylink.rtss.simulation.cbtc.Simulation;
|
||||
import club.joylink.rtss.simulation.cbtc.data.SimulationDataRepository;
|
||||
import club.joylink.rtss.simulation.cbtc.data.map.*;
|
||||
import club.joylink.rtss.simulation.cbtc.data.map.Route;
|
||||
import club.joylink.rtss.simulation.cbtc.data.map.Section;
|
||||
import club.joylink.rtss.simulation.cbtc.data.map.SwitchElement;
|
||||
import club.joylink.rtss.simulation.cbtc.data.plan.StationPlan;
|
||||
import club.joylink.rtss.simulation.cbtc.data.plan.TripPlan;
|
||||
import club.joylink.rtss.simulation.cbtc.data.support.RoutePath;
|
||||
import club.joylink.rtss.simulation.cbtc.data.support.SectionPosition;
|
||||
import club.joylink.rtss.simulation.cbtc.data.vo.TrainInfo;
|
||||
import lombok.Getter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
@ -337,7 +337,7 @@ public class AtsPlanTrainRouteSelectServiceImpl extends AtsRouteSelectService {
|
||||
Map<String, Route> atsTriggerRouteMap = aheadTrain.getAtsTriggerRouteMap();
|
||||
if (!atsTriggerRouteMap.isEmpty()) {
|
||||
for (Route triggerRoute : atsTriggerRouteMap.values()) {
|
||||
if (triggerRoute.isConflictWith(route) && (triggerRoute.isSetting() || triggerRoute.isOpen())) {
|
||||
if (triggerRoute.isConflictWith(route) && (triggerRoute.isSetting() || triggerRoute.isOpenMain())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
package club.joylink.rtss.simulation.cbtc.ATS.service.ars;
|
||||
|
||||
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
|
||||
import club.joylink.rtss.simulation.cbtc.CI.service.RouteService;
|
||||
import club.joylink.rtss.simulation.cbtc.CI.device.CiRouteService;
|
||||
import club.joylink.rtss.simulation.cbtc.Simulation;
|
||||
import club.joylink.rtss.simulation.cbtc.data.SimulationDataRepository;
|
||||
import club.joylink.rtss.simulation.cbtc.data.map.*;
|
||||
@ -144,7 +144,7 @@ public abstract class AtsRouteSelectService {
|
||||
}
|
||||
}
|
||||
if (route != null) {
|
||||
Route.CheckFailMessage check = RouteService.check(simulation, route);
|
||||
Route.CheckFailMessage check = CiRouteService.routeSetCheck(simulation, route);
|
||||
if (check != null)
|
||||
route = null;
|
||||
}
|
||||
@ -188,7 +188,7 @@ public abstract class AtsRouteSelectService {
|
||||
}
|
||||
if (signal.hasCiAutoTriggerRoute() || signal.hasFleetModeRoute() || signal.hasNotAtsControlRoute()) { // 以此信号机为始端存在联锁自动进路或联锁自动触发进路或非ATS自动控制进路
|
||||
// 如果信号机正常开放,且进路是路径方向上的进路,继续找,否则返回
|
||||
if (signal.isNormalOpen()) {
|
||||
if (signal.isMainAspect()) {
|
||||
Route lockedRoute = signal.getLockedRoute();
|
||||
if (routePath.isPathRoute(lockedRoute)) {
|
||||
continue;
|
||||
@ -201,7 +201,7 @@ public abstract class AtsRouteSelectService {
|
||||
}
|
||||
if (this.isApproachSignal(repository, trainInfo, signal)) {
|
||||
// 是信号机接近区段
|
||||
if (signal.isNormalOpen()) {
|
||||
if (signal.isMainAspect()) {
|
||||
if (routePath.isPathRoute(signal.getLockedRoute())) {
|
||||
continue;
|
||||
} else {
|
||||
|
@ -72,7 +72,7 @@ public class AtsTriggerRouteService {
|
||||
return true;
|
||||
}
|
||||
if (route.getConflictAlarm() != null) {
|
||||
if (route.isOpen()) {
|
||||
if (route.isOpenMain()) {
|
||||
route.getConflictAlarm().recover(simulation.getCorrectSystemTime());
|
||||
route.setConflictAlarm(null);
|
||||
continue;
|
||||
@ -90,7 +90,7 @@ public class AtsTriggerRouteService {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!route.isOpen()) { // 存在未开放的进路,直接返回
|
||||
if (!route.isOpenMain()) { // 存在未开放的进路,直接返回
|
||||
if (!route.isSetting()) { // 进路未办理,继续尝试办理
|
||||
this.trySetRoute(simulation, trainInfo, route);
|
||||
}
|
||||
|
@ -125,7 +125,7 @@ public class AtsPlanTrainStageService implements AtsStageService {
|
||||
log.debug(String.format("列车[%s]折返初始化", trainInfo.getGroupNumber()));
|
||||
List<RoutePath> routePaths = repository.getRoutePaths(parkSection, tripPlan.getEndSection());
|
||||
Signal signal = parkSection.getSignalOf(routePaths.get(0).isRight());
|
||||
if (signal.isNormalOpen() || signal.isGuideOpen()) {
|
||||
if (signal.isMainAspect() || signal.isGuideAspect()) {
|
||||
Route lockedRoute = signal.getLockedRoute();
|
||||
if (lockedRoute != null && lockedRoute.getLastRouteSection().isTurnBackTrack()) {
|
||||
trainInfo.turnBackInit(lockedRoute.getLastRouteSection());
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user