diff --git a/build.sbt b/build.sbt index cb871bf..7899d57 100644 --- a/build.sbt +++ b/build.sbt @@ -3,15 +3,15 @@ import Dependencies._ name := "mesa" -scalacOptions in (Compile, doc) += "-no-java-comments" +Compile / doc / scalacOptions += "-no-java-comments" // factor out common settings across the sub-projects lazy val commonSettings = Seq( organization := "gov.nasa", - version := "1.0", - scalaVersion := "2.13.2", - mainClass in Compile := Some("gov.nasa.mesa.core.MesaMain"), - scalacOptions in (Compile, doc) += "-no-java-comments", + version := "1.1", + scalaVersion := "2.13.8", + Compile / mainClass := Some("gov.nasa.mesa.core.MesaMain"), + Compile / doc / scalacOptions += "-no-java-comments", // uncomment to get the full stack trace for failed tests //testOptions in Test += Tests.Argument(TestFrameworks.ScalaTest, "-oF"), libraryDependencies ++= diff --git a/mesa-core/src/main/scala/gov/nasa/mesa/dataAcquisition/InstantReplayActor.scala b/mesa-core/src/main/scala/gov/nasa/mesa/dataAcquisition/InstantReplayActor.scala index e9196a9..a556731 100644 --- a/mesa-core/src/main/scala/gov/nasa/mesa/dataAcquisition/InstantReplayActor.scala +++ b/mesa-core/src/main/scala/gov/nasa/mesa/dataAcquisition/InstantReplayActor.scala @@ -66,7 +66,7 @@ class InstantReplayActor(override val config: Config) extends val delayMillis: Int = config.getIntOrElse("delay-millis", 0) val reader: ArchiveReader = createReader - var noMoreData: Boolean = !reader.hasMoreData + var noMoreData: Boolean = !reader.hasMoreArchivedData /** Creates an instance of gov.nasa.race.archive.ArchiveReader to read * ArchiveEntry objects from the given archive. diff --git a/mesa-nextgen/src/main/scala/gov/nasa/mesa/nextgen/core/Geo.scala b/mesa-nextgen/src/main/scala/gov/nasa/mesa/nextgen/core/Geo.scala index 9dc5e04..eee9ecc 100644 --- a/mesa-nextgen/src/main/scala/gov/nasa/mesa/nextgen/core/Geo.scala +++ b/mesa-nextgen/src/main/scala/gov/nasa/mesa/nextgen/core/Geo.scala @@ -30,7 +30,7 @@ */ package gov.nasa.mesa.nextgen.core -import gov.nasa.race.geo.Datum +import gov.nasa.race.geo.{Datum, GeoPosition} import gov.nasa.race.uom.Area.√ import gov.nasa.race.uom.Length.Meters import gov.nasa.race.uom.{Angle, Length} @@ -78,8 +78,8 @@ object Geo { var minDevWaypoint: Option[Waypoint] = None for (w <- waypoints) { - val distance = getEuclideanDistance(state.position.φ, state.position.λ, - Meters(0), w.position.φ, w.position.λ, Meters(0)) + val distance = getEuclideanDistance(GeoPosition(state.position.φ, state.position.λ, + Meters(0)), GeoPosition(w.position.φ, w.position.λ, Meters(0))) if (distance <= proximity && distance < minDev) { minDevWaypoint = Some(w) @@ -102,17 +102,16 @@ object Geo { : Boolean = { val alt1 = Meters(0) val alt2 = Meters(0) - getEuclideanDistance(state.position.φ, state.position.λ, alt1, - wp.position.φ, wp.position.λ, alt2) <= proximity + getEuclideanDistance(GeoPosition(state.position.φ, state.position.λ, alt1), + GeoPosition(wp.position.φ, wp.position.λ, alt2)) <= proximity } /** Returns the Euclidean distance between the two given geographic * coordinates. */ - def getEuclideanDistance(φ1: Angle, λ1: Angle, alt1: Length, φ2: Angle, - λ2: Angle, alt2: Length): Length = { - val p1 = Datum.wgs84ToECEF(φ1, λ1, alt1) - val p2 = Datum.wgs84ToECEF(φ2, λ2, alt2) - √((p1.x - p2.x).`²` + (p1.y - p2.y).`²` + (p1.z - p2.z).`²`) + def getEuclideanDistance(pos1: GeoPosition, pos2: GeoPosition): Length = { + val p1 = Datum.wgs84ToECEF(pos1) + val p2 = Datum.wgs84ToECEF(pos2) + √((p1.x - p2.x).`²` + (p1.y - p2.y).`²` + (p1.z - p2.z).`²`) } } \ No newline at end of file diff --git a/mesa-nextgen/src/main/scala/gov/nasa/mesa/nextgen/dataAcquisition/FlightStateSbsReplayActor.scala b/mesa-nextgen/src/main/scala/gov/nasa/mesa/nextgen/dataAcquisition/FlightStateSbsReplayActor.scala index 4bc34dc..a26af61 100644 --- a/mesa-nextgen/src/main/scala/gov/nasa/mesa/nextgen/dataAcquisition/FlightStateSbsReplayActor.scala +++ b/mesa-nextgen/src/main/scala/gov/nasa/mesa/nextgen/dataAcquisition/FlightStateSbsReplayActor.scala @@ -55,8 +55,10 @@ import scala.concurrent.duration.Duration * @param config the actor configuration */ class FlightStateSbsReplayActor(val config: Config) - extends Replayer[FlightStateSbsReader] with PeriodicRaceActor + extends Replayer with PeriodicRaceActor with SbsImporter { + type R = FlightStateSbsReader + class DropCheckSBSReader (conf: Config) extends FlightStateSbsReader(config) { override def dropTrack (id: String, cs: String, date: DateTime, @@ -88,17 +90,17 @@ class FlightStateSbsReader(iStream: InputStream, pathName: String="", conf.getMappedStringOrElse("default-zone", ZoneId.of, ZoneId.systemDefault) ) - override val updater: SbsUpdater = new FstateSbsArchiveUpdater + override val updater: SbsUpdater = new SbsUpdater( Some(this), defaultZone) - class FstateSbsArchiveUpdater extends SbsUpdater(updateTrack,dropTrack, - Some(this), defaultZone) { - override protected def acquireMoreData: Boolean = refillBuf - } +// class FstateSbsArchiveUpdater extends SbsUpdater(updateTrack,dropTrack, +// Some(this), defaultZone) { +// override protected def acquireMoreData: Boolean = refillBuf +// } - override def updateTrack (track: TrackedObject): Boolean = { - val fstate = new FlightState(track.id, track.cs, track.position, - track.speed, track.heading, track.vr, track.date, track.status) - next = someEntry(fstate.date, fstate) - false - } +// override def updateTrack (track: TrackedObject): Boolean = { +// val fstate = new FlightState(track.id, track.cs, track.position, +// track.speed, track.heading, track.vr, track.date, track.status) +// next = someEntry(fstate.date, fstate) +// false +// } } \ No newline at end of file diff --git a/project/Dependencies.scala b/project/Dependencies.scala index 9831ba3..4b9b9e0 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -2,7 +2,7 @@ import sbt._ object Dependencies { lazy val latestVersion = "latest.release" - lazy val raceVersion = "1.8.0" + lazy val raceVersion = "1.8.1" val typesafeConfig = "com.typesafe" % "config" % "1.4.1" diff --git a/project/build.properties b/project/build.properties index f37b0aa..fcc6ebc 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version = 1.3.10 \ No newline at end of file +sbt.version = 1.7.1 \ No newline at end of file