summaryrefslogtreecommitdiff
path: root/src/plugins/ivivehiclefunctions/climate_simulator
diff options
context:
space:
mode:
authorDominik Holland <dominik.holland@pelagicore.com>2016-04-19 15:41:28 +0200
committerDominik Holland <dominik.holland@pelagicore.com>2016-04-26 08:39:56 +0000
commit968fd5feb69d9d8b8ffac50a517ac87c6d04e53c (patch)
tree5202cd1fde8b7440bd168c0c242a25cbc82c9a52 /src/plugins/ivivehiclefunctions/climate_simulator
parent26396dcf05762b6077ebc017e7fe0ca685c769aa (diff)
downloadqtivi-968fd5feb69d9d8b8ffac50a517ac87c6d04e53c.tar.gz
Made the ClimateControl API more complete
Changed the recirculationMode from being a bool to a enum. Added support for: * outsideTemperature * zoneSynchronization * defrost * recirculationSensitivityLevel * climateMode * automaticClimateFanIntensityLevel Change-Id: Ia8f5189aaba34546fbcc40893e316a8c91e1ad2b Reviewed-by: Robert Griebl <robert.griebl@pelagicore.com>
Diffstat (limited to 'src/plugins/ivivehiclefunctions/climate_simulator')
-rw-r--r--src/plugins/ivivehiclefunctions/climate_simulator/climatecontrolbackend.cpp91
-rw-r--r--src/plugins/ivivehiclefunctions/climate_simulator/climatecontrolbackend.h14
2 files changed, 92 insertions, 13 deletions
diff --git a/src/plugins/ivivehiclefunctions/climate_simulator/climatecontrolbackend.cpp b/src/plugins/ivivehiclefunctions/climate_simulator/climatecontrolbackend.cpp
index 23f714f..9656d6e 100644
--- a/src/plugins/ivivehiclefunctions/climate_simulator/climatecontrolbackend.cpp
+++ b/src/plugins/ivivehiclefunctions/climate_simulator/climatecontrolbackend.cpp
@@ -49,8 +49,14 @@ ClimateControlBackend::ClimateControlBackend(QObject *parent) :
m_airCondition(true),
m_heater(true),
m_airRecirculation(false),
+ m_zoneSynchronization(false),
+ m_defrost(false),
m_steeringWheelHeater(0),
- m_fanSpeed(2)
+ m_fanSpeed(2),
+ m_recirculationMode(QtIVIClimateControl::RecirculationOff),
+ m_recirculationSensitivityLevel(0),
+ m_climateMode(QtIVIClimateControl::ClimateOn),
+ m_automaticClimateFanIntensityLevel(0)
{
ZoneBackend leftZone;
@@ -92,21 +98,37 @@ QStringList ClimateControlBackend::availableZones() const
void ClimateControlBackend::initializeAttributes()
{
- QVector<QtIVIClimateControl::AirflowDirections> list;
- list << (QtIVIClimateControl::Floor | QtIVIClimateControl::Dashboard) << QtIVIClimateControl::Floor << QtIVIClimateControl::Dashboard;
- emit airflowDirectionsAttributeChanged(QtIVIPropertyAttribute<QtIVIClimateControl::AirflowDirections>(list));
+ QVector<QtIVIClimateControl::AirflowDirections> airflow;
+ airflow << (QtIVIClimateControl::Floor | QtIVIClimateControl::Dashboard) << QtIVIClimateControl::Floor << QtIVIClimateControl::Dashboard;
+ emit airflowDirectionsAttributeChanged(QtIVIPropertyAttribute<QtIVIClimateControl::AirflowDirections>(airflow));
emit airflowDirectionsChanged(m_flowDirection);
emit airConditioningAttributeChanged(QtIVIPropertyAttribute<bool>(true));
emit airConditioningEnabledChanged(m_airCondition);
emit heaterAttributeChanged(QtIVIPropertyAttribute<bool>(true));
emit heaterEnabledChanged(m_heater);
- emit airRecirculationAttributeChanged(QtIVIPropertyAttribute<bool>(true));
- emit airRecirculationEnabledChanged(m_airRecirculation);
+ emit zoneSynchronizationEnabledChanged(m_zoneSynchronization);
+ emit zoneSynchronizationAttributeChanged(QtIVIPropertyAttribute<bool>(true));
+ emit defrostEnabledChanged(m_defrost);
+ emit defrostAttributeChanged(QtIVIPropertyAttribute<bool>(true));
emit steeringWheelHeaterAttributeChanged(QtIVIPropertyAttribute<int>(false));
emit steeringWheelHeaterChanged(m_steeringWheelHeater);
emit fanSpeedLevelAttributeChanged(QtIVIPropertyAttribute<int>(0, 10));
emit fanSpeedLevelChanged(m_fanSpeed);
+ QVector<QtIVIClimateControl::RecirculationMode> recirculation;
+ recirculation << QtIVIClimateControl::RecirculationOff << QtIVIClimateControl::RecirculationOn;
+ emit recirculationModeChanged(m_recirculationMode);
+ emit recirculationModeAttributeChanged(QtIVIPropertyAttribute<QtIVIClimateControl::RecirculationMode>(recirculation));
+ emit recirculationSensitivityLevelChanged(m_recirculationSensitivityLevel);
+ emit recirculationSensitivityLevelAttributeChanged(QtIVIPropertyAttribute<int>(false));
+
+ QVector<QtIVIClimateControl::ClimateMode> climate;
+ climate << QtIVIClimateControl::ClimateOff << QtIVIClimateControl::ClimateOn;
+ emit climateModeChanged(m_climateMode);
+ emit climateModeAttributeChanged(QtIVIPropertyAttribute<QtIVIClimateControl::ClimateMode>(climate));
+ emit automaticClimateFanIntensityLevelChanged(m_automaticClimateFanIntensityLevel);
+ emit automaticClimateFanIntensityLevelAttributeChanged(QtIVIPropertyAttribute<int>(false));
+
foreach (QString zone, availableZones()) {
emit targetTemperatureAttributeChanged(m_zoneMap[zone].targetTemperatureAttribute, zone);
emit targetTemperatureChanged(m_zoneMap[zone].targetTemperature, zone);
@@ -226,13 +248,60 @@ void ClimateControlBackend::setHeaterEnabled(bool val, const QString &zone)
emit heaterEnabledChanged(val);
}
-void ClimateControlBackend::setAirRecirculationEnabled(bool val, const QString &zone)
+void ClimateControlBackend::setZoneSynchronizationEnabled(bool zoneSynchronization, const QString &zone)
+{
+ if (!zone.isEmpty() || m_zoneSynchronization == zoneSynchronization)
+ return;
+
+ qWarning() << "SIMULATION ZoneSynchronization changed to" << zoneSynchronization;
+
+ m_zoneSynchronization = zoneSynchronization;
+ emit zoneSynchronizationEnabledChanged(zoneSynchronization);
+}
+
+void ClimateControlBackend::setDefrostEnabled(bool defrost, const QString &zone)
+{
+ if (!zone.isEmpty() || m_defrost == defrost)
+ return;
+
+ qWarning() << "SIMULATION Defrost changed to" << defrost;
+
+ m_defrost = defrost;
+ emit defrostEnabledChanged(defrost);
+}
+
+void ClimateControlBackend::setRecirculationMode(QtIVIClimateControl::RecirculationMode recirculationMode, const QString &zone)
{
- if (!zone.isEmpty() || m_airRecirculation == val)
+ if (!zone.isEmpty() || m_recirculationMode == recirculationMode)
return;
- qWarning() << "SIMULATION AirRecirculationEnabled changed to" << val;
+ qWarning() << "SIMULATION RecirculationMode changed to" << recirculationMode;
+
+ m_recirculationMode = recirculationMode;
+ emit recirculationModeChanged(recirculationMode);
+}
- m_airRecirculation = val;
- emit airRecirculationEnabledChanged(val);
+void ClimateControlBackend::setRecirculationSensitivityLevel(int recirculationSensitivityLevel, const QString &zone)
+{
+ Q_UNUSED(recirculationSensitivityLevel);
+ Q_UNUSED(zone);
+ qWarning() << "SIMULATION Setting RecirculationSensitivityLevel is not supported!";
+}
+
+void ClimateControlBackend::setClimateMode(QtIVIClimateControl::ClimateMode climateMode, const QString &zone)
+{
+ if (!zone.isEmpty() || m_climateMode == climateMode)
+ return;
+
+ qWarning() << "SIMULATION ZoneSynchronization changed to" << climateMode;
+
+ m_climateMode = climateMode;
+ emit climateModeChanged(climateMode);
+}
+
+void ClimateControlBackend::setAutomaticClimateFanIntensityLevel(int automaticClimateFanIntensityLevel, const QString &zone)
+{
+ Q_UNUSED(automaticClimateFanIntensityLevel);
+ Q_UNUSED(zone);
+ qWarning() << "SIMULATION Setting AutomaticClimateFanIntensityLevel is not supported!";
}
diff --git a/src/plugins/ivivehiclefunctions/climate_simulator/climatecontrolbackend.h b/src/plugins/ivivehiclefunctions/climate_simulator/climatecontrolbackend.h
index 89081e4..8ee25c1 100644
--- a/src/plugins/ivivehiclefunctions/climate_simulator/climatecontrolbackend.h
+++ b/src/plugins/ivivehiclefunctions/climate_simulator/climatecontrolbackend.h
@@ -56,7 +56,6 @@ public:
void initializeAttributes();
- QtIVIPropertyAttribute<int> targetTemperatureAttribute(const QString &zone) const;
void setTargetTemperature(int val, const QString &zone);
void setSeatCooler(int val, const QString &zone);
void setSeatHeater(int val, const QString &zone);
@@ -65,7 +64,12 @@ public:
void setAirflowDirections(QtIVIClimateControl::AirflowDirections direction, const QString &zone);
void setAirConditioningEnabled(bool val, const QString &zone);
void setHeaterEnabled(bool val, const QString &zone);
- void setAirRecirculationEnabled(bool val, const QString &zone);
+ void setZoneSynchronizationEnabled(bool zoneSynchronization, const QString &zone);
+ void setDefrostEnabled(bool defrost, const QString &zone);
+ void setRecirculationMode(QtIVIClimateControl::RecirculationMode recirculationMode, const QString &zone);
+ void setRecirculationSensitivityLevel(int recirculationSensitivityLevel, const QString &zone);
+ void setClimateMode(QtIVIClimateControl::ClimateMode climateMode, const QString &zone);
+ void setAutomaticClimateFanIntensityLevel(int automaticClimateFanIntensityLevel, const QString &zone);
private:
@@ -73,8 +77,14 @@ private:
bool m_airCondition;
bool m_heater;
bool m_airRecirculation;
+ bool m_zoneSynchronization;
+ bool m_defrost;
int m_steeringWheelHeater;
int m_fanSpeed;
+ QtIVIClimateControl::RecirculationMode m_recirculationMode;
+ int m_recirculationSensitivityLevel;
+ QtIVIClimateControl::ClimateMode m_climateMode;
+ int m_automaticClimateFanIntensityLevel;
struct ZoneBackend {
int targetTemperature;