Skip to content

Commit

Permalink
#278 monitor route analysis - wip
Browse files Browse the repository at this point in the history
  • Loading branch information
vmarc committed Feb 10, 2024
1 parent 3b392ae commit 17ac780
Show file tree
Hide file tree
Showing 36 changed files with 215 additions and 244 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class MonitorRouteOsmSegmentAnalyzerImpl() extends MonitorRouteOsmSegmentAnalyze

val forwardElements = elementGroup.elements.filter { element =>
element.direction match {
case Some(ElementDirection.Up) => false
case Some(ElementDirection.Backward) => false
case _ => true
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package kpn.server.analyzer.engine.monitor.structure

object ElementDirection extends Enumeration {
val Up, Down = Value
val Forward, Backward = Value
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ class StructureAnalyzer(traceEnabled: Boolean = false) {
elementGroups.headOption.flatMap { firstElementGroup =>
val elements = firstElementGroup.elements.filter { element =>
element.direction match {
case Some(ElementDirection.Down) => true
case Some(ElementDirection.Up) => false
case Some(ElementDirection.Forward) => true
case Some(ElementDirection.Backward) => false
case _ => true
}
}
Expand Down Expand Up @@ -58,8 +58,8 @@ class StructureAnalyzer(traceEnabled: Boolean = false) {
elementGroups.lastOption.flatMap { lastElementGroup =>
val elements = lastElementGroup.elements.reverse.filter { element =>
element.direction match {
case Some(ElementDirection.Up) => true
case Some(ElementDirection.Down) => false
case Some(ElementDirection.Backward) => true
case Some(ElementDirection.Forward) => false
case _ => true
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ case class StructureElement(
def string: String = {

direction match {
case Some(ElementDirection.Up) =>
case Some(ElementDirection.Backward) =>
val endNodeIds = fragments.map(_.backwardEndNodeId)
val nodeString = backwardStartNodeId.toString + endNodeIds.mkString(">", ">", "")
val directionString = direction match {
Expand Down

0 comments on commit 17ac780

Please sign in to comment.