Skip to content

Commit 96e803f

Browse files
committed
editoast: merge branch 'dev'
2 parents 281e005 + cd085cb commit 96e803f

File tree

221 files changed

+3472
-1931
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

221 files changed

+3472
-1931
lines changed

core/envelope-sim/src/main/java/fr/sncf/osrd/envelope/Envelope.java

-1
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,6 @@ public double maxSpeedInRange(double beginPos, double endPos) {
186186
}
187187

188188
private long interpolateUS(double position, boolean isArrivalAt) {
189-
assert continuous : "interpolating times on a non continuous envelope is a risky business";
190189
var envelopePartIndex = findLeft(position);
191190
assert envelopePartIndex >= 0 : "Trying to interpolate time outside of the envelope";
192191
var envelopePart = get(envelopePartIndex);

core/osrd-reporting/src/main/java/fr/sncf/osrd/reporting/exceptions/ErrorType.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,8 @@ public enum ErrorType {
152152
InconsistentSpeedSection(
153153
"speed_section",
154154
"Speed section definition is nonsensical and cannot be used for simulation",
155-
ErrorCause.USER);
155+
ErrorCause.USER),
156+
MissingLastSTDCMStop("missing_last_stdcm_stop", "Last step of stdcm request needs to be a stop", ErrorCause.USER);
156157

157158
public final String type;
158159
public final String message;

core/src/main/kotlin/fr/sncf/osrd/api/api_v2/stdcm/STDCMEndpointV2.kt

+4-2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import fr.sncf.osrd.envelope_sim_infra.EnvelopeTrainPath
1616
import fr.sncf.osrd.envelope_sim_infra.MRSP
1717
import fr.sncf.osrd.graph.Pathfinding
1818
import fr.sncf.osrd.graph.PathfindingEdgeLocationId
19+
import fr.sncf.osrd.reporting.exceptions.ErrorType
1920
import fr.sncf.osrd.reporting.exceptions.OSRDError
2021
import fr.sncf.osrd.reporting.warnings.DiagnosticRecorderImpl
2122
import fr.sncf.osrd.sim_infra.api.Block
@@ -35,7 +36,6 @@ import fr.sncf.osrd.utils.units.Offset
3536
import fr.sncf.osrd.utils.units.meters
3637
import fr.sncf.osrd.utils.units.seconds
3738
import java.time.Duration.ofMillis
38-
import java.util.HashSet
3939
import org.takes.Request
4040
import org.takes.Response
4141
import org.takes.Take
@@ -174,7 +174,9 @@ class STDCMEndpointV2(private val infraManager: InfraManager) : Take {
174174
}
175175

176176
private fun parseSteps(infra: FullInfra, pathItems: List<STDCMPathItem>): List<STDCMStep> {
177-
assert(pathItems.last().stopDuration != null)
177+
if (pathItems.last().stopDuration == null) {
178+
throw OSRDError(ErrorType.MissingLastSTDCMStop)
179+
}
178180
return pathItems
179181
.map {
180182
STDCMStep(

0 commit comments

Comments
 (0)