实训修改
This commit is contained in:
parent
32972e5697
commit
a6cae4e14c
@ -138,7 +138,7 @@ public interface GeneratorNew {
|
||||
}
|
||||
stepVO.setTip(replacePlaceholder(stepVO.getTip(), placeholderVOMap, Objects.isNull(operSignal) ? mapDevice : operSignal,null, simulation.getBuildParams().getMap()));
|
||||
} else {
|
||||
stepVO.setTip(replacePlaceholder(stepVO.getTip(), placeholderVOMap, mapDevice, null,simulation.getBuildParams().getMap()));
|
||||
stepVO.setTip(replacePlaceholder(stepVO.getTip(), placeholderVOMap, mapDevice, mapButton,simulation.getBuildParams().getMap()));
|
||||
}
|
||||
}
|
||||
if (containPlaceholder(stepVO.getVal())) {
|
||||
|
@ -6,7 +6,6 @@ import club.joylink.rtss.services.training.generatornew.annotation.GeneratorSele
|
||||
import club.joylink.rtss.simulation.cbtc.ATS.operation.Operation;
|
||||
import club.joylink.rtss.simulation.cbtc.Simulation;
|
||||
import club.joylink.rtss.simulation.cbtc.data.map.Section;
|
||||
import club.joylink.rtss.simulation.cbtc.data.map.Switch;
|
||||
import club.joylink.rtss.vo.client.OperateDefinitionVO;
|
||||
import club.joylink.rtss.vo.client.training.TrainingNewVO;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
@ -28,7 +27,7 @@ public class SectionGeneratorNew implements GeneratorNew {
|
||||
if (section.isSwitchTrack() || section.isSwitchAxleCounterSection() || section.isLogicSection()) { // 道岔区段不生成
|
||||
continue;
|
||||
}
|
||||
switch (Operation.Type.valueOf (operateDefinitionVO.getOperateType())) {
|
||||
switch (Operation.Type.valueOf(operateDefinitionVO.getOperateType())) {
|
||||
case Section_Cut_Off:
|
||||
case Section_Block:
|
||||
case Section_Set_Limit_Speed:
|
||||
@ -91,157 +90,10 @@ public class SectionGeneratorNew implements GeneratorNew {
|
||||
// 其他操作,不生成
|
||||
continue;
|
||||
}
|
||||
trainingVOList.add(this.build(config, simulation, section,null, operateDefinitionVO));
|
||||
trainingVOList.add(this.build(config, simulation, section, null, operateDefinitionVO));
|
||||
// 仿真重置
|
||||
simulation.reset();
|
||||
}
|
||||
return trainingVOList;
|
||||
}
|
||||
|
||||
protected TrainingNewVO sectionUnlock(Section section, GenerateConfig config, Simulation simulation,
|
||||
OperateDefinitionVO operateDefinitionVO) {
|
||||
//设置故障
|
||||
section.setFaultLock(true);
|
||||
section.setOverlapLock(true);
|
||||
section.setRouteLock(true);
|
||||
// settingDirectly(simulation, route);
|
||||
TrainingNewVO build = build(config, simulation, section,null, operateDefinitionVO);
|
||||
|
||||
//恢复背景
|
||||
section.setFaultLock(false);
|
||||
section.setOverlapLock(false);
|
||||
section.setRouteLock(false);
|
||||
|
||||
return build;
|
||||
}
|
||||
|
||||
protected TrainingNewVO sectionCutOff(Section section, GenerateConfig config, Simulation simulation,
|
||||
OperateDefinitionVO operateDefinitionVO) {
|
||||
// 无背景
|
||||
return build(config, simulation, section, null,operateDefinitionVO);
|
||||
}
|
||||
|
||||
protected TrainingNewVO sectionActive(Section section, GenerateConfig config, Simulation simulation,
|
||||
OperateDefinitionVO operateDefinitionVO) {
|
||||
// 区段切除
|
||||
if (section.isPhysical()) {
|
||||
section.setCutOff(true);
|
||||
if (section.isShowLogic()) { //有逻辑区段
|
||||
section.getLogicList().forEach(lc -> lc.setCutOff(true));
|
||||
}
|
||||
} else {
|
||||
Section parentSection = section.getParent();
|
||||
parentSection.setCutOff(true);
|
||||
parentSection.getLogicList().forEach(ls -> ls.setCutOff(true));
|
||||
}
|
||||
TrainingNewVO build = build(config, simulation, section,null, operateDefinitionVO);
|
||||
// 区段切除
|
||||
if(section.isPhysical()){
|
||||
section.setCutOff(true);
|
||||
if(section.isShowLogic()){ //有逻辑区段
|
||||
section.getLogicList().forEach(lc->lc.setCutOff(true));
|
||||
}
|
||||
}else{
|
||||
Section parentSection = section.getParent();
|
||||
parentSection.setCutOff(true);
|
||||
parentSection.getLogicList().forEach(ls->ls.setCutOff(true));
|
||||
}
|
||||
|
||||
return build;
|
||||
}
|
||||
|
||||
protected TrainingNewVO sectionAxisPreReset(Section section, GenerateConfig config, Simulation simulation,
|
||||
OperateDefinitionVO operateDefinitionVO) {
|
||||
// 设置故障
|
||||
// TODO
|
||||
return build(config, simulation, section,null, operateDefinitionVO);
|
||||
}
|
||||
|
||||
protected TrainingNewVO sectionBlock(Section section, GenerateConfig config, Simulation simulation,
|
||||
OperateDefinitionVO operateDefinitionVO) {
|
||||
// 无背景
|
||||
return build(config, simulation, section,null, operateDefinitionVO);
|
||||
}
|
||||
|
||||
protected TrainingNewVO sectionUnblock(Section section, GenerateConfig config, Simulation simulation,
|
||||
OperateDefinitionVO operateDefinitionVO) {
|
||||
// 区段封锁
|
||||
section.setRouteLock(false);
|
||||
section.setOverlapLock(false);
|
||||
if (Objects.nonNull(section.getParent())) { // 取计轴区段
|
||||
Section sectionParent = section.getParent();
|
||||
sectionParent.setBlockade(true);
|
||||
if (!CollectionUtils.isEmpty(sectionParent.getLogicList())) {
|
||||
sectionParent.getLogicList().forEach(logic -> logic.setBlockade(true));
|
||||
}
|
||||
}
|
||||
// sectionService.blockade(section);
|
||||
TrainingNewVO build = build(config, simulation, section,null, operateDefinitionVO);
|
||||
|
||||
section.setBlockade(false);
|
||||
if (Objects.nonNull(section.getParent())) { // 取计轴区段
|
||||
Section sectionParent = section.getParent();
|
||||
sectionParent.setBlockade(true);
|
||||
if (!CollectionUtils.isEmpty(sectionParent.getLogicList())) {
|
||||
sectionParent.getLogicList().forEach(logic -> logic.setBlockade(true));
|
||||
}
|
||||
}
|
||||
return build;
|
||||
}
|
||||
|
||||
protected TrainingNewVO sectionSetSpeedLimit(Section section, GenerateConfig config, Simulation simulation,
|
||||
OperateDefinitionVO operateDefinitionVO) {
|
||||
// 设置背景
|
||||
if (section.isSwitchTrack()) {
|
||||
Switch relSwitch = section.getRelSwitch();
|
||||
relSwitch.setSpeedUpperLimit(-1);
|
||||
} else if (section.isLogicSection()) {
|
||||
section.getParent().setSpeedUpLimit(-1);
|
||||
} else {
|
||||
section.setSpeedUpLimit(-1);
|
||||
}
|
||||
TrainingNewVO build = build(config, simulation, section, null,operateDefinitionVO);
|
||||
|
||||
// 区段设置限速
|
||||
if (section.isSwitchTrack()) {
|
||||
Switch relSwitch = section.getRelSwitch();
|
||||
relSwitch.setSpeedUpperLimit(LIMITED_SPEED);
|
||||
} else if (section.isLogicSection()) {
|
||||
section.getParent().setSpeedUpLimit(LIMITED_SPEED);
|
||||
} else {
|
||||
section.setSpeedUpLimit(LIMITED_SPEED);
|
||||
}
|
||||
|
||||
return build;
|
||||
}
|
||||
|
||||
protected TrainingNewVO sectionCancelSpeedLimit(Section section, GenerateConfig config, Simulation simulation,
|
||||
OperateDefinitionVO operateDefinitionVO) {
|
||||
// 区段设置限速
|
||||
if (section.isSwitchTrack()) {
|
||||
Switch relSwitch = section.getRelSwitch();
|
||||
relSwitch.setSpeedUpperLimit(LIMITED_SPEED);
|
||||
} else if (section.isLogicSection()) {
|
||||
section.getParent().setSpeedUpLimit(LIMITED_SPEED);
|
||||
} else {
|
||||
section.setSpeedUpLimit(LIMITED_SPEED);
|
||||
}
|
||||
TrainingNewVO build = build(config, simulation, section, null,operateDefinitionVO);
|
||||
|
||||
if (section.isSwitchTrack()) {
|
||||
Switch relSwitch = section.getRelSwitch();
|
||||
relSwitch.setSpeedUpperLimit(-1);
|
||||
} else if (section.isLogicSection()) {
|
||||
section.getParent().setSpeedUpLimit(-1);
|
||||
} else {
|
||||
section.setSpeedUpLimit(-1);
|
||||
}
|
||||
return build;
|
||||
}
|
||||
|
||||
protected TrainingNewVO sectionDetail(Section section, GenerateConfig config, Simulation simulation, OperateDefinitionVO operateDefinitionVO) {
|
||||
//区段详情
|
||||
return build(config, simulation, section, null,operateDefinitionVO);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -81,7 +81,7 @@ public class OperateStepVO {
|
||||
private String tip;
|
||||
|
||||
/**
|
||||
* 步骤提示信息
|
||||
* 步骤指定设备
|
||||
*/
|
||||
@ApiModelProperty(value = "所需code类型")
|
||||
private String codeType;
|
||||
|
Loading…
Reference in New Issue
Block a user