Added '*' option to led indices of transform

Former-commit-id: 2a6af2ad4ba9e4577b466ac7401528a6df84ef0b
This commit is contained in:
T. van der Zwan 2013-12-13 21:58:09 +00:00
parent 89252d45d0
commit b38a98c3ad

View File

@ -223,7 +223,15 @@ MultiColorTransform * Hyperion::createLedColorsTransform(const unsigned ledCnt,
ColorTransform * colorTransform = createColorTransform(config); ColorTransform * colorTransform = createColorTransform(config);
transform->addTransform(colorTransform); transform->addTransform(colorTransform);
const QString ledIndicesStr = config.get("leds", "").asCString(); const QString ledIndicesStr = QString(config.get("leds", "").asCString()).trimmed();
if (ledIndicesStr.compare("*") == 0)
{
// Special case for indices '*' => all leds
transform->setTransformForLed(colorTransform->_id, 0, ledCnt-1);
std::cout << "ColorTransform '" << colorTransform->_id << "' => [0; "<< ledCnt-1 << "]" << std::endl;
continue;
}
if (!overallExp.exactMatch(ledIndicesStr)) if (!overallExp.exactMatch(ledIndicesStr))
{ {
std::cerr << "Given led indices " << i << " not correct format: " << ledIndicesStr.toStdString() << std::endl; std::cerr << "Given led indices " << i << " not correct format: " << ledIndicesStr.toStdString() << std::endl;