mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Fix non image updates ignore blacklisted leds (#1635)
* Fix #1634 * Refactor to process blacklisted LEDs with less resources
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
|
||||
// QT includes
|
||||
#include <QString>
|
||||
#include <QJsonArray>
|
||||
|
||||
// Forward class declarations
|
||||
namespace Json { class Value; }
|
||||
@@ -73,7 +74,7 @@ inline ColorOrder stringToColorOrder(const QString & order)
|
||||
}
|
||||
|
||||
///
|
||||
/// The Led structure contains the definition of the image portion used to determine a single led's
|
||||
/// The Led structure contains the definition of the image portion used to determine a single LED's
|
||||
/// color.
|
||||
/// @verbatim
|
||||
/// |--------------------image--|
|
||||
@@ -89,39 +90,66 @@ inline ColorOrder stringToColorOrder(const QString & order)
|
||||
///
|
||||
struct Led
|
||||
{
|
||||
/// The minimum vertical scan line included for this leds color
|
||||
/// The minimum vertical scan line included for this LEDs color
|
||||
double minX_frac;
|
||||
/// The maximum vertical scan line included for this leds color
|
||||
/// The maximum vertical scan line included for this LEDs color
|
||||
double maxX_frac;
|
||||
/// The minimum horizontal scan line included for this leds color
|
||||
/// The minimum horizontal scan line included for this LEDs color
|
||||
double minY_frac;
|
||||
/// The maximum horizontal scan line included for this leds color
|
||||
/// The maximum horizontal scan line included for this LEDs color
|
||||
double maxY_frac;
|
||||
/// A LEDs at {0,0,0,0} is not visible and therefore treated as blacklisted
|
||||
bool isBlacklisted {false};
|
||||
/// the color order
|
||||
ColorOrder colorOrder;
|
||||
};
|
||||
|
||||
///
|
||||
/// The LedString contains the image integration information of the leds
|
||||
/// The LedString contains the image integration information of the LEDs
|
||||
///
|
||||
class LedString
|
||||
{
|
||||
public:
|
||||
///
|
||||
/// Returns the led specifications
|
||||
/// Returns the LED specifications
|
||||
///
|
||||
/// @return The list with led specifications
|
||||
///
|
||||
std::vector<Led>& leds();
|
||||
|
||||
///
|
||||
/// Returns the led specifications
|
||||
/// Returns the LED specifications
|
||||
///
|
||||
/// @return The list with led specifications
|
||||
///
|
||||
const std::vector<Led>& leds() const;
|
||||
|
||||
///
|
||||
/// Returns the IDs of blacklisted LEDs
|
||||
///
|
||||
/// @return ID List of blacklisted LEDs
|
||||
///
|
||||
std::vector<int>& blacklistedLedIds();
|
||||
|
||||
///
|
||||
/// Returns the IDs of blacklisted LEDs
|
||||
///
|
||||
/// @return ID List of blacklisted LEDs
|
||||
///
|
||||
const std::vector<int>& blacklistedLedIds() const;
|
||||
|
||||
///
|
||||
/// Check, if teh layout has blacklisted LEDs configured
|
||||
///
|
||||
/// @return True, if blacklisted LEDs are configured
|
||||
///
|
||||
bool hasBlackListedLeds ();
|
||||
|
||||
static LedString createLedString(const QJsonArray& ledConfigArray, const ColorOrder deviceOrder);
|
||||
|
||||
private:
|
||||
/// The list with led specifications
|
||||
std::vector<Led> mLeds;
|
||||
/// The list with LED specifications
|
||||
std::vector<Led> _leds;
|
||||
/// The list containing IDs of blacklisted LED
|
||||
std::vector<int> _blacklistedLedIds;
|
||||
};
|
||||
|
Reference in New Issue
Block a user