/****************************************************************************
** Generated from 'Example.IVI.Climate.qface'
**
** Created by: The QFace generator (QtAS 5.12.8)
**
** WARNING! All changes made in this file will be lost!
*****************************************************************************/
#include "climatemodule.h"#include "climatemodulefactory.h"#include "climatecontrol.h"#include <QtIviCore/QIviPendingReply>#include <QQmlEngine>#include <QDebug>#include <QDataStream>/*! \internal */QObject* climatemodule_singletontype_provider(QQmlEngine*,QJSEngine*)
{
returnnew ClimateModuleFactory();
}
/*!
\class ClimateModule
\inmodule Example.IVI.Climate
\brief The ClimateModule class holds all the enums defined in the Example.IVI.Climate module.
*//*!
\enum ClimateModule::AirflowDirection
\brief Control where the airflow goes
\value Windshield
\brief Airflow to the windshield
\value Dashboard
\brief Airflow to the dashboard
\value Floor
\brief Airflow to the floor
*//*!
\enum ClimateModule::RecirculationMode
\value RecirculationOff
\value RecirculationOn
\value AutoRecirculation
*//*!
\enum ClimateModule::ClimateMode
\value ClimateOff
\value ClimateOn
\value AutoClimate
*/
ClimateModule::ClimateModule(QObject*parent)
: QObject(parent)
{
}
/*! \internal */
ClimateModule::AirflowDirection ClimateModule::toAirflowDirection(quint8 v, bool *ok)
{
if (ok)
*ok =true;
switch (v) {
case1: return Windshield;
case2: return Dashboard;
case4: return Floor;
default:
if (ok)
*ok =false;
return Windshield;
}
}
/*! \internal */
ClimateModule::RecirculationMode ClimateModule::toRecirculationMode(quint8 v, bool *ok)
{
if (ok)
*ok =true;
switch (v) {
case0: return RecirculationOff;
case1: return RecirculationOn;
case2: return AutoRecirculation;
default:
if (ok)
*ok =false;
return RecirculationOff;
}
}
/*! \internal */
ClimateModule::ClimateMode ClimateModule::toClimateMode(quint8 v, bool *ok)
{
if (ok)
*ok =true;
switch (v) {
case0: return ClimateOff;
case1: return ClimateOn;
case2: return AutoClimate;
default:
if (ok)
*ok =false;
return ClimateOff;
}
}
/*! \internal */void ClimateModule::registerTypes()
{
qRegisterMetaType<ClimateModule::AirflowDirections>();
qRegisterMetaTypeStreamOperators<ClimateModule::AirflowDirections>();
qIviRegisterPendingReplyType<ClimateModule::AirflowDirections>();
qRegisterMetaType<ClimateModule::RecirculationMode>();
qRegisterMetaTypeStreamOperators<ClimateModule::RecirculationMode>();
qIviRegisterPendingReplyType<ClimateModule::RecirculationMode>();
qRegisterMetaType<ClimateModule::ClimateMode>();
qRegisterMetaTypeStreamOperators<ClimateModule::ClimateMode>();
qIviRegisterPendingReplyType<ClimateModule::ClimateMode>();
}
/*! \internal */void ClimateModule::registerQmlTypes(constQString& uri,int majorVersion,int minorVersion)
{
qmlRegisterSingletonType<ClimateModule>(uri.toLatin1(), majorVersion, minorVersion,"ClimateModule",
climatemodule_singletontype_provider);
ClimateControl::registerQmlTypes(uri, majorVersion, minorVersion);
}
QDataStream&operator<<(QDataStream&out, ClimateModule::AirflowDirections var)
{
out << (quint8)var;
return out;
}
QDataStream&operator>>(QDataStream&in, ClimateModule::AirflowDirections &var)
{
bool ok;
quint8 val;
in >> val;
var = ClimateModule::toAirflowDirection(val,&ok);
if (!ok)
qWarning() <<"Received an invalid enum value for type ClimateModule::AirflowDirections, value ="<< var;
return in;
}
QDataStream&operator<<(QDataStream&out, ClimateModule::RecirculationMode var)
{
out << (quint8)var;
return out;
}
QDataStream&operator>>(QDataStream&in, ClimateModule::RecirculationMode &var)
{
bool ok;
quint8 val;
in >> val;
var = ClimateModule::toRecirculationMode(val,&ok);
if (!ok)
qWarning() <<"Received an invalid enum value for type ClimateModule::RecirculationMode, value ="<< var;
return in;
}
QDataStream&operator<<(QDataStream&out, ClimateModule::ClimateMode var)
{
out << (quint8)var;
return out;
}
QDataStream&operator>>(QDataStream&in, ClimateModule::ClimateMode &var)
{
bool ok;
quint8 val;
in >> val;
var = ClimateModule::toClimateMode(val,&ok);
if (!ok)
qWarning() <<"Received an invalid enum value for type ClimateModule::ClimateMode, value ="<< var;
return in;
}