summaryrefslogtreecommitdiffstats
path: root/hvac/hvac.h
diff options
context:
space:
mode:
authorScott Murray <scott.murray@konsulko.com>2022-07-04 22:02:55 +0000
committerGerrit Code Review <gerrit@automotivelinux.org>2022-07-04 22:02:55 +0000
commita2d991a54f77017ced1558d289bcb83d73fe2a35 (patch)
tree5e195241ea9b6ae4198ad72433409dfa6f00064d /hvac/hvac.h
parentfc9399e54dfd05a4307f954549ae58afbf57fb5e (diff)
parentb2cb90d9f5e3e87e963e42f4320edcfad8391f50 (diff)
Merge "Reimplement HVAC API with VIS signals"needlefish_13.93.0needlefish/13.93.013.93.0
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);