This commit is contained in:
xiazengbin 2022-08-01 13:41:29 +08:00
commit 9ec80abc27
5 changed files with 22 additions and 19 deletions

View File

@ -1123,8 +1123,8 @@ public class VirtualRealityTrain extends VirtualRealityDevice {
/** /**
* 获取一个非null的限速值计算限速时更方便 * 获取一个非null的限速值计算限速时更方便
*/ */
public float getNonNullSpeedLimit() { public float getSpeedLimitInMs() {
return robotDriveParam.getNonNullSpeedLimit(); return robotDriveParam.getSpeedLimitInMs();
} }
public void setSpeedLimit(float v) { public void setSpeedLimit(float v) {

View File

@ -197,9 +197,9 @@ public class SrTrainServiceImpl implements UDPRealDeviceService {
} else { } else {
float recommendedSpeedMax; float recommendedSpeedMax;
if (train.isRMMode()) { if (train.isRMMode()) {
recommendedSpeedMax = Math.min(repository.getConfig().getRmAtpSpeed(), train.getNonNullSpeedLimit()) * 0.9f; recommendedSpeedMax = Math.min(repository.getConfig().getRmAtpSpeed(), train.getSpeedLimitInMs()) * 0.9f;
} else if (train.isNRMMode()) { } else if (train.isNRMMode()) {
recommendedSpeedMax = Math.min(repository.getConfig().getUrmAtpSpeed(), train.getNonNullSpeedLimit()) * 0.9f; recommendedSpeedMax = Math.min(repository.getConfig().getUrmAtpSpeed(), train.getSpeedLimitInMs()) * 0.9f;
} else { } else {
recommendedSpeedMax = 0; recommendedSpeedMax = 0;
} }

View File

@ -458,11 +458,11 @@ public class SimulationRobotService {
break; break;
case RM: case RM:
speedCurve = SpeedCurve.buildTargetSpeedCurve(headPosition, tailPosition, right, speedCurve = SpeedCurve.buildTargetSpeedCurve(headPosition, tailPosition, right,
distance, speed, Math.min(repository.getConfig().getRmAtpSpeed(), train.getNonNullSpeedLimit()) * 0.9f); distance, speed, Math.min(repository.getConfig().getRmAtpSpeed(), train.getSpeedLimitInMs()) * 0.9f);
break; break;
case NRM: case NRM:
speedCurve = SpeedCurve.buildTargetSpeedCurve(headPosition, tailPosition, right, speedCurve = SpeedCurve.buildTargetSpeedCurve(headPosition, tailPosition, right,
distance, speed, Math.min(repository.getConfig().getUrmAtpSpeed(), train.getNonNullSpeedLimit()) * 0.9f); distance, speed, Math.min(repository.getConfig().getUrmAtpSpeed(), train.getSpeedLimitInMs()) * 0.9f);
break; break;
default: default:
return; return;

View File

@ -4,6 +4,7 @@ import club.joylink.rtss.simulation.cbtc.constant.SignalAspect;
import club.joylink.rtss.simulation.cbtc.data.map.Signal; import club.joylink.rtss.simulation.cbtc.data.map.Signal;
import club.joylink.rtss.simulation.cbtc.data.support.SectionPosition; import club.joylink.rtss.simulation.cbtc.data.support.SectionPosition;
import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.AccessLevel;
import lombok.Getter; import lombok.Getter;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import lombok.Setter; import lombok.Setter;
@ -16,10 +17,17 @@ import lombok.Setter;
@NoArgsConstructor @NoArgsConstructor
public class DriveParamVO { public class DriveParamVO {
/** /**
* 限速值 * 限速值km/h
*/ */
private Float speedLimit; private Float speedLimit;
/**
* 限速值m/s
*/
@JsonIgnore
@Setter(value = AccessLevel.NONE)
private float speedLimitInMs = Float.MAX_VALUE;
/** /**
* 下令停车优先级比运行高 * 下令停车优先级比运行高
*/ */
@ -47,27 +55,32 @@ public class DriveParamVO {
* 越过信号机 * 越过信号机
*/ */
private int through; private int through;
public static final int NO = 0; public static final int NO = 0;
public static final int RED_SIGNAL = 1; public static final int RED_SIGNAL = 1;
public static final int GUIDE_SIGNAL = 2; public static final int GUIDE_SIGNAL = 2;
/** /**
* 要越过的信号机 * 要越过的信号机
*/ */
@JsonIgnore @JsonIgnore
private Signal throughSignal; private Signal throughSignal;
/** /**
* 要越过的信号 * 要越过的信号
*/ */
@JsonIgnore @JsonIgnore
private SignalAspect throughSignalAspect; private SignalAspect throughSignalAspect;
/** /**
* 解除EB目的是在且仅在每次进行驾驶操作后自动缓解当时存在的EB * 解除EB目的是在且仅在每次进行驾驶操作后自动缓解当时存在的EB
*/ */
@JsonIgnore @JsonIgnore
private boolean releaseEB = true; private boolean releaseEB = true;
public void setSpeedLimit(Float speedLimit) {
this.speedLimit = speedLimit;
this.speedLimitInMs = speedLimit == null ? Float.MAX_VALUE : speedLimit / 3.6f;
}
public boolean needStop() { public boolean needStop() {
return stop; return stop;
} }
@ -93,9 +106,4 @@ public class DriveParamVO {
public boolean isThroughGuideSignal() { public boolean isThroughGuideSignal() {
return GUIDE_SIGNAL == through; return GUIDE_SIGNAL == through;
} }
@JsonIgnore
public float getNonNullSpeedLimit() {
return speedLimit == null ? Float.MAX_VALUE : speedLimit;
}
} }

View File

@ -5,8 +5,6 @@ import lombok.Getter;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import lombok.Setter; import lombok.Setter;
import java.util.List;
/** /**
* 指示灯 * 指示灯
*/ */
@ -48,9 +46,6 @@ public class MapIndicatorLightVO {
*/ */
private boolean right; private boolean right;
private List<String> switchCodes;
// public enum Type{ // public enum Type{
// AtsControl, // AtsControl,
// CenterCommunication, // CenterCommunication,