aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Odersky <jakob@odersky.com>2016-04-19 16:26:30 -0700
committerJakob Odersky <jakob@odersky.com>2016-04-19 16:26:30 -0700
commitce97c76e05621485cc01c75c081309071a6889de (patch)
tree08e03316c83d6b7479a74b1a6fad61d29a4eaf04
parentcf7837690c799f4acd0b9e97da4f7d8d0c2df112 (diff)
downloadmavigator-demo1-before.tar.gz
mavigator-demo1-before.tar.bz2
mavigator-demo1-before.zip
Before Demodemo1-before
-rw-r--r--mavigator-bindings/mavlink/common.xml4
-rw-r--r--mavigator-cockpit/src/main/scala/mavigator/cockpit/Instruments.scala10
-rw-r--r--mavigator-cockpit/src/main/scala/mavigator/cockpit/Layout.scala2
-rw-r--r--mavigator-cockpit/src/main/scala/mavigator/cockpit/MavlinkWebSockets.scala5
-rw-r--r--mavigator-uav/src/main/scala/mavigator/uav/Core.scala19
5 files changed, 2 insertions, 38 deletions
diff --git a/mavigator-bindings/mavlink/common.xml b/mavigator-bindings/mavlink/common.xml
index b91e165..cf5d9d5 100644
--- a/mavigator-bindings/mavlink/common.xml
+++ b/mavigator-bindings/mavlink/common.xml
@@ -3234,10 +3234,6 @@
<field type="float" name="size_x">Size in radians of target along x-axis</field>
<field type="float" name="size_y">Size in radians of target along y-axis</field>
</message>
- <message id="150" name="Stability">
- <description>Stability issues</description>
- <field type="uint8_t" name="stable">Is it stable?</field>
- </message>
<!-- MESSAGE IDs 180 - 240: Space for custom messages in individual projectname_messages.xml files -->
<message id="241" name="VIBRATION">
diff --git a/mavigator-cockpit/src/main/scala/mavigator/cockpit/Instruments.scala b/mavigator-cockpit/src/main/scala/mavigator/cockpit/Instruments.scala
index f6a32db..00f9aeb 100644
--- a/mavigator-cockpit/src/main/scala/mavigator/cockpit/Instruments.scala
+++ b/mavigator-cockpit/src/main/scala/mavigator/cockpit/Instruments.scala
@@ -118,16 +118,6 @@ trait Instruments { page: Page =>
}"""
- def mode(name: String, level: String) = new Instrument[Boolean] {
- override val element: html.Element = div(`class` := s"mode $level off")(name).render
- def update(newValue: Boolean): Unit = {
- val classes = element.classList
- if (newValue) classes.add("off") else classes.remove("off")
- }
- }
-
- val unstable = mode("UNSTABLE", "danger")
-
val modeStyle = """
.mode {
display: inline-block;
diff --git a/mavigator-cockpit/src/main/scala/mavigator/cockpit/Layout.scala b/mavigator-cockpit/src/main/scala/mavigator/cockpit/Layout.scala
index 67db95b..2a053e4 100644
--- a/mavigator-cockpit/src/main/scala/mavigator/cockpit/Layout.scala
+++ b/mavigator-cockpit/src/main/scala/mavigator/cockpit/Layout.scala
@@ -14,7 +14,7 @@ trait Layout { self: Page with Instruments =>
img(src := asset("images/logo-invert.svg"), style:="height: 20px; margin: 5px;"),
span(`class`:="mode warning")("Demo System"),
div(`style` := "float: right")(
- unstable.element
+
)
)
diff --git a/mavigator-cockpit/src/main/scala/mavigator/cockpit/MavlinkWebSockets.scala b/mavigator-cockpit/src/main/scala/mavigator/cockpit/MavlinkWebSockets.scala
index d4b0239..b2ecf48 100644
--- a/mavigator-cockpit/src/main/scala/mavigator/cockpit/MavlinkWebSockets.scala
+++ b/mavigator-cockpit/src/main/scala/mavigator/cockpit/MavlinkWebSockets.scala
@@ -55,11 +55,6 @@ trait MavlinkWebSockets { self: Instruments =>
case a: Attitude =>
attitudeOverlay.update((a.pitch, a.roll))
horizonOverlay.update((a.pitch, a.roll))
- case Stability(v) => {
- unstable.update(v != 0)
- println("stability " + v)
- }
-
case _ => ()
}
diff --git a/mavigator-uav/src/main/scala/mavigator/uav/Core.scala b/mavigator-uav/src/main/scala/mavigator/uav/Core.scala
index 02a8779..884a8e3 100644
--- a/mavigator-uav/src/main/scala/mavigator/uav/Core.scala
+++ b/mavigator-uav/src/main/scala/mavigator/uav/Core.scala
@@ -35,14 +35,7 @@ class Core(implicit val system: ActorSystem, val materializer: Materializer) {
)((toClient, fromClient) => (toClient, fromClient))
private lazy val runnable: RunnableGraph[Publisher[ByteString]] = {
- val timer = Source.tick(2.seconds, 2.seconds, ())
- val generator: Source[ByteString, _] = timer.flatMapConcat{ _ =>
- Util.barrelRoll via Util.assembler
- }
-
- val merged: Flow[ByteString, ByteString, _] = Util.merge(generator, backend)
-
- merged.joinMat(clients){case (_, (toClient, _)) =>
+ backend.joinMat(clients){case (_, (toClient, _)) =>
toClient
}
@@ -96,16 +89,6 @@ object Util {
ByteString(bytes)
}
- def barrelRoll(): Source[Message, _] = {
- val angle: Source[Float, _] =
- Source.tick(10.millis, 10.millis, 0.1f).scan(0.0f)(_+_).takeWhile(_ < 2 * math.Pi)
- val attitude = angle.map{ a =>
- Attitude(0,a,0,0,0,0,0)
- }
-
- Source.single(Stability(0)) concat attitude concat Source.single(Stability(1))
- }
-
}