From 38e3b5e83e6ab8bb21565aa62011ca79702916dc Mon Sep 17 00:00:00 2001 From: 8-Lambda-8 Date: Sat, 28 Dec 2024 19:39:44 +0100 Subject: [PATCH 01/10] create Effects in function wizard --- ui/src/functionwizard.cpp | 30 ++++++++++++++ ui/src/palettegenerator.cpp | 80 +++++++++++++++++++++++++++++++++++++ ui/src/palettegenerator.h | 9 +++++ 3 files changed, 119 insertions(+) diff --git a/ui/src/functionwizard.cpp b/ui/src/functionwizard.cpp index 2da3877a30..ab2fdfed78 100644 --- a/ui/src/functionwizard.cpp +++ b/ui/src/functionwizard.cpp @@ -31,6 +31,7 @@ #include "vcsoloframe.h" #include "vccuelist.h" #include "rgbmatrix.h" +#include "efx.h" #include "vcwidget.h" #include "vcbutton.h" #include "vcslider.h" @@ -328,6 +329,15 @@ void FunctionWizard::updateAvailableFunctionsTree() addFunctionsGroup(fxGrpItem, grpItem, PaletteGenerator::typetoString(PaletteGenerator::Animation), PaletteGenerator::Animation); + addFunctionsGroup(fxGrpItem, grpItem, + PaletteGenerator::typetoString(PaletteGenerator::Effect), + PaletteGenerator::Effect); + } + else if (cap == QLCChannel::groupToString(QLCChannel::Pan)) + { + addFunctionsGroup(fxGrpItem, grpItem, + PaletteGenerator::typetoString(PaletteGenerator::Effect), + PaletteGenerator::Effect); } else if (cap == QLCChannel::groupToString(QLCChannel::Gobo)) addFunctionsGroup(fxGrpItem, grpItem, @@ -427,6 +437,12 @@ void FunctionWizard::updateResultFunctionsTree() item->setText(KFunctionName, matrix->name()); item->setIcon(KFunctionName, matrix->getIcon()); } + foreach (EFX *effect, palette->effects()) + { + QTreeWidgetItem *item = new QTreeWidgetItem(getFunctionGroupItem(effect)); + item->setText(KFunctionName, effect->name()); + item->setIcon(KFunctionName, effect->getIcon()); + } } } } @@ -521,6 +537,20 @@ void FunctionWizard::updateWidgetsTree() item->setData(KWidgetName, Qt::UserRole, VCWidget::ButtonWidget); item->setData(KWidgetName, Qt::UserRole + 1, QVariant::fromValue((void *)matrix)); } + foreach (EFX *effect, palette->effects()) + { + QTreeWidgetItem *item = NULL; + if (soloFrameItem != NULL) + item = new QTreeWidgetItem(soloFrameItem); + else + item = new QTreeWidgetItem(frame); + QString toRemove = " - " + palette->model(); + item->setText(KWidgetName, effect->name().remove(toRemove)); + item->setIcon(KWidgetName, VCWidget::typeToIcon(VCWidget::ButtonWidget)); + item->setCheckState(KWidgetName, Qt::Unchecked); + item->setData(KWidgetName, Qt::UserRole, VCWidget::ButtonWidget); + item->setData(KWidgetName, Qt::UserRole + 1, QVariant::fromValue((void *)effect)); + } if (palette->scenes().count() > 0) { diff --git a/ui/src/palettegenerator.cpp b/ui/src/palettegenerator.cpp index cb35fc132e..9f451b98b6 100644 --- a/ui/src/palettegenerator.cpp +++ b/ui/src/palettegenerator.cpp @@ -30,6 +30,7 @@ #include "fixturegroup.h" #include "chaserstep.h" #include "rgbmatrix.h" +#include "efx.h" #include "fixture.h" #include "chaser.h" #include "scene.h" @@ -60,6 +61,7 @@ PaletteGenerator::~PaletteGenerator() m_scenes.clear(); m_chasers.clear(); m_matrices.clear(); + m_effects.clear(); } void PaletteGenerator::setName(QString name) @@ -102,6 +104,7 @@ QString PaletteGenerator::typetoString(PaletteGenerator::PaletteType type) case Gobos: return tr("Gobo macros"); case ColourMacro: return tr("Colour macros"); case Animation: return tr("Animations"); + case Effect: return tr("Effects"); case Undefined: default: return tr("Unknown"); @@ -194,6 +197,11 @@ QList PaletteGenerator::matrices() return m_matrices; } +QList PaletteGenerator::effects() +{ + return m_effects; +} + void PaletteGenerator::addToDoc() { foreach (Scene *scene, m_scenes) @@ -217,6 +225,10 @@ void PaletteGenerator::addToDoc() matrix->setFixtureGroup(m_fixtureGroup->id()); m_doc->addFunction(matrix); } + foreach (EFX *effect, m_effects) + { + m_doc->addFunction(effect); + } } void PaletteGenerator::createColorScene(QList chMap, QString name, PaletteSubType subType) @@ -453,6 +465,65 @@ void PaletteGenerator::createRGBMatrices(QList rgbMap) } } +EFX *PaletteGenerator::createEffect(QList fixtures, bool staggered, EFXFixture::Mode mode) +{ + EFX *efx = new EFX(m_doc); + + QString modeString = (new QString[]{KXMLQLCEFXFixtureModePanTilt, KXMLQLCEFXFixtureModeDimmer, KXMLQLCEFXFixtureModeRGB})[mode]; + + efx->setName(tr("Effect %1 %2 - ").arg(modeString).arg(staggered ? " Staggered " : "") + m_model); + + if (mode == EFXFixture::Mode::RGB) + { + efx->setAlgorithm(EFX::Algorithm::Line2); + efx->setHeight(0); + } + else if (mode == EFXFixture::Mode::PanTilt) + { + } + else if (mode == EFXFixture::Mode::Dimmer) + { + } + + for (int i = 0; i < fixtures.count(); i++) + { + Fixture *fixture = fixtures[i]; + for (int h = 0; h < fixture->heads(); h++) + { + qDebug() << "fx" << fixture->channelAddress(0) << " " << h; + + EFXFixture *ef = new EFXFixture(efx); + ef->setHead(GroupHead(fixture->id(), h)); + ef->setMode(mode); + ef->setStartOffset(staggered ? (i * (360 / fixtures.count())) : 0); + efx->addFixture(ef); + } + } + + qDebug() << "efx: " << efx << efx->fixtures().count(); + + return efx; +} + +void PaletteGenerator::createEffects(QList fixtures) +{ + qDebug() << "createEffects"; + + m_effects.append(createEffect(fixtures, false, EFXFixture::Mode::Dimmer)); + m_effects.append(createEffect(fixtures, true, EFXFixture::Mode::Dimmer)); + + if (PaletteGenerator::getCapabilities(fixtures[0]).contains(KQLCChannelRGB)) + { + m_effects.append(createEffect(fixtures, false, EFXFixture::Mode::RGB)); + m_effects.append(createEffect(fixtures, true, EFXFixture::Mode::RGB)); + } + if (PaletteGenerator::getCapabilities(fixtures[0]).contains(KQLCChannelMovement)) + { + m_effects.append(createEffect(fixtures, false, EFXFixture::Mode::PanTilt)); + m_effects.append(createEffect(fixtures, true, EFXFixture::Mode::PanTilt)); + } +} + void PaletteGenerator::createChaser(QString name) { if (m_scenes.count() == 0) @@ -561,6 +632,15 @@ void PaletteGenerator::createFunctions(PaletteGenerator::PaletteType type, if (m_redList.size() > 1 && m_greenList.size() == m_redList.size() && m_blueList.size() == m_redList.size()) createRGBMatrices(m_redList); } + break; + case Effect: + { + if ((m_redList.size() > 1 && + m_greenList.size() == m_redList.size() && + m_blueList.size() == m_redList.size()) || + m_panList.size() > 1) + createEffects(m_fixtures); + } break; case Gobos: { diff --git a/ui/src/palettegenerator.h b/ui/src/palettegenerator.h index 6e7fd6ec89..bdd38eb944 100644 --- a/ui/src/palettegenerator.h +++ b/ui/src/palettegenerator.h @@ -26,9 +26,12 @@ #include #include "scenevalue.h" +#include "efx.h" class FixtureGroup; class RGBMatrix; +class EFX; +class EFXFixture; class Fixture; class Chaser; class Scene; @@ -56,6 +59,7 @@ class PaletteGenerator: public QObject Shutter, Gobos, ColourMacro, + Effect, Animation }; @@ -112,6 +116,7 @@ class PaletteGenerator: public QObject QList scenes(); QList chasers(); QList matrices(); + QList effects(); void addToDoc(); @@ -127,6 +132,9 @@ class PaletteGenerator: public QObject void createRGBMatrices(QList rgbMap); + EFX* createEffect(QList fixtures, bool staggered, EFXFixture::Mode mode); + void createEffects(QList fixtures); + void createChaser(QString name); /** @@ -152,6 +160,7 @@ class PaletteGenerator: public QObject QList m_scenes; QList m_chasers; QList m_matrices; + QList m_effects; }; /** @} */ From d17d3ec9b8536cb6003899329976d2c52e9aeefa Mon Sep 17 00:00:00 2001 From: 8-Lambda-8 Date: Sat, 4 Jan 2025 17:16:50 +0100 Subject: [PATCH 02/10] fixed mode String --- ui/src/palettegenerator.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ui/src/palettegenerator.cpp b/ui/src/palettegenerator.cpp index 9f451b98b6..f24f95c770 100644 --- a/ui/src/palettegenerator.cpp +++ b/ui/src/palettegenerator.cpp @@ -469,9 +469,7 @@ EFX *PaletteGenerator::createEffect(QList fixtures, bool staggered, E { EFX *efx = new EFX(m_doc); - QString modeString = (new QString[]{KXMLQLCEFXFixtureModePanTilt, KXMLQLCEFXFixtureModeDimmer, KXMLQLCEFXFixtureModeRGB})[mode]; - - efx->setName(tr("Effect %1 %2 - ").arg(modeString).arg(staggered ? " Staggered " : "") + m_model); + efx->setName(tr("Effect %1 %2 - ").arg(EFXFixture::modeToString(mode)).arg(staggered ? " Staggered " : "") + m_model); if (mode == EFXFixture::Mode::RGB) { From 009b02364026b777a66f205b9a7c97422f7618e9 Mon Sep 17 00:00:00 2001 From: 8-Lambda-8 Date: Sat, 4 Jan 2025 18:21:24 +0100 Subject: [PATCH 03/10] fixed indentation --- ui/src/palettegenerator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/src/palettegenerator.cpp b/ui/src/palettegenerator.cpp index f24f95c770..a1555dc6b1 100644 --- a/ui/src/palettegenerator.cpp +++ b/ui/src/palettegenerator.cpp @@ -630,7 +630,7 @@ void PaletteGenerator::createFunctions(PaletteGenerator::PaletteType type, if (m_redList.size() > 1 && m_greenList.size() == m_redList.size() && m_blueList.size() == m_redList.size()) createRGBMatrices(m_redList); } - break; + break; case Effect: { if ((m_redList.size() > 1 && From 13247430320b9dc23b804ca89922e7813449c268 Mon Sep 17 00:00:00 2001 From: 8-Lambda-8 Date: Sat, 4 Jan 2025 18:54:47 +0100 Subject: [PATCH 04/10] renamed Effects to EFX --- ui/src/palettegenerator.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/src/palettegenerator.cpp b/ui/src/palettegenerator.cpp index a1555dc6b1..2f2504df9b 100644 --- a/ui/src/palettegenerator.cpp +++ b/ui/src/palettegenerator.cpp @@ -104,7 +104,7 @@ QString PaletteGenerator::typetoString(PaletteGenerator::PaletteType type) case Gobos: return tr("Gobo macros"); case ColourMacro: return tr("Colour macros"); case Animation: return tr("Animations"); - case Effect: return tr("Effects"); + case Effect: return tr("EFXs"); case Undefined: default: return tr("Unknown"); @@ -469,7 +469,7 @@ EFX *PaletteGenerator::createEffect(QList fixtures, bool staggered, E { EFX *efx = new EFX(m_doc); - efx->setName(tr("Effect %1 %2 - ").arg(EFXFixture::modeToString(mode)).arg(staggered ? " Staggered " : "") + m_model); + efx->setName(tr("EFX %1 %2 - ").arg(EFXFixture::modeToString(mode)).arg(staggered ? " Staggered " : "") + m_model); if (mode == EFXFixture::Mode::RGB) { From a041b1c4ba063239659170f8644245ba41840c08 Mon Sep 17 00:00:00 2001 From: 8-Lambda-8 Date: Wed, 19 Mar 2025 20:27:45 +0100 Subject: [PATCH 05/10] renamed all effects to EFX --- ui/src/functionwizard.cpp | 22 +++++++++++----------- ui/src/palettegenerator.cpp | 36 ++++++++++++++++++------------------ ui/src/palettegenerator.h | 10 +++++----- 3 files changed, 34 insertions(+), 34 deletions(-) diff --git a/ui/src/functionwizard.cpp b/ui/src/functionwizard.cpp index ab2fdfed78..ef27cda6de 100644 --- a/ui/src/functionwizard.cpp +++ b/ui/src/functionwizard.cpp @@ -330,14 +330,14 @@ void FunctionWizard::updateAvailableFunctionsTree() PaletteGenerator::typetoString(PaletteGenerator::Animation), PaletteGenerator::Animation); addFunctionsGroup(fxGrpItem, grpItem, - PaletteGenerator::typetoString(PaletteGenerator::Effect), - PaletteGenerator::Effect); + PaletteGenerator::typetoString(PaletteGenerator::Efx), + PaletteGenerator::Efx); } else if (cap == QLCChannel::groupToString(QLCChannel::Pan)) { addFunctionsGroup(fxGrpItem, grpItem, - PaletteGenerator::typetoString(PaletteGenerator::Effect), - PaletteGenerator::Effect); + PaletteGenerator::typetoString(PaletteGenerator::Efx), + PaletteGenerator::Efx); } else if (cap == QLCChannel::groupToString(QLCChannel::Gobo)) addFunctionsGroup(fxGrpItem, grpItem, @@ -437,11 +437,11 @@ void FunctionWizard::updateResultFunctionsTree() item->setText(KFunctionName, matrix->name()); item->setIcon(KFunctionName, matrix->getIcon()); } - foreach (EFX *effect, palette->effects()) + foreach (EFX *efx, palette->efxs()) { - QTreeWidgetItem *item = new QTreeWidgetItem(getFunctionGroupItem(effect)); - item->setText(KFunctionName, effect->name()); - item->setIcon(KFunctionName, effect->getIcon()); + QTreeWidgetItem *item = new QTreeWidgetItem(getFunctionGroupItem(efx)); + item->setText(KFunctionName, efx->name()); + item->setIcon(KFunctionName, efx->getIcon()); } } } @@ -537,7 +537,7 @@ void FunctionWizard::updateWidgetsTree() item->setData(KWidgetName, Qt::UserRole, VCWidget::ButtonWidget); item->setData(KWidgetName, Qt::UserRole + 1, QVariant::fromValue((void *)matrix)); } - foreach (EFX *effect, palette->effects()) + foreach (EFX *efx, palette->efxs()) { QTreeWidgetItem *item = NULL; if (soloFrameItem != NULL) @@ -545,11 +545,11 @@ void FunctionWizard::updateWidgetsTree() else item = new QTreeWidgetItem(frame); QString toRemove = " - " + palette->model(); - item->setText(KWidgetName, effect->name().remove(toRemove)); + item->setText(KWidgetName, efx->name().remove(toRemove)); item->setIcon(KWidgetName, VCWidget::typeToIcon(VCWidget::ButtonWidget)); item->setCheckState(KWidgetName, Qt::Unchecked); item->setData(KWidgetName, Qt::UserRole, VCWidget::ButtonWidget); - item->setData(KWidgetName, Qt::UserRole + 1, QVariant::fromValue((void *)effect)); + item->setData(KWidgetName, Qt::UserRole + 1, QVariant::fromValue((void *)efx)); } if (palette->scenes().count() > 0) diff --git a/ui/src/palettegenerator.cpp b/ui/src/palettegenerator.cpp index 2f2504df9b..2135da2436 100644 --- a/ui/src/palettegenerator.cpp +++ b/ui/src/palettegenerator.cpp @@ -61,7 +61,7 @@ PaletteGenerator::~PaletteGenerator() m_scenes.clear(); m_chasers.clear(); m_matrices.clear(); - m_effects.clear(); + m_efxs.clear(); } void PaletteGenerator::setName(QString name) @@ -104,7 +104,7 @@ QString PaletteGenerator::typetoString(PaletteGenerator::PaletteType type) case Gobos: return tr("Gobo macros"); case ColourMacro: return tr("Colour macros"); case Animation: return tr("Animations"); - case Effect: return tr("EFXs"); + case Efx: return tr("EFXs"); case Undefined: default: return tr("Unknown"); @@ -197,9 +197,9 @@ QList PaletteGenerator::matrices() return m_matrices; } -QList PaletteGenerator::effects() +QList PaletteGenerator::efxs() { - return m_effects; + return m_efxs; } void PaletteGenerator::addToDoc() @@ -225,9 +225,9 @@ void PaletteGenerator::addToDoc() matrix->setFixtureGroup(m_fixtureGroup->id()); m_doc->addFunction(matrix); } - foreach (EFX *effect, m_effects) + foreach (EFX *efx, m_efxs) { - m_doc->addFunction(effect); + m_doc->addFunction(efx); } } @@ -465,7 +465,7 @@ void PaletteGenerator::createRGBMatrices(QList rgbMap) } } -EFX *PaletteGenerator::createEffect(QList fixtures, bool staggered, EFXFixture::Mode mode) +EFX *PaletteGenerator::createEfx(QList fixtures, bool staggered, EFXFixture::Mode mode) { EFX *efx = new EFX(m_doc); @@ -503,22 +503,22 @@ EFX *PaletteGenerator::createEffect(QList fixtures, bool staggered, E return efx; } -void PaletteGenerator::createEffects(QList fixtures) +void PaletteGenerator::createEfxs(QList fixtures) { - qDebug() << "createEffects"; + qDebug() << "createEfxs"; - m_effects.append(createEffect(fixtures, false, EFXFixture::Mode::Dimmer)); - m_effects.append(createEffect(fixtures, true, EFXFixture::Mode::Dimmer)); + m_efxs.append(createEfx(fixtures, false, EFXFixture::Mode::Dimmer)); + m_efxs.append(createEfx(fixtures, true, EFXFixture::Mode::Dimmer)); if (PaletteGenerator::getCapabilities(fixtures[0]).contains(KQLCChannelRGB)) { - m_effects.append(createEffect(fixtures, false, EFXFixture::Mode::RGB)); - m_effects.append(createEffect(fixtures, true, EFXFixture::Mode::RGB)); + m_efxs.append(createEfx(fixtures, false, EFXFixture::Mode::RGB)); + m_efxs.append(createEfx(fixtures, true, EFXFixture::Mode::RGB)); } if (PaletteGenerator::getCapabilities(fixtures[0]).contains(KQLCChannelMovement)) { - m_effects.append(createEffect(fixtures, false, EFXFixture::Mode::PanTilt)); - m_effects.append(createEffect(fixtures, true, EFXFixture::Mode::PanTilt)); + m_efxs.append(createEfx(fixtures, false, EFXFixture::Mode::PanTilt)); + m_efxs.append(createEfx(fixtures, true, EFXFixture::Mode::PanTilt)); } } @@ -631,13 +631,13 @@ void PaletteGenerator::createFunctions(PaletteGenerator::PaletteType type, createRGBMatrices(m_redList); } break; - case Effect: - { + case Efx: + { if ((m_redList.size() > 1 && m_greenList.size() == m_redList.size() && m_blueList.size() == m_redList.size()) || m_panList.size() > 1) - createEffects(m_fixtures); + createEfxs(m_fixtures); } break; case Gobos: diff --git a/ui/src/palettegenerator.h b/ui/src/palettegenerator.h index bdd38eb944..b46dceb3e3 100644 --- a/ui/src/palettegenerator.h +++ b/ui/src/palettegenerator.h @@ -59,7 +59,7 @@ class PaletteGenerator: public QObject Shutter, Gobos, ColourMacro, - Effect, + Efx Animation }; @@ -116,7 +116,7 @@ class PaletteGenerator: public QObject QList scenes(); QList chasers(); QList matrices(); - QList effects(); + QList efxs(); void addToDoc(); @@ -132,8 +132,8 @@ class PaletteGenerator: public QObject void createRGBMatrices(QList rgbMap); - EFX* createEffect(QList fixtures, bool staggered, EFXFixture::Mode mode); - void createEffects(QList fixtures); + EFX* createEfx(QList fixtures, bool staggered, EFXFixture::Mode mode); + void createEfxs(QList fixtures); void createChaser(QString name); @@ -160,7 +160,7 @@ class PaletteGenerator: public QObject QList m_scenes; QList m_chasers; QList m_matrices; - QList m_effects; + QList m_efxs; }; /** @} */ From 79b7e4b826b454568462276592d5e5bde78e3f1c Mon Sep 17 00:00:00 2001 From: 8-Lambda-8 Date: Wed, 19 Mar 2025 20:51:51 +0100 Subject: [PATCH 06/10] added dimmer Capability --- engine/src/qlcchannel.h | 1 + ui/src/functionwizard.cpp | 4 ++++ ui/src/palettegenerator.cpp | 15 ++++++++++++--- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/engine/src/qlcchannel.h b/engine/src/qlcchannel.h index b9e714b585..c986b623fd 100644 --- a/engine/src/qlcchannel.h +++ b/engine/src/qlcchannel.h @@ -53,6 +53,7 @@ class QXmlStreamWriter; #define KQLCChannelRGB QString("RGB") #define KQLCChannelCMY QString("CMY") #define KQLCChannelWhite QString("White") +#define KQLCChannelDimmer QString("Dimmer") /** * QLCChannel represents one DMX channel with one or more DMX value ranges, diff --git a/ui/src/functionwizard.cpp b/ui/src/functionwizard.cpp index ef27cda6de..80c3759e3f 100644 --- a/ui/src/functionwizard.cpp +++ b/ui/src/functionwizard.cpp @@ -351,6 +351,10 @@ void FunctionWizard::updateAvailableFunctionsTree() addFunctionsGroup(fxGrpItem, grpItem, PaletteGenerator::typetoString(PaletteGenerator::ColourMacro), PaletteGenerator::ColourMacro); + else if (cap == KQLCChannelDimmer) + addFunctionsGroup(fxGrpItem, grpItem, + PaletteGenerator::typetoString(PaletteGenerator::Efx), + PaletteGenerator::Efx); } } diff --git a/ui/src/palettegenerator.cpp b/ui/src/palettegenerator.cpp index 2135da2436..6c739811f6 100644 --- a/ui/src/palettegenerator.cpp +++ b/ui/src/palettegenerator.cpp @@ -119,6 +119,7 @@ QStringList PaletteGenerator::getCapabilities(const Fixture *fixture) bool hasRed = false, hasGreen = false, hasBlue = false; bool hasCyan = false, hasMagenta = false, hasYellow = false; bool hasWhite = false; + bool hasDimmer = false; Q_ASSERT(fixture != NULL); for (quint32 ch = 0; ch < fixture->channels(); ch++) @@ -160,6 +161,9 @@ QStringList PaletteGenerator::getCapabilities(const Fixture *fixture) case QLCChannel::White: hasWhite = true; break; default: break; } + if (channel->preset() == QLCChannel::IntensityDimmer || + channel->preset() == QLCChannel::IntensityMasterDimmer) + hasDimmer = true; } break; default: @@ -179,6 +183,9 @@ QStringList PaletteGenerator::getCapabilities(const Fixture *fixture) if (hasWhite) caps.append(KQLCChannelWhite); + if (hasDimmer) + caps.append(KQLCChannelDimmer); + return caps; } @@ -507,9 +514,11 @@ void PaletteGenerator::createEfxs(QList fixtures) { qDebug() << "createEfxs"; - m_efxs.append(createEfx(fixtures, false, EFXFixture::Mode::Dimmer)); - m_efxs.append(createEfx(fixtures, true, EFXFixture::Mode::Dimmer)); - + if (PaletteGenerator::getCapabilities(fixtures[0]).contains(KQLCChannelDimmer)) + { + m_efxs.append(createEfx(fixtures, false, EFXFixture::Mode::Dimmer)); + m_efxs.append(createEfx(fixtures, true, EFXFixture::Mode::Dimmer)); + } if (PaletteGenerator::getCapabilities(fixtures[0]).contains(KQLCChannelRGB)) { m_efxs.append(createEfx(fixtures, false, EFXFixture::Mode::RGB)); From cea71cfc811992c283d1dab71c3317353804d82b Mon Sep 17 00:00:00 2001 From: 8-Lambda-8 Date: Wed, 19 Mar 2025 23:37:56 +0100 Subject: [PATCH 07/10] added EFX child TreeWidgetItems --- ui/src/functionwizard.cpp | 54 ++++++++++++++++++++++++++++++------- ui/src/palettegenerator.cpp | 39 ++++++++++----------------- ui/src/palettegenerator.h | 6 +++-- 3 files changed, 62 insertions(+), 37 deletions(-) diff --git a/ui/src/functionwizard.cpp b/ui/src/functionwizard.cpp index 80c3759e3f..d7bcba7bff 100644 --- a/ui/src/functionwizard.cpp +++ b/ui/src/functionwizard.cpp @@ -269,12 +269,28 @@ QList FunctionWizard::fixtureIds() const * Functions ********************************************************************/ +QTreeWidgetItem *efxItem = NULL; + void FunctionWizard::addFunctionsGroup(QTreeWidgetItem *fxGrpItem, QTreeWidgetItem *grpItem, QString name, PaletteGenerator::PaletteType type) { if (grpItem == NULL) return; + if ((type == PaletteGenerator::EfxDimmer || + type == PaletteGenerator::EfxRGB || + type == PaletteGenerator::EfxPosition)) + { + if (efxItem == NULL){ + QTreeWidgetItem *item = new QTreeWidgetItem(grpItem); + item->setText(KFunctionName, "EFXs"); + item->setCheckState(KFunctionName, Qt::Unchecked); + item->setFlags(item->flags() | Qt::ItemIsUserCheckable | Qt::ItemIsAutoTristate); + efxItem = item; + } + grpItem = efxItem; + } + QTreeWidgetItem *item = new QTreeWidgetItem(grpItem); item->setText(KFunctionName, name); item->setCheckState(KFunctionName, Qt::Unchecked); @@ -330,14 +346,8 @@ void FunctionWizard::updateAvailableFunctionsTree() PaletteGenerator::typetoString(PaletteGenerator::Animation), PaletteGenerator::Animation); addFunctionsGroup(fxGrpItem, grpItem, - PaletteGenerator::typetoString(PaletteGenerator::Efx), - PaletteGenerator::Efx); - } - else if (cap == QLCChannel::groupToString(QLCChannel::Pan)) - { - addFunctionsGroup(fxGrpItem, grpItem, - PaletteGenerator::typetoString(PaletteGenerator::Efx), - PaletteGenerator::Efx); + PaletteGenerator::typetoString(PaletteGenerator::EfxRGB), + PaletteGenerator::EfxRGB); } else if (cap == QLCChannel::groupToString(QLCChannel::Gobo)) addFunctionsGroup(fxGrpItem, grpItem, @@ -353,9 +363,14 @@ void FunctionWizard::updateAvailableFunctionsTree() PaletteGenerator::ColourMacro); else if (cap == KQLCChannelDimmer) addFunctionsGroup(fxGrpItem, grpItem, - PaletteGenerator::typetoString(PaletteGenerator::Efx), - PaletteGenerator::Efx); + PaletteGenerator::typetoString(PaletteGenerator::EfxDimmer), + PaletteGenerator::EfxDimmer); + else if (cap == KQLCChannelMovement) + addFunctionsGroup(fxGrpItem, grpItem, + PaletteGenerator::typetoString(PaletteGenerator::EfxPosition), + PaletteGenerator::EfxPosition); } + efxItem = NULL; } m_allFuncsTree->resizeColumnToContents(KFunctionName); @@ -441,6 +456,25 @@ void FunctionWizard::updateResultFunctionsTree() item->setText(KFunctionName, matrix->name()); item->setIcon(KFunctionName, matrix->getIcon()); } + } + + for (int c = 0; c < funcItem->childCount(); c++) + { + + QTreeWidgetItem *subFuncItem = funcItem->child(c); + if (subFuncItem->checkState(KFunctionName) != Qt::Checked) + continue; + + int type = subFuncItem->data(KFunctionName, Qt::UserRole).toInt(); + int subType = PaletteGenerator::All; + if (funcItem->checkState(KFunctionOddEven) == Qt::Checked) + subType = PaletteGenerator::OddEven; + + PaletteGenerator *palette = new PaletteGenerator(m_doc, fxList, + (PaletteGenerator::PaletteType)type, + (PaletteGenerator::PaletteSubType)subType); + m_paletteList.append(palette); + foreach (EFX *efx, palette->efxs()) { QTreeWidgetItem *item = new QTreeWidgetItem(getFunctionGroupItem(efx)); diff --git a/ui/src/palettegenerator.cpp b/ui/src/palettegenerator.cpp index 6c739811f6..4dac20e85e 100644 --- a/ui/src/palettegenerator.cpp +++ b/ui/src/palettegenerator.cpp @@ -104,7 +104,9 @@ QString PaletteGenerator::typetoString(PaletteGenerator::PaletteType type) case Gobos: return tr("Gobo macros"); case ColourMacro: return tr("Colour macros"); case Animation: return tr("Animations"); - case Efx: return tr("EFXs"); + case EfxDimmer: return tr("Dimmer EFXs"); + case EfxPosition: return tr("Position EFXs"); + case EfxRGB: return tr("RGB EFXs"); case Undefined: default: return tr("Unknown"); @@ -510,25 +512,12 @@ EFX *PaletteGenerator::createEfx(QList fixtures, bool staggered, EFXF return efx; } -void PaletteGenerator::createEfxs(QList fixtures) +void PaletteGenerator::createEfxs(QList fixtures, EFXFixture::Mode mode) { qDebug() << "createEfxs"; - if (PaletteGenerator::getCapabilities(fixtures[0]).contains(KQLCChannelDimmer)) - { - m_efxs.append(createEfx(fixtures, false, EFXFixture::Mode::Dimmer)); - m_efxs.append(createEfx(fixtures, true, EFXFixture::Mode::Dimmer)); - } - if (PaletteGenerator::getCapabilities(fixtures[0]).contains(KQLCChannelRGB)) - { - m_efxs.append(createEfx(fixtures, false, EFXFixture::Mode::RGB)); - m_efxs.append(createEfx(fixtures, true, EFXFixture::Mode::RGB)); - } - if (PaletteGenerator::getCapabilities(fixtures[0]).contains(KQLCChannelMovement)) - { - m_efxs.append(createEfx(fixtures, false, EFXFixture::Mode::PanTilt)); - m_efxs.append(createEfx(fixtures, true, EFXFixture::Mode::PanTilt)); - } + m_efxs.append(createEfx(fixtures, false, mode)); + m_efxs.append(createEfx(fixtures, true, mode)); } void PaletteGenerator::createChaser(QString name) @@ -640,14 +629,14 @@ void PaletteGenerator::createFunctions(PaletteGenerator::PaletteType type, createRGBMatrices(m_redList); } break; - case Efx: - { - if ((m_redList.size() > 1 && - m_greenList.size() == m_redList.size() && - m_blueList.size() == m_redList.size()) || - m_panList.size() > 1) - createEfxs(m_fixtures); - } + case EfxDimmer: + createEfxs(m_fixtures, EFXFixture::Mode::Dimmer); + break; + case EfxRGB: + createEfxs(m_fixtures, EFXFixture::Mode::RGB); + break; + case EfxPosition: + createEfxs(m_fixtures, EFXFixture::Mode::PanTilt); break; case Gobos: { diff --git a/ui/src/palettegenerator.h b/ui/src/palettegenerator.h index b46dceb3e3..3fc05006fa 100644 --- a/ui/src/palettegenerator.h +++ b/ui/src/palettegenerator.h @@ -59,7 +59,9 @@ class PaletteGenerator: public QObject Shutter, Gobos, ColourMacro, - Efx + EfxDimmer, + EfxRGB, + EfxPosition, Animation }; @@ -133,7 +135,7 @@ class PaletteGenerator: public QObject void createRGBMatrices(QList rgbMap); EFX* createEfx(QList fixtures, bool staggered, EFXFixture::Mode mode); - void createEfxs(QList fixtures); + void createEfxs(QList fixtures, EFXFixture::Mode mode); void createChaser(QString name); From 98b7b89d7dce1c82684a1f87ed4f50079ede51da Mon Sep 17 00:00:00 2001 From: 8-Lambda-8 Date: Wed, 19 Mar 2025 23:39:43 +0100 Subject: [PATCH 08/10] EFX VC soloFrames --- ui/src/functionwizard.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/ui/src/functionwizard.cpp b/ui/src/functionwizard.cpp index d7bcba7bff..f8dd477bf7 100644 --- a/ui/src/functionwizard.cpp +++ b/ui/src/functionwizard.cpp @@ -511,7 +511,10 @@ void FunctionWizard::updateWidgetsTree() { QTreeWidgetItem *frame = new QTreeWidgetItem(m_widgetsTree); frame->setText(KWidgetName, palette->fullName()); - if (palette->type() == PaletteGenerator::Animation) + if (palette->type() == PaletteGenerator::Animation || + palette->type() == PaletteGenerator::EfxDimmer || + palette->type() == PaletteGenerator::EfxPosition || + palette->type() == PaletteGenerator::EfxRGB) { frame->setIcon(KWidgetName, VCWidget::typeToIcon(VCWidget::SoloFrameWidget)); frame->setData(KWidgetName, Qt::UserRole, VCWidget::SoloFrameWidget); @@ -577,11 +580,7 @@ void FunctionWizard::updateWidgetsTree() } foreach (EFX *efx, palette->efxs()) { - QTreeWidgetItem *item = NULL; - if (soloFrameItem != NULL) - item = new QTreeWidgetItem(soloFrameItem); - else - item = new QTreeWidgetItem(frame); + QTreeWidgetItem *item = new QTreeWidgetItem(frame); QString toRemove = " - " + palette->model(); item->setText(KWidgetName, efx->name().remove(toRemove)); item->setIcon(KWidgetName, VCWidget::typeToIcon(VCWidget::ButtonWidget)); From b5a1c25974505040c670eb79350b8e2702dfaf99 Mon Sep 17 00:00:00 2001 From: 8-Lambda-8 Date: Wed, 19 Mar 2025 23:47:06 +0100 Subject: [PATCH 09/10] EFX treeItem expanded --- ui/src/functionwizard.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/ui/src/functionwizard.cpp b/ui/src/functionwizard.cpp index f8dd477bf7..c3cfdd69ec 100644 --- a/ui/src/functionwizard.cpp +++ b/ui/src/functionwizard.cpp @@ -286,6 +286,7 @@ void FunctionWizard::addFunctionsGroup(QTreeWidgetItem *fxGrpItem, QTreeWidgetIt item->setText(KFunctionName, "EFXs"); item->setCheckState(KFunctionName, Qt::Unchecked); item->setFlags(item->flags() | Qt::ItemIsUserCheckable | Qt::ItemIsAutoTristate); + item->setExpanded(true); efxItem = item; } grpItem = efxItem; From 4ba978b25bf5022c0c0da5da418594ccccb13857 Mon Sep 17 00:00:00 2001 From: 8-Lambda-8 Date: Thu, 20 Mar 2025 19:50:42 +0100 Subject: [PATCH 10/10] added subType columns --- ui/src/functionwizard.cpp | 14 +++++++++++++- ui/src/functionwizard.ui | 30 ++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 1 deletion(-) diff --git a/ui/src/functionwizard.cpp b/ui/src/functionwizard.cpp index c3cfdd69ec..0a0593862f 100644 --- a/ui/src/functionwizard.cpp +++ b/ui/src/functionwizard.cpp @@ -52,6 +52,9 @@ #define KFunctionName 0 #define KFunctionOddEven 1 +#define KFunctionStaggered 2 +#define KFunctionAsymetric 3 +#define KFunctionSplitReverse 4 #define KWidgetName 0 @@ -280,7 +283,7 @@ void FunctionWizard::addFunctionsGroup(QTreeWidgetItem *fxGrpItem, QTreeWidgetIt if ((type == PaletteGenerator::EfxDimmer || type == PaletteGenerator::EfxRGB || type == PaletteGenerator::EfxPosition)) - { + { if (efxItem == NULL){ QTreeWidgetItem *item = new QTreeWidgetItem(grpItem); item->setText(KFunctionName, "EFXs"); @@ -300,6 +303,15 @@ void FunctionWizard::addFunctionsGroup(QTreeWidgetItem *fxGrpItem, QTreeWidgetIt if (fxGrpItem != NULL && fxGrpItem->childCount() > 1) { item->setCheckState(KFunctionOddEven, Qt::Unchecked); + + if ((type == PaletteGenerator::EfxDimmer || + type == PaletteGenerator::EfxRGB || + type == PaletteGenerator::EfxPosition)) + { + item->setCheckState(KFunctionStaggered, Qt::Unchecked); + item->setCheckState(KFunctionAsymetric, Qt::Unchecked); + item->setCheckState(KFunctionSplitReverse, Qt::Unchecked); + } } } diff --git a/ui/src/functionwizard.ui b/ui/src/functionwizard.ui index e12c278833..8820f21a22 100644 --- a/ui/src/functionwizard.ui +++ b/ui/src/functionwizard.ui @@ -277,6 +277,21 @@ p, li { white-space: pre-wrap; } + + false + + + true + + + true + + + 60 + + + true + Available @@ -287,6 +302,21 @@ p, li { white-space: pre-wrap; } Odd/Even + + + Staggered + + + + + Asymetric + + + + + Split Reverse + +