diff options
author | Scott Murray <scott.murray@konsulko.com> | 2019-12-18 10:53:42 -0500 |
---|---|---|
committer | Scott Murray <scott.murray@konsulko.com> | 2019-12-18 16:07:53 +0000 |
commit | 37b9a2dfa67e45689cab15d4edfd98808c7315ae (patch) | |
tree | eb38bf1243d9bc6183f15cf8755dbbe03774369f /app/main.cpp | |
parent | f269917773e8c019ae497c83ed2b7c914829157b (diff) |
Switch to using signal-composer speed eventsicefish_8.99.5icefish_8.99.4icefish/8.99.5icefish/8.99.48.99.58.99.4
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.cpp | 12 |
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(); |