summaryrefslogtreecommitdiffstats
path: root/app/main.cpp
diff options
context:
space:
mode:
authorScott Murray <scott.murray@konsulko.com>2020-01-03 18:13:33 -0500
committerScott Murray <scott.murray@konsulko.com>2020-01-03 18:20:12 -0500
commit6095052818bdee3e467f3674837d9279e0d697d0 (patch)
treea15d8d4f1efea632ba13130d582a796c78364f65 /app/main.cpp
parent4dc183bf09c0f4b27cf7327937721f3b57e55c12 (diff)
Add signal-composer speed and steering wheel event supporthalibut_8.0.6halibut_8.0.5halibut/8.0.6halibut/8.0.58.0.68.0.5halibut
Changes include: - Pull in signal-composer support from libqtappfw - Add a configuration file that controls whether the existing canned animation behavior should be used, or events from signal-composer should drive speeds and indicators. - Add new icons provided by LF graphics team for cruise control and lane departure warning, and drive their state based on appropriate steering wheel events. - Hide/show the digital vehicle/engine speed values in the gauges based on the steering wheel info event. This is intended to work in sync with changes to tbtnavi to have it display larger speed indicators via an alternate page. Bug-AGL: SPEC-3045, SPEC-3049 Change-Id: I77249f65b80596fe7f2af9fe29b3ed86b63a8a45 Signed-off-by: Scott Murray <scott.murray@konsulko.com>
Diffstat (limited to 'app/main.cpp')
-rw-r--r--app/main.cpp43
1 files changed, 42 insertions, 1 deletions
diff --git a/app/main.cpp b/app/main.cpp
index 4f36ef7..a5b9ece 100644
--- a/app/main.cpp
+++ b/app/main.cpp
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2016 The Qt Company Ltd.
- * Copyright (C) 2018 Konsulko Group
+ * Copyright (C) 2018, 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.
@@ -24,8 +24,45 @@
#include <QtQml/qqml.h>
#include <QQuickWindow>
#include <QtQuickControls2/QQuickStyle>
+#include <glib.h>
#include <qlibwindowmanager.h>
+#include <signalcomposer.h>
+
+// Global indicating whether canned animation should run
+bool runAnimation = true;
+
+void read_config(void)
+{
+ GKeyFile* conf_file;
+ gboolean value;
+
+ // Load settings from configuration file if it exists
+ conf_file = g_key_file_new();
+ if(conf_file &&
+ g_key_file_load_from_dirs(conf_file,
+ "AGL.conf",
+ (const gchar**) g_get_system_config_dirs(),
+ NULL,
+ G_KEY_FILE_KEEP_COMMENTS,
+ NULL) == TRUE) {
+ GError *err = NULL;
+ value = g_key_file_get_boolean(conf_file,
+ "dashboard",
+ "animation",
+ &err);
+ if(value) {
+ runAnimation = true;
+ } else {
+ if(err == NULL) {
+ runAnimation = false;
+ } else {
+ qWarning("Invalid value for \"animation\" key!");
+ }
+ }
+ }
+
+}
int main(int argc, char *argv[])
{
@@ -78,6 +115,10 @@ int main(int argc, char *argv[])
qwm->endDraw(myname);
});
+ context->setContextProperty("SignalComposer", new SignalComposer(bindingAddress, context));
+ read_config();
+ context->setContextProperty("runAnimation", runAnimation);
+
engine.load(QUrl(QStringLiteral("qrc:/cluster-gauges.qml")));
// Find the instantiated model QObject and connect the signals/slots