语音识别结果修正内容增加

This commit is contained in:
joylink_zhangsai 2021-04-29 15:47:34 +08:00
parent 3f45fc1c8f
commit f9aa41c5bd
2 changed files with 73 additions and 55 deletions

View File

@ -52,7 +52,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("(调制)", "调至"));
replacementList.add(new Replacement("(时代丽|时代绿)", "首待令"));
replacementList.add(new Replacement("(绰号)", "做好"));
@ -70,7 +70,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("(会断|会短|回断)", "回段"));
replacementList.add(new Replacement("(清朝|请朝|请钞)", "请抄"));
replacementList.add(new Replacement("(请超链|请超龄)", "请抄令"));
@ -85,10 +85,16 @@ 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("(鼓掌|部长)", "故障"));
replacementList.add(new Replacement("(向凤)", "下放"));
replacementList.add(new Replacement("(向凤|下方)", "下放"));
replacementList.add(new Replacement("(占线|占先)", "站线"));
replacementList.add(new Replacement("(定为)", "定位"));
replacementList.add(new Replacement("(者搬迁)", "折返线"));
replacementList.add(new Replacement("(进入)", "进路"));
replacementList.add(new Replacement("(污点)", "无电"));
replacementList.add(new Replacement("(出轻)", "出清"));
replacementList.add(new Replacement("(抚慰)", "复位"));
//------------- 设备相关 --------------
replacementList.add(new Replacement("(宇花祭|玉花祭|雨化寨|氯化钙|绿化带|优化钙)", "鱼化寨"));
replacementList.add(new Replacement("(保税局)", "保税区"));
@ -124,6 +130,7 @@ public class SimulationVoiceHandler {
replacementList.add(new Replacement("(车站9)", "车站九"));
replacementList.add(new Replacement("(5爱3|我爱干|5爱站|5爱车|我爱他|吾爱插|我爱张|不爱张|我爱着|父爱站|我爱家|52战" +
"|於爱站|於2站|5Y站|Y站|外站|屋外站|不2战|不爱站|外传|5爱弹|污爱战|无爱站|吾隘站|无爱展|无爱占|无爱战|屋爱站)", "邬隘站"));
replacementList.add(new Replacement("(平安大道)", "民安大道"));
}
/**

View File

@ -1,8 +1,6 @@
package club.joylink.rtss.simulation.rt.CIL;
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
import club.joylink.rtss.simulation.Simulation;
import club.joylink.rtss.simulation.cbtc.data.map.Signal;
import club.joylink.rtss.simulation.rt.CIL.bo.*;
import club.joylink.rtss.simulation.rt.RtSimulation;
import club.joylink.rtss.simulation.rt.repo.*;
@ -190,6 +188,7 @@ public class CilRouteLogicService {
/**
* 排列进路接口包括办理冲突检查和选出延续保护及一些初始化工作
*
* @return 是否办理
*/
public boolean setRoute(RtSimulation rtSimulation, String routeId) {
@ -400,15 +399,19 @@ public class CilRouteLogicService {
}
}
} else {
lockRouteDevices(rtSimulation, cilRepository, cilRoute, commonRoute);
if (cilRoute.isCanAutoOpen()) {
lockRouteDevices(rtSimulation, cilRepository, cilRoute, commonRoute);
}
setLockingStateByInterlockCheck(cilRepository, cilRoute, commonRoute);
CilSignal cilSignal = cilRepository.getSignalById(commonRoute.getStart().getId());
updateSignalLevel(cilRepository, cilRoute, commonRoute, cilSignal);
try2OpenSignal4Route(rtSimulation, cilRoute, commonRoute, cilSignal, commonRoute.getSignalAspect());
monitorRoute(rtSimulation, commonRepository, cilRepository, cilSignal, commonRoute, cilRoute);
}
}
/**
* 监控进路目前只是信号显示
* 监控进路
*/
private void monitorRoute(RtSimulation rtSimulation, CommonRepository commonRepository, CilRepository cilRepository, CilSignal cilSignal, CommonRoute commonRoute, CilRoute cilRoute) {
//列车进入进路检查
@ -452,62 +455,58 @@ public class CilRouteLogicService {
TrackWay pathElement = commonRoute.getPathElement();
CommonSignal commonSignal = commonRoute.getStart();
CilSignal cilSignal = cilRepository.getSignalById(commonSignal.getId());
if (cilRoute.isCanAutoOpen()) { //2021-04-25 14:47:06 这个判断条件可能不合理能自动开放信号就应该尝试锁闭进路相关的设备吗
// 进路内的设备转动锁闭
if (!cilRoute.isLock()) {
cilSwitchLogicService.tryTurn(rtSimulation, pathElement.getSpList()); // 转动道岔
boolean allLock = try2RouteLockSwitches(cilRepository, cilRoute.getId(), pathElement.getSpList()); // 锁闭道岔
if (allLock) {
// 进路内的设备转动锁闭
if (!cilRoute.isLock()) {
cilSwitchLogicService.tryTurn(rtSimulation, pathElement.getSpList()); // 转动道岔
boolean allLock = try2RouteLockSwitches(cilRepository, cilRoute.getId(), pathElement.getSpList()); // 锁闭道岔
if (allLock) {
// if (!config.isLockFirst()) {
routeLockSections(cilRepository, commonRoute);
routeLockSections(cilRepository, commonRoute);
// }
}
}
// 侧防设备转动锁闭
List<CommonFls> flsList = commonRoute.getFlsList();
if (!CollectionUtils.isEmpty(flsList)) { //进路侧防不为空
if (!cilRoute.isFl()) { //进路未侧防锁闭
for (CommonFls commonFls : flsList) {
SwitchPosition target = commonFls.getTarget();
if (commonRoute.getPathElement().isContainSwitchPosition(target.getCommonSwitch().getId(), target.isNormal())) { //进路包含侧防所防护的道岔位置
List<CommonFls.FlsElement> firstLevelList = commonFls.getFirstLevelList();
for (CommonFls.FlsElement commonFlsElement : firstLevelList) {
//侧防道岔转动
cilSwitchLogicService.tryTurn(rtSimulation, cilRepository, commonFlsElement.getPp().getCommonSwitch(), commonFlsElement.getPp().getPosition());
cilSwitchLogicService.tryTurn(rtSimulation, cilRepository, commonFlsElement.getPae().getCommonSwitch(), commonFlsElement.getPae().getPosition());
//侧防设备锁闭
commonFlsElement.lock(cilRepository);
}
}
// 侧防设备转动锁闭
List<CommonFls> flsList = commonRoute.getFlsList();
if (!CollectionUtils.isEmpty(flsList)) { //进路侧防不为空
if (!cilRoute.isFl()) { //进路未侧防锁闭
for (CommonFls commonFls : flsList) {
SwitchPosition target = commonFls.getTarget();
if (commonRoute.getPathElement().isContainSwitchPosition(target.getCommonSwitch().getId(), target.isNormal())) { //进路包含侧防所防护的道岔位置
List<CommonFls.FlsElement> firstLevelList = commonFls.getFirstLevelList();
for (CommonFls.FlsElement commonFlsElement : firstLevelList) {
//侧防道岔转动
cilSwitchLogicService.tryTurn(rtSimulation, cilRepository, commonFlsElement.getPp().getCommonSwitch(), commonFlsElement.getPp().getPosition());
cilSwitchLogicService.tryTurn(rtSimulation, cilRepository, commonFlsElement.getPae().getCommonSwitch(), commonFlsElement.getPae().getPosition());
//侧防设备锁闭
commonFlsElement.lock(cilRepository);
}
}
}
}
// 延续保护设备转动锁闭
CilOverlap overlap = cilRoute.getOverlap();
if (overlap != null) {
CommonOverlap commonOverlap = commonRoute.getOverlap();
if (!cilRoute.isOl()) {
TrackWay selectedPath = overlap.getSelectedPath();
if (selectedPath != null) {
cilSwitchLogicService.tryTurn(rtSimulation, selectedPath.getSpList());
boolean allSwitchesLocked = try2OverlapLockSwitches(cilRepository, overlap, pathElement.getSpList()); // 锁闭道岔
if (allSwitchesLocked) {
}
// 延续保护设备转动锁闭
CilOverlap overlap = cilRoute.getOverlap();
if (overlap != null) {
CommonOverlap commonOverlap = commonRoute.getOverlap();
if (!cilRoute.isOl()) {
TrackWay selectedPath = overlap.getSelectedPath();
if (selectedPath != null) {
cilSwitchLogicService.tryTurn(rtSimulation, selectedPath.getSpList());
boolean allSwitchesLocked = try2OverlapLockSwitches(cilRepository, overlap, pathElement.getSpList()); // 锁闭道岔
if (allSwitchesLocked) {
// if (!config.isLockFirst()) {
overlapLockSections(cilRepository, commonOverlap.getStart().isRight(), overlap.getSelectedPath().getSectionList());
overlapLockSections(cilRepository, commonOverlap.getStart().isRight(), overlap.getSelectedPath().getSectionList());
// }
}
}
}
}
}
//检查联锁条件并设置对应锁闭状态
cilRoute.setLock(isRoutePassInterlockingCheck(cilRepository, commonRoute));
if (!CollectionUtils.isEmpty(commonRoute.getFlsList())) {
cilRoute.setFl(isFlsPassInterlockingCheck(cilRepository, commonRoute));
}
if (cilRoute.getOverlap() != null && cilRoute.getOverlap().getSelectedPath() != null) {
cilRoute.setFl(isOverlapPassInterlockingCheck(cilRepository, commonRoute, cilRoute.getOverlap()));
}
}
/**
* 根据进路状态判断信号级别
*/
private void updateSignalLevel(CilRepository cilRepository, CilRoute cilRoute, CommonRoute commonRoute, CilSignal cilSignal) {
//判断信号级别
if (cilRoute.isLock()) {
if (cilRoute.isFl() || CollectionUtils.isEmpty(commonRoute.getFlsList())) {
@ -520,7 +519,7 @@ public class CilRouteLogicService {
cilSignal.updateLevel(CilSignal.LEVEL_2);
}
} else {
if (commonRoute.getPathElement().getSpList().stream().allMatch(sp->cilRepository.getSwitchById(sp.getCommonSwitch().getId()).isMgl())) {
if (commonRoute.getPathElement().getSpList().stream().allMatch(sp -> cilRepository.getSwitchById(sp.getCommonSwitch().getId()).isMgl())) {
cilSignal.updateLevel(CilSignal.LEVEL_2);
} else {
cilSignal.updateLevel(CilSignal.LEVEL_1);
@ -528,6 +527,20 @@ public class CilRouteLogicService {
}
}
/**
* 根据联锁检查结果设置锁闭状态
*/
private void setLockingStateByInterlockCheck(CilRepository cilRepository, CilRoute cilRoute, CommonRoute commonRoute) {
//检查联锁条件并设置对应锁闭状态
cilRoute.setLock(isRoutePassInterlockingCheck(cilRepository, commonRoute));
if (!CollectionUtils.isEmpty(commonRoute.getFlsList())) {
cilRoute.setFl(isFlsPassInterlockingCheck(cilRepository, commonRoute));
}
if (cilRoute.getOverlap() != null && cilRoute.getOverlap().getSelectedPath() != null) {
cilRoute.setFl(isOverlapPassInterlockingCheck(cilRepository, commonRoute, cilRoute.getOverlap()));
}
}
/**
* 进路是否能通过联锁检查
*/
@ -638,9 +651,7 @@ public class CilRouteLogicService {
if (!CollectionUtils.isEmpty(switchPositionList)) {
for (SwitchPosition switchPosition : switchPositionList) {
CilSwitch cilSwitch = cilRepository.getSwitchById(switchPosition.getCommonSwitch().getId());
if (cilSwitch.getPosition() != switchPosition.getPosition()) {
flag = false;
} else {
if (!cilSwitch.isRouteLockOnPosition(routeId, switchPosition.getPosition())) {
cilSwitch.lockByRoute(routeId);
}
}