新增:设置ARB故障
This commit is contained in:
parent
eddd0171b7
commit
2339952cae
@ -185,6 +185,13 @@ public class AtpSectionService {
|
||||
section.judgeAsInvalid();
|
||||
}
|
||||
}
|
||||
//ARB故障判定
|
||||
if (Section.AxleFault.ARB.equals(section.getFault())) {
|
||||
section.setInvalid(true);
|
||||
for (Section logic : section.getLogicList()) {
|
||||
logic.setInvalid(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -132,7 +132,7 @@ public class ZCLogicLoop {
|
||||
}
|
||||
//非通信车占用区段
|
||||
if (section.isNonCbtcOccupy()) {
|
||||
endList.add(new MovementAuthority.End(section, MovementAuthority.EndType.NCT_OCCUPIED_IN_FRONT_OF_SECTION));
|
||||
endList.add(new MovementAuthority.End(section, MovementAuthority.EndType.NCT_OCCUPIED_SECTION));
|
||||
return endList;
|
||||
}
|
||||
int count = 0;
|
||||
@ -182,7 +182,7 @@ public class ZCLogicLoop {
|
||||
if (temp.isNonCbtcOccupy()) {
|
||||
SectionPosition headPosition1 = train.getHeadPosition();
|
||||
if (!temp.isSamePhysical(headPosition1.getSection().getCode())) {
|
||||
endList.add(new MovementAuthority.End(temp, MovementAuthority.EndType.NCT_OCCUPIED_IN_FRONT_OF_SECTION));
|
||||
endList.add(new MovementAuthority.End(temp, MovementAuthority.EndType.NCT_OCCUPIED_SECTION));
|
||||
}
|
||||
}
|
||||
//检查关闭的区段
|
||||
@ -283,11 +283,14 @@ public class ZCLogicLoop {
|
||||
Section section = headPosition.getSection();
|
||||
int count = 0;
|
||||
while (Objects.nonNull(section) && count < 20) {
|
||||
if (count > 1 && !CollectionUtils.isEmpty(endList))
|
||||
break;
|
||||
++count;
|
||||
// 信号机
|
||||
MovementAuthority.End signalEnd = checkGroundSignal(section, right);
|
||||
if (Objects.nonNull(signalEnd)) {
|
||||
deviceEnd = signalEnd;
|
||||
endList.add(signalEnd);
|
||||
// deviceEnd = signalEnd;
|
||||
break;
|
||||
}
|
||||
// 轨道尽头/问题道岔
|
||||
@ -295,15 +298,24 @@ public class ZCLogicLoop {
|
||||
if (Objects.isNull(temp)) { // 到尽头
|
||||
if (section.isSwitchTrack()) { // 问题道岔
|
||||
if (Objects.nonNull(section.getSectionOf(!right))) {
|
||||
deviceEnd = new MovementAuthority.End(section.getSectionOf(!right),
|
||||
MovementAuthority.EndType.FAULT_SWITCH);
|
||||
endList.add(new MovementAuthority.End(section.getSectionOf(!right),
|
||||
MovementAuthority.EndType.FAULT_SWITCH));
|
||||
// deviceEnd = new MovementAuthority.End(section.getSectionOf(!right),
|
||||
// MovementAuthority.EndType.FAULT_SWITCH);
|
||||
}
|
||||
} else {
|
||||
deviceEnd = new MovementAuthority.End(section,
|
||||
MovementAuthority.EndType.END_TRACK);
|
||||
endList.add(new MovementAuthority.End(section,
|
||||
MovementAuthority.EndType.END_TRACK));
|
||||
// deviceEnd = new MovementAuthority.End(section,
|
||||
// MovementAuthority.EndType.END_TRACK);
|
||||
}
|
||||
break;
|
||||
}
|
||||
// else {
|
||||
// if (temp.isNonCbtcOccupy() && temp.isInvalid()) {
|
||||
// endList.add(new MovementAuthority.End(temp, MovementAuthority.EndType.NCT_OCCUPIED_SECTION));
|
||||
// }
|
||||
// }
|
||||
section = temp;
|
||||
}
|
||||
if (Objects.nonNull(deviceEnd)) {
|
||||
|
@ -12,6 +12,7 @@ import lombok.Setter;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@ -1109,6 +1110,56 @@ public class Section extends MayOutOfOrderDevice {
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
ARB {
|
||||
@Override
|
||||
public boolean apply(MayOutOfOrderDevice device) {
|
||||
Section section = (Section) device;
|
||||
List<Section> sections;
|
||||
if (!section.isAxleCounter()) {
|
||||
if (section.getParent() != null && section.getParent().isAxleCounter()) {
|
||||
sections = Collections.singletonList(section.getParent());
|
||||
} else if (!CollectionUtils.isEmpty(section.getLogicList())) {
|
||||
sections = section.getLogicList();
|
||||
} else {
|
||||
sections = new ArrayList<>();
|
||||
}
|
||||
} else {
|
||||
sections = Collections.singletonList(section);
|
||||
}
|
||||
boolean flag = false;
|
||||
for (Section axleSection : sections) {
|
||||
if (axleSection.isAxleCounter() && !this.equals(axleSection.getFault())) {
|
||||
flag = true;
|
||||
axleSection.setFault(this);
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fix(MayOutOfOrderDevice device) {
|
||||
Section section = (Section) device;
|
||||
List<Section> sections;
|
||||
if (!section.isAxleCounter()) {
|
||||
if (section.getParent() != null && section.getParent().isAxleCounter()) {
|
||||
sections = Collections.singletonList(section.getParent());
|
||||
} else if (!CollectionUtils.isEmpty(section.getLogicList())) {
|
||||
sections = section.getLogicList();
|
||||
} else {
|
||||
sections = new ArrayList<>();
|
||||
}
|
||||
} else {
|
||||
sections = Collections.singletonList(section);
|
||||
}
|
||||
boolean flag = false;
|
||||
for (Section axleSection : sections) {
|
||||
if (this.equals(axleSection.getFault())) {
|
||||
axleSection.setFault(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -5,7 +5,6 @@ import club.joylink.rtss.simulation.cbtc.data.CalculateService;
|
||||
import club.joylink.rtss.simulation.cbtc.data.map.MapNamedElement;
|
||||
import club.joylink.rtss.simulation.cbtc.data.map.Section;
|
||||
import club.joylink.rtss.simulation.cbtc.data.map.Signal;
|
||||
import club.joylink.rtss.simulation.cbtc.data.map.Stand;
|
||||
import club.joylink.rtss.simulation.cbtc.data.vr.VirtualRealityTrain;
|
||||
import club.joylink.rtss.simulation.cbtc.exception.SimulationException;
|
||||
import club.joylink.rtss.simulation.cbtc.exception.SimulationExceptionType;
|
||||
@ -153,7 +152,7 @@ public class MovementAuthority {
|
||||
// float offset = right ? 0 : baseSection.getLen();
|
||||
// return new SectionPosition(baseSection, offset);
|
||||
// }
|
||||
case NCT_OCCUPIED_IN_FRONT_OF_SECTION:{
|
||||
case NCT_OCCUPIED_SECTION:{
|
||||
Section section = (Section) this.device;
|
||||
Section previous = section.getNextRunningSectionOf(!right);
|
||||
float offset = right ? 0 : previous.getLen();
|
||||
@ -213,9 +212,9 @@ public class MovementAuthority {
|
||||
UNLOCKED_OVERLAP,
|
||||
UNLOCK_SECTION,
|
||||
/**
|
||||
* 区段前方有非通信车占用
|
||||
* 非通信车占用区段
|
||||
*/
|
||||
NCT_OCCUPIED_IN_FRONT_OF_SECTION,
|
||||
NCT_OCCUPIED_SECTION,
|
||||
/**
|
||||
* 故障区段
|
||||
*/
|
||||
|
@ -602,6 +602,8 @@ public class VirtualRealityTrain extends VirtualRealityDevice {
|
||||
}
|
||||
|
||||
public void updateTBForce(float fk, float fb) {
|
||||
if (isEB())
|
||||
return;
|
||||
if (Fault.DRIVE_FAULT.equals(fault) && fk > 0) {
|
||||
return;
|
||||
}
|
||||
@ -983,7 +985,7 @@ public class VirtualRealityTrain extends VirtualRealityDevice {
|
||||
* 设置紧急制动的功率和制动力
|
||||
*/
|
||||
public void emergencyBreak() {
|
||||
updateTBForce(0, 350);
|
||||
enforceUpdateTBForce(0, 350);
|
||||
}
|
||||
|
||||
@Getter
|
||||
|
@ -21,12 +21,10 @@ 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.*;
|
||||
import java.util.concurrent.atomic.AtomicLong;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* 仿真机器人逻辑循环
|
||||
@ -110,8 +108,11 @@ public class RobotLogicLoop {
|
||||
switch (train.getDriveMode()) {
|
||||
case AM:
|
||||
case CM:
|
||||
Float recommendedSpeedMax = Stream.of(train.getAtpSpeedMax(), train.getSpeedLimit() * 0.9f, train.getAtoSpeedMax())
|
||||
.min(Comparator.comparingDouble(Float::doubleValue)).get();
|
||||
distance = ATOService.calculateTargetRemainDistance(train, train.getMa());
|
||||
speedCurve = SpeedCurve.buildTargetSpeedCurve(headPosition, tailPosition, right,
|
||||
distance, speed, Math.min(train.getAtpSpeedMax(), train.getSpeedLimit()) * 0.9f);
|
||||
distance, speed, recommendedSpeedMax);
|
||||
break;
|
||||
case RM:
|
||||
speedCurve = SpeedCurve.buildTargetSpeedCurve(headPosition, tailPosition, right,
|
||||
|
Loading…
Reference in New Issue
Block a user