From 82ae4b18a62e949e7280afbaa5dde90d613c4ce6 Mon Sep 17 00:00:00 2001 From: Jakob Odersky Date: Thu, 18 Dec 2014 11:57:54 +0100 Subject: cleanup and tweaks --- vfd-backend/app/controllers/Application.scala | 9 +- vfd-backend/conf/application.conf | 2 +- vfd-backend/public/images/instruments/bar.svg | 175 ++++++++++++++++++++++++++ 3 files changed, 178 insertions(+), 8 deletions(-) create mode 100644 vfd-backend/public/images/instruments/bar.svg (limited to 'vfd-backend') diff --git a/vfd-backend/app/controllers/Application.scala b/vfd-backend/app/controllers/Application.scala index 6739d3c..09e0e0d 100644 --- a/vfd-backend/app/controllers/Application.scala +++ b/vfd-backend/app/controllers/Application.scala @@ -10,13 +10,8 @@ import play.api.libs.json._ import plugins.UavPlugin object Application extends Controller { - - def use[A <: Plugin](implicit app: Application, m: Manifest[A]) = { - app.plugin[A].getOrElse(throw new RuntimeException(m.runtimeClass.toString + " plugin should be available at this point")) - } - - def uav = use[UavPlugin] + private def uav = current.plugin[UavPlugin].getOrElse(throw new RuntimeException("UAV plugin is not available")) def index = Action { implicit request => Redirect(routes.Application.uav(0)) @@ -27,7 +22,7 @@ object Application extends Controller { } def mavlink = WebSocket.acceptWithActor[Array[Byte], Array[Byte]] { implicit request => - out => use[UavPlugin].register(out) + out => uav.register(out) } } \ No newline at end of file diff --git a/vfd-backend/conf/application.conf b/vfd-backend/conf/application.conf index e069b23..cecd0f9 100644 --- a/vfd-backend/conf/application.conf +++ b/vfd-backend/conf/application.conf @@ -69,7 +69,7 @@ uav.system_id=1 # Type of connection to use # 'mock' for a sample connection -uav.connection.type=serial +uav.connection.type=mock # Mavlink component id used by this connection (not the web frontend), # in case it needs to inject messages diff --git a/vfd-backend/public/images/instruments/bar.svg b/vfd-backend/public/images/instruments/bar.svg new file mode 100644 index 0000000..03d311a --- /dev/null +++ b/vfd-backend/public/images/instruments/bar.svg @@ -0,0 +1,175 @@ + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + 0 + % + + + + + + + + + + + + -- cgit v1.2.3