summaryrefslogtreecommitdiffstats
path: root/hvac/hvac.h
diff options
context:
space:
mode:
authorScott Murray <scott.murray@konsulko.com>2022-06-16 00:43:21 -0400
committerScott Murray <scott.murray@konsulko.com>2022-07-04 21:23:25 +0000
commitb2cb90d9f5e3e87e963e42f4320edcfad8391f50 (patch)
tree1b34e6c1cfbaac24e22a56f06daac59ee8327ca6 /hvac/hvac.h
parent607f2b680891c25b51917d5b7f20bc3a3ffc6a65 (diff)
Reimplement HVAC API with VIS signals
Reimplement the HVAC interface with use of VIS signals. There is some impedance mismatching done between VIS signal notifications and the API Qt signals to avoid changing the clients signficantly for now. If the Qt demo lifetime is extended, this may be revisited to either switch to directly using the VehicleSignals interface or doing a more granular mapping that works better with the VSS schema and VIS. Bug-AGL: SPEC-4409 Signed-off-by: Scott Murray <scott.murray@konsulko.com> Change-Id: I6f1763836945600d84d6f70faea40eaa7d45ce27 (cherry picked from commit 01a723bf51a286b4a6b984a6115c2835d9e99b73)
Diffstat (limited to 'hvac/hvac.h')
-rw-r--r--hvac/hvac.h29
1 files changed, 19 insertions, 10 deletions
diff --git a/hvac/hvac.h b/hvac/hvac.h
index 1a8b233..34530fa 100644
--- a/hvac/hvac.h
+++ b/hvac/hvac.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2020-2021 Konsulko Group
+ * Copyright (C) 2020-2022 Konsulko Group
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -23,25 +23,35 @@
#include <QtQml/QQmlContext>
#include <QtQml/QQmlListProperty>
+class VehicleSignals;
+
class HVAC : public QObject
{
- Q_OBJECT
+ Q_OBJECT
- Q_PROPERTY(int fanSpeed READ get_fanspeed WRITE set_fanspeed NOTIFY fanSpeedChanged)
- Q_PROPERTY(int leftTemperature READ get_temp_left_zone WRITE set_temp_left_zone NOTIFY leftTemperatureChanged)
- Q_PROPERTY(int rightTemperature READ get_temp_right_zone WRITE set_temp_right_zone NOTIFY rightTemperatureChanged)
+ Q_PROPERTY(int fanSpeed READ get_fanspeed WRITE set_fanspeed NOTIFY fanSpeedChanged)
+ Q_PROPERTY(int leftTemperature READ get_temp_left_zone WRITE set_temp_left_zone NOTIFY leftTemperatureChanged)
+ Q_PROPERTY(int rightTemperature READ get_temp_right_zone WRITE set_temp_right_zone NOTIFY rightTemperatureChanged)
- public:
- explicit HVAC(QObject * parent = Q_NULLPTR);
+public:
+ explicit HVAC(VehicleSignals *vs, QObject * parent = Q_NULLPTR);
virtual ~HVAC();
- signals:
+signals:
void fanSpeedChanged(int fanSpeed);
void leftTemperatureChanged(int temp);
void rightTemperatureChanged(int temp);
void languageChanged(QString language);
- private:
+private slots:
+ void onConnected();
+ void onAuthorized();
+ void onDisconnected();
+
+private:
+ VehicleSignals *m_vs;
+ bool m_connected;
+
int m_fanspeed;
int m_temp_left_zone;
int m_temp_right_zone;
@@ -50,7 +60,6 @@ class HVAC : public QObject
int get_temp_left_zone() const { return m_temp_left_zone; };
int get_temp_right_zone() const { return m_temp_right_zone; };
- void control(QString verb, QString field, int value);
void set_fanspeed(int speed);
void set_temp_left_zone(int temp);
void set_temp_right_zone(int temp);