Qt IVI Generator Climate Example
#ifndef CLIMATE_CLIMATECONTROL_H_
#define CLIMATE_CLIMATECONTROL_H_
#include "climatemodule.h"
#include <QtIviCore/QIviAbstractZonedFeature>
#include <QtIviCore/QIviPendingReply>
#include <QtIviCore/QIviPagingModel>
class ClimateControlPrivate;
class ClimateControlBackendInterface;
class Q_EXAMPLE_IVI_CLIMATE_EXPORT ClimateControl : public QIviAbstractZonedFeature
{
Q_OBJECT
Q_PROPERTY(bool airConditioning READ airConditioning WRITE setAirConditioning NOTIFY airConditioningChanged)
Q_PROPERTY(bool heater READ heater WRITE setHeater NOTIFY heaterChanged)
Q_PROPERTY(int fanSpeedLevel READ fanSpeedLevel WRITE setFanSpeedLevel NOTIFY fanSpeedLevelChanged)
Q_PROPERTY(int steeringWheelHeater READ steeringWheelHeater WRITE setSteeringWheelHeater NOTIFY steeringWheelHeaterChanged)
Q_PROPERTY(qreal targetTemperature READ targetTemperature WRITE setTargetTemperature NOTIFY targetTemperatureChanged)
Q_PROPERTY(int seatCooler READ seatCooler WRITE setSeatCooler NOTIFY seatCoolerChanged)
Q_PROPERTY(int seatHeater READ seatHeater WRITE setSeatHeater NOTIFY seatHeaterChanged)
Q_PROPERTY(int outsideTemperature READ outsideTemperature WRITE setOutsideTemperature NOTIFY outsideTemperatureChanged)
Q_PROPERTY(QString outsideTemperatureLabel READ outsideTemperatureLabel WRITE setOutsideTemperatureLabel NOTIFY outsideTemperatureLabelChanged)
Q_PROPERTY(bool zoneSynchronization READ zoneSynchronization WRITE setZoneSynchronization NOTIFY zoneSynchronizationChanged)
Q_PROPERTY(bool defrost READ defrost WRITE setDefrost NOTIFY defrostChanged)
Q_PROPERTY(ClimateModule:: RecirculationMode recirculationMode READ recirculationMode WRITE setRecirculationMode NOTIFY recirculationModeChanged)
Q_PROPERTY(bool recirculation READ recirculation WRITE setRecirculation NOTIFY recirculationChanged)
Q_PROPERTY(int recirculationSensitivityLevel READ recirculationSensitivityLevel WRITE setRecirculationSensitivityLevel NOTIFY recirculationSensitivityLevelChanged)
Q_PROPERTY(ClimateModule:: ClimateMode climateMode READ climateMode WRITE setClimateMode NOTIFY climateModeChanged)
Q_PROPERTY(int automaticClimateFanIntensityLevel READ automaticClimateFanIntensityLevel WRITE setAutomaticClimateFanIntensityLevel NOTIFY automaticClimateFanIntensityLevelChanged)
Q_PROPERTY(ClimateModule:: AirflowDirections airflowDirections READ airflowDirections WRITE setAirflowDirections NOTIFY airflowDirectionsChanged)
Q_CLASSINFO("IviPropertyDomains" , "{\"steeringWheelHeater\":{\"minimum\":0},\"targetTemperature\":{\"maximum\":30.0},\"iviVersion\":\"5.12.8\",\"fanSpeedLevel\":{\"range\":[0,50]},\"outsideTemperatureLabel\":{\"domain\":[\"cold\",\"mild\",\"warm\"]}}" )
public :
explicit ClimateControl(const QString & zone = QString (), QObject * parent = nullptr);
~ ClimateControl();
static void registerQmlTypes(const QString & uri, int majorVersion= 1 , int minorVersion= 0 );
bool airConditioning() const ;
bool heater() const ;
int fanSpeedLevel() const ;
int steeringWheelHeater() const ;
qreal targetTemperature() const ;
int seatCooler() const ;
int seatHeater() const ;
int outsideTemperature() const ;
QString outsideTemperatureLabel() const ;
bool zoneSynchronization() const ;
bool defrost() const ;
ClimateModule:: RecirculationMode recirculationMode() const ;
bool recirculation() const ;
int recirculationSensitivityLevel() const ;
ClimateModule:: ClimateMode climateMode() const ;
int automaticClimateFanIntensityLevel() const ;
ClimateModule:: AirflowDirections airflowDirections() const ;
public Q_SLOTS:
void setAirConditioning(bool airConditioning);
void setHeater(bool heater);
void setFanSpeedLevel(int fanSpeedLevel);
void setSteeringWheelHeater(int steeringWheelHeater);
void setTargetTemperature(qreal targetTemperature);
void setSeatCooler(int seatCooler);
void setSeatHeater(int seatHeater);
void setOutsideTemperature(int outsideTemperature);
void setOutsideTemperatureLabel(const QString & outsideTemperatureLabel);
void setZoneSynchronization(bool zoneSynchronization);
void setDefrost(bool defrost);
void setRecirculationMode(ClimateModule:: RecirculationMode recirculationMode);
void setRecirculation(bool recirculation);
void setRecirculationSensitivityLevel(int recirculationSensitivityLevel);
void setClimateMode(ClimateModule:: ClimateMode climateMode);
void setAutomaticClimateFanIntensityLevel(int automaticClimateFanIntensityLevel);
void setAirflowDirections(ClimateModule:: AirflowDirections airflowDirections);
Q_SIGNALS:
void airConditioningChanged(bool airConditioning);
void heaterChanged(bool heater);
void fanSpeedLevelChanged(int fanSpeedLevel);
void steeringWheelHeaterChanged(int steeringWheelHeater);
void targetTemperatureChanged(qreal targetTemperature);
void seatCoolerChanged(int seatCooler);
void seatHeaterChanged(int seatHeater);
void outsideTemperatureChanged(int outsideTemperature);
void outsideTemperatureLabelChanged(const QString & outsideTemperatureLabel);
void zoneSynchronizationChanged(bool zoneSynchronization);
void defrostChanged(bool defrost);
void recirculationModeChanged(ClimateModule:: RecirculationMode recirculationMode);
void recirculationChanged(bool recirculation);
void recirculationSensitivityLevelChanged(int recirculationSensitivityLevel);
void climateModeChanged(ClimateModule:: ClimateMode climateMode);
void automaticClimateFanIntensityLevelChanged(int automaticClimateFanIntensityLevel);
void airflowDirectionsChanged(ClimateModule:: AirflowDirections airflowDirections);
protected :
QIviAbstractZonedFeature * createZoneFeature(const QString & zone) Q_DECL_OVERRIDE;
ClimateControlBackendInterface * climatecontrolBackend() const ;
void connectToServiceObject(QIviServiceObject * service) Q_DECL_OVERRIDE;
void clearServiceObject() Q_DECL_OVERRIDE;
private :
Q_PRIVATE_SLOT(d_func(), void onAirConditioningChanged(bool airConditioning, const QString & zone))
Q_PRIVATE_SLOT(d_func(), void onHeaterChanged(bool heater, const QString & zone))
Q_PRIVATE_SLOT(d_func(), void onFanSpeedLevelChanged(int fanSpeedLevel, const QString & zone))
Q_PRIVATE_SLOT(d_func(), void onSteeringWheelHeaterChanged(int steeringWheelHeater, const QString & zone))
Q_PRIVATE_SLOT(d_func(), void onTargetTemperatureChanged(qreal targetTemperature, const QString & zone))
Q_PRIVATE_SLOT(d_func(), void onSeatCoolerChanged(int seatCooler, const QString & zone))
Q_PRIVATE_SLOT(d_func(), void onSeatHeaterChanged(int seatHeater, const QString & zone))
Q_PRIVATE_SLOT(d_func(), void onOutsideTemperatureChanged(int outsideTemperature, const QString & zone))
Q_PRIVATE_SLOT(d_func(), void onOutsideTemperatureLabelChanged(const QString & outsideTemperatureLabel, const QString & zone))
Q_PRIVATE_SLOT(d_func(), void onZoneSynchronizationChanged(bool zoneSynchronization, const QString & zone))
Q_PRIVATE_SLOT(d_func(), void onDefrostChanged(bool defrost, const QString & zone))
Q_PRIVATE_SLOT(d_func(), void onRecirculationModeChanged(ClimateModule:: RecirculationMode recirculationMode, const QString & zone))
Q_PRIVATE_SLOT(d_func(), void onRecirculationChanged(bool recirculation, const QString & zone))
Q_PRIVATE_SLOT(d_func(), void onRecirculationSensitivityLevelChanged(int recirculationSensitivityLevel, const QString & zone))
Q_PRIVATE_SLOT(d_func(), void onClimateModeChanged(ClimateModule:: ClimateMode climateMode, const QString & zone))
Q_PRIVATE_SLOT(d_func(), void onAutomaticClimateFanIntensityLevelChanged(int automaticClimateFanIntensityLevel, const QString & zone))
Q_PRIVATE_SLOT(d_func(), void onAirflowDirectionsChanged(ClimateModule:: AirflowDirections airflowDirections, const QString & zone))
Q_DECLARE_PRIVATE(ClimateControl)
};
#endif // CLIMATE_CLIMATECONTROL_H_