Fix some more threading errors (#911)

This commit is contained in:
Murat Seker
2020-08-02 10:44:42 +02:00
committed by GitHub
parent d9e33885a0
commit 8824e69986
9 changed files with 132 additions and 156 deletions

View File

@@ -50,24 +50,12 @@ public:
///
~LedDevice() override;
///
/// @brief Get color order of device.
///
/// @return The color order
///
const QString & getColorOrder() const { return _colorOrder; }
///
/// @brief Set the current active LED-device type.
///
/// @param deviceType Device's type
///
void setActiveDeviceType(const QString& deviceType);
///
/// @brief Get the current active LED-device type.
///
const QString & getActiveDeviceType() const { return _activeDeviceType; }
void setActiveDeviceType(const QString& deviceType);
///
/// @brief Set the number of LEDs supported by the device.
@@ -76,13 +64,6 @@ public:
///
void setLedCount(unsigned int ledCount);
///
/// @brief Get the number of LEDs supported by the device.
///
/// @return Number of device's LEDs
///
unsigned int getLedCount() const { return _ledCount; }
///
/// @brief Check, if the device is enabled.
///
@@ -100,13 +81,6 @@ public:
///
void setLatchTime(int latchTime_ms);
///
/// @brief Get the currently defined LatchTime.
///
/// @return Latch time in milliseconds
///
int getLatchTime() const { return _latchTime_ms; }
///
/// @brief Discover devices of this type available (for configuration).
/// @note Mainly used for network devices. Allows to find devices, e.g. via ssdp, mDNS or cloud ways.
@@ -167,13 +141,6 @@ public:
///
bool isInError() const { return _isDeviceInError; }
///
/// @brief Get the LED-Device component's state.
///
/// @return True, if enabled
///
inline bool componentState() const { return isEnabled(); }
///
/// @brief Prints the color values to stdout.
///
@@ -214,6 +181,39 @@ public slots:
///
void setEnable(bool enable);
///
/// @brief Get the currently defined LatchTime.
///
/// @return Latch time in milliseconds
///
int getLatchTime() const { return _latchTime_ms; }
///
/// @brief Get the number of LEDs supported by the device.
///
/// @return Number of device's LEDs
///
unsigned int getLedCount() const { return _ledCount; }
///
/// @brief Get the current active LED-device type.
///
QString getActiveDeviceType() const { return _activeDeviceType; }
///
/// @brief Get color order of device.
///
/// @return The color order
///
QString getColorOrder() const { return _colorOrder; }
///
/// @brief Get the LED-Device component's state.
///
/// @return True, if enabled
///
inline bool componentState() const { return isEnabled(); }
signals:
///
/// @brief Emits whenever the LED-Device switches between on/off.

View File

@@ -6,6 +6,8 @@
#include <utils/ColorRgb.h>
#include <utils/Components.h>
#include <QMutex>
class LedDevice;
class Hyperion;
@@ -53,7 +55,7 @@ public:
///
/// @brief Get the current active ledDevice type
///
const QString & getActiveDeviceType();
QString getActiveDeviceType();
///
/// @brief Return the last enable state
@@ -63,7 +65,7 @@ public:
///
/// @brief Get the current colorOrder from device
///
const QString & getColorOrder();
QString getColorOrder();
///
/// @brief Get the number of LEDs from device
@@ -103,6 +105,7 @@ private slots:
protected:
/// contains all available led device constructors
static LedDeviceRegistry _ledDeviceMap;
static QMutex _ledDeviceMapLock;
private:
///