summaryrefslogtreecommitdiffstats
path: root/app/main.cpp
diff options
context:
space:
mode:
authorScott Murray <scott.murray@konsulko.com>2019-12-18 10:53:42 -0500
committerScott Murray <scott.murray@konsulko.com>2019-12-18 10:53:42 -0500
commitd81bd39e4f4d48534d7c47b50451d84126fc244e (patch)
tree91ff26d441f52c6f1a4345dfbeba767dde62ae90 /app/main.cpp
parentf85c9d866866de0df4d36535342402dfc13cc759 (diff)
Switch from using the vehicle and engine speeds messages from the low-can binding directly to using the abstracted events from the signal-composer binding instead. Bug-AGL: SPEC-3042 Signed-off-by: Scott Murray <scott.murray@konsulko.com> Change-Id: I36f4d1c7f8565daf43014f47811cd5d3fdfd1dd6
Diffstat (limited to 'app/main.cpp')
-rw-r--r--app/main.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/app/main.cpp b/app/main.cpp
index 3520605..d1486c5 100644
--- a/app/main.cpp
+++ b/app/main.cpp
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2016 The Qt Company Ltd.
+ * Copyright (C) 2019 Konsulko Group
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,6 +17,8 @@
#include <QtAGLExtras/AGLApplication>
#include <QtQml/QQmlApplicationEngine>
+#include <QtQml/QQmlContext>
+#include <signalcomposer.h>
#include "translator.h"
int main(int argc, char *argv[])
@@ -24,6 +27,15 @@ int main(int argc, char *argv[])
app.setApplicationName("Dashboard");
app.setupApplicationRole("dashboard");
+ QQmlApplicationEngine *engine = app.getQmlApplicationEngine();
+ QQmlContext *context = engine->rootContext();
+ QVariant v = context->contextProperty(QStringLiteral("bindingAddress"));
+ if(v.canConvert(QMetaType::QUrl)) {
+ QUrl bindingAddress = v.toUrl();
+ context->setContextProperty("SignalComposer", new SignalComposer(bindingAddress, context));
+ } else {
+ qCritical("Cannot find bindingAddress property in context, SignalComposer unavailable");
+ }
qmlRegisterType<Translator>("Translator", 1, 0, "Translator");
app.load(QUrl(QStringLiteral("qrc:/Dashboard.qml")));
return app.exec();