【大铁发车行驶至目标地区时,判断是否可以继续行驶】

【行车日志初始化BUG修复】
【行车计划修改日期报错修改】
This commit is contained in:
weizhihong 2022-07-06 17:15:04 +08:00
parent 40e94ba1a8
commit fed97fa2a6
4 changed files with 16 additions and 4 deletions

View File

@ -72,7 +72,8 @@ public class CtcZoneOperateHandler {
*/ */
@OperateHandlerMapping(type = Operation.Type.CTC_ZONE_SAVE_PLAN_TIME) @OperateHandlerMapping(type = Operation.Type.CTC_ZONE_SAVE_PLAN_TIME)
public CtcRunPlanParam savePlanTime(Simulation simulation, String stationCode, String runPlanCode, String planTime, StationDirection.ReceiveAndDeliverModel model) { public CtcRunPlanParam savePlanTime(Simulation simulation, String stationCode, String runPlanCode, String planTime, StationDirection.ReceiveAndDeliverModel model) {
return ctcZoneService.savePlanTime(simulation, stationCode, runPlanCode, LocalDateTime.parse(planTime), model); LocalDateTime t = LocalDateTime.parse(planTime.replace(" ", "T"));
return ctcZoneService.savePlanTime(simulation, stationCode, runPlanCode, t, model);
} }
/** /**

View File

@ -373,7 +373,8 @@ public class CTCLogicLoop {
changeMap.put(k, Boolean.TRUE); changeMap.put(k, Boolean.TRUE);
} }
}); });
if (!Objects.equals(simulation.getCtcRepository().isRunPlanSendOut(), changeMap.isEmpty())) { // 为空时
if (!Objects.equals(simulation.getCtcRepository().getRunPlanSendOut(), changeMap.isEmpty()) || !changeMap.isEmpty()) {
simulation.getCtcRepository().setRunPlanSendOut(changeMap.isEmpty()); simulation.getCtcRepository().setRunPlanSendOut(changeMap.isEmpty());
sendCtcMessage(simulation.getId(), changeMap, WebSocketMessageType.SIMULATION_CTC_RUN_PLAN_CONFIRM_SEND sendCtcMessage(simulation.getId(), changeMap, WebSocketMessageType.SIMULATION_CTC_RUN_PLAN_CONFIRM_SEND
, simulation.getSimulationUserIds()); , simulation.getSimulationUserIds());

View File

@ -95,7 +95,7 @@ public class CtcRepository {
/** /**
* 是否需要发送计划消息 * 是否需要发送计划消息
*/ */
private boolean runPlanSendOut; private Boolean runPlanSendOut;
/******************************************* 以上为车站终端数据:车站为单位 *******************************************/ /******************************************* 以上为车站终端数据:车站为单位 *******************************************/
/** /**
@ -126,6 +126,7 @@ public class CtcRepository {
this.ctcZoneRepository.reset(); this.ctcZoneRepository.reset();
this.ctcEffectRepository.reset(); this.ctcEffectRepository.reset();
this.ctcManageRepository.reset(); this.ctcManageRepository.reset();
this.runPlanSendOut = null;
// this.runPlanStatusVOMap.clear(); // this.runPlanStatusVOMap.clear();
this.allRunPlanList.clear(); this.allRunPlanList.clear();
this.simulationRunPlanMap.clear(); this.simulationRunPlanMap.clear();

View File

@ -577,7 +577,16 @@ public class CommandBO {
List<Step> steps = command.getStepByType(Step.StepType.DRIVE); List<Step> steps = command.getStepByType(Step.StepType.DRIVE);
Step driveStep = steps.get(0); Step driveStep = steps.get(0);
if (train.isStopAtThePosition(driveStep.getTargetPosition())) { //如果列车已经停到目标位置 if (train.isStopAtThePosition(driveStep.getTargetPosition())) { //如果列车已经停到目标位置
boolean isRight = train.isRight(); // 列车运行方向
Section section = train.getHeadPosition().getSection(); // 列车车头所在区段
Section targetSection = getTargetSection(isRight, section);
if (Objects.equals(section, targetSection)) {
command.getTargetMember().setCommand(null); command.getTargetMember().setCommand(null);
} else {
SectionPosition targetPosition = new SectionPosition(targetSection, targetSection.getStopPointByDirection(isRight));
driveStep.setTargetPosition(targetPosition);
return driveStep;
}
} else { } else {
return driveStep; return driveStep;
} }