Merge remote-tracking branch 'origin/test' into test
This commit is contained in:
commit
029764eb07
@ -11,6 +11,7 @@ public enum MapPrdTypeEnum {
|
||||
SCHEDULING("05", "派班工作站"),
|
||||
ISCS("06", "ISCS工作站"),
|
||||
BIG_SCREEN("07", "大屏工作站"),
|
||||
RUN_PLAN_MAKE("08", "运行图编制工作站")
|
||||
;
|
||||
|
||||
private String code;
|
||||
|
@ -11,10 +11,7 @@ import club.joylink.rtss.vo.UserVO;
|
||||
import club.joylink.rtss.vo.client.*;
|
||||
import club.joylink.rtss.vo.client.local.LocalDataVO;
|
||||
import club.joylink.rtss.vo.client.map.*;
|
||||
import club.joylink.rtss.vo.client.map.newmap.MapGraphDataNewVO;
|
||||
import club.joylink.rtss.vo.client.map.newmap.MapPSDVO;
|
||||
import club.joylink.rtss.vo.client.map.newmap.MapStationNewVO;
|
||||
import club.joylink.rtss.vo.client.map.newmap.MapStationStandNewVO;
|
||||
import club.joylink.rtss.vo.client.map.newmap.*;
|
||||
import club.joylink.rtss.vo.client.validGroup.MapInfoSortCheck;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@ -251,6 +248,12 @@ public class MapController {
|
||||
return this.iMapService.getStationHasPsdStands(id, stationCode);
|
||||
}
|
||||
|
||||
@ApiOperation("获取地图车站下的区段")
|
||||
@GetMapping("/{id}/station/{stationCode}/sections")
|
||||
public List<MapSectionNewVO> querySectionsUnderTheStation(@PathVariable Long id, @PathVariable String stationCode){
|
||||
return this.iMapService.querySectionsUnderTheStation(id, stationCode);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取地图站台关联的屏蔽门")
|
||||
@GetMapping("/{id}/stand/{standCode}/psd")
|
||||
public List<MapPSDVO> getStandPsds(@PathVariable Long id,
|
||||
@ -287,4 +290,10 @@ public class MapController {
|
||||
public List<MapStationNewVO> getAllStations() {
|
||||
return iMapService.getAllStations();
|
||||
}
|
||||
|
||||
@ApiOperation("查询地图下所有区段")
|
||||
@GetMapping("/{id}/sections")
|
||||
public List<MapSectionNewVO> querySectionsUnderMap(@PathVariable Long id) {
|
||||
return iMapService.querySectionsUnderMap(id);
|
||||
}
|
||||
}
|
||||
|
@ -276,8 +276,8 @@ public class SimulationV1Controller {
|
||||
|
||||
@ApiOperation("按下IBP盘按钮")
|
||||
@PutMapping("/{group}/ibp/{button}")
|
||||
public void pressIbpButton(@PathVariable String group, String stationCode, @PathVariable VirtualRealityIbp.Button button) {
|
||||
iVirtualRealityIBPService.pressTheButton(group, stationCode, button);
|
||||
public void pressIbpButton(@PathVariable String group, String stationCode, @PathVariable VirtualRealityIbp.ButtonType button, String buttonCode) {
|
||||
iVirtualRealityIBPService.pressTheButton(group, stationCode, button, buttonCode);
|
||||
}
|
||||
|
||||
@ApiOperation("查询报警列表")
|
||||
|
@ -8,6 +8,7 @@ import club.joylink.rtss.vo.client.PageQueryVO;
|
||||
import club.joylink.rtss.vo.client.PageVO;
|
||||
import club.joylink.rtss.vo.client.map.*;
|
||||
import club.joylink.rtss.vo.client.map.newmap.MapPSDVO;
|
||||
import club.joylink.rtss.vo.client.map.newmap.MapSectionNewVO;
|
||||
import club.joylink.rtss.vo.client.map.newmap.MapStationNewVO;
|
||||
import club.joylink.rtss.vo.client.map.newmap.MapStationStandNewVO;
|
||||
|
||||
@ -281,4 +282,14 @@ public interface IMapService {
|
||||
* 获取所有车站
|
||||
*/
|
||||
List<MapStationNewVO> getAllStations();
|
||||
|
||||
/**
|
||||
* 查询地图/车站下的区段
|
||||
*/
|
||||
List<MapSectionNewVO> querySectionsUnderTheStation(Long id, String stationCode);
|
||||
|
||||
/**
|
||||
* 查询地图下的所有区段
|
||||
*/
|
||||
List<MapSectionNewVO> querySectionsUnderMap(Long id);
|
||||
}
|
||||
|
@ -15,8 +15,9 @@ public interface IVirtualRealityIbpService {
|
||||
|
||||
/**
|
||||
* 按下按钮
|
||||
* @param buttonCode 区分统一类型按钮,目前只是宁波一的区段按钮
|
||||
*/
|
||||
void pressTheButton(String group, String stationCode, VirtualRealityIbp.Button button);
|
||||
void pressTheButton(String group, String stationCode, VirtualRealityIbp.ButtonType button, String buttonCode);
|
||||
|
||||
/**
|
||||
* 收集并发送IBP的状态数据
|
||||
|
@ -23,6 +23,7 @@ import club.joylink.rtss.vo.client.PageQueryVO;
|
||||
import club.joylink.rtss.vo.client.PageVO;
|
||||
import club.joylink.rtss.vo.client.map.*;
|
||||
import club.joylink.rtss.vo.client.map.newmap.MapPSDVO;
|
||||
import club.joylink.rtss.vo.client.map.newmap.MapSectionNewVO;
|
||||
import club.joylink.rtss.vo.client.map.newmap.MapStationNewVO;
|
||||
import club.joylink.rtss.vo.client.map.newmap.MapStationStandNewVO;
|
||||
import club.joylink.rtss.vo.client.runplan.RunPlanLoadVO;
|
||||
@ -839,6 +840,19 @@ public class MapService implements IMapService {
|
||||
.map(MapVO::findSortedAllStationListNew).flatMap(Collection::stream).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MapSectionNewVO> querySectionsUnderTheStation(Long id, String stationCode) {
|
||||
MapVO mapDetail = getMapDetail(id);
|
||||
return mapDetail.getGraphDataNew().getSectionList().stream()
|
||||
.filter(section -> Objects.equals(section.getBelongStation(), stationCode)).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MapSectionNewVO> querySectionsUnderMap(Long id) {
|
||||
MapVO mapDetail = getMapDetail(id);
|
||||
return mapDetail.getGraphDataNew().getSectionList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 该版本的地图数据是否存在
|
||||
*/
|
||||
|
@ -1,8 +1,10 @@
|
||||
package club.joylink.rtss.services;
|
||||
|
||||
import club.joylink.rtss.configuration.configProp.OtherConfig;
|
||||
import club.joylink.rtss.constants.BusinessConsts;
|
||||
import club.joylink.rtss.constants.SaleOrderPayStatusEnum;
|
||||
import club.joylink.rtss.constants.SaleOrderTypeEnum;
|
||||
import club.joylink.rtss.constants.SystemEnv;
|
||||
import club.joylink.rtss.dao.SaleOrderDAO;
|
||||
import club.joylink.rtss.dao.SaleOrderDetailDAO;
|
||||
import club.joylink.rtss.entity.SaleOrder;
|
||||
@ -57,6 +59,9 @@ public class OrderService implements IOrderService {
|
||||
@Autowired
|
||||
private WechatPayService wechatPayService;
|
||||
|
||||
@Autowired
|
||||
private OtherConfig otherConfig;
|
||||
|
||||
@Override
|
||||
public PageVO<OrderVO> queryPagedOrders(OrderQueryVO queryVO) {
|
||||
return queryPagedOrders(queryVO, null);
|
||||
@ -155,6 +160,9 @@ public class OrderService implements IOrderService {
|
||||
@Override
|
||||
public WxPayUnifiedOrderResultVO pay(long id, String payType, String description) {
|
||||
SaleOrder order = getEntity(id);
|
||||
if (!SystemEnv.isPrdEnv(otherConfig.getEnv())) {
|
||||
order.setCode(order.getCode() + "-" + otherConfig.getEnv());
|
||||
}
|
||||
if (!StringUtils.hasText(description)) {
|
||||
description = "城轨平台权限";
|
||||
}
|
||||
@ -281,7 +289,8 @@ public class OrderService implements IOrderService {
|
||||
SaleOrderTypeEnum type = SaleOrderTypeEnum.getSaleOrderTypeByCode(createVO.getOrderType());
|
||||
switch (type) {
|
||||
case Individual:
|
||||
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertNotNull(createVO.getPrice(), "个人订单价格不能为空");
|
||||
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertTrue(createVO.getPrice() != null || createVO.getPriceInCents() != null,
|
||||
"个人订单价格不能为空");
|
||||
case Business_Contract:
|
||||
// BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertNotNull(createVO.getOrganizationId(), "订单组织/单位不能为空");
|
||||
// BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertNotNull(createVO.getContractNo(), "订单合同号不能为空");
|
||||
@ -298,7 +307,7 @@ public class OrderService implements IOrderService {
|
||||
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertNotNull(createVO.getStartTime(), "非永久订单开始时间不能为空");
|
||||
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertNotNull(createVO.getMonthAmount(), "非永久订单购买时长不能为空");
|
||||
}
|
||||
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertNotNull(createVO.getPrice(), "订单总价不能为空");
|
||||
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertTrue(createVO.getPrice() != null || createVO.getPriceInCents() != null, "订单总价不能为空");
|
||||
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertNotNull(createVO.getPayWays(), "订单支付方式不能为空");
|
||||
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertNotNull(createVO.getPayStatus(), "订单支付状态不能为空");
|
||||
break;
|
||||
|
@ -80,6 +80,8 @@ public class OrgUserService implements IOrgUserService {
|
||||
public CompanyVO create(CompanyVO companyVO) {
|
||||
Org entity = companyVO.toDB();
|
||||
this.orgDAO.insert(entity);
|
||||
entity.setRootId(entity.getId());
|
||||
orgDAO.updateByPrimaryKey(entity);
|
||||
return new CompanyVO(entity);
|
||||
}
|
||||
|
||||
|
@ -55,7 +55,7 @@ public class VirtualRealityIbpService implements IVirtualRealityIbpService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void pressTheButton(String group, String stationCode, VirtualRealityIbp.Button button) {
|
||||
public void pressTheButton(String group, String stationCode, VirtualRealityIbp.ButtonType button, String buttonCode) {
|
||||
Objects.requireNonNull(group);
|
||||
Objects.requireNonNull(button);
|
||||
|
||||
@ -109,6 +109,9 @@ public class VirtualRealityIbpService implements IVirtualRealityIbpService {
|
||||
case SXYS:
|
||||
ibp.setSxys(!ibp.isSxys());
|
||||
break;
|
||||
case PRERESET:
|
||||
ciApiService.axleReset(simulation, buttonCode);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -437,7 +437,7 @@ public class CompetitionPracticalService implements ICompetitionPracticalService
|
||||
SaleGoods goods = iGoodsService.getByPermissionId(permission.getId());
|
||||
//创建订单
|
||||
OrderCreateVO orderCreate = new OrderCreateVO();
|
||||
orderCreate.setPrice(200f * monthAmount);
|
||||
orderCreate.setPriceInCents(20000 * monthAmount);
|
||||
orderCreate.setPayWays(SaleOrderPayWaysEnum.Wechat.getCode());
|
||||
orderCreate.setPayStatus(SaleOrderPayStatusEnum.Unpaid.getCode());
|
||||
orderCreate.setOrderType(SaleOrderTypeEnum.Individual.getCode());
|
||||
|
@ -178,7 +178,81 @@ public class WechatPayService {
|
||||
// System.out.println(decryptToString(associated_data.getBytes(), nonce.getBytes(), ciphertext));
|
||||
|
||||
WechatPayService service = new WechatPayService();
|
||||
service.queryOrder("2021012900013");
|
||||
new Thread(() -> {
|
||||
try {
|
||||
service.queryOrder("2021012900013");
|
||||
System.out.println("Thread_" + 1);
|
||||
for (; ; ) {
|
||||
try {
|
||||
Thread.sleep(1000);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}).start();
|
||||
new Thread(() -> {
|
||||
try {
|
||||
service.queryOrder("2021012900013");
|
||||
System.out.println("Thread_" + 2);
|
||||
for (; ; ) {
|
||||
try {
|
||||
Thread.sleep(1000);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}).start();
|
||||
new Thread(() -> {
|
||||
try {
|
||||
service.queryOrder("2021012900013");
|
||||
System.out.println("Thread_" + 3);
|
||||
for (; ; ) {
|
||||
try {
|
||||
Thread.sleep(1000);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}).start();
|
||||
new Thread(() -> {
|
||||
try {
|
||||
service.queryOrder("2021012900013");
|
||||
System.out.println("Thread_" + 4);
|
||||
for (; ; ) {
|
||||
try {
|
||||
Thread.sleep(1000);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}).start();
|
||||
new Thread(() -> {
|
||||
try {
|
||||
service.queryOrder("2021012900013");
|
||||
System.out.println("Thread_" + 5);
|
||||
for (; ; ) {
|
||||
try {
|
||||
Thread.sleep(1000);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -59,6 +59,9 @@ public interface GeneratorNew {
|
||||
case STAND:
|
||||
((Stand) mapDevice).getDeviceStation().setControlMode(Station.ControlMode.Local);
|
||||
break;
|
||||
case CYCLE:
|
||||
((Cycle) mapDevice).getStation().setControlMode(Station.ControlMode.Local);
|
||||
break;
|
||||
}
|
||||
}
|
||||
// 实训基本信息
|
||||
|
@ -329,13 +329,16 @@ public class SignalGeneratorNew implements GeneratorNew {
|
||||
}
|
||||
case Signal_Set_Guide: {
|
||||
// 若信号机可开引导信号,则生成实训,暂不设置背景(暂时先简单处理,此处业务比较复杂,需明确后再生成各种情况的实训)
|
||||
if (signal.isCallOn()) { // 不是引导信号机,不生成
|
||||
// if (signal.isCallOn()) { // 不是引导信号机,不生成
|
||||
//非折返进路办理引导
|
||||
List<Route> notTurnBackRouteList = routeList.stream()
|
||||
.filter(route -> !route.isTurnBack())
|
||||
.collect(Collectors.toList());
|
||||
if (routeLikeHa1) {
|
||||
// 对于ATP进路、地面联锁进路、引导进路类的,取引导进路
|
||||
if (routeLikeHa1 ) {
|
||||
if (!signal.isCallOn()) {
|
||||
continue;
|
||||
}
|
||||
// 对于ATP进路、地面联锁进路、引导进路类的,取引导进路
|
||||
notTurnBackRouteList = notTurnBackRouteList.stream()
|
||||
.filter(route -> route.isGuide())
|
||||
.collect(Collectors.toList());
|
||||
@ -346,11 +349,16 @@ public class SignalGeneratorNew implements GeneratorNew {
|
||||
deviceStatusModifyTool.closeSignalDirectly(route.getStart());
|
||||
}
|
||||
deviceStatusModifyTool.loadManualTrainOfGroup(simulation, "001",signal.getSection(),signal.isRight());
|
||||
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();
|
||||
}
|
||||
}
|
||||
// }
|
||||
continue;
|
||||
}
|
||||
case Signal_Close_Guide: {
|
||||
@ -376,7 +384,7 @@ public class SignalGeneratorNew implements GeneratorNew {
|
||||
}
|
||||
case Signal_Cancel_Guide: {
|
||||
// 若信号可开放引导信号,生成实训,背景设置为开放引导进路/开放引导信号
|
||||
if (signal.isCallOn()) {
|
||||
// if (signal.isCallOn()) {
|
||||
if (!CollectionUtils.isEmpty(routeList)) {
|
||||
for (Route route : routeList) {
|
||||
if (routeLikeHa1 &&
|
||||
@ -386,12 +394,17 @@ public class SignalGeneratorNew implements GeneratorNew {
|
||||
}
|
||||
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())) { // 信号机是自动信号
|
||||
// this.deviceStatusModifyTool.openGuideSignalDirectly(signal);
|
||||
// trainingVOList.add(this.build(config, simulation, signal, operateDefinitionVO));
|
||||
|
@ -50,8 +50,8 @@ public class ATSLogicLoop {
|
||||
|
||||
// 站台倒计时
|
||||
this.atsStandService.countDown(simulation);
|
||||
// 取消过期的控制权转换申请
|
||||
atsStationService.cancelInvalidControlTransferApplication(simulation);
|
||||
// 车站随时间变化的属性更新
|
||||
this.atsStationService.updateField(simulation);
|
||||
// long end = System.currentTimeMillis();
|
||||
// System.out.println(String.format("------------ATS自动排列进路逻辑耗时: %s ms", (end-start)));
|
||||
}
|
||||
|
@ -41,4 +41,6 @@ public interface AtsApiService {
|
||||
* @param sectionCode
|
||||
*/
|
||||
void handleTrainOnTransfer(Simulation simulation, String groupNumber, String sectionCode);
|
||||
|
||||
void cancelStandSkipSetOfTrain(Simulation simulation, String groupNumber, String standCode);
|
||||
}
|
||||
|
@ -1,10 +1,12 @@
|
||||
package club.joylink.rtss.simulation.cbtc.ATS;
|
||||
|
||||
import club.joylink.rtss.simulation.cbtc.ATS.service.AtsPlanService;
|
||||
import club.joylink.rtss.simulation.cbtc.ATS.service.AtsStandService;
|
||||
import club.joylink.rtss.simulation.cbtc.Simulation;
|
||||
import club.joylink.rtss.simulation.cbtc.data.SimulationDataRepository;
|
||||
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.map.Stand;
|
||||
import club.joylink.rtss.simulation.cbtc.data.map.Station;
|
||||
import club.joylink.rtss.simulation.cbtc.data.support.TrainStopMessage;
|
||||
import club.joylink.rtss.simulation.cbtc.data.vo.TrainInfo;
|
||||
@ -25,6 +27,9 @@ public class AtsApiServiceImpl implements AtsApiService {
|
||||
@Autowired
|
||||
private AtsPlanService atsPlanService;
|
||||
|
||||
@Autowired
|
||||
private AtsStandService atsStandService;
|
||||
|
||||
@Autowired
|
||||
private ATSMessageCollectAndDispatcher atsMessageCollectAndDispatcher;
|
||||
|
||||
@ -72,4 +77,14 @@ public class AtsApiServiceImpl implements AtsApiService {
|
||||
this.atsPlanService.handleTrainOnTransfer(simulation, train, section);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cancelStandSkipSetOfTrain(Simulation simulation, String groupNumber, String standCode) {
|
||||
SimulationDataRepository repository = simulation.getRepository();
|
||||
TrainInfo train = repository.findSupervisedTrainByGroup(groupNumber);
|
||||
if (Objects.isNull(train)) {
|
||||
return;
|
||||
}
|
||||
atsStandService.cancelJumpStop(simulation, standCode,groupNumber);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -39,6 +39,8 @@ public class Operation {
|
||||
// Switch_Single_Lock_Chain(),
|
||||
// /** 单解(联动) */
|
||||
// Switch_Single_Unlock_Chain(),
|
||||
/** 初始化封锁 */
|
||||
Switch_Initialize_Block,
|
||||
/** 封锁 */
|
||||
Switch_Block(),
|
||||
/** 解封 */
|
||||
@ -79,6 +81,8 @@ public class Operation {
|
||||
Switch_Force_Unlock,
|
||||
/** 挤岔恢复 */
|
||||
Switch_Squeeze_Recovery,
|
||||
/** 命令 */
|
||||
Switch_Command,
|
||||
|
||||
//--------------------------- 区段 ---------------------------
|
||||
/** 封锁 */
|
||||
@ -99,6 +103,8 @@ public class Operation {
|
||||
Cancel_All_Limit_Speed(),
|
||||
/** 计轴预复位 */
|
||||
Section_Axis_Pre_Reset(),
|
||||
/** 计轴复位 */
|
||||
Section_Reset,
|
||||
/** 故障解锁 */
|
||||
Section_Fault_Unlock(),
|
||||
/** 确认计轴有效 */
|
||||
@ -147,6 +153,10 @@ public class Operation {
|
||||
Signal_Cancel_Auto_Turn_Back,
|
||||
/** 信号机总取消 */
|
||||
Signal_Total_Cancel,
|
||||
/** 初始化引导 */
|
||||
Signal_Initialize_Guide,
|
||||
/** 取消引导的初始化 */
|
||||
Signal_Cancel_Guide_Initialization,
|
||||
/** 办理引导 */
|
||||
Signal_Set_Guide,
|
||||
/** 取消引导 */
|
||||
@ -157,6 +167,10 @@ public class Operation {
|
||||
Stand_Set_Jump_Stop(),
|
||||
/** 取消跳停 */
|
||||
Stand_Cancel_Jump_Stop(),
|
||||
/** 全站台设置跳停 */
|
||||
Stand_All_Set_Jump_Stop(),
|
||||
/** 全站台取消跳停 */
|
||||
Stand_All_Cancel_Jump_Stop(),
|
||||
/** 设置扣车 */
|
||||
Stand_Set_Hold_Train(),
|
||||
/** 取消扣车 */
|
||||
@ -189,6 +203,10 @@ public class Operation {
|
||||
Stand_Open_Psd,
|
||||
/** 取消设置(扣车或跳停) */
|
||||
Stand_Cancel_Setting,
|
||||
/** 系统扣车 */
|
||||
Stand_Sys_Hold_Train(),
|
||||
/** 取消系统扣车 */
|
||||
Stand_Cancel_Sys_Hold_Train(),
|
||||
|
||||
//--------------------------- 控制模式 ---------------------------
|
||||
/** 请求站控 */
|
||||
@ -209,7 +227,7 @@ public class Operation {
|
||||
CM_Surrender_Control(),
|
||||
/** 连锁控 */
|
||||
CM_Interlock_Control(),
|
||||
/** 回复中控请求(同意/拒绝) */
|
||||
/** 回复连锁控请求(同意/拒绝) */
|
||||
CM_Reply_Interlock_Control(),
|
||||
|
||||
//--------------------------- 集中车站 ---------------------------
|
||||
@ -239,6 +257,25 @@ public class Operation {
|
||||
Station_CIArea_Close_AllSignal,
|
||||
/** 重启令解(哈尔滨) */
|
||||
Station_Restart,
|
||||
/** 全站设置自动通过 */
|
||||
Station_Set_CI_Auto,
|
||||
/** 全站取消自动通过 */
|
||||
Station_Cancel_CI_Auto,
|
||||
/** 设置/取消强制点灯 */
|
||||
Station_Set_Or_Cancel_Force_Physical_Signal,
|
||||
/** 预复位(宁波一) */
|
||||
Station_Pre_Reset,
|
||||
/** 取消预复位 */
|
||||
Station_Cancel_Pre_Reset,
|
||||
//车站控制授权
|
||||
/** 区域选择(请求区域控制权【泰雷兹】) */
|
||||
Station_Control_Apply,
|
||||
/** 授权转移 */
|
||||
Station_Control_Transfer,
|
||||
/** 下放站控 */
|
||||
Station_Control_Devolve,
|
||||
/** 收回站控 */
|
||||
Station_Control_Revoke,
|
||||
|
||||
//--------------------------- 列车 ---------------------------
|
||||
/** 在指定区段加载一辆计划列车(本地开发使用) */
|
||||
@ -309,6 +346,8 @@ public class Operation {
|
||||
Train_Link,
|
||||
/** 排列进路到 */
|
||||
Train_Set_Route,
|
||||
/** 设置运行类型 */
|
||||
Train_Set_Run_Type,
|
||||
|
||||
//--------------------------- 司机 ---------------------------
|
||||
/** 改变列车的牵引/制动力 */
|
||||
|
@ -103,6 +103,12 @@ public class SectionOperateHandler {
|
||||
ciApiService.axlePreReset(simulation, sectionCode);
|
||||
}
|
||||
|
||||
/**区段计轴复位*/
|
||||
@OperateHandlerMapping(type =Operation.Type.Section_Reset)
|
||||
public void axleReset(Simulation simulation, String sectionCode) {
|
||||
ciApiService.axleReset(simulation, sectionCode);
|
||||
}
|
||||
|
||||
/**确认计轴有效*/
|
||||
@OperateHandlerMapping(type = Operation.Type.Section_Confirm_Axis_Valid)
|
||||
public void confirmAxisValid(Simulation simulation, String sectionCode) {
|
||||
|
@ -275,6 +275,22 @@ public class SignalOperateHandler {
|
||||
atsRouteService.totalCancel(simulation, signalCode);
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化引导
|
||||
*/
|
||||
@OperateHandlerMapping(type = Operation.Type.Signal_Initialize_Guide)
|
||||
public void initializeGuide(Simulation simulation, String signalCode) {
|
||||
ciApiService.initializeGuide(simulation, signalCode);
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化引导
|
||||
*/
|
||||
@OperateHandlerMapping(type = Operation.Type.Signal_Cancel_Guide_Initialization)
|
||||
public void cancelGuideInitialization(Simulation simulation, String signalCode) {
|
||||
ciApiService.cancelGuideInitialization(simulation, signalCode);
|
||||
}
|
||||
|
||||
/**
|
||||
* 办理引导
|
||||
*/
|
||||
|
@ -39,6 +39,23 @@ public class StandOperateHandler {
|
||||
atsStandService.cancelJumpStop(simulation, standCode, trainGroupNumber);
|
||||
}
|
||||
|
||||
/**
|
||||
* 多站台设置跳停
|
||||
*/
|
||||
@OperateHandlerMapping(type = Operation.Type.Stand_All_Set_Jump_Stop)
|
||||
public void setJumpStop(Simulation simulation, List<String> standCodes, String trainGroupNumber) {
|
||||
standCodes.forEach(s -> atsStandService.setJumpStop(simulation, s, trainGroupNumber));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 多站台取消跳停
|
||||
*/
|
||||
@OperateHandlerMapping(type = Operation.Type.Stand_All_Cancel_Jump_Stop)
|
||||
public void cancelJumpStop(Simulation simulation, List<String> standCodes, String trainGroupNumber) {
|
||||
standCodes.forEach(s -> atsStandService.cancelJumpStop(simulation, s, trainGroupNumber));
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置扣车
|
||||
*/
|
||||
@ -73,6 +90,22 @@ public class StandOperateHandler {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置系统扣车
|
||||
*/
|
||||
@OperateHandlerMapping(type = Operation.Type.Stand_Sys_Hold_Train)
|
||||
public void setSysHoldTrain(Simulation simulation) {
|
||||
this.atsStandService.sysHoldTrain(simulation);
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消系统扣车
|
||||
*/
|
||||
@OperateHandlerMapping(type = Operation.Type.Stand_Cancel_Sys_Hold_Train)
|
||||
public void cancelSysHoldTrain(Simulation simulation) {
|
||||
this.atsStandService.cancelSysHoldTrain(simulation);
|
||||
}
|
||||
|
||||
/**
|
||||
* 提前发车
|
||||
*/
|
||||
|
@ -1,5 +1,6 @@
|
||||
package club.joylink.rtss.simulation.cbtc.ATS.operation.handler;
|
||||
|
||||
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
|
||||
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;
|
||||
@ -161,6 +162,7 @@ public class StationOperateHandler {
|
||||
atsStationService.emergencyStationControl(simulation, fromMember, stationCodes);
|
||||
}
|
||||
|
||||
|
||||
/**回复站控请求c*/
|
||||
@OperateHandlerMapping(type = Operation.Type.CM_Reply_Station_Control)
|
||||
public void replyForStationControl(Simulation simulation, List<ControlTransferReplyVO> replyVOList){
|
||||
@ -187,14 +189,14 @@ public class StationOperateHandler {
|
||||
repository.getSignalList().stream().filter(s -> Objects.equals(stationCode,s.getInterlockStation().getCode())).forEach(signal -> ciApiService.blockadeSignal(simulation, signal.getCode()));
|
||||
}
|
||||
|
||||
/**交出控制权*/
|
||||
/**交出控制权/下放站控*/
|
||||
@OperateHandlerMapping(type = Operation.Type.CM_Surrender_Control)
|
||||
public void surrenderControl(Simulation simulation, SimulationMember member, String stationCode){
|
||||
SimulationDataRepository repository = simulation.getRepository();
|
||||
this.atsStationService.surrenderControl(simulation, member, repository.getByCode(stationCode, Station.class));
|
||||
}
|
||||
|
||||
/**交出控制权*/
|
||||
/**接收控制权*/
|
||||
@OperateHandlerMapping(type = Operation.Type.CM_Receive_Control)
|
||||
public void receiveControl(Simulation simulation, SimulationMember member, String stationCode){
|
||||
SimulationDataRepository repository = simulation.getRepository();
|
||||
@ -206,4 +208,57 @@ public class StationOperateHandler {
|
||||
SimulationDataRepository repository = simulation.getRepository();
|
||||
this.ciApiService.restart(simulation, repository.getByCode(stationCode, Station.class));
|
||||
}
|
||||
|
||||
@OperateHandlerMapping(type = Operation.Type.Station_Set_CI_Auto)
|
||||
public void setCIAuto(Simulation simulation, String stationCode) {
|
||||
SimulationDataRepository repository = simulation.getRepository();
|
||||
this.atsStationService.setCIAuto(simulation, repository.getByCode(stationCode, Station.class));
|
||||
}
|
||||
|
||||
@OperateHandlerMapping(type = Operation.Type.Station_Cancel_CI_Auto)
|
||||
public void cancelCIAuto(Simulation simulation, String stationCode) {
|
||||
SimulationDataRepository repository = simulation.getRepository();
|
||||
this.atsStationService.cancelCIAuto(simulation, repository.getByCode(stationCode, Station.class));
|
||||
}
|
||||
|
||||
@OperateHandlerMapping(type = Operation.Type.Station_Set_Or_Cancel_Force_Physical_Signal)
|
||||
public void setOrCancelForcePhysicalSignal(Simulation simulation, String stationCode) {
|
||||
SimulationDataRepository repository = simulation.getRepository();
|
||||
this.atsStationService.setOrCancelForcePhysicalSignal(simulation, repository.getByCode(stationCode, Station.class));
|
||||
}
|
||||
|
||||
@OperateHandlerMapping(type = Operation.Type.Station_Control_Apply)
|
||||
public void applyControl(Simulation simulation, List<String> stationCodes, SimulationMember simulationMember) {
|
||||
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertCollectionNotEmpty(stationCodes, "未选择车站");
|
||||
this.atsStationService.applyControl(simulation, stationCodes, simulationMember);
|
||||
}
|
||||
|
||||
@OperateHandlerMapping(type = Operation.Type.Station_Control_Transfer)
|
||||
public void transferControl(Simulation simulation, List<String> stationCodes, boolean agree, SimulationMember simulationMember) {
|
||||
this.atsStationService.transferControl(simulation, stationCodes, agree, simulationMember);
|
||||
}
|
||||
|
||||
@OperateHandlerMapping(type = Operation.Type.Station_Control_Devolve)
|
||||
public void devolveControl(Simulation simulation, List<String> stationCodes, SimulationMember simulationMember) {
|
||||
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertCollectionNotEmpty(stationCodes, "未选择车站");
|
||||
this.atsStationService.devolveControl(simulation, stationCodes, simulationMember);
|
||||
}
|
||||
|
||||
@OperateHandlerMapping(type = Operation.Type.Station_Control_Revoke)
|
||||
public void revokeControl(Simulation simulation, List<String> stationCodes, SimulationMember simulationMember) {
|
||||
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertCollectionNotEmpty(stationCodes, "未选择车站");
|
||||
this.atsStationService.revokeControl(simulation, stationCodes, simulationMember);
|
||||
}
|
||||
|
||||
@OperateHandlerMapping(type = Operation.Type.Station_Pre_Reset)
|
||||
public void preReset(Simulation simulation, String stationCode) {
|
||||
SimulationDataRepository repository = simulation.getRepository();
|
||||
this.atsStationService.preReset(simulation, repository.getByCode(stationCode, Station.class));
|
||||
}
|
||||
|
||||
@OperateHandlerMapping(type = Operation.Type.Station_Cancel_Pre_Reset)
|
||||
public void cancelPreReset(Simulation simulation, String stationCode) {
|
||||
SimulationDataRepository repository = simulation.getRepository();
|
||||
this.atsStationService.cancelPreReset(simulation, repository.getByCode(stationCode, Station.class));
|
||||
}
|
||||
}
|
||||
|
@ -164,6 +164,12 @@ public class SwitchOperateHandler {
|
||||
// }
|
||||
// }
|
||||
|
||||
/**道岔初始化封锁*/
|
||||
@OperateHandlerMapping(type =Operation.Type.Switch_Initialize_Block)
|
||||
public void initializeBlock(Simulation simulation, String switchCode) {
|
||||
ciApiService.initializeBlock(simulation, switchCode);
|
||||
}
|
||||
|
||||
/**道岔封锁l*/
|
||||
@OperateHandlerMapping(type =Operation.Type.Switch_Block)
|
||||
public void blockadeSwitch(Simulation simulation, String switchCode) {
|
||||
@ -266,4 +272,10 @@ public class SwitchOperateHandler {
|
||||
public void switchSqueezeRecovery(Simulation simulation, String switchCode) {
|
||||
ciApiService.switchSqueezeRecovery(simulation, switchCode);
|
||||
}
|
||||
|
||||
/** 命令【泰雷兹】 */
|
||||
@OperateHandlerMapping(type = Operation.Type.Switch_Command)
|
||||
public void switchCommand(Simulation simulation, String switchCode, Boolean auto, Boolean reserve, Boolean normal) {
|
||||
ciApiService.switchCommand(simulation, switchCode, auto, reserve, normal);
|
||||
}
|
||||
}
|
||||
|
@ -321,8 +321,16 @@ public class TrainOperateHandler {
|
||||
/**
|
||||
* 排列进路到(站台/信号机)【泰雷兹】
|
||||
*/
|
||||
@OperateHandlerMapping(type = Operation.Type.Train_Link)
|
||||
@OperateHandlerMapping(type = Operation.Type.Train_Set_Route)
|
||||
public void setRouteTo(Simulation simulation, RoutePathVO routePath) {
|
||||
atsTrainService.setRouteTo(simulation, routePath);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置列车运行类型【泰雷兹】
|
||||
*/
|
||||
@OperateHandlerMapping(type = Operation.Type.Train_Set_Run_Type)
|
||||
public void setRunType(Simulation simulation, String groupNumber, VirtualRealityTrain.RunType runType) {
|
||||
atsTrainService.setRunType(simulation, groupNumber, runType);
|
||||
}
|
||||
}
|
||||
|
@ -95,20 +95,41 @@ public class AtsRouteService {
|
||||
*/
|
||||
public void setCiAuto(Simulation simulation, String signalCode) {
|
||||
Signal signal = simulation.getRepository().getByCode(signalCode, Signal.class);
|
||||
Route lockedRoute = signal.getLockedRoute();
|
||||
if (lockedRoute == null) {
|
||||
throw new SimulationException(SimulationExceptionType.Operation_Handle_FAIL,
|
||||
String.format("信号机[%s(%s)]没有已锁闭进路,不能设置联锁自动进路", signal.getName(), signal.getCode()));
|
||||
if (simulation.getRepository().getConfig().isSetRouteBeforeSetFlt()) {
|
||||
Route lockedRoute = signal.getLockedRoute();
|
||||
if (lockedRoute == null) {
|
||||
throw new SimulationException(SimulationExceptionType.Operation_Handle_FAIL,
|
||||
String.format("信号机[%s(%s)]没有已锁闭进路,不能设置联锁自动进路", signal.getName(), signal.getCode()));
|
||||
}
|
||||
if (!lockedRoute.isFlt()) {
|
||||
throw new SimulationException(SimulationExceptionType.Unsupported_Operation,
|
||||
String.format("进路[%s]不能设置车队进路", lockedRoute.getCode()));
|
||||
}
|
||||
if (lockedRoute.isCiControl()) {
|
||||
throw new SimulationException(SimulationExceptionType.Operation_Conflict,
|
||||
String.format("进路[%s(%s)]自动追踪已开启,不能设置联锁自动进路", lockedRoute.getName(), lockedRoute.getCode()));
|
||||
}
|
||||
lockedRoute.setFleetMode(true);
|
||||
} else {
|
||||
List<Route> routeList = signal.getRouteList();
|
||||
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertCollectionNotEmpty(routeList, signal.debugStr() + "不是进路始端信号机");
|
||||
// 筛选最适合的进路,筛选逻辑与办理引导时筛选逻辑类似
|
||||
List<Route> fltRoutes = routeList.stream().filter(Route::isFlt).collect(Collectors.toList());
|
||||
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertCollectionNotEmpty(fltRoutes, signal.debugStr() + "下没有可设置的车队进路");
|
||||
List<Route> collect = fltRoutes.stream()
|
||||
.filter(r -> !r.isTurnBack() && CollectionUtils.isEmpty(r.getSwitchList()))
|
||||
.collect(Collectors.toList());
|
||||
if (CollectionUtils.isEmpty(collect)) {
|
||||
collect = fltRoutes.stream().filter(r -> !r.isTurnBack()).collect(Collectors.toList());
|
||||
}
|
||||
if (CollectionUtils.isEmpty(collect)) {
|
||||
collect = fltRoutes;
|
||||
}
|
||||
Route route = collect.get(0);
|
||||
Route.CheckFailMessage message = routeService.setting(simulation, route);
|
||||
BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertNull(message, route.debugStr() + "无法办理");
|
||||
route.setFleetMode(true);
|
||||
}
|
||||
if (!lockedRoute.isFlt()) {
|
||||
throw new SimulationException(SimulationExceptionType.Unsupported_Operation,
|
||||
String.format("进路[%s]不能设置车队进路", lockedRoute.getCode()));
|
||||
}
|
||||
if (lockedRoute.isCiControl()) {
|
||||
throw new SimulationException(SimulationExceptionType.Operation_Conflict,
|
||||
String.format("进路[%s(%s)]自动追踪已开启,不能设置联锁自动进路", lockedRoute.getName(), lockedRoute.getCode()));
|
||||
}
|
||||
lockedRoute.setFleetMode(true);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -125,6 +146,9 @@ public class AtsRouteService {
|
||||
throw new SimulationException(SimulationExceptionType.Operation_Repetition, String.format("信号机[%s(%s)]没有打开连锁自动进路,不能取消联锁自动进路", signal.getName(), signal.getCode()));
|
||||
}
|
||||
lockedRoute.setFleetMode(false);
|
||||
if (simulation.getRepository().getConfig().isCancelRouteWhenCancelFlt()) {
|
||||
routeService.cancelWithoutCheck(simulation, lockedRoute);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -120,6 +120,7 @@ public class AtsStandService {
|
||||
standList.forEach(stand -> stand.setTrainParking(false));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 设置站台跳停(指定列车跳停)
|
||||
*/
|
||||
@ -203,7 +204,7 @@ public class AtsStandService {
|
||||
public void cancelJumpStop(Simulation simulation, String standCode, String trainGroupNumber) {
|
||||
Stand stand = getStand(simulation, standCode);
|
||||
if (!stand.isJumpStop()) {
|
||||
throw new SimulationException(SimulationExceptionType.Operation_Repetition);
|
||||
return;
|
||||
}
|
||||
if (!StringUtils.hasText(trainGroupNumber)) { //如果是取消站台跳停
|
||||
stand.setAllSkip(false);
|
||||
@ -329,6 +330,10 @@ public class AtsStandService {
|
||||
} else {
|
||||
this.ciApiService.standHoldTrain(simulation, standCode, false);
|
||||
}
|
||||
checkAndSetTrainHold(simulation, stand);
|
||||
}
|
||||
|
||||
private void checkAndSetTrainHold(Simulation simulation, Stand stand) {
|
||||
if (stand.isHoldTrain()) {
|
||||
// 先默认CBTC模式,扣车状态发送给列车
|
||||
List<TrainInfo> superviseTrainList = simulation.getRepository().getSuperviseTrainList();
|
||||
@ -342,6 +347,34 @@ public class AtsStandService {
|
||||
}
|
||||
}
|
||||
|
||||
public void sysHoldTrain(Simulation simulation) {
|
||||
List<Stand> stands = simulation.getRepository().getStandList();
|
||||
stands.forEach(stand -> {
|
||||
if (stand.isJumpStop()) {
|
||||
stand.setAllSkip(false);
|
||||
stand.getSkipSet().clear();
|
||||
}
|
||||
this.ciApiService.sysHoldTrain(simulation, stand.getCode());
|
||||
checkAndSetTrainHold(simulation, stand);
|
||||
});
|
||||
List<VirtualRealityTrain> onlineTrainList = simulation.getRepository().getOnlineTrainList();
|
||||
for (VirtualRealityTrain train : onlineTrainList) {
|
||||
if (train.isJump()) {
|
||||
this.onboardAtpApiService.cancelJump(simulation, train.getGroupNumber());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void cancelSysHoldTrain(Simulation simulation) {
|
||||
List<Stand> stands = simulation.getRepository().getStandList();
|
||||
stands.forEach(stand -> {
|
||||
if (stand.isSysHoldTrain()) {
|
||||
this.ciApiService.sysHoldTrainCancel(simulation, stand.getCode());
|
||||
this.checkAndCancelTrainHold(simulation, stand);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void forceCancelHoldTrain(Simulation simulation, String standCode) {
|
||||
Stand stand = simulation.getRepository().getByCode(standCode, Stand.class);
|
||||
if (stand.isCenterHoldTrain()) {
|
||||
|
@ -8,21 +8,24 @@ import club.joylink.rtss.simulation.cbtc.command.OperationMessage;
|
||||
import club.joylink.rtss.simulation.cbtc.constant.SimulationConstants;
|
||||
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.Signal;
|
||||
import club.joylink.rtss.simulation.cbtc.data.map.Station;
|
||||
import club.joylink.rtss.simulation.cbtc.data.map.Switch;
|
||||
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;
|
||||
import lombok.NonNull;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
@Component
|
||||
@ -33,7 +36,7 @@ public class AtsStationService {
|
||||
private ATSMessageCollectAndDispatcher atsMessageCollectAndDispatcher;
|
||||
|
||||
@Autowired
|
||||
private ApplicationContext applicationContext;
|
||||
private AtsRouteService atsRouteService;
|
||||
|
||||
public StationStatus info(Simulation simulation, String stationCode) {
|
||||
Station station = getStation(simulation, stationCode);
|
||||
@ -231,6 +234,7 @@ public class AtsStationService {
|
||||
atsMessageCollectAndDispatcher.handlerOperateMessage(simulation, new OperationMessage(fromMember.getId(), new HashSet<>(Collections.singleton(fromMember)), Operation.Type.CM_Reply_Interlock_Control, null, true, stationCodes));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 回复站控请求c
|
||||
*/
|
||||
@ -368,19 +372,167 @@ public class AtsStationService {
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消失效的控制权转换申请
|
||||
* 更新车站控制权转换倒计时及有效性
|
||||
*/
|
||||
public void cancelInvalidControlTransferApplication(Simulation simulation) {
|
||||
for (Station station : simulation.getRepository().getStationList()) {
|
||||
if (station.isControlTransferApplying()) {
|
||||
Integer validDuration = station.getValidDuration();
|
||||
validDuration -= SimulationConstants.ATS_LOOP_RATE;
|
||||
if (validDuration <= 0) {
|
||||
station.cancelControlTransferApplication();
|
||||
} else {
|
||||
station.setValidDuration(validDuration);
|
||||
}
|
||||
public void updateControlTransferApplicationStatus(Station station) {
|
||||
if (station.isControlTransferApplying()) {
|
||||
Integer validDuration = station.getValidDuration();
|
||||
validDuration -= SimulationConstants.ATS_LOOP_RATE;
|
||||
if (validDuration <= 0) {
|
||||
station.cancelControlTransferApplication();
|
||||
} else {
|
||||
station.setValidDuration(validDuration);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 全站设置自动通过进路
|
||||
*/
|
||||
public void setCIAuto(Simulation simulation, @NonNull Station station) {
|
||||
List<Route> routes = simulation.getRepository().getRouteList();
|
||||
routes.stream()
|
||||
.filter(route -> station.equals(route.getInterlockStation()) && route.isFlt() && !route.isFleetMode())
|
||||
.map(Route::getStart)
|
||||
.distinct()
|
||||
.forEach(signal -> atsRouteService.setCiAuto(simulation, signal.getCode()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 全站取消自动通过进路
|
||||
*/
|
||||
public void cancelCIAuto(Simulation simulation, @NonNull Station station) {
|
||||
List<Route> routes = simulation.getRepository().getRouteList();
|
||||
routes.stream().filter(route -> station.equals(route.getInterlockStation()) && route.isFlt() && route.isFleetMode())
|
||||
.filter(route -> station.equals(route.getInterlockStation()) && route.isFleetMode())
|
||||
.map(Route::getStart)
|
||||
.forEach(signal -> atsRouteService.cancelCiAuto(simulation, signal.getCode()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置/取消强制点灯
|
||||
*/
|
||||
public void setOrCancelForcePhysicalSignal(Simulation simulation, @NonNull Station station) {
|
||||
List<Signal> signalList = simulation.getRepository().getSignalList().stream()
|
||||
.filter(signal -> station.equals(signal.getInterlockStation())).collect(Collectors.toList());
|
||||
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertCollectionNotEmpty(signalList, station.debugStr() + "下无信号机");
|
||||
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);
|
||||
});
|
||||
} else {
|
||||
signalList.forEach(signal -> signal.setForcePhysical(false));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 计轴预复位
|
||||
*/
|
||||
public void preReset(Simulation simulation, Station station) {
|
||||
station.getPreResetValidDuration().set(60 * 1000);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新车站随时间变化的属性
|
||||
*/
|
||||
public void updateField(Simulation simulation) {
|
||||
List<Station> stations = simulation.getRepository().getStationList();
|
||||
for (Station station : stations) {
|
||||
//更新车站控制权转换倒计时及有效性
|
||||
this.updateControlTransferApplicationStatus(station);
|
||||
// 更新车站预复位的剩余时间
|
||||
this.updatePreResetRemainderTime(station);
|
||||
}
|
||||
}
|
||||
|
||||
private void updatePreResetRemainderTime(Station station) {
|
||||
int validDuration = station.getPreResetValidDuration().get();
|
||||
if (validDuration > 0) {
|
||||
station.getPreResetValidDuration().compareAndExchange(validDuration, Math.max(0, validDuration - SimulationConstants.ATS_LOOP_RATE));
|
||||
}
|
||||
}
|
||||
|
||||
public void applyControl(Simulation simulation, List<String> stationCodes, SimulationMember member) {
|
||||
if (CollectionUtils.isEmpty(stationCodes)) {
|
||||
throw new SimulationException(SimulationExceptionType.Operation_Handle_FAIL, "申请控制的车站列表不能为空");
|
||||
}
|
||||
//TODO 角色和设备检查
|
||||
synchronized (simulation) {
|
||||
SimulationDataRepository repository = simulation.getRepository();
|
||||
BusinessExceptionAssertEnum.INVALID_OPERATION.assertNotTrue(stationCodes.stream().anyMatch(s -> Objects.nonNull(repository.getByCode(s, Station.class).getControlApplicant())), "申请列车存在已被申请的车站");
|
||||
stationCodes.forEach(s -> {
|
||||
Station station = repository.getByCode(s, Station.class);
|
||||
if (station.getController() == null) {
|
||||
station.setController(member);
|
||||
} else {
|
||||
station.setControlApplicant(member);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public void transferControl(Simulation simulation, List<String> stationCodes, boolean agree, SimulationMember member) {
|
||||
if (CollectionUtils.isEmpty(stationCodes)) {
|
||||
throw new SimulationException(SimulationExceptionType.Operation_Handle_FAIL, "控制权转移的车站列表不能为空");
|
||||
}
|
||||
//TODO 角色和设备检查
|
||||
synchronized (simulation) {
|
||||
SimulationDataRepository repository = simulation.getRepository();
|
||||
stationCodes.forEach(s -> {
|
||||
Station station = repository.getByCode(s, Station.class);
|
||||
if (agree) {
|
||||
if (station.getController() == null || Objects.equals(station.getController(), member)) {
|
||||
station.setController(station.getControlApplicant());
|
||||
station.setControlApplicant(null);
|
||||
}
|
||||
return;
|
||||
}
|
||||
station.setControlApplicant(null);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public void devolveControl(Simulation simulation, List<String> stationCodes, SimulationMember member) {
|
||||
if (CollectionUtils.isEmpty(stationCodes)) {
|
||||
throw new SimulationException(SimulationExceptionType.Operation_Handle_FAIL, "控制权下放的车站列表不能为空");
|
||||
}
|
||||
//TODO 角色和设备检查
|
||||
synchronized (simulation) {
|
||||
SimulationDataRepository repository = simulation.getRepository();
|
||||
stationCodes.forEach(s -> {
|
||||
Station station = repository.getByCode(s, Station.class);
|
||||
if (Objects.nonNull(station.getController()) && Objects.equals(station.getController(), member)) {
|
||||
station.setController(null);
|
||||
station.setEmergencyController(false);
|
||||
station.setControlApplicant(null);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void revokeControl(Simulation simulation, List<String> stationCodes, SimulationMember member) {
|
||||
if (CollectionUtils.isEmpty(stationCodes)) {
|
||||
throw new SimulationException(SimulationExceptionType.Operation_Handle_FAIL, "回收控制权的车站列表不能为空");
|
||||
}
|
||||
//TODO 角色和设备检查
|
||||
synchronized (simulation) {
|
||||
SimulationDataRepository repository = simulation.getRepository();
|
||||
stationCodes.forEach(s -> {
|
||||
Station station = repository.getByCode(s, Station.class);
|
||||
station.setController(member);
|
||||
station.setEmergencyController(true);
|
||||
station.setControlApplicant(null);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public void cancelPreReset(Simulation simulation, Station station) {
|
||||
station.getPreResetValidDuration().set(0);
|
||||
}
|
||||
}
|
||||
|
@ -896,4 +896,12 @@ public class AtsTrainService {
|
||||
public void setRouteTo(Simulation simulation, RoutePathVO routePath) {
|
||||
routePath.getRouteList().forEach(routeCode -> ciApiService.settingRoute(simulation, routeCode));
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置列车运行类型
|
||||
*/
|
||||
public void setRunType(Simulation simulation, String groupNumber, VirtualRealityTrain.RunType runType) {
|
||||
VirtualRealityTrain train = simulation.getRepository().getOnlineTrainBy(groupNumber);
|
||||
train.setRunType(runType);
|
||||
}
|
||||
}
|
||||
|
@ -250,6 +250,8 @@ public interface CiApiService {
|
||||
*/
|
||||
void standHoldTrain(Simulation simulation, String standCode, boolean center);
|
||||
|
||||
void sysHoldTrain(Simulation simulation, String standCode);
|
||||
|
||||
/**
|
||||
* 站台取消扣车,联锁关系处理
|
||||
* @param simulation
|
||||
@ -258,6 +260,8 @@ public interface CiApiService {
|
||||
*/
|
||||
void standHoldTrainCancel(Simulation simulation, String standCode, boolean center);
|
||||
|
||||
void sysHoldTrainCancel(Simulation simulation, String standCode);
|
||||
|
||||
void standHoldTrainCancelAll(Simulation simulation, String standCode);
|
||||
|
||||
/**
|
||||
@ -337,4 +341,26 @@ public interface CiApiService {
|
||||
* 挤岔恢复
|
||||
*/
|
||||
void switchSqueezeRecovery(Simulation simulation, String switchCode);
|
||||
|
||||
/**
|
||||
* 命令
|
||||
*/
|
||||
void switchCommand(Simulation simulation, String switchCode, Boolean auto, Boolean reserve, Boolean normal);
|
||||
|
||||
/**
|
||||
* 初始化封锁
|
||||
*/
|
||||
void initializeBlock(Simulation simulation, String switchCode);
|
||||
|
||||
/**
|
||||
* 初始化引导
|
||||
*/
|
||||
void initializeGuide(Simulation simulation, String signalCode);
|
||||
|
||||
/**
|
||||
* 取消引导的初始化
|
||||
*/
|
||||
void cancelGuideInitialization(Simulation simulation, String signalCode);
|
||||
|
||||
void axleReset(Simulation simulation, String sectionCode);
|
||||
}
|
||||
|
@ -153,6 +153,19 @@ public class CiApiServiceImpl implements CiApiService {
|
||||
@Override
|
||||
public void blockadeSwitch(Simulation simulation, String switchCode) {
|
||||
Switch aSwitch = simulation.getRepository().getByCode(switchCode, Switch.class);
|
||||
//条件检查
|
||||
MapConfig config = simulation.getRepository().getConfig();
|
||||
if (config.isBlockadeCommandOnlyValidInStandbyMode()) {
|
||||
boolean standbyMode = simulation.getRepository().getRouteList()
|
||||
.stream().filter(route -> route.isRouteSwitch(aSwitch)).anyMatch(route -> !route.isCbtcMode()); //包含该道岔的进路是否有处于后备模式的
|
||||
if (!standbyMode) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (config.isSomeCommandNeedInit()) {
|
||||
BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertTrue(aSwitch.isInit(), aSwitch.debugStr() + "未初始化");
|
||||
}
|
||||
|
||||
this.switchService.blockade(aSwitch);
|
||||
}
|
||||
|
||||
@ -223,12 +236,18 @@ public class CiApiServiceImpl implements CiApiService {
|
||||
Section section = simulation.getRepository().getByCode(sectionCode, Section.class);
|
||||
if (section.isCross()) {
|
||||
Optional<Section> crossLockedSectionOptional = section.getLogicList().stream().filter(Section::isLocked).findAny();
|
||||
BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertTrue(crossLockedSectionOptional.isPresent(),
|
||||
section.debugStr() + "未锁闭,无需解锁");
|
||||
if (crossLockedSectionOptional.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
// BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertTrue(crossLockedSectionOptional.isPresent(),
|
||||
// section.debugStr() + "未锁闭,无需解锁");
|
||||
section = crossLockedSectionOptional.get();
|
||||
}
|
||||
BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertTrue(section.isLocked(),
|
||||
section.debugStr() + "未锁闭,无需解锁");
|
||||
if (!section.isLocked()) {
|
||||
return;
|
||||
}
|
||||
// BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertTrue(section.isLocked(),
|
||||
// section.debugStr() + "未锁闭,无需解锁");
|
||||
List<Route> lockedRouteList = simulation.getRepository().queryAllLockedRoute();
|
||||
Route lockedRoute = null;
|
||||
for (Route route : lockedRouteList) {
|
||||
@ -332,12 +351,24 @@ public class CiApiServiceImpl implements CiApiService {
|
||||
this.standService.holdTrain(simulation, stand, center);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sysHoldTrain(Simulation simulation, String standCode) {
|
||||
Stand stand = simulation.getRepository().getByCode(standCode, Stand.class);
|
||||
this.standService.sysHoldTrain(simulation, stand);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void standHoldTrainCancel(Simulation simulation, String standCode, boolean center) {
|
||||
Stand stand = simulation.getRepository().getByCode(standCode, Stand.class);
|
||||
this.standService.cancelHoldTrain(simulation, stand, center);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sysHoldTrainCancel(Simulation simulation, String standCode) {
|
||||
Stand stand = simulation.getRepository().getByCode(standCode, Stand.class);
|
||||
this.standService.cancelSysHoldTrain(simulation, stand);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void standHoldTrainCancelAll(Simulation simulation, String standCode) {
|
||||
Stand stand = simulation.getRepository().getByCode(standCode, Stand.class);
|
||||
@ -399,11 +430,16 @@ public class CiApiServiceImpl implements CiApiService {
|
||||
BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertNotNull(signal.getLockedRoute(), String.format("信号机[%s]无已办理进路", signal.getCode()));
|
||||
}
|
||||
}
|
||||
if (config.isSomeCommandNeedInit()) {
|
||||
BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertTrue(signal.isInit(), signal.debugStr() + "未初始化");
|
||||
}
|
||||
BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertTrue(signal.isClose(), String.format("信号机[%s]需处于关闭状态", signal.getCode()));
|
||||
boolean signalApproachOccupied = signal.getApproachPathList()
|
||||
.stream().anyMatch(sectionPath -> sectionPath.getSectionList().stream().anyMatch(Section::isOccupied));
|
||||
BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertTrue(signalApproachOccupied,
|
||||
String.format("对%s开放引导操作失败,接近区段没有列车占用", signal.getName()));
|
||||
if (config.isNeedApproachLockBeforeSetGuide()) {
|
||||
BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertTrue(signalApproachOccupied,
|
||||
String.format("对%s开放引导操作失败,接近区段没有列车占用", signal.getName()));
|
||||
}
|
||||
//办理引导进路或开放引导信号
|
||||
if (config.isGuideNeedRouteSettingFirst()) {
|
||||
signalService.openGuideSignal(simulation, signal);
|
||||
@ -516,15 +552,8 @@ public class CiApiServiceImpl implements CiApiService {
|
||||
|
||||
@Override
|
||||
public void axlePreReset(Simulation simulation, String sectionCode) {
|
||||
Section section = simulation.getRepository().getByCode(sectionCode, Section.class);
|
||||
Section chooseSection = section;
|
||||
if (!section.isAxleCounter()) {
|
||||
section = section.getParent();
|
||||
}
|
||||
BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertTrue(section != null && section.isAxleCounter(),
|
||||
chooseSection.debugStr() + "不是计轴区段");
|
||||
VirtualRealitySectionAxleCounter virtualAxleCounter = section.getVirtualAxleCounter();
|
||||
BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertTrue(virtualAxleCounter.isOccupy(), chooseSection + "计轴未占用,无需预复位");
|
||||
VirtualRealitySectionAxleCounter virtualAxleCounter = getAxleCounterAndCheck4Reset(simulation, sectionCode);
|
||||
|
||||
virtualAxleCounter.preReset();
|
||||
}
|
||||
|
||||
@ -539,4 +568,70 @@ public class CiApiServiceImpl implements CiApiService {
|
||||
Switch aSwitch = simulation.getRepository().getByCode(switchCode, Switch.class);
|
||||
Switch.SwitchFault.SQUEEZE.fix(aSwitch);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void switchCommand(Simulation simulation, String switchCode, Boolean auto, Boolean reserve, Boolean normal) {
|
||||
Switch aSwitch = simulation.getRepository().getByCode(switchCode, Switch.class);
|
||||
if (auto != null) {
|
||||
aSwitch.setAuto(auto);
|
||||
} else {
|
||||
if (normal != null) {
|
||||
BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertTrue(!aSwitch.isAuto(), "道岔未处于人工模式");
|
||||
if (normal) {
|
||||
switchService.turn2NormalPosition(simulation, aSwitch);
|
||||
} else {
|
||||
switchService.turn2ReversePosition(simulation, aSwitch);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (reserve != null) {
|
||||
aSwitch.setDispatcherReserve(reserve);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initializeBlock(Simulation simulation, String switchCode) {
|
||||
Switch aSwitch = simulation.getRepository().getByCode(switchCode, Switch.class);
|
||||
aSwitch.setInit(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initializeGuide(Simulation simulation, String signalCode) {
|
||||
Signal signal = simulation.getRepository().getByCode(signalCode, Signal.class);
|
||||
signal.setInit(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cancelGuideInitialization(Simulation simulation, String signalCode) {
|
||||
Signal signal = simulation.getRepository().getByCode(signalCode, Signal.class);
|
||||
signal.setInit(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void axleReset(Simulation simulation, String sectionCode) {
|
||||
VirtualRealitySectionAxleCounter axle = getAxleCounterAndCheck4Reset(simulation, sectionCode);
|
||||
axle.axleReset();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取计轴器并为预复位/复位操作检查设备状态
|
||||
*/
|
||||
private VirtualRealitySectionAxleCounter getAxleCounterAndCheck4Reset(Simulation simulation, String sectionCode) {
|
||||
Section section = simulation.getRepository().getByCode(sectionCode, Section.class);
|
||||
Section chooseSection = section;
|
||||
if (!section.isAxleCounter()) {
|
||||
section = section.getParent();
|
||||
}
|
||||
//条件检查
|
||||
BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertTrue(section != null && section.isAxleCounter(),
|
||||
chooseSection.debugStr() + "不是计轴区段");
|
||||
VirtualRealitySectionAxleCounter virtualAxleCounter = section.getVirtualAxleCounter();
|
||||
BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertTrue(virtualAxleCounter.isOccupy(), chooseSection.debugStr() + "计轴未占用,无需预复位");
|
||||
if (simulation.getRepository().getConfig().isStationPreResetBeforeAxlePreReset()) {
|
||||
Station station = section.getStation();
|
||||
BusinessExceptionAssertEnum.SYSTEM_EXCEPTION.assertNotNull(station, chooseSection.debugStr() + "没有所属车站");
|
||||
BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertTrue(station.isPreReset(), station.debugStr() + "需处于预复位状态");
|
||||
}
|
||||
return virtualAxleCounter;
|
||||
}
|
||||
}
|
||||
|
@ -778,26 +778,30 @@ public class RouteService {
|
||||
* @param route
|
||||
*/
|
||||
public boolean humanCancel(Simulation simulation, Route route) {
|
||||
if (route.isDelayUnlocking()) { // 已经在延时解锁中
|
||||
throw new SimulationException(SimulationExceptionType.Operation_Handle_FAIL,
|
||||
String.format("正在延时解锁"));
|
||||
}
|
||||
if (simulation.getRepository().getConfig().isCancelAtsControlOfAllRoutesWhenCancelRoute()) {
|
||||
route.getStart().getRouteList().forEach(aRoute -> {
|
||||
aRoute.setAtsControl(false);
|
||||
aRoute.setCiControl(false);
|
||||
});
|
||||
if (route.isGuideSignalOpen()) { //根据宁波一HMI教学视频添加该分支
|
||||
this.cancelGuideRoute(simulation, route);
|
||||
} else {
|
||||
route.setAtsControl(false);
|
||||
if (route.isDelayUnlocking()) { // 已经在延时解锁中
|
||||
throw new SimulationException(SimulationExceptionType.Operation_Handle_FAIL,
|
||||
String.format("正在延时解锁"));
|
||||
}
|
||||
if (simulation.getRepository().getConfig().isCancelAtsControlOfAllRoutesWhenCancelRoute()) {
|
||||
route.getStart().getRouteList().forEach(aRoute -> {
|
||||
aRoute.setAtsControl(false);
|
||||
aRoute.setCiControl(false);
|
||||
});
|
||||
} else {
|
||||
route.setAtsControl(false);
|
||||
}
|
||||
// 关闭始端信号
|
||||
this.routeClose(simulation, route);
|
||||
log.debug(String.format("人解进路,信号机[%s(%s)]关灯",
|
||||
route.getStart().getName(), route.getStart().getCode()));
|
||||
// 设置延时
|
||||
route.getStart().setDelayTime(route.getDelayReleaseTime() * 1000);
|
||||
route.setDelayUnlocking(true);
|
||||
route.getLogicSections().forEach(section -> section.setDelayUnlock(true));
|
||||
}
|
||||
// 关闭始端信号
|
||||
this.routeClose(simulation, route);
|
||||
log.debug(String.format("人解进路,信号机[%s(%s)]关灯",
|
||||
route.getStart().getName(), route.getStart().getCode()));
|
||||
// 设置延时
|
||||
route.getStart().setDelayTime(route.getDelayReleaseTime() * 1000);
|
||||
route.setDelayUnlocking(true);
|
||||
route.getLogicSections().forEach(section -> section.setDelayUnlock(true));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -4,8 +4,10 @@ import club.joylink.rtss.simulation.cbtc.Simulation;
|
||||
import club.joylink.rtss.simulation.cbtc.data.map.Route;
|
||||
import club.joylink.rtss.simulation.cbtc.data.map.Signal;
|
||||
import club.joylink.rtss.simulation.cbtc.data.support.SignalApproachMessage;
|
||||
import club.joylink.rtss.simulation.cbtc.event.RouteModeChangeEvent;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
@ -22,6 +24,9 @@ public class SignalService {
|
||||
@Autowired
|
||||
private VrSignalControlService vrSignalControlService;
|
||||
|
||||
@Autowired
|
||||
private ApplicationContext applicationContext;
|
||||
|
||||
/**
|
||||
* 封锁(封锁后,包含信号机的进路不能排列)
|
||||
* @param signal
|
||||
@ -113,6 +118,7 @@ public class SignalService {
|
||||
} else {
|
||||
signal.guideStart();
|
||||
}
|
||||
signal.setInit(false);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -127,12 +133,12 @@ public class SignalService {
|
||||
}
|
||||
signal.setApproachMsg(approachMessage.getApproachMsg());
|
||||
if (signal.isNctApproach()) { // 接近区段非通信车占用
|
||||
this.changeRoutesCBTCMode(signal, false);
|
||||
this.changeRoutesCBTCMode(simulation, signal, false);
|
||||
if (signal.isLogicLight()) { // 非通信车占用,改为物理点灯
|
||||
this.changeSignalLightType(simulation, signal, false);
|
||||
}
|
||||
} else if (signal.isCbtcApproach()) { // 接近区段通信车占用
|
||||
this.changeRoutesCBTCMode(signal, true);
|
||||
this.changeRoutesCBTCMode(simulation, signal, true);
|
||||
if (!signal.isLogicLight()) {
|
||||
this.changeSignalLightType(simulation, signal, true);
|
||||
}
|
||||
@ -154,10 +160,11 @@ public class SignalService {
|
||||
}
|
||||
}
|
||||
|
||||
private void changeRoutesCBTCMode(Signal signal, boolean cbtc) {
|
||||
private void changeRoutesCBTCMode(Simulation simulation, Signal signal, boolean cbtc) {
|
||||
List<Route> routeList = signal.getRouteList();
|
||||
if (!CollectionUtils.isEmpty(routeList)) {
|
||||
routeList.forEach(route -> route.setCbtcMode(cbtc));
|
||||
applicationContext.publishEvent(new RouteModeChangeEvent(this, simulation, routeList));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -89,6 +89,26 @@ public class StandService {
|
||||
}
|
||||
}
|
||||
|
||||
/**系统扣车*/
|
||||
public void sysHoldTrain(Simulation simulation, Stand stand) {
|
||||
stand.setSysHoldTrain(true);
|
||||
// 关闭出站信号机
|
||||
Signal signal = stand.getSection().getSignalOf(stand.isRight());
|
||||
if (Objects.nonNull(signal)) {
|
||||
MapConfig config = simulation.getRepository().getConfig();
|
||||
if (config.isStandHoldCloseLogicLight() || !signal.isLogicLight()) {
|
||||
this.signalService.close(simulation, signal);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void cancelSysHoldTrain(Simulation simulation, Stand stand) {
|
||||
stand.setSysHoldTrain(false);
|
||||
// 如果所有扣车都取消,开放出站信号机
|
||||
if (!stand.isHoldTrain()) {
|
||||
this.reopenSignal(simulation, stand);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 取消扣车
|
||||
*
|
||||
|
@ -7,15 +7,20 @@ import club.joylink.rtss.simulation.cbtc.constant.SimulationModule;
|
||||
import club.joylink.rtss.simulation.cbtc.data.map.Route;
|
||||
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.map.SwitchElement;
|
||||
import club.joylink.rtss.simulation.cbtc.data.vr.VirtualRealitySwitch;
|
||||
import club.joylink.rtss.simulation.cbtc.event.RouteModeChangeEvent;
|
||||
import club.joylink.rtss.simulation.cbtc.event.SimulationDeviceControlEvent;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.event.EventListener;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 道岔服务
|
||||
@ -111,6 +116,7 @@ public class SwitchService {
|
||||
aSwitch.getB().setBlockade(true);
|
||||
aSwitch.getC().setBlockade(true);
|
||||
}
|
||||
aSwitch.setInit(false);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -179,4 +185,46 @@ public class SwitchService {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventListener
|
||||
public void handle(RouteModeChangeEvent event) {
|
||||
this.switchStatusUpdate(event.getSimulation(), event.getRoutes());
|
||||
}
|
||||
|
||||
/**
|
||||
* 道岔的封锁失效状态更新
|
||||
*/
|
||||
private void switchStatusUpdate(Simulation simulation, List<Route> routes) {
|
||||
if (!simulation.getRepository().getConfig().isBlockadeCommandOnlyValidInStandbyMode()) {
|
||||
return;
|
||||
}
|
||||
if (!CollectionUtils.isEmpty(routes)) {
|
||||
if (!routes.get(0).isCbtcMode()) { //进路的状态被设为非cbtc
|
||||
routes.forEach(route -> {
|
||||
route.getSwitchList().forEach(switchElement -> {
|
||||
Switch aSwitch = switchElement.getASwitch();
|
||||
if (aSwitch.isBlockade()) {
|
||||
aSwitch.setBlockadeInvalid(false);
|
||||
}
|
||||
});
|
||||
});
|
||||
} else {
|
||||
List<Switch> switches = routes.stream()
|
||||
.flatMap(route -> route.getSwitchList()
|
||||
.stream()
|
||||
.map(SwitchElement::getASwitch)
|
||||
.filter(aSwitch -> aSwitch.isBlockade() && !aSwitch.isBlockadeInvalid()))
|
||||
.collect(Collectors.toList()); //进路下所有处于封锁且封锁有效状态的道岔
|
||||
for (Route route : simulation.getRepository().getRouteList()) {
|
||||
if (!route.isCbtcMode()) {
|
||||
switches.removeIf(route::isRouteSwitch);
|
||||
if (switches.isEmpty()) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
switches.forEach(aSwitch -> aSwitch.setBlockadeInvalid(true));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -60,6 +60,7 @@ public class CompetitionAndScriptManager {
|
||||
@Qualifier("baiDuVoiceService")
|
||||
private IVoiceService iVoiceService;
|
||||
|
||||
@Deprecated
|
||||
public void run(Simulation simulation) {
|
||||
//--- 确认剧本需要运行 ---
|
||||
CompetitionBO competition = simulation.getCompetition();
|
||||
|
@ -1,16 +1,15 @@
|
||||
package club.joylink.rtss.simulation.cbtc.conversation;
|
||||
|
||||
import club.joylink.rtss.services.IVoiceService;
|
||||
import club.joylink.rtss.simulation.cbtc.GroupSimulationCache;
|
||||
import club.joylink.rtss.simulation.cbtc.Simulation;
|
||||
import club.joylink.rtss.simulation.cbtc.data.SimulationDataRepository;
|
||||
import club.joylink.rtss.simulation.cbtc.competition.ScriptExecuteService;
|
||||
import club.joylink.rtss.simulation.cbtc.data.vo.ConversationVO;
|
||||
import club.joylink.rtss.simulation.cbtc.event.*;
|
||||
import club.joylink.rtss.simulation.cbtc.exception.SimulationException;
|
||||
import club.joylink.rtss.simulation.cbtc.exception.SimulationExceptionType;
|
||||
import club.joylink.rtss.simulation.cbtc.member.SimulationMember;
|
||||
import club.joylink.rtss.simulation.cbtc.member.SimulationUser;
|
||||
import club.joylink.rtss.services.IVoiceService;
|
||||
import club.joylink.rtss.simulation.cbtc.competition.ScriptExecuteService;
|
||||
import club.joylink.rtss.vo.UserVO;
|
||||
import club.joylink.rtss.vo.client.VoiceRecognitionResult;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
@ -87,6 +87,7 @@ public class SimulationVoiceHandler {
|
||||
replacementList.add(new Replacement("(控子权|控质权|放置权|矿质权|空置权)", "控制权"));
|
||||
replacementList.add(new Replacement("(手机号)", "手信号"));
|
||||
replacementList.add(new Replacement("(鼓掌|部长)", "故障"));
|
||||
replacementList.add(new Replacement("(向凤)", "下放"));
|
||||
//------------- 设备相关 --------------
|
||||
replacementList.add(new Replacement("(宇花祭|玉花祭|雨化寨|氯化钙|绿化带|优化钙)", "鱼化寨"));
|
||||
replacementList.add(new Replacement("(保税局)", "保税区"));
|
||||
|
@ -166,6 +166,41 @@ public class MapConfig {
|
||||
*/
|
||||
private boolean adjustOperationAutomatically;
|
||||
|
||||
/**
|
||||
* 在办理车队进路前是否要先排列进路
|
||||
*/
|
||||
private boolean setRouteBeforeSetFlt;
|
||||
|
||||
/**
|
||||
* 在取消车队进路时同时取消进路
|
||||
*/
|
||||
private boolean cancelRouteWhenCancelFlt;
|
||||
|
||||
/**
|
||||
* 办理引导前需要信号机接近锁闭
|
||||
*/
|
||||
private boolean needApproachLockBeforeSetGuide;
|
||||
|
||||
// /**
|
||||
// * 站台指定列车跳停仅跳停一次
|
||||
// */
|
||||
// private boolean standSkipSetTrainOnlyOnce;
|
||||
|
||||
/**
|
||||
* 封锁命令(状态)仅在后备模式下有效
|
||||
*/
|
||||
private boolean blockadeCommandOnlyValidInStandbyMode;
|
||||
|
||||
/**
|
||||
* 一些命令需要初始化【泰雷兹】(道岔封锁、信号机开放引导)
|
||||
*/
|
||||
private boolean someCommandNeedInit;
|
||||
|
||||
/**
|
||||
* 计轴预复位前需要车站预复位
|
||||
*/
|
||||
private boolean stationPreResetBeforeAxlePreReset;
|
||||
|
||||
private Set<SimulationMember.Type> needConfirmConnectMembers =
|
||||
Stream.of(DISPATCHER, STATION_SUPERVISOR, MAINTAINER, ELECTRIC_DISPATCHER).collect(Collectors.toSet());
|
||||
|
||||
@ -200,6 +235,13 @@ public class MapConfig {
|
||||
setAllowEarlyDepartureWhenHoldTrain(configVO.isAllowEarlyDepartureWhenHoldTrain());
|
||||
setEBWhenCancelRoute(configVO.isEBWhenCancelRoute());
|
||||
setAdjustOperationAutomatically(configVO.isAdjustOperationAutomatically());
|
||||
setSetRouteBeforeSetFlt(configVO.isSetRouteBeforeSetFlt());
|
||||
setCancelRouteWhenCancelFlt(configVO.isCancelRouteWhenCancelFlt());
|
||||
setNeedApproachLockBeforeSetGuide(configVO.isNeedApproachLockBeforeSetGuide());
|
||||
// setStandSkipSetTrainOnlyOnce(configVO.isStandSkipSetTrainOnlyOnce());
|
||||
setBlockadeCommandOnlyValidInStandbyMode(configVO.isBlockadeCommandOnlyValidInStandbyMode());
|
||||
setSomeCommandNeedInit(configVO.isSwitchBlockadeCommandNeedInit());
|
||||
setStationPreResetBeforeAxlePreReset(configVO.isStationPreResetBeforeAxlePreReset());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -186,11 +186,21 @@ public class Signal extends MayOutOfOrderDevice {
|
||||
*/
|
||||
private SignalApproachMessage.ApproachMessage approachMsg;
|
||||
|
||||
/**
|
||||
* 强制物理点灯
|
||||
*/
|
||||
private boolean forcePhysical;
|
||||
|
||||
/**
|
||||
* 无状态
|
||||
*/
|
||||
private boolean noStatus;
|
||||
|
||||
/**
|
||||
* 初始化
|
||||
*/
|
||||
private boolean init;
|
||||
|
||||
@Override
|
||||
public void reset() {
|
||||
super.reset();
|
||||
@ -198,14 +208,16 @@ public class Signal extends MayOutOfOrderDevice {
|
||||
this.level = 1;
|
||||
this.blockade = false;
|
||||
this.reblockade = false;
|
||||
this.changeLightType(true);
|
||||
this.logicLight = this.isCtc();
|
||||
this.greenOpen = false;
|
||||
this.yellowOpen = false;
|
||||
this.redOpen = true;
|
||||
this.delayTime = 0;
|
||||
this.guideRemain = 0;
|
||||
this.approachMsg = SignalApproachMessage.ApproachMessage.NULL;
|
||||
this.forcePhysical = false;
|
||||
this.noStatus = false;
|
||||
this.init = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -217,6 +229,12 @@ public class Signal extends MayOutOfOrderDevice {
|
||||
if (SignalFault.MAIN_FILAMENT_BROKEN.equals(getFault()) && logic) {
|
||||
return;
|
||||
}
|
||||
if (logic && forcePhysical) {
|
||||
return;
|
||||
}
|
||||
if (!logic && virtual) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.isCtc()) {
|
||||
this.logicLight = logic;
|
||||
|
@ -82,6 +82,9 @@ public class Stand extends MayOutOfOrderDevice {
|
||||
*/
|
||||
private volatile boolean centerHoldTrain;
|
||||
|
||||
/**系统扣车*/
|
||||
private volatile boolean sysHoldTrain;
|
||||
|
||||
/**
|
||||
* 区间自动扣车
|
||||
*/
|
||||
@ -153,6 +156,7 @@ public class Stand extends MayOutOfOrderDevice {
|
||||
this.remainTime = 0;
|
||||
this.stationHoldTrain = false;
|
||||
this.centerHoldTrain = false;
|
||||
this.sysHoldTrain = false;
|
||||
this.autoHoldTrain = false;
|
||||
this.allSkip = false;
|
||||
this.skipSet = Collections.synchronizedSet(new HashSet<>());
|
||||
@ -175,7 +179,7 @@ public class Stand extends MayOutOfOrderDevice {
|
||||
*/
|
||||
//TODO 反向扣车是否计算在内
|
||||
public boolean isHoldTrain() {
|
||||
return stationHoldTrain || centerHoldTrain;
|
||||
return stationHoldTrain || centerHoldTrain || sysHoldTrain;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -17,6 +17,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Getter
|
||||
@ -162,6 +163,26 @@ public class Station extends MayOutOfOrderDevice {
|
||||
*/
|
||||
private LocalTime restartTime;
|
||||
|
||||
/**
|
||||
* 该车站的控制权拥有者
|
||||
*/
|
||||
private SimulationMember controller;
|
||||
|
||||
/**
|
||||
* 是否紧急控制
|
||||
*/
|
||||
private boolean emergencyController;
|
||||
|
||||
/**
|
||||
* 控制权申请者
|
||||
*/
|
||||
private SimulationMember controlApplicant;
|
||||
|
||||
/**
|
||||
* 预复位剩余时间/ms
|
||||
*/
|
||||
private AtomicInteger preResetValidDuration = new AtomicInteger(0);
|
||||
|
||||
@Override
|
||||
public void reset() {
|
||||
super.reset();
|
||||
@ -180,6 +201,11 @@ public class Station extends MayOutOfOrderDevice {
|
||||
this.apply2TheControlMode = null;
|
||||
this.validDuration = null;
|
||||
this.interlockMachineStarting = false;
|
||||
this.restartTime = null;
|
||||
this.controller = null;
|
||||
this.emergencyController = false;
|
||||
this.controlApplicant = null;
|
||||
this.preResetValidDuration = new AtomicInteger(0);
|
||||
}
|
||||
|
||||
public List<Stand> getStandOf(boolean right) {
|
||||
@ -362,6 +388,28 @@ public class Station extends MayOutOfOrderDevice {
|
||||
throw new SimulationException(SimulationExceptionType.Illegal_Argument, String.format("区段[%s]不是车站[%s]的站台轨", section.getCode(), this.getCode()));
|
||||
}
|
||||
|
||||
public String getControllerId() {
|
||||
if (controller == null) {
|
||||
return null;
|
||||
}
|
||||
return controller.getId();
|
||||
}
|
||||
|
||||
public String getControlApplicantId() {
|
||||
if (controlApplicant == null) {
|
||||
return null;
|
||||
}
|
||||
return controlApplicant.getId();
|
||||
}
|
||||
|
||||
public int getPreResetValidDurationInSeconds() {
|
||||
return this.preResetValidDuration.get() / 1000;
|
||||
}
|
||||
|
||||
public boolean isPreReset() {
|
||||
return this.preResetValidDuration != null && this.preResetValidDuration.get() > 0;
|
||||
}
|
||||
|
||||
public enum ControlMode {
|
||||
/**
|
||||
* 交出未被接收
|
||||
@ -379,6 +427,7 @@ public class Station extends MayOutOfOrderDevice {
|
||||
* 紧急站控
|
||||
*/
|
||||
Emergency,
|
||||
|
||||
/**
|
||||
* 联锁控
|
||||
*/
|
||||
@ -436,7 +485,7 @@ public class Station extends MayOutOfOrderDevice {
|
||||
}
|
||||
|
||||
public String debugStr() {
|
||||
return String.format("%s", this.getName());
|
||||
return String.format("车站[%s]", this.getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -104,6 +104,31 @@ public class Switch extends MayOutOfOrderDevice {
|
||||
*/
|
||||
private boolean preReset;
|
||||
|
||||
/**
|
||||
* 自动
|
||||
*/
|
||||
private boolean auto;
|
||||
|
||||
/**
|
||||
* 中央调度员预留
|
||||
*/
|
||||
private boolean dispatcherReserve;
|
||||
|
||||
/**
|
||||
* 联锁预留
|
||||
*/
|
||||
private boolean interlockReserve;
|
||||
|
||||
/**
|
||||
* 封锁失效
|
||||
*/
|
||||
private boolean blockadeInvalid;
|
||||
|
||||
/**
|
||||
* 初始化
|
||||
*/
|
||||
private boolean init;
|
||||
|
||||
@Override
|
||||
public void reset() {
|
||||
super.reset();
|
||||
@ -118,6 +143,11 @@ public class Switch extends MayOutOfOrderDevice {
|
||||
this.delayTime = 0;
|
||||
this.noStatus = false;
|
||||
this.preReset = false;
|
||||
this.auto = false;
|
||||
this.dispatcherReserve = false;
|
||||
this.interlockReserve = false;
|
||||
this.blockadeInvalid = false;
|
||||
this.init = false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -41,6 +41,10 @@ public class StandStatus extends DeviceStatus {
|
||||
@JsonSerialize(using = Boolean2NumSerializer.class)
|
||||
private boolean centerHoldTrain;
|
||||
|
||||
/**中心是否扣车*/
|
||||
@JsonSerialize(using = Boolean2NumSerializer.class)
|
||||
private boolean sysHoldTrain;
|
||||
|
||||
/**区间自动扣车*/
|
||||
@JsonSerialize(using = Boolean2NumSerializer.class)
|
||||
private boolean autoHoldTrain;
|
||||
@ -90,6 +94,7 @@ public class StandStatus extends DeviceStatus {
|
||||
this.emergencyClosed = stand.isEmergencyClosed();
|
||||
this.stationHoldTrain = stand.isStationHoldTrain();
|
||||
this.centerHoldTrain = stand.isCenterHoldTrain();
|
||||
this.sysHoldTrain = stand.isSysHoldTrain();
|
||||
this.autoHoldTrain = stand.isAutoHoldTrain();
|
||||
this.allSkip = stand.isAllSkip();
|
||||
this.skipSet = new HashSet<>(stand.getSkipSet());
|
||||
@ -143,6 +148,11 @@ public class StandStatus extends DeviceStatus {
|
||||
status.setCenterHoldTrain(this.centerHoldTrain);
|
||||
change = true;
|
||||
}
|
||||
if (!Objects.equals(this.sysHoldTrain, stand.isSysHoldTrain())) {
|
||||
this.sysHoldTrain = stand.isSysHoldTrain();
|
||||
status.setSysHoldTrain(this.sysHoldTrain);
|
||||
change = true;
|
||||
}
|
||||
if (!Objects.equals(this.autoHoldTrain, stand.isAutoHoldTrain())) {
|
||||
this.autoHoldTrain = stand.isAutoHoldTrain();
|
||||
status.setAutoHoldTrain(this.autoHoldTrain);
|
||||
@ -220,6 +230,7 @@ public class StandStatus extends DeviceStatus {
|
||||
statusVO.setAllSkip(allSkip);
|
||||
statusVO.setAutoHoldTrain(autoHoldTrain);
|
||||
statusVO.setCenterHoldTrain(centerHoldTrain);
|
||||
statusVO.setSysHoldTrain(sysHoldTrain);
|
||||
statusVO.setStationHoldTrain(stationHoldTrain);
|
||||
statusVO.setEmergencyClosed(emergencyClosed);
|
||||
statusVO.setTrainParking(trainParking);
|
||||
|
@ -1,13 +1,13 @@
|
||||
package club.joylink.rtss.simulation.cbtc.data.status;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import club.joylink.rtss.simulation.cbtc.data.map.MapElement;
|
||||
import club.joylink.rtss.simulation.cbtc.data.map.Station;
|
||||
import club.joylink.rtss.simulation.cbtc.data.vo.DeviceStatusVO;
|
||||
import club.joylink.rtss.simulation.cbtc.data.vo.StationStatusVO;
|
||||
import club.joylink.rtss.util.jsonSerialize.Boolean2NumDeserializer;
|
||||
import club.joylink.rtss.util.jsonSerialize.Boolean2NumSerializer;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.time.LocalTime;
|
||||
@ -47,13 +47,33 @@ public class StationStatus extends DeviceStatus {
|
||||
private Station.ControlMode apply2TheControlMode;
|
||||
|
||||
/**
|
||||
* 控制权转换申请失效时刻
|
||||
* 控制权转换申请有效时长/s
|
||||
*/
|
||||
private Integer validDuration;
|
||||
|
||||
/**连锁机上电重启时间*/
|
||||
private LocalTime restartTime;
|
||||
|
||||
/**
|
||||
* 该车站的控制权拥有者
|
||||
*/
|
||||
private String controller;
|
||||
|
||||
/**
|
||||
* 是否紧急控制
|
||||
*/
|
||||
private boolean emergencyController;
|
||||
|
||||
/**
|
||||
* 控制权申请者
|
||||
*/
|
||||
private String controlApplicant;
|
||||
|
||||
/**
|
||||
* 预复位有效时长
|
||||
*/
|
||||
private int preResetValidDuration;
|
||||
|
||||
public StationStatus(Station station) {
|
||||
super(station.getCode(), station.getDeviceType());
|
||||
this.controlMode = station.getControlMode();
|
||||
@ -63,6 +83,10 @@ public class StationStatus extends DeviceStatus {
|
||||
this.apply2TheControlMode = station.getApply2TheControlMode();
|
||||
this.validDuration = station.getValidDurationInSeconds();
|
||||
this.restartTime = station.getRestartTime();
|
||||
this.controller = station.getControllerId();
|
||||
this.emergencyController = station.isEmergencyController();
|
||||
this.controlApplicant = station.getControlApplicantId();
|
||||
this.preResetValidDuration = station.getPreResetValidDurationInSeconds();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -106,6 +130,26 @@ public class StationStatus extends DeviceStatus {
|
||||
this.restartTime = station.getRestartTime();
|
||||
status.setRestartTime(restartTime);
|
||||
}
|
||||
if (!Objects.equals(this.controller, station.getControllerId())) {
|
||||
change = true;
|
||||
this.controller = station.getControllerId();
|
||||
}
|
||||
status.setController(this.controller);
|
||||
if (!Objects.equals(this.emergencyController, station.isEmergencyController())) {
|
||||
change = true;
|
||||
this.emergencyController = station.isEmergencyController();
|
||||
status.setEmergencyController(this.emergencyController);
|
||||
}
|
||||
if (!Objects.equals(this.controlApplicant, station.getControlApplicantId())) {
|
||||
change = true;
|
||||
this.controlApplicant = station.getControlApplicantId();
|
||||
}
|
||||
status.setControlApplicant(this.controlApplicant);
|
||||
if (!Objects.equals(this.preResetValidDuration, station.getPreResetValidDurationInSeconds())) {
|
||||
change = true;
|
||||
this.preResetValidDuration = station.getPreResetValidDurationInSeconds();
|
||||
status.setPreResetValidDuration(this.preResetValidDuration);
|
||||
}
|
||||
return change;
|
||||
}
|
||||
|
||||
@ -119,6 +163,10 @@ public class StationStatus extends DeviceStatus {
|
||||
statusVO.setApply2TheControlMode(apply2TheControlMode);
|
||||
statusVO.setValidDuration(validDuration);
|
||||
statusVO.setRestartTime(restartTime);
|
||||
statusVO.setController(controller);
|
||||
statusVO.setEmergencyController(emergencyController);
|
||||
statusVO.setControlApplicant(controlApplicant);
|
||||
statusVO.setPreResetValidDuration(preResetValidDuration);
|
||||
return statusVO;
|
||||
}
|
||||
}
|
||||
|
@ -66,7 +66,25 @@ public class SwitchStatus extends DeviceStatus {
|
||||
@JsonSerialize(using = Boolean2NumSerializer.class)
|
||||
private boolean preReset;
|
||||
|
||||
private int speedUpLimit;
|
||||
/**
|
||||
* 自动
|
||||
*/
|
||||
private boolean auto;
|
||||
|
||||
/**
|
||||
* 中央调度员预留
|
||||
*/
|
||||
private boolean dispatcherReserve;
|
||||
|
||||
/**
|
||||
* 联锁预留
|
||||
*/
|
||||
private boolean interlockReserve;
|
||||
|
||||
/**
|
||||
* 封锁失效
|
||||
*/
|
||||
private boolean blockadeInvalid;
|
||||
|
||||
/**
|
||||
* 故障
|
||||
@ -85,6 +103,10 @@ public class SwitchStatus extends DeviceStatus {
|
||||
this.delayTime = aSwitch.getDelayTime() / 1000;
|
||||
this.noStatus = aSwitch.isNoStatus();
|
||||
this.preReset = aSwitch.isPreReset();
|
||||
this.auto = aSwitch.isAuto();
|
||||
this.dispatcherReserve = aSwitch.isDispatcherReserve();
|
||||
this.interlockReserve = aSwitch.isInterlockReserve();
|
||||
this.blockadeInvalid = aSwitch.isBlockadeInvalid();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -143,6 +165,26 @@ public class SwitchStatus extends DeviceStatus {
|
||||
status.setPreReset(this.preReset);
|
||||
change = true;
|
||||
}
|
||||
if (!Objects.equals(this.auto, aSwitch.isAuto())) {
|
||||
this.auto = aSwitch.isAuto();
|
||||
status.setAuto(this.auto);
|
||||
change = true;
|
||||
}
|
||||
if (!Objects.equals(this.dispatcherReserve, aSwitch.isDispatcherReserve())) {
|
||||
this.dispatcherReserve = aSwitch.isDispatcherReserve();
|
||||
status.setDispatcherReserve(this.dispatcherReserve);
|
||||
change = true;
|
||||
}
|
||||
if (!Objects.equals(this.interlockReserve, aSwitch.isInterlockReserve())) {
|
||||
this.interlockReserve = aSwitch.isInterlockReserve();
|
||||
status.setInterlockReserve(this.interlockReserve);
|
||||
change = true;
|
||||
}
|
||||
if (!Objects.equals(this.blockadeInvalid, aSwitch.isBlockadeInvalid())) {
|
||||
this.blockadeInvalid = aSwitch.isBlockadeInvalid();
|
||||
status.setBlockadeInvalid(this.blockadeInvalid);
|
||||
change = true;
|
||||
}
|
||||
if (!Objects.equals(this.fault, aSwitch.getFault())) {
|
||||
this.fault = (Switch.SwitchFault) aSwitch.getFault();
|
||||
change = true;
|
||||
@ -163,6 +205,10 @@ public class SwitchStatus extends DeviceStatus {
|
||||
statusVO.setSingleLock(singleLock);
|
||||
statusVO.setNoStatus(noStatus);
|
||||
statusVO.setPreReset(preReset);
|
||||
statusVO.setAuto(auto);
|
||||
statusVO.setDispatcherReserve(dispatcherReserve);
|
||||
statusVO.setInterlockReserve(interlockReserve);
|
||||
statusVO.setBlockadeInvalid(blockadeInvalid);
|
||||
statusVO.setFault(this.fault != null ? this.fault.name() : null);
|
||||
return statusVO;
|
||||
}
|
||||
|
@ -1,17 +1,21 @@
|
||||
package club.joylink.rtss.simulation.cbtc.data.storage.device;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import club.joylink.rtss.simulation.cbtc.Simulation;
|
||||
import club.joylink.rtss.simulation.cbtc.data.SimulationDataRepository;
|
||||
import club.joylink.rtss.simulation.cbtc.data.map.MapElement;
|
||||
import club.joylink.rtss.simulation.cbtc.data.map.Station;
|
||||
import club.joylink.rtss.util.jsonSerialize.Boolean2NumDeserializer;
|
||||
import club.joylink.rtss.util.jsonSerialize.Boolean2NumSerializer;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.time.LocalTime;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@ -49,6 +53,18 @@ public class StorageStation extends StorageDevice {
|
||||
*/
|
||||
private Integer validDuration;
|
||||
|
||||
private Boolean interlockMachineStarting;
|
||||
|
||||
private LocalTime restartTime;
|
||||
|
||||
private String controller;
|
||||
|
||||
private Boolean emergencyController;
|
||||
|
||||
private String controlApplicant;
|
||||
|
||||
private Integer preResetValidDuration;
|
||||
|
||||
public StorageStation(String code) {
|
||||
super(code);
|
||||
}
|
||||
@ -75,6 +91,18 @@ public class StorageStation extends StorageDevice {
|
||||
if (station.getValidDuration() != null) {
|
||||
storageStation.setValidDuration(station.getValidDuration());
|
||||
}
|
||||
if (station.isInterlockMachineStarting()) {
|
||||
storageStation.setInterlockMachineStarting(station.isInterlockMachineStarting());
|
||||
}
|
||||
storageStation.setRestartTime(station.getRestartTime());
|
||||
storageStation.setController(station.getControllerId());
|
||||
if (station.isEmergencyController()) {
|
||||
storageStation.setEmergencyController(station.isEmergencyController());
|
||||
}
|
||||
storageStation.setControlApplicant(station.getControlApplicantId());
|
||||
if (station.getPreResetValidDuration() != null && station.getPreResetValidDuration().get() != 0) {
|
||||
storageStation.setPreResetValidDuration(station.getPreResetValidDuration().get());
|
||||
}
|
||||
|
||||
return storageStation;
|
||||
}
|
||||
@ -92,5 +120,11 @@ public class StorageStation extends StorageDevice {
|
||||
}
|
||||
station.setApply2TheControlMode(apply2TheControlMode);
|
||||
station.setValidDuration(validDuration);
|
||||
station.setInterlockMachineStarting(interlockMachineStarting != null ? interlockMachineStarting : false);
|
||||
station.setRestartTime(restartTime);
|
||||
station.setController(controller != null ? simulation.getSimulationMemberById(controller) : null);
|
||||
station.setEmergencyController(emergencyController != null ? emergencyController : false);
|
||||
station.setControlApplicant(controlApplicant != null ? simulation.getSimulationMemberById(controlApplicant) : null);
|
||||
station.setPreResetValidDuration(new AtomicInteger(Objects.requireNonNullElse(preResetValidDuration, 0)));
|
||||
}
|
||||
}
|
||||
|
@ -37,6 +37,10 @@ public class StandStatusVO extends DeviceStatusVO {
|
||||
@JsonSerialize(using = Boolean2NumSerializer.class)
|
||||
private Boolean centerHoldTrain;
|
||||
|
||||
/**是否系统扣车*/
|
||||
@JsonSerialize(using = Boolean2NumSerializer.class)
|
||||
private Boolean sysHoldTrain;
|
||||
|
||||
/**区间自动扣车*/
|
||||
@JsonSerialize(using = Boolean2NumSerializer.class)
|
||||
private Boolean autoHoldTrain;
|
||||
|
@ -1,15 +1,14 @@
|
||||
package club.joylink.rtss.simulation.cbtc.data.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import club.joylink.rtss.simulation.cbtc.data.map.Station;
|
||||
import club.joylink.rtss.util.jsonSerialize.Boolean2NumDeserializer;
|
||||
import club.joylink.rtss.util.jsonSerialize.Boolean2NumSerializer;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
|
||||
/**
|
||||
@ -52,6 +51,25 @@ public class StationStatusVO extends DeviceStatusVO {
|
||||
|
||||
private LocalTime restartTime;
|
||||
|
||||
/**
|
||||
* 该车站的控制权拥有者
|
||||
*/
|
||||
@JsonInclude()
|
||||
private String controller;
|
||||
|
||||
/**
|
||||
* 是否紧急控制
|
||||
*/
|
||||
private Boolean emergencyController;
|
||||
|
||||
/**
|
||||
* 控制权申请者
|
||||
*/
|
||||
@JsonInclude()
|
||||
private String controlApplicant;
|
||||
|
||||
private Integer preResetValidDuration;
|
||||
|
||||
public StationStatusVO(Station station) {
|
||||
super(station.getCode(), station.getDeviceType());
|
||||
}
|
||||
|
@ -55,6 +55,18 @@ public class SwitchStatusVO extends DeviceStatusVO {
|
||||
@JsonSerialize(using = Boolean2NumSerializer.class)
|
||||
private Boolean preReset;
|
||||
|
||||
@JsonSerialize(using = Boolean2NumSerializer.class)
|
||||
private Boolean auto;
|
||||
|
||||
@JsonSerialize(using = Boolean2NumSerializer.class)
|
||||
private Boolean dispatcherReserve;
|
||||
|
||||
@JsonSerialize(using = Boolean2NumSerializer.class)
|
||||
private Boolean interlockReserve;
|
||||
|
||||
@JsonSerialize(using = Boolean2NumSerializer.class)
|
||||
private Boolean blockadeInvalid;
|
||||
|
||||
@JsonInclude
|
||||
private String fault;
|
||||
|
||||
|
@ -44,7 +44,7 @@ public class VirtualRealityIbp {
|
||||
this.xxys = false;
|
||||
}
|
||||
|
||||
public enum Button{
|
||||
public enum ButtonType {
|
||||
//------------------ 信号 ------------------
|
||||
/** 下行扣车 */
|
||||
XXKC,
|
||||
@ -70,5 +70,9 @@ public class VirtualRealityIbp {
|
||||
SXKM,
|
||||
/** 上行钥匙 */
|
||||
SXYS,
|
||||
|
||||
//------------------ 区段 ------------------
|
||||
/** 预复位 */
|
||||
PRERESET,
|
||||
}
|
||||
}
|
||||
|
@ -114,15 +114,22 @@ public class VirtualRealitySectionAxleCounter extends VirtualRealityDevice {
|
||||
public void judgePreResetSuccess() {
|
||||
if (preReset) {
|
||||
if (leftCount == 0 && rightCount == 0) {
|
||||
preReset = false;
|
||||
if (Fault.FAULT.equals(this.fault)) {
|
||||
this.fault = null;
|
||||
}
|
||||
this.clear();
|
||||
axleReset();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 计轴复位
|
||||
*/
|
||||
public void axleReset() {
|
||||
preReset = false;
|
||||
if (Fault.FAULT.equals(this.fault)) {
|
||||
this.fault = null;
|
||||
}
|
||||
this.clear();
|
||||
}
|
||||
|
||||
public enum Fault {
|
||||
FAULT {
|
||||
@Override
|
||||
|
@ -368,6 +368,39 @@ public class VirtualRealityTrain extends VirtualRealityDevice {
|
||||
/**最近经过的两个应答器*/
|
||||
private Queue<Responder> lastTwoPassedResponders = new FixedQueue<>(Responders_Record);
|
||||
|
||||
/**
|
||||
* 运行类型
|
||||
*/
|
||||
private RunType runType;
|
||||
|
||||
public void setRunType(RunType runType) {
|
||||
this.runType = runType;
|
||||
switch (runType) {
|
||||
case ENERGY_CONSERVATION:
|
||||
this.atoSpeedMax = this.atpSpeedMax * 0.2f * 0.9f;
|
||||
break;
|
||||
case MIDDLE_ONE:
|
||||
this.atoSpeedMax = this.atpSpeedMax * 0.4f * 0.9f;
|
||||
break;
|
||||
case MIDDLE_TWO:
|
||||
this.atoSpeedMax = this.atpSpeedMax * 0.6f * 0.9f;
|
||||
break;
|
||||
case NORMAL:
|
||||
this.atoSpeedMax = this.atpSpeedMax * 0.8f * 0.9f;
|
||||
break;
|
||||
case ACCELERATE:
|
||||
this.atoSpeedMax = this.atpSpeedMax * 0.9f;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void setAtoSpeedMax(float atoSpeedMax) {
|
||||
if (runType != null) {
|
||||
return;
|
||||
}
|
||||
this.atoSpeedMax = atoSpeedMax;
|
||||
}
|
||||
|
||||
public void setAtpOn(boolean on) {
|
||||
this.atpOn = on;
|
||||
if (!on) { //如果是关闭ATP,取消信号EB
|
||||
@ -432,6 +465,7 @@ public class VirtualRealityTrain extends VirtualRealityDevice {
|
||||
this.pantograph2Up = true;
|
||||
this.linkTrain = null;
|
||||
this.lastTwoPassedResponders = new FixedQueue<>(Responders_Record);
|
||||
this.runType = null;
|
||||
}
|
||||
|
||||
public boolean isEB() {
|
||||
@ -1056,4 +1090,17 @@ public class VirtualRealityTrain extends VirtualRealityDevice {
|
||||
}
|
||||
}
|
||||
|
||||
public enum RunType{
|
||||
/** 节能 */
|
||||
ENERGY_CONSERVATION,
|
||||
/** 中间的1 */
|
||||
MIDDLE_ONE,
|
||||
/** 中间的2 */
|
||||
MIDDLE_TWO,
|
||||
/** 正常 */
|
||||
NORMAL,
|
||||
/** 加速 */
|
||||
ACCELERATE,
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,17 @@
|
||||
package club.joylink.rtss.simulation.cbtc.event;
|
||||
|
||||
import club.joylink.rtss.simulation.cbtc.Simulation;
|
||||
import club.joylink.rtss.simulation.cbtc.data.map.Route;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
public class RouteModeChangeEvent extends AbstractSimulationEvent{
|
||||
private List<Route> routes;
|
||||
|
||||
public RouteModeChangeEvent(Object source, Simulation simulation, List<Route> routes) {
|
||||
super(source, simulation);
|
||||
this.routes = routes;
|
||||
}
|
||||
}
|
@ -158,7 +158,7 @@ public class ATOService {
|
||||
// nextStopStandSection.getName(), nextStopStandSection.getCode()));
|
||||
boolean parking = true;
|
||||
Signal signal = target.getSignalOf(right);
|
||||
if (!train.isHold() && (train.isJump() && signal.isNormalOpen() || !train.isNextParking())) {
|
||||
if (!train.isHold() && (train.isJump() && (Objects.isNull(signal) || signal.isNormalOpen()) || !train.isNextParking())) {
|
||||
parking = false;
|
||||
}
|
||||
if (parking) {
|
||||
|
@ -161,7 +161,7 @@ public class ATPLogicLoop {
|
||||
}
|
||||
// 列车倒车限速
|
||||
if (ControlGear.Reverse.equals(train.getGear())) {
|
||||
if (train.getSpeed() > 25 / 3.6) {
|
||||
if (train.getSpeed() > 5 / 3.6) { //5km/h从西安二操作手册得来
|
||||
atpService.triggerSignalEB(train);
|
||||
}
|
||||
}
|
||||
@ -215,6 +215,14 @@ public class ATPLogicLoop {
|
||||
case OPEN_DOOR: // 开门
|
||||
if (train.isJump()) { // 列车跳停,跳过开门
|
||||
train.earlyDeparture();
|
||||
// if (simulation.getRepository().getConfig().isStandSkipSetTrainOnlyOnce()) {
|
||||
List<Stand> standList = train.getHeadPosition().getSection().getStandList();
|
||||
if (!CollectionUtils.isEmpty(standList)) {
|
||||
standList.stream().filter(stand -> stand.isGivenTrainSkip(train.getGroupNumber())).forEach(stand -> {
|
||||
atsApiService.cancelStandSkipSetOfTrain(simulation,train.getGroupNumber(), stand.getCode());
|
||||
});
|
||||
}
|
||||
// }
|
||||
} else {
|
||||
this.atoService.syncOpenDoor(simulation, train);
|
||||
if (this.isAllDoorOpen(simulation, train)) {
|
||||
@ -234,7 +242,7 @@ public class ATPLogicLoop {
|
||||
}
|
||||
break;
|
||||
case CLOSE_DOOR: // 关门
|
||||
Signal signal = train.getHeadPosition().getSection().getSignalOf(train.isRight());
|
||||
// Signal signal = train.getHeadPosition().getSection().getSignalOf(train.isRight());
|
||||
if (!train.isHold() || simulation.getRepository().getConfig().isAllowEarlyDepartureWhenHoldTrain()) { // 列车未扣车或允许在扣车状态下提前发车
|
||||
// if (Objects.nonNull(signal) && !signal.isNormalOpen()) {
|
||||
// if (!train.isRMMode() && !train.isNRMMode()) {
|
||||
@ -638,22 +646,32 @@ public class ATPLogicLoop {
|
||||
*/
|
||||
private void checkTrainJumpAndSend2Ats(Simulation simulation, VirtualRealityTrain train,
|
||||
SectionPosition headPosition, SectionPosition tailPosition, boolean right) {
|
||||
if (!train.isStop()) { // 列车未停车
|
||||
// 判断列车是否成功跳站
|
||||
Station nextStation = train.getNextStation();
|
||||
if (Objects.nonNull(nextStation)) {
|
||||
Section tailSection = tailPosition.getSection();
|
||||
if (tailSection.isNormalStandTrack() &&
|
||||
Objects.equals(nextStation, tailSection.getStation())) {
|
||||
// 列车尾部在计划的下一站台轨
|
||||
SectionPosition standEndPosition = new SectionPosition(tailSection, right ? tailSection.getLen() : 0);
|
||||
Float distance = CalculateService.calculateDistance(standEndPosition, headPosition, right);
|
||||
if (Objects.nonNull(distance) && distance > 5) {
|
||||
// 列车成功越站
|
||||
this.atsApiService.handleTrainPassingStation(simulation, train.getGroupNumber(),
|
||||
nextStation.getCode(), tailSection.getCode());
|
||||
}
|
||||
}
|
||||
if (train.isStop()) {
|
||||
return;
|
||||
}
|
||||
// 列车未停车
|
||||
// 判断列车是否成功跳站
|
||||
Station nextStation = train.getNextStation();
|
||||
if (Objects.isNull(nextStation)) {
|
||||
return;
|
||||
}
|
||||
Section tailSection = tailPosition.getSection();
|
||||
if (tailSection.isNormalStandTrack() &&
|
||||
Objects.equals(nextStation, tailSection.getStation())) {
|
||||
// 列车尾部在计划的下一站台轨
|
||||
SectionPosition standEndPosition = new SectionPosition(tailSection, right ? tailSection.getLen() : 0);
|
||||
Float distance = CalculateService.calculateDistance(standEndPosition, headPosition, right);
|
||||
if (Objects.nonNull(distance) && distance > 5) {
|
||||
// 列车成功越站
|
||||
this.atsApiService.handleTrainPassingStation(simulation, train.getGroupNumber(),
|
||||
nextStation.getCode(), tailSection.getCode());
|
||||
// if (simulation.getRepository().getConfig().isStandSkipSetTrainOnlyOnce()) {
|
||||
// List<Stand> standList = train.getHeadPosition().getSection().getStandList();
|
||||
// if (CollectionUtils.isEmpty(standList)) {
|
||||
// return;
|
||||
// }
|
||||
// standList.stream().filter(stand -> stand.isGivenTrainSkip(train.getGroupNumber())).forEach(stand -> atsApiService.cancelStandSkipSetOfTrain(simulation, train.getGroupNumber(), stand.getCode()));
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -14,11 +14,14 @@ import club.joylink.rtss.simulation.cbtc.driving.DrivingService;
|
||||
import club.joylink.rtss.simulation.cbtc.member.SimulationMember;
|
||||
import club.joylink.rtss.simulation.cbtc.onboard.ATO.SpeedCurve;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.core.task.TaskExecutor;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@ -38,13 +41,20 @@ public class RobotLogicLoop {
|
||||
@Autowired
|
||||
private DriverOperateHandler driverOperateHandler;
|
||||
|
||||
@Qualifier("nsExecutor")
|
||||
@Autowired
|
||||
private TaskExecutor executor;
|
||||
/**
|
||||
* 根据目标位置运行
|
||||
*/
|
||||
public void run(Simulation simulation) {
|
||||
robotDriverLogicLoop(simulation);
|
||||
executor.execute(() -> robotDriverLogicLoop(simulation));
|
||||
executor.execute(() -> robotReplyControlTransferApplicationLogicLoop(simulation));
|
||||
executor.execute(() -> robotStationControlAutoTransfer(simulation));
|
||||
|
||||
|
||||
|
||||
|
||||
robotReplyControlTransferApplicationLogicLoop(simulation);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -151,6 +161,18 @@ public class RobotLogicLoop {
|
||||
}
|
||||
}
|
||||
|
||||
/**机器人自动执行车站控制权限转移*/
|
||||
private void robotStationControlAutoTransfer(Simulation simulation) {
|
||||
if (simulation.getScript() != null && simulation.getScript().isBgSet()) {
|
||||
return;
|
||||
}
|
||||
Map<SimulationMember, List<Station>> robotControlStations = simulation.getRepository().getStationList().stream()
|
||||
.filter(station -> Objects.nonNull(station.getController()) && station.getController().isRobot() && Objects.nonNull(station.getControlApplicant())).collect(Collectors.groupingBy(Station::getController));
|
||||
robotControlStations.forEach((controler, stations) -> {
|
||||
atsStationService.transferControl(simulation, stations.stream().map(Station::getCode).collect(Collectors.toList()), true, controler);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 机器人回复控制权转换申请
|
||||
*
|
||||
|
@ -34,49 +34,70 @@ public class MapTrainModelVO {
|
||||
/**
|
||||
* 车长-- 米
|
||||
*/
|
||||
@ApiModelProperty(value = "车长")
|
||||
@ApiModelProperty(value = "车长/m")
|
||||
@NotNull(message = "车长不能为空")
|
||||
private Float length;
|
||||
|
||||
/**
|
||||
* 平均速度
|
||||
* 车重-- 吨
|
||||
*/
|
||||
@ApiModelProperty(value = "平均速度")
|
||||
@NotNull(message = "平均速度不能为空")
|
||||
private Float averageVelocity;
|
||||
@ApiModelProperty(value = "重量/t")
|
||||
@NotNull(message = "重量不能为空")
|
||||
private Float weight;
|
||||
|
||||
/**
|
||||
* 平均减速度
|
||||
* 车厢数量
|
||||
*/
|
||||
@ApiModelProperty(value = "平均减速度")
|
||||
@NotNull(message = "平均减速度不能为空")
|
||||
private Float averageDeceleration;
|
||||
|
||||
/**
|
||||
* 默认速度
|
||||
*/
|
||||
@ApiModelProperty(value = "默认速度")
|
||||
@NotNull(message = "默认速度不能为空")
|
||||
private Float defaultVelocity;
|
||||
|
||||
/**
|
||||
* 最大速度
|
||||
*/
|
||||
@ApiModelProperty(value = "最大速度")
|
||||
@NotNull(message = "最大速度不能为空")
|
||||
private Float maxVelocity;
|
||||
|
||||
/**
|
||||
* 安全运行距离(米)
|
||||
*/
|
||||
@ApiModelProperty(value = "安全运行距离,单位:米")
|
||||
@NotNull(message = "安全运行距离不能为空")
|
||||
private Float safeDistance;
|
||||
|
||||
/**
|
||||
* 安全运行距离上限(米)
|
||||
*/
|
||||
@ApiModelProperty(value = "安全运行距离上限,单位:米")
|
||||
@NotNull(message = "安全运行距离上限不能为空")
|
||||
private Float maxSafeDistance;
|
||||
@ApiModelProperty(value = "车厢数量")
|
||||
@NotNull(message = "车厢数量不能为空")
|
||||
private Integer numberOfCars;
|
||||
//
|
||||
// /**
|
||||
// * 车长-- 米
|
||||
// */
|
||||
// @ApiModelProperty(value = "车长")
|
||||
// @NotNull(message = "车长不能为空")
|
||||
// private Float length;
|
||||
//
|
||||
// /**
|
||||
// * 平均速度
|
||||
// */
|
||||
// @ApiModelProperty(value = "平均速度")
|
||||
// @NotNull(message = "平均速度不能为空")
|
||||
// private Float averageVelocity;
|
||||
//
|
||||
// /**
|
||||
// * 平均减速度
|
||||
// */
|
||||
// @ApiModelProperty(value = "平均减速度")
|
||||
// @NotNull(message = "平均减速度不能为空")
|
||||
// private Float averageDeceleration;
|
||||
//
|
||||
// /**
|
||||
// * 默认速度
|
||||
// */
|
||||
// @ApiModelProperty(value = "默认速度")
|
||||
// @NotNull(message = "默认速度不能为空")
|
||||
// private Float defaultVelocity;
|
||||
//
|
||||
// /**
|
||||
// * 最大速度
|
||||
// */
|
||||
// @ApiModelProperty(value = "最大速度")
|
||||
// @NotNull(message = "最大速度不能为空")
|
||||
// private Float maxVelocity;
|
||||
//
|
||||
// /**
|
||||
// * 安全运行距离(米)
|
||||
// */
|
||||
// @ApiModelProperty(value = "安全运行距离,单位:米")
|
||||
// @NotNull(message = "安全运行距离不能为空")
|
||||
// private Float safeDistance;
|
||||
//
|
||||
// /**
|
||||
// * 安全运行距离上限(米)
|
||||
// */
|
||||
// @ApiModelProperty(value = "安全运行距离上限,单位:米")
|
||||
// @NotNull(message = "安全运行距离上限不能为空")
|
||||
// private Float maxSafeDistance;
|
||||
}
|
||||
|
@ -105,6 +105,41 @@ public class RealLineConfigVO {
|
||||
*/
|
||||
private boolean adjustOperationAutomatically = true;
|
||||
|
||||
/**
|
||||
* 在办理车队进路前是否要先排列进路
|
||||
*/
|
||||
private boolean setRouteBeforeSetFlt = true;
|
||||
|
||||
/**
|
||||
* 在取消车队进路时同时取消进路
|
||||
*/
|
||||
private boolean cancelRouteWhenCancelFlt;
|
||||
|
||||
/**
|
||||
* 办理引导前需要信号机接近锁闭
|
||||
*/
|
||||
private boolean needApproachLockBeforeSetGuide = true;
|
||||
|
||||
// /**
|
||||
// * 站台指定列车跳停仅跳停一次
|
||||
// */
|
||||
// private boolean standSkipSetTrainOnlyOnce;
|
||||
|
||||
/**
|
||||
* 封锁命令(状态)仅在后备模式下有效
|
||||
*/
|
||||
private boolean blockadeCommandOnlyValidInStandbyMode;
|
||||
|
||||
/**
|
||||
* 道岔封锁命令需要初始化
|
||||
*/
|
||||
private boolean switchBlockadeCommandNeedInit;
|
||||
|
||||
/**
|
||||
* 计轴预复位前需要车站预复位
|
||||
*/
|
||||
private boolean stationPreResetBeforeAxlePreReset;
|
||||
|
||||
public static RealLineConfigVO parseJsonStr(String configData) {
|
||||
if (StringUtils.hasText(configData)) {
|
||||
return JsonUtils.read(configData, RealLineConfigVO.class);
|
||||
|
@ -239,12 +239,6 @@ public class MapStationNewVO {
|
||||
@ApiModelProperty(value = "引导总锁按钮坐标")
|
||||
private Point guideTotalLockPoint;
|
||||
|
||||
@ApiModelProperty("现地显示是否折行")
|
||||
private boolean foldLine;
|
||||
|
||||
@ApiModelProperty("折行偏移")
|
||||
private Point foldLineOffset;
|
||||
|
||||
public void addStand(MapStationStandNewVO standVO) {
|
||||
if(Objects.isNull(getStandList())) {
|
||||
this.standList = new ArrayList<>();
|
||||
|
@ -28,6 +28,11 @@ public class OrderCreateVO implements Serializable {
|
||||
|
||||
private Float price;
|
||||
|
||||
/**
|
||||
* 以分为单位的价格
|
||||
*/
|
||||
private Integer priceInCents;
|
||||
|
||||
private String payWays;
|
||||
|
||||
@NotBlank(message = "支付状态不能为空")
|
||||
@ -55,7 +60,9 @@ public class OrderCreateVO implements Serializable {
|
||||
public SaleOrder convert2DB() {
|
||||
SaleOrder saleOrder = new SaleOrder();
|
||||
saleOrder.setOrganizationId(organizationId);
|
||||
if (price != null) {
|
||||
if (priceInCents != null) {
|
||||
saleOrder.setPrice(priceInCents.longValue());
|
||||
} else if (price != null) {
|
||||
saleOrder.setPrice((long) (price * 100));
|
||||
}
|
||||
saleOrder.setPayWays(payWays);
|
||||
|
Loading…
Reference in New Issue
Block a user