Skip to content

Commit

Permalink
Parse exits from banner components
Browse files Browse the repository at this point in the history
This is a follow up to #391, which parses out the exit numbers from the
banner components. Note that this explicitly ignores all types other
than "exit-number" for now.
  • Loading branch information
ahmedre committed Dec 17, 2024
1 parent 62d39df commit d4d8574
Show file tree
Hide file tree
Showing 28 changed files with 1,747 additions and 38 deletions.
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ if useLocalFramework {
path: "./common/target/ios/libferrostar-rs.xcframework"
)
} else {
let releaseTag = "0.24.0"
let releaseTag = "0.25.0"
let releaseChecksum = "bcd5558cddceb711ff8997c6dc6c999d14d4c1f648e4394348e3a658cd50ba88"
binaryTarget = .binaryTarget(
name: "FerrostarCoreRS",
Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ ext {

allprojects {
group = "com.stadiamaps.ferrostar"
version = "0.24.0"
version = "0.25.0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,8 @@ fun PreviewInstructionsView() {
maneuverType = ManeuverType.TURN,
maneuverModifier = ManeuverModifier.LEFT,
roundaboutExitDegrees = null,
laneInfo = null),
laneInfo = null,
exitNumbers = emptyList()),
secondaryContent = null,
subContent = null,
triggerDistanceBeforeManeuver = 42.0)
Expand All @@ -175,7 +176,8 @@ fun PreviewRTLInstructionsView() {
maneuverType = ManeuverType.TURN,
maneuverModifier = ManeuverModifier.LEFT,
roundaboutExitDegrees = null,
laneInfo = null),
laneInfo = null,
exitNumbers = emptyList()),
secondaryContent = null,
subContent = null,
triggerDistanceBeforeManeuver = 42.0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ fun ManeuverImageLeftTurnPreview() {
maneuverType = ManeuverType.TURN,
maneuverModifier = ManeuverModifier.LEFT,
roundaboutExitDegrees = null,
laneInfo = null))
laneInfo = null,
exitNumbers = emptyList()))
}

@Preview
Expand All @@ -66,5 +67,6 @@ fun ManeuverImageContinueUturnPreview() {
maneuverType = ManeuverType.CONTINUE,
maneuverModifier = ManeuverModifier.U_TURN,
roundaboutExitDegrees = null,
laneInfo = null))
laneInfo = null,
exitNumbers = emptyList()))
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ class InstructionViewTest {
maneuverType = ManeuverType.TURN,
maneuverModifier = ManeuverModifier.LEFT,
roundaboutExitDegrees = null,
laneInfo = null),
laneInfo = null,
exitNumbers = emptyList()),
secondaryContent = null,
subContent = null,
triggerDistanceBeforeManeuver = 42.0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ class ManeuverImageTest {
maneuverType = ManeuverType.TURN,
maneuverModifier = ManeuverModifier.RIGHT,
roundaboutExitDegrees = null,
laneInfo = null))
laneInfo = null,
exitNumbers = emptyList()))
}
}

Expand All @@ -41,7 +42,8 @@ class ManeuverImageTest {
maneuverType = ManeuverType.FORK,
maneuverModifier = ManeuverModifier.LEFT,
roundaboutExitDegrees = null,
laneInfo = null))
laneInfo = null,
exitNumbers = emptyList()))
}
}

Expand All @@ -54,7 +56,8 @@ class ManeuverImageTest {
maneuverType = ManeuverType.FORK,
maneuverModifier = ManeuverModifier.LEFT,
roundaboutExitDegrees = null,
laneInfo = null),
laneInfo = null,
exitNumbers = emptyList()),
tint = Color.Magenta)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ class RTLInstructionViewTests {
maneuverType = ManeuverType.TURN,
maneuverModifier = ManeuverModifier.LEFT,
roundaboutExitDegrees = null,
laneInfo = null),
laneInfo = null,
exitNumbers = emptyList()),
secondaryContent = null,
subContent = null,
triggerDistanceBeforeManeuver = 42.0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ class FerrostarCoreTest {
maneuverType = ManeuverType.DEPART,
maneuverModifier = ManeuverModifier.STRAIGHT,
roundaboutExitDegrees = null,
laneInfo = null)
laneInfo = null,
exitNumbers = emptyList())
private val mockRoute =
Route(
geometry = mockGeom,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ fun NavigationState.Companion.pedestrianExample(): NavigationState {
maneuverType = ManeuverType.TURN,
maneuverModifier = ManeuverModifier.RIGHT,
roundaboutExitDegrees = null,
laneInfo = null),
laneInfo = null,
exitNumbers = emptyList()),
secondaryContent = null,
subContent = null,
triggerDistanceBeforeManeuver = 0.0,
Expand Down
3 changes: 2 additions & 1 deletion apple/Sources/FerrostarCore/Mock/MockNavigationState.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ public extension NavigationState {
maneuverType: .turn,
maneuverModifier: .left,
roundaboutExitDegrees: nil,
laneInfo: nil
laneInfo: nil,
exitNumbers: []
),
secondaryContent: nil,
subContent: nil,
Expand Down
3 changes: 2 additions & 1 deletion apple/Sources/FerrostarSwiftUI/TestFixtureFactory.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ struct VisualInstructionContentFactory: TestFixtureFactory {
maneuverType: .turn,
maneuverModifier: .left,
roundaboutExitDegrees: nil,
laneInfo: nil
laneInfo: nil,
exitNumbers: []
)
}
}
Expand Down
18 changes: 12 additions & 6 deletions apple/Sources/FerrostarSwiftUI/Views/InstructionsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -157,14 +157,16 @@ public struct InstructionsView: View {
maneuverType: .turn,
maneuverModifier: .right,
roundaboutExitDegrees: nil,
laneInfo: nil
laneInfo: nil,
exitNumbers: []
),
secondaryContent: VisualInstructionContent(
text: "Merge onto Hwy 123",
maneuverType: .merge,
maneuverModifier: .right,
roundaboutExitDegrees: nil,
laneInfo: nil
laneInfo: nil,
exitNumbers: []
),
subContent: nil,
triggerDistanceBeforeManeuver: 123
Expand All @@ -178,7 +180,8 @@ public struct InstructionsView: View {
maneuverType: .rotary,
maneuverModifier: .slightRight,
roundaboutExitDegrees: nil,
laneInfo: nil
laneInfo: nil,
exitNumbers: []
),
secondaryContent: nil,
subContent: nil,
Expand All @@ -193,7 +196,8 @@ public struct InstructionsView: View {
maneuverType: .merge,
maneuverModifier: .slightLeft,
roundaboutExitDegrees: nil,
laneInfo: nil
laneInfo: nil,
exitNumbers: []
),
secondaryContent: nil,
subContent: nil,
Expand All @@ -210,14 +214,16 @@ public struct InstructionsView: View {
maneuverType: .turn,
maneuverModifier: .right,
roundaboutExitDegrees: nil,
laneInfo: nil
laneInfo: nil,
exitNumbers: []
),
secondaryContent: VisualInstructionContent(
text: "Merge onto Hwy 123",
maneuverType: .merge,
maneuverModifier: .right,
roundaboutExitDegrees: nil,
laneInfo: nil
laneInfo: nil,
exitNumbers: []
),
subContent: nil,
triggerDistanceBeforeManeuver: 123
Expand Down
18 changes: 16 additions & 2 deletions apple/Sources/UniFFI/ferrostar.swift

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion apple/Tests/FerrostarCoreTests/FerrostarCoreTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ let instructionContent = VisualInstructionContent(
maneuverType: .depart,
maneuverModifier: .straight,
roundaboutExitDegrees: nil,
laneInfo: nil
laneInfo: nil,
exitNumbers: []
)
let mockRoute = Route(
geometry: mockGeom,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
▿ visualInstructions: 1 element
▿ VisualInstruction
▿ primaryContent: VisualInstructionContent
- exitNumbers: 0 elements
- laneInfo: Optional<Array<LaneInfo>>.none
▿ maneuverModifier: Optional<ManeuverModifier>
- some: ManeuverModifier.straight
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
▿ visualInstructions: 1 element
▿ VisualInstruction
▿ primaryContent: VisualInstructionContent
- exitNumbers: 0 elements
- laneInfo: Optional<Array<LaneInfo>>.none
▿ maneuverModifier: Optional<ManeuverModifier>
- some: ManeuverModifier.straight
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
▿ visualInstructions: 1 element
▿ VisualInstruction
▿ primaryContent: VisualInstructionContent
- exitNumbers: 0 elements
- laneInfo: Optional<Array<LaneInfo>>.none
▿ maneuverModifier: Optional<ManeuverModifier>
- some: ManeuverModifier.straight
Expand Down
30 changes: 20 additions & 10 deletions apple/Tests/FerrostarSwiftUITests/Views/InstructionsViewTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,16 @@ final class InstructionsViewTests: XCTestCase {
maneuverType: .turn,
maneuverModifier: .right,
roundaboutExitDegrees: nil,
laneInfo: nil
laneInfo: nil,
exitNumbers: []
),
secondaryContent: VisualInstructionContent(
text: "Merge onto Hwy 123",
maneuverType: .merge,
maneuverModifier: .right,
roundaboutExitDegrees: nil,
laneInfo: nil
laneInfo: nil,
exitNumbers: []
),
subContent: nil,
triggerDistanceBeforeManeuver: 123
Expand All @@ -40,14 +42,16 @@ final class InstructionsViewTests: XCTestCase {
maneuverType: .turn,
maneuverModifier: .right,
roundaboutExitDegrees: nil,
laneInfo: nil
laneInfo: nil,
exitNumbers: []
),
secondaryContent: VisualInstructionContent(
text: "Merge onto Hwy 123",
maneuverType: .merge,
maneuverModifier: .right,
roundaboutExitDegrees: nil,
laneInfo: nil
laneInfo: nil,
exitNumbers: []
),
subContent: nil,
triggerDistanceBeforeManeuver: 123
Expand All @@ -67,7 +71,8 @@ final class InstructionsViewTests: XCTestCase {
maneuverType: .rotary,
maneuverModifier: .slightRight,
roundaboutExitDegrees: nil,
laneInfo: nil
laneInfo: nil,
exitNumbers: []
),
secondaryContent: nil,
subContent: nil,
Expand All @@ -88,7 +93,8 @@ final class InstructionsViewTests: XCTestCase {
maneuverType: .rotary,
maneuverModifier: .slightRight,
roundaboutExitDegrees: nil,
laneInfo: nil
laneInfo: nil,
exitNumbers: []
),
secondaryContent: nil,
subContent: nil,
Expand All @@ -110,7 +116,8 @@ final class InstructionsViewTests: XCTestCase {
maneuverType: .rotary,
maneuverModifier: .slightRight,
roundaboutExitDegrees: nil,
laneInfo: nil
laneInfo: nil,
exitNumbers: []
),
secondaryContent: nil,
subContent: nil,
Expand All @@ -132,7 +139,8 @@ final class InstructionsViewTests: XCTestCase {
maneuverType: .rotary,
maneuverModifier: .slightRight,
roundaboutExitDegrees: nil,
laneInfo: nil
laneInfo: nil,
exitNumbers: []
),
secondaryContent: nil,
subContent: nil,
Expand All @@ -155,7 +163,8 @@ final class InstructionsViewTests: XCTestCase {
maneuverType: .rotary,
maneuverModifier: .slightRight,
roundaboutExitDegrees: nil,
laneInfo: nil
laneInfo: nil,
exitNumbers: []
),
secondaryContent: nil,
subContent: nil,
Expand All @@ -178,7 +187,8 @@ final class InstructionsViewTests: XCTestCase {
maneuverType: .turn,
maneuverModifier: .left,
roundaboutExitDegrees: nil,
laneInfo: nil
laneInfo: nil,
exitNumbers: []
),
secondaryContent: nil,
subContent: nil,
Expand Down
Loading

0 comments on commit d4d8574

Please sign in to comment.