Skip to content

Commit 056906b

Browse files
committed
Moving Heads: separate layouts from effects, add Wowi & Troy lights & fx
Server ===== - effects: MH's at the end, add Wowi and Troy effects - layouts: MH's at the end, add Wowi and Troy layouts - Artnet: bugfix
1 parent 5df4e51 commit 056906b

File tree

8 files changed

+289
-216
lines changed

8 files changed

+289
-216
lines changed

src/MoonLight/Effects.h

Lines changed: 155 additions & 205 deletions
Large diffs are not rendered by default.

src/MoonLight/Layouts.h

Lines changed: 110 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
#if FT_MOONLIGHT
1313

14-
//alphabetically from here
14+
//alphabetically from here, MHs at the end
1515

1616
class HumanSizedCubeLayout: public Node {
1717
public:
@@ -151,4 +151,113 @@ class RingsLayout: public Node {
151151
}
152152
};
153153

154+
class MHWowi24Layout: public Node {
155+
public:
156+
157+
static const char * name() {return "MHWowi24 🚥";}
158+
static uint8_t dim() {return _2D;}
159+
static const char * tags() {return "";}
160+
161+
uint8_t width = 4;
162+
uint8_t pin = 16;
163+
164+
void setup() override {
165+
hasLayout = true;
166+
Node::setup();
167+
168+
addControl(width, "width", "range", 1, 32);
169+
addControl(pin, "pin", "pin", 1, 48);
170+
171+
}
172+
173+
void addLayout() override {
174+
layerV->layerP->lights.header.channelsPerLight = 24;
175+
layerV->layerP->lights.header.offsetPan = 0;
176+
layerV->layerP->lights.header.offsetTilt = 1;
177+
layerV->layerP->lights.header.offsetBrightness = 3;
178+
layerV->layerP->lights.header.offsetRGB = 4;
179+
layerV->layerP->lights.header.offsetRGB1 = 8;
180+
layerV->layerP->lights.header.offsetRGB2 = 12;
181+
layerV->layerP->lights.header.offsetZoom = 17;
182+
183+
for (uint8_t x = 0; x<width; x++) {
184+
addLight({x, 0, 0});
185+
}
186+
addPin(pin); //needed to slow down the dmx stream ... wip
187+
}
188+
};
189+
190+
class MHTroy15Layout: public Node {
191+
public:
192+
193+
static const char * name() {return "MHTroy15 🚥";}
194+
static uint8_t dim() {return _2D;}
195+
static const char * tags() {return "";}
196+
197+
uint8_t width = 2;
198+
uint8_t pin = 16;
199+
200+
void setup() override {
201+
hasLayout = true;
202+
Node::setup();
203+
204+
addControl(width, "width", "range", 1, 32);
205+
addControl(pin, "pin", "pin", 1, 48);
206+
207+
hasLayout = true; //so the system knows to rebuild the mapping if needed
208+
Node::setup();
209+
layerV->layerP->lights.header.channelsPerLight = 15; //set channels per light to 15 (RGB + Pan + Tilt + Zoom + Brightness)
210+
layerV->layerP->lights.header.offsetRGB = 10; //set offset for RGB lights in DMX map
211+
layerV->layerP->lights.header.offsetPan = 0;
212+
layerV->layerP->lights.header.offsetTilt = 1;
213+
layerV->layerP->lights.header.offsetZoom = 7;
214+
layerV->layerP->lights.header.offsetBrightness = 8; //set offset for brightness
215+
layerV->layerP->lights.header.offsetGobo = 5; //set offset for color wheel in DMX map
216+
layerV->layerP->lights.header.offsetBrightness2 = 3; //set offset for color wheel brightness in DMX map
217+
}
218+
219+
void addLayout() override {
220+
for (uint8_t x = 0; x<width; x++) {
221+
addLight({x, 0, 0});
222+
}
223+
addPin(pin); //needed to slow down the dmx stream ... wip
224+
}
225+
};
226+
227+
class MHTroy32Layout: public Node {
228+
public:
229+
230+
static const char * name() {return "MHTroy32 🚥";}
231+
static uint8_t dim() {return _2D;}
232+
static const char * tags() {return "";}
233+
234+
uint8_t width = 2;
235+
uint8_t pin = 16;
236+
237+
void setup() override {
238+
hasLayout = true;
239+
Node::setup();
240+
241+
addControl(width, "width", "range", 1, 32);
242+
addControl(pin, "pin", "pin", 1, 48);
243+
244+
layerV->layerP->lights.header.channelsPerLight = 32;
245+
layerV->layerP->lights.header.offsetRGB = 9;
246+
layerV->layerP->lights.header.offsetRGB1 = 13;
247+
layerV->layerP->lights.header.offsetRGB2 = 17;
248+
layerV->layerP->lights.header.offsetRGB3 = 24;
249+
layerV->layerP->lights.header.offsetPan = 0;
250+
layerV->layerP->lights.header.offsetTilt = 2;
251+
layerV->layerP->lights.header.offsetZoom = 5;
252+
layerV->layerP->lights.header.offsetBrightness = 6;
253+
}
254+
255+
void addLayout() override {
256+
for (uint8_t x = 0; x<width; x++) {
257+
addLight({x, 0, 0});
258+
}
259+
addPin(pin); //needed to slow down the dmx stream ... wip
260+
}
261+
};
262+
154263
#endif //FT_MOONLIGHT

src/MoonLight/ModuleArtnet.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ class ModuleArtnet : public Module
7474
hardware_outputs_universe_start[updatedItem.index[0]] = updatedItem.value.as<uint8_t>();
7575
}
7676
if (updatedItem.name == "size") { //onStart
77-
ESP_LOGD(TAG, "Size[%d] = %d", updatedItem.index[0], updatedItem.value.as<uint8_t>());
78-
hardware_outputs[updatedItem.index[0]] = updatedItem.value.as<uint8_t>();
77+
ESP_LOGD(TAG, "Size[%d] = %d", updatedItem.index[0], updatedItem.value.as<uint16_t>());
78+
hardware_outputs[updatedItem.index[0]] = updatedItem.value.as<uint16_t>();
7979
}
8080
}
8181
else

src/MoonLight/ModuleEditor.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,21 +115,24 @@ class ModuleEditor : public Module
115115
values.add(GEQEffect::name());
116116
values.add(LinesEffect::name());
117117
values.add(LissajousEffect::name());
118-
values.add(MovingHeadLayoutAndEffect::name());
119118
values.add(PaintBrushEffect::name());
120119
values.add(RainbowEffect::name());
121120
values.add(RandomEffect::name());
122121
values.add(RipplesEffect::name());
123122
values.add(RGBWParEffect::name());
124123
values.add(SinusEffect::name());
125124
values.add(SphereMoveEffect::name());
126-
values.add(TroyMovingHeadEffect::name());
127-
values.add(TroyMovingHead32Effect::name());
128125
values.add(WaveEffect::name());
126+
values.add(MHTroy15Effect::name());
127+
values.add(MHTroy32Effect::name());
128+
values.add(MHWowiEffect::name());
129129

130130
values.add(HumanSizedCubeLayout::name());
131131
values.add(PanelLayout::name());
132132
values.add(RingsLayout::name());
133+
values.add(MHTroy15Layout::name());
134+
values.add(MHTroy32Layout::name());
135+
values.add(MHWowi24Layout::name());
133136

134137
values.add(CircleModifier::name());
135138
values.add(MirrorModifier::name());

src/MoonLight/Nodes.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ class Node {
163163
virtual ~Node() {
164164
//delete any allocated memory
165165

166-
ESP_LOGD(TAG, "Node destructor %d %d", hasLayout, hasModifier);
166+
ESP_LOGD(TAG, "Node destructor 🚥:%d 💎:%d", hasLayout, hasModifier);
167167

168168
}
169169

src/MoonLight/PhysicalLayer.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,21 +159,24 @@ PhysicalLayer::PhysicalLayer() {
159159
else if (equal(name, GEQEffect::name())) node = new GEQEffect();
160160
else if (equal(name, LinesEffect::name())) node = new LinesEffect();
161161
else if (equal(name, LissajousEffect::name())) node = new LissajousEffect();
162-
else if (equal(name, MovingHeadLayoutAndEffect::name())) node = new MovingHeadLayoutAndEffect();
163162
else if (equal(name, PaintBrushEffect::name())) node = new PaintBrushEffect();
164163
else if (equal(name, RainbowEffect::name())) node = new RainbowEffect();
165164
else if (equal(name, RandomEffect::name())) node = new RandomEffect();
166165
else if (equal(name, RipplesEffect::name())) node = new RipplesEffect();
167166
else if (equal(name, RGBWParEffect::name())) node = new RGBWParEffect();
168167
else if (equal(name, SinusEffect::name())) node = new SinusEffect();
169168
else if (equal(name, SphereMoveEffect::name())) node = new SphereMoveEffect();
170-
else if (equal(name, TroyMovingHeadEffect::name())) node = new TroyMovingHeadEffect();
171-
else if (equal(name, TroyMovingHead32Effect::name())) node = new TroyMovingHead32Effect();
172169
else if (equal(name, WaveEffect::name())) node = new WaveEffect();
170+
else if (equal(name, MHTroy15Effect::name())) node = new MHTroy15Effect();
171+
else if (equal(name, MHTroy32Effect::name())) node = new MHTroy32Effect();
172+
else if (equal(name, MHWowiEffect::name())) node = new MHWowiEffect();
173173

174174
else if (equal(name, HumanSizedCubeLayout::name())) node = new HumanSizedCubeLayout();
175175
else if (equal(name, PanelLayout::name())) node = new PanelLayout();
176176
else if (equal(name, RingsLayout::name())) node = new RingsLayout();
177+
else if (equal(name, MHTroy15Layout::name())) node = new MHTroy15Layout();
178+
else if (equal(name, MHTroy32Layout::name())) node = new MHTroy32Layout();
179+
else if (equal(name, MHWowi24Layout::name())) node = new MHWowi24Layout();
177180

178181
else if (equal(name, CircleModifier::name())) node = new CircleModifier();
179182
else if (equal(name, MirrorModifier::name())) node = new MirrorModifier();

src/MoonLight/PhysicalLayer.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,12 @@ struct LightsHeader {
5151
uint8_t offsetGobo = UINT8_MAX;
5252
uint8_t offsetRGB1 = UINT8_MAX;
5353
uint8_t offsetRGB2 = UINT8_MAX;
54+
uint8_t offsetRGB3 = UINT8_MAX;
5455
uint8_t offsetBrightness2 = UINT8_MAX;
5556
//19 bytes until here
5657
// uint8_t ledFactor = 1; //factor to multiply the positions with
5758
// uint8_t ledSize = 4; //mm size of each light, used in monitor ...
58-
uint8_t dummy[5];
59+
uint8_t dummy[4];
5960
//24 bytes total
6061

6162
//support for more channels, like white, pan, tilt etc.
@@ -72,6 +73,7 @@ struct LightsHeader {
7273
offsetGobo = UINT8_MAX;
7374
offsetRGB1 = UINT8_MAX;
7475
offsetRGB2 = UINT8_MAX;
76+
offsetRGB3 = UINT8_MAX;
7577
offsetBrightness2 = UINT8_MAX;
7678
}
7779

src/MoonLight/VirtualLayer.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,12 @@ class VirtualLayer {
142142
}
143143
void setRGB2(Coord3D pos, CRGB color) { setRGB2(XYZ(pos), color); }
144144

145+
void setRGB3(const uint16_t indexV, CRGB color) {
146+
if (layerP->lights.header.offsetRGB3 != UINT8_MAX)
147+
setLight(indexV, color.raw, layerP->lights.header.offsetRGB3, sizeof(color));
148+
}
149+
void setRGB3(Coord3D pos, CRGB color) { setRGB3(XYZ(pos), color); }
150+
145151
void setBrightness2(const uint16_t indexV, const uint8_t value) {
146152
if (layerP->lights.header.offsetBrightness2 != UINT8_MAX)
147153
setLight(indexV, &value, layerP->lights.header.offsetBrightness2, sizeof(value));

0 commit comments

Comments
 (0)