29 m_resolution(MaxResolution),
30 m_maxResolution(MaxResolution)
38 QVariantMap::const_iterator it = Details.begin();
39 for ( ; it != Details.constEnd(); ++it)
41 if (it.key() == QStringLiteral(
"resolution"))
44 uint resolution = it.value().toUInt(&ok);
47 if (resolution >= 128 && resolution <= 16777215)
51 LOG(VB_GENERAL, LOG_ERR, QStringLiteral(
"Requested resolution of %1 for '%2' exceeds maximum - defaulting to %3")
62 LOG(VB_GENERAL, LOG_ERR, QStringLiteral(
"Requested resolution of %1 for '%2' is out of range - defaulting to %3")
68 LOG(VB_GENERAL, LOG_ERR, QStringLiteral(
"Failed to parse resolution for '%1'").arg(
uniqueId));
76 return QStringList() << tr(
"Constant PWM");
97 double newvalue = qBound(0.0, NewValue, 1.0);
102 if (newvalue <= threshhold || newvalue >= (1 - threshhold))
105 if (qAbs(
value - newvalue) < threshhold)
TorcOutput::Type GetType(void) override
uint GetMaxResolution(void)
QStringList GetDescription(void) override
bool ValueIsDifferent(double &NewValue)
TorcPWMOutput(double Value, const QString &ModelId, const QVariantMap &Details, uint MaxResolution=DEFAULT_PWM_RESOLUTION)
#define LOG(_MASK_, _LEVEL_, _STRING_)
bool SetOwner(QObject *Owner)