aboutsummaryrefslogtreecommitdiff
path: root/vfd-dashboard/src/main/scala/vfd/dashboard/ui/instruments/Horizon.scala
diff options
context:
space:
mode:
Diffstat (limited to 'vfd-dashboard/src/main/scala/vfd/dashboard/ui/instruments/Horizon.scala')
-rw-r--r--vfd-dashboard/src/main/scala/vfd/dashboard/ui/instruments/Horizon.scala20
1 files changed, 20 insertions, 0 deletions
diff --git a/vfd-dashboard/src/main/scala/vfd/dashboard/ui/instruments/Horizon.scala b/vfd-dashboard/src/main/scala/vfd/dashboard/ui/instruments/Horizon.scala
new file mode 100644
index 0000000..2484561
--- /dev/null
+++ b/vfd-dashboard/src/main/scala/vfd/dashboard/ui/instruments/Horizon.scala
@@ -0,0 +1,20 @@
+package vfd.dashboard.ui.instruments
+
+import org.scalajs.dom.html
+import vfd.dashboard.Environment
+
+class Horizon(implicit env: Environment) extends SvgInstrument[(Double, Double)] {
+ import SvgInstrument._
+
+ val initial = (0.0, 0.0)
+
+ lazy val element = svgObject("horizon")
+ lazy val pitch = part("pitch")
+ lazy val roll = part("roll")
+ lazy val moveable = Seq(pitch, roll)
+
+ protected def update(pitchRoll: (Double, Double)) = {
+ translate(pitch, 0, pitchRoll._1.toInt)
+ rotate(roll, pitchRoll._2.toInt)
+ }
+}