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 16:07:53 +0000
commit37b9a2dfa67e45689cab15d4edfd98808c7315ae (patch)
treeeb38bf1243d9bc6183f15cf8755dbbe03774369f /app/main.cpp
parentf269917773e8c019ae497c83ed2b7c914829157b (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();