diff options
author | Scott Murray <scott.murray@konsulko.com> | 2020-01-03 18:13:33 -0500 |
---|---|---|
committer | Scott Murray <scott.murray@konsulko.com> | 2020-01-03 23:07:34 +0000 |
commit | faa6ebce32c5875687f028a4d6c990e33cf260d5 (patch) | |
tree | 5e8f51a6107dbbdb42fa63ad4a88ea6e491d2065 /app/main.cpp | |
parent | 6b250497f27c37cae1d005f06158146e47ec8800 (diff) |
Add signal-composer speed and steering wheel event supporticefish_8.99.5icefish/8.99.58.99.5
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.cpp | 43 |
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 |