summaryrefslogtreecommitdiffstats
path: root/recipes-automotive/climatecontrolplugin/files/climatecontrol.h
diff options
context:
space:
mode:
authorMatthew Vick <mvick@jaguarlandrover.com>2015-12-17 13:37:25 -0800
committerGerrit Code Review <gerrit@172.30.200.200>2015-12-21 16:23:04 +0000
commit762181dff011efbaf3d40edb1b3d573c5aceab01 (patch)
treec24b68c6a4a60577dbbfdb107a8c40ccd160b2da /recipes-automotive/climatecontrolplugin/files/climatecontrol.h
parentee2a49c5adc2bc545df6f616f235af42589f1655 (diff)
Add a QML plugin to expose AMB's ClimateControl objects.
To expose the AMB ClimateControl objects to the application layer, add a QML plugin so the application developers can natively configure the vehicle's climate controls based on user input. Because the potential compatibility issue between AMB and Qt being discussed on the AGL mailing list has not yet been resolved, this commit also adds a helper program that the climate control plugin will use as a workaround to access AMB that may be removed in the future. To include support for this plugin, it is necessary for users to add "climatecontrolplugin" to their conf/local.conf when building the image. Change-Id: I6117f0a13e4195e460e3b552befb6e326cdf0f6a Signed-off-by: Matthew Vick <mvick@jaguarlandrover.com>
Diffstat (limited to 'recipes-automotive/climatecontrolplugin/files/climatecontrol.h')
-rw-r--r--recipes-automotive/climatecontrolplugin/files/climatecontrol.h84
1 files changed, 84 insertions, 0 deletions
diff --git a/recipes-automotive/climatecontrolplugin/files/climatecontrol.h b/recipes-automotive/climatecontrolplugin/files/climatecontrol.h
new file mode 100644
index 000000000..819bb5942
--- /dev/null
+++ b/recipes-automotive/climatecontrolplugin/files/climatecontrol.h
@@ -0,0 +1,84 @@
+/* Copyright (C) 2015, Jaguar Land Rover. All Rights Reserved.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#ifndef CLIMATECONTROL_H
+#define CLIMATECONTROL_H
+
+#include <QQuickItem>
+
+class ClimateControl : public QQuickItem
+{
+ Q_OBJECT
+ Q_DISABLE_COPY(ClimateControl)
+ Q_PROPERTY(int zone READ getZone WRITE setZone)
+ Q_PROPERTY(int fanSpeedLevel READ getFanSpeedLevel WRITE setFanSpeedLevel)
+ Q_PROPERTY(int targetTemperature READ getTargetTemperature WRITE setTargetTemperature)
+ Q_PROPERTY(bool airConditioning READ getAirConditioning WRITE setAirConditioning)
+ Q_PROPERTY(bool heater READ getHeater WRITE setHeater)
+ Q_PROPERTY(int seatHeater READ getSeatHeater WRITE setSeatHeater)
+ Q_PROPERTY(int seatCooler READ getSeatCooler WRITE setSeatCooler)
+ Q_PROPERTY(bool airCirculation READ getAirCirculation WRITE setAirCirculation)
+ Q_PROPERTY(int steeringWheelHeater READ getSteeringWheelHeater WRITE setSteeringWheelHeater)
+
+public:
+ ClimateControl(QQuickItem *parent = 0);
+ ~ClimateControl();
+
+ // Accessor functions.
+ qint32 getZone();
+ void setZone(qint32 newZone);
+ quint16 getFanSpeedLevel();
+ void setFanSpeedLevel(quint16 newFanSpeedLevel);
+ qint32 getTargetTemperature();
+ void setTargetTemperature(qint32 newTargetTemperature);
+ bool getAirConditioning();
+ void setAirConditioning(bool newAirConditioning);
+ bool getHeater();
+ void setHeater(bool newHeater);
+ quint8 getSeatHeater();
+ void setSeatHeater(quint8 newSeatHeater);
+ quint8 getSeatCooler();
+ void setSeatCooler(quint8 newSeatCooler);
+ bool getAirCirculation();
+ void setAirCirculation(bool newAirCirculation);
+ quint8 getSteeringWheelHeater();
+ void setSteeringWheelHeater(quint8 newSteeringWheelHeater);
+
+signals:
+ // Standard notifiers for property updates.
+ void zoneChanged();
+ void fanSpeedLevelChanged();
+ void targetTemperatureChanged();
+ void airConditioningChanged();
+ void heaterChanged();
+ void seatHeaterChanged();
+ void seatCoolerChanged();
+ void airCirculationChanged();
+ void steeringWheelHeaterChanged();
+
+private:
+ // Representations of the AMB properties.
+ qint32 zone;
+ quint16 fanSpeedLevel;
+ qint32 targetTemperature;
+ bool airConditioning;
+ bool heater;
+ quint8 seatHeater;
+ quint8 seatCooler;
+ bool airCirculation;
+ quint8 steeringWheelHeater;
+
+ //
+ // D-Bus functionality member variables.
+ //
+ // TODO: Make some of this a generic class for use by other plugins.
+ //
+ QVariant dbusRead(const char *property);
+ void dbusWrite(const char *property, QVariant value);
+ void getSettings();
+};
+
+#endif // CLIMATECONTROL_H