Skip to content

Commit

Permalink
Added final wand programs, and some cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
catalanojuan committed Feb 14, 2023
1 parent acee50d commit 39ca9ef
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 22 deletions.
10 changes: 10 additions & 0 deletions server/setups/program-presets/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -1464,6 +1464,16 @@
}
}
]
},
"MainWithWand": {
"programs": [
{
"programName": "PROGRAM_Main_fuego2022"
},
{
"programName": "wand-empty-canvas"
}
]
}
},
"DJTap": {
Expand Down
5 changes: 0 additions & 5 deletions server/src/LightController.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,10 @@ const programNames = [
"warroBass",
"water-flood",
"waveform",
"PROGRAM_Tap_fuego2023",
"PROGRAM_Wand_fuego2023",
"DJTap",
"wand-empty-canvas",
"wandMix",
"wandRelampejo",
"wand-mixable",
"wand-stars",
"djtap"
];

module.exports = class LightController extends EventEmitter {
Expand Down
14 changes: 0 additions & 14 deletions server/src/light-programs/programs/radial.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,9 @@ const {loadGradient} = require("../utils/gradients");

module.exports = class Radial extends LightProgram {
init() {
this.taps = [];
this.holdWhite = 0;
super.init();
}

tap(data){
console.log('tap received program');
this.taps.push(data);
}

drawFrame(leds) {
const elapsed = this.timeInMs / 1000;

Expand All @@ -34,12 +27,6 @@ module.exports = class Radial extends LightProgram {
this.config.power
);

if (this.taps.length > 0){
this.taps.pop();
this.holdWhite = 3000;
console.log('adentro tap');
}

if (this.config.colorMap) {
const gradient = loadGradient(this.config.colorMap);
const [r, g, b, a] = gradient.colorAt(1 - v);
Expand All @@ -51,7 +38,6 @@ module.exports = class Radial extends LightProgram {
v
);
}
leds[i] = --this.holdWhite > 0 ? [255,255,255] : leds[i];

}
}
Expand Down
5 changes: 2 additions & 3 deletions server/src/light-programs/programs/wand-empty-canvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ module.exports = class WandEmptyCanvas extends LightProgram {
this.ledsToPaint = new Array(this.numberOfLeds).fill([0, 0, 0]);
return;
}
if (data.move){
this.config.move = true;
}
this.config.move = data.move !== undefined ? data.move : this.config.move;

this.ledsToPaint[data.position] = data.color;
}
// Override base class
Expand Down

0 comments on commit 39ca9ef

Please sign in to comment.