Skip to content

Commit

Permalink
Merge remote-tracking branch 'ewowi/dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
ewowi committed Nov 6, 2024
2 parents 6be0c98 + 64bcfb5 commit 873be57
Show file tree
Hide file tree
Showing 15 changed files with 387 additions and 413 deletions.
2 changes: 1 addition & 1 deletion data/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ function createHTML(json, parentNode = null, rowNr = UINT8_MAX) {
let file = fileNode.files[0];
let formData = new FormData();
console.log("fileUpload " + variable.id, file, formData, file.size);
fileNode.parentNode.querySelector("progress").max = Math.round(file.size / 10000); //set progress max in blocks of 10K
fileNode.parentNode.querySelector("progress").max = Math.round(file.size / 50000); //set progress max in blocks of 50K

formData.append("file", file);
fetch('/' + variable.id, {method: "POST", body: formData});
Expand Down
2 changes: 1 addition & 1 deletion src/App/LedModEffects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ inline uint16_t getRGBWsize(uint16_t nleds){
// ui->dashVarChanged = true;
// //rebuild the table
for (JsonObject childVar: Variable(mdl->findVar("E131", "watches")).children())
ui->callVarFun(childVar, UINT8_MAX, onSetValue); //set the value (WIP)
Variable(childVar).triggerEvent(onSetValue); //set the value (WIP)

// }
// else
Expand Down
2 changes: 1 addition & 1 deletion src/App/LedModFixture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@

JsonObject currentVar = ui->initCheckBox(parentVar, "on", true, false, [](JsonObject var, uint8_t rowNr, uint8_t funType) { switch (funType) { //varFun
case onChange:
mdl->callVarOnChange(mdl->findVar("Fixture", "brightness"), UINT8_MAX, true); //set brightness (init is true so bri value not send via udp)
Variable(mdl->findVar("Fixture", "brightness")).triggerEvent(onChange, UINT8_MAX, true); //set brightness (init is true so bri value not send via udp)
return true;
default: return false;
}});
Expand Down
2 changes: 1 addition & 1 deletion src/App/LedModFixtureGen.h
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,7 @@ class LedModFixtureGen:public SysModule {
generateOnChange(var, fileName);

//set fixture in fixture module
ui->callVarFun("Fixture", "fixture", UINT8_MAX, onUI); //rebuild options
Variable(mdl->findVar("Fixture", "fixture")).triggerEvent(onUI); //rebuild options

uint8_t value = ui->selectOptionToValue("fixture", fileName);
if (value != UINT8_MAX)
Expand Down
18 changes: 9 additions & 9 deletions src/Sys/SysModInstances.h
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ class SysModInstances:public SysModule {
return true;
case onUI:
// call onUI of the base variable for the new variable
ui->varFunctions[var["fun"]](insVar, rowNr, onUI);
mdl->varFunctions[var["fun"]](insVar, rowNr, onUI);
return true;
case onChange: {
//do not set this initially!!!
Expand Down Expand Up @@ -428,7 +428,7 @@ class SysModInstances:public SysModule {

ppf("instances handleNotifications %d\n", notifierUdp.remoteIP()[3]);
for (JsonObject childVar: Variable(mdl->findVar("Instances", "instances")).children())
ui->callVarFun(childVar, UINT8_MAX, onSetValue); //set the value (WIP) ); //rowNr //instance - instances.begin()
Variable(childVar).triggerEvent(onSetValue); //set the value (WIP) ); //rowNr //instance - instances.begin()

web->recvUDPCounter++;
web->recvUDPBytes+=packetSize;
Expand Down Expand Up @@ -529,12 +529,12 @@ class SysModInstances:public SysModule {
if (erased) {
ppf("instances remove inactive instances\n");
for (JsonObject childVar: Variable(mdl->findVar("Instances", "instances")).children())
ui->callVarFun(childVar, UINT8_MAX, onSetValue); //set the value (WIP)); //no rowNr so all rows updated
Variable(childVar).triggerEvent(onSetValue); //set the value (WIP)); //no rowNr so all rows updated

//tbd: pubsub mechanism
//LEDs specific
ui->callVarFun("DDP", "instance", UINT8_MAX, onUI); //rebuild options
// ui->callVarFun("Artnet", "artInst", UINT8_MAX, onUI); //rebuild options
Variable(mdl->findVar("DDP", "instance")).triggerEvent(onUI); //rebuild options
// Variable(mdl->findVar("Artnet", "artInst")).triggerEvent(onUI); //rebuild options
}
}

Expand Down Expand Up @@ -802,7 +802,7 @@ class SysModInstances:public SysModule {
// ppf("updateInstance updRow\n");

for (JsonObject childVar: Variable(mdl->findVar("Instances", "instances")).children())
ui->callVarFun(childVar, UINT8_MAX, onSetValue); //set the value (WIP)); //rowNr instance - instances.begin()
Variable(childVar).triggerEvent(onSetValue); //set the value (WIP)); //rowNr instance - instances.begin()

//tbd: now done for all rows, should be done only for updated rows!
}
Expand All @@ -816,15 +816,15 @@ class SysModInstances:public SysModule {

//tbd: pubsub mechanism
//LEDs specific
ui->callVarFun("DDP", "instance", UINT8_MAX, onUI); //rebuild options
// ui->callVarFun("Artnet", "artInst", UINT8_MAX, onUI); //rebuild options
Variable(mdl->findVar("DDP", "instance")).triggerEvent(onUI); //rebuild options
// Variable(mdl->findVar(Artnet", "artInst")).triggerEvent(onUI); //rebuild options

// ui->processOnUI("instances");
//run though it sorted to find the right rowNr
// for (std::vector<InstanceInfo>::iterator instance=instances.begin(); instance!=instances.end(); ++instance) {
// if (instance->ip == messageIP) {
for (JsonObject childVar: Variable(mdl->findVar("Instances", "instances")).children()) {
ui->callVarFun(childVar, UINT8_MAX, onSetValue); //set the value (WIP)); //no rowNr, update all
Variable(childVar).triggerEvent(onSetValue); //set the value (WIP)); //no rowNr, update all
}
// }
// }
Expand Down
Loading

0 comments on commit 873be57

Please sign in to comment.