10#include <QQmlParserStatus>
11#include <QVariantAnimation>
13#ifdef HYELICHT_BUILD_ONBOARD
49 Q_INTERFACES(QQmlParserStatus)
395 void connectPwmGenerator();
396 void disconnectPwmGenerator();
397 void fade(qreal from, qreal to);
398 inline
void writeBrightness(qreal
brightness);
402#ifdef HYELICHT_BUILD_ONBOARD
403 QSerialPort m_serialPort;
409 qreal m_pendingBrightness;
411 QTimer m_idleTimeoutTimer;
413 QVariantAnimation m_fadeAnimation;
Provides PWM-based display backlight control with the help of an attached MCU.
Definition displaycontroller.h:47
void setIdleTimeout(int timeout)
Set the wait time in seconds after which the display is turned off.
Definition displaycontroller.cpp:232
qreal brightness
Display brightness level while on.
Definition displaycontroller.h:108
void componentComplete() override
Implements the QQmlParserStatus interface.
Definition displaycontroller.cpp:291
void setSerialPortName(const QString &serialPortName)
Set the serial port device filename used for communication with the PWM generator MCU.
Definition displaycontroller.cpp:121
void brightnessChanged() const
The display brightness level while on has changed.
void setEnabled(bool enabled)
Turn serial communication with the PWM generator MCU on or off.
Definition displaycontroller.cpp:95
int fadeDuration
Duration in milliseconds for an animated fade between the two ends of the brightness range.
Definition displaycontroller.h:135
QEasingCurve fadeEasing
Easing curve used when fading between display brightness levels.
Definition displaycontroller.h:145
void classBegin() override
Implements the QQmlParserStatus interface.
Definition displaycontroller.cpp:286
void baudRateChanged() const
The baud rate used for serial communication with the PWM generator MCU has changed.
QString serialPortName
Serial port device filename used for communication with the PWM generator MCU.
Definition displaycontroller.h:70
void serialPortNameChanged() const
The serial port device filename used for communication with the PWM generator MCU has changed.
void idleTimeoutChanged() const
The wait time in seconds after which the display is turned off has changed.
void fadeDurationChanged() const
The duration in milliseconds for an animated fade between the two ends of the brightness range has ch...
void setBrightness(qreal brightness)
Set the display brightness level while on.
Definition displaycontroller.cpp:212
void setOn(bool on)
Turn the display on or off.
Definition displaycontroller.cpp:173
void setFadeEasing(const QEasingCurve &fadeEasing)
Set the easing curve used when fading between display brightness levels.
Definition displaycontroller.cpp:278
void enabledChanged() const
Serial communication with the PWM generator MCU has turned on or off.
int idleTimeout
Wait time in seconds after which the display is turned off.
Definition displaycontroller.h:120
Q_INVOKABLE void resetIdleTimeout()
Reset the auto-turnoff timer.
Definition displaycontroller.cpp:250
void setFadeDuration(int fadeDuration)
Set the duration in milliseconds for an animated fade between the two ends of the brightness range.
Definition displaycontroller.cpp:264
void onChanged() const
The display has turned on or off.
bool enabled
Toggle serial communication with the PWM generator MCU.
Definition displaycontroller.h:60
qint32 baudRate
Baud rate used for serial communication with the PWM generator MCU.
Definition displaycontroller.h:80
bool on
Toggle the display on or off.
Definition displaycontroller.h:94
void fadeEasingChanged() const
The easing curve used when fading between display brightness levels has changed.
void setBaudRate(qint32 rate)
Set the baud rate used for serial communication with the PWM generator MCU.
Definition displaycontroller.cpp:149