Skip to content

Commit

Permalink
Rename stage to dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
ewowi committed Mar 4, 2024
1 parent 6d5b1d4 commit ab2c8dc
Show file tree
Hide file tree
Showing 13 changed files with 843 additions and 841 deletions.
2 changes: 1 addition & 1 deletion data/index.htm
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<h1>StarMod💫 LEDs 🎨 by MoonModules 🌔</h1>
<h2><div id="instanceName"></div></h2>
<input type="button" value="App" id="vApp" onclick="setView(this)">
<input type="button" value="Stage" id="vStage" onclick="setView(this)">
<input type="button" value="DashBoard" id="vDash" onclick="setView(this)">
<input type="button" value="User" id="vUser" onclick="setView(this)">
<input type="button" value="System" id="vSys" onclick="setView(this)">
<input type="button" value="All" id="vAll" onclick="setView(this)">
Expand Down
12 changes: 6 additions & 6 deletions data/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1302,7 +1302,7 @@ function setInstanceTableColumns() {

let tbl = gId("insTbl");
if (!tbl) return;
let isStageView = gId("vStage").classList.contains("selected");
let isDashView = gId("vDash").classList.contains("selected");
let thead = tbl.querySelector("thead");
let tbody = tbl.querySelector("tbody");

Expand All @@ -1318,13 +1318,13 @@ function setInstanceTableColumns() {
// console.log("setInstanceTableColumns", tbl, thead, tbody);
columnNr = 2;
for (; columnNr<6; columnNr++) {
showHideColumn(columnNr, isStageView);
showHideColumn(columnNr, isDashView);
}
for (; columnNr<thead.querySelector("tr").childNodes.length; columnNr++) {
showHideColumn(columnNr, !isStageView);
showHideColumn(columnNr, !isDashView);
}

if (gId("sma")) gId("sma").parentNode.hidden = isStageView; //hide sync master label field and comment
if (gId("sma")) gId("sma").parentNode.hidden = isDashView; //hide sync master label field and comment
}

function changeHTMLView(value) {
Expand All @@ -1333,7 +1333,7 @@ function changeHTMLView(value) {

gId("vAI").classList.remove("selected");
gId("vApp").classList.remove("selected");
gId("vStage").classList.remove("selected");
gId("vDash").classList.remove("selected");
gId("vUser").classList.remove("selected");
gId("vSys").classList.remove("selected");
gId("vAll").classList.remove("selected");
Expand All @@ -1359,7 +1359,7 @@ function changeHTMLView(value) {
found = true;
if (value=="vUser" && moduleNode.className == "usermod")
found = true;
if (value=="vStage" && moduleNode.id == "Instances")
if (value=="vDash" && moduleNode.id == "Instances")
found = true;
}
// console.log(mdlColumnNode, moduleNode, moduleNode.className);
Expand Down
2 changes: 1 addition & 1 deletion src/App/AppEffects.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class Effect {
default: return false;
}});
//tbd: check if memory is freed!
// currentVar["stage"] = true;
// currentVar["dash"] = true;
}

CRGBPalette16 getPalette() {
Expand Down
3 changes: 2 additions & 1 deletion src/App/AppFixture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,8 @@ void Fixture::projectAndMap() {
for (size_t i = leds->mappingTable.size(); i <= indexV; i++) {
// USER_PRINTF("mapping %d,%d,%d add physMap before %d %d\n", pixel.y, pixel.y, pixel.z, indexV, leds->mappingTable.size());
std::vector<unsigned16> physMap;
physMap.push_back(0);
if (i != indexV)
physMap.push_back(0);
leds->mappingTable.push_back(physMap); //abort() was called at PC 0x40191473 on core 1 std::allocator<unsigned short> >&&)
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/App/AppModEffects.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class AppModEffects:public SysModule {
return true;
default: return false;
}});
currentVar["stage"] = true;
currentVar["dash"] = true;

currentVar = ui->initSelect(tableVar, "pro", 2, false, [this](JsonObject var, unsigned8 rowNr, unsigned8 funType) { switch (funType) { //varFun
case f_ValueFun:
Expand Down Expand Up @@ -190,7 +190,7 @@ class AppModEffects:public SysModule {
return true;
default: return false;
}});
currentVar["stage"] = true;
currentVar["dash"] = true;

ui->initCoord3D(tableVar, "fxStart", {0,0,0}, 0, NUM_LEDS_Max, false, [this](JsonObject var, unsigned8 rowNr, unsigned8 funType) { switch (funType) { //varFun
case f_ValueFun:
Expand Down Expand Up @@ -296,7 +296,7 @@ class AppModEffects:public SysModule {
// e131mod->patchChannel(3, "pro", Projections::count);
// e131mod->patchChannel(4, "fixture", 5); //assuming 5!!!

// ui->stageVarChanged = true;
// ui->dashVarChanged = true;
// //rebuild the table
for (JsonObject childVar: mdl->varChildren("e131Tbl"))
ui->callVarFun(childVar, UINT8_MAX, f_ValueFun);
Expand Down
4 changes: 2 additions & 2 deletions src/App/AppModFixture.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class AppModFixture:public SysModule {
return true;
default: return false;
}});
currentVar["stage"] = true;
currentVar["dash"] = true;

//logarithmic slider (10)
currentVar = ui->initSlider(parentVar, "bri", 10, 0, 255, false, [](JsonObject var, unsigned8 rowNr, unsigned8 funType) { switch (funType) { //varFun
Expand All @@ -48,7 +48,7 @@ class AppModFixture:public SysModule {
default: return false;
}});
currentVar["log"] = true; //logarithmic
currentVar["stage"] = true; //these values override model.json???
currentVar["dash"] = true; //these values override model.json???

ui->initCanvas(parentVar, "pview", UINT16_MAX, false, [this](JsonObject var, unsigned8 rowNr, unsigned8 funType) { switch (funType) { //varFun
case f_UIFun:
Expand Down
6 changes: 3 additions & 3 deletions src/Sys/SysModModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ void SysModModel::setup() {

StarModJson starModJson("/model.json", "w"); //open fileName for deserialize
starModJson.addExclusion("fun");
starModJson.addExclusion("stage");
starModJson.addExclusion("dash");
starModJson.writeJsonDocToFile(model);

// print->printJson("Write model", *model); //this shows the model before exclusion
Expand Down Expand Up @@ -206,8 +206,8 @@ void SysModModel::varToValues(JsonObject var, JsonArray row) {
void SysModModel::callChangeFun(JsonObject var, unsigned8 rowNr) {

//done here as ui cannot be used in SysModModel.h
if (var["stage"])
ui->stageVarChanged = true;
if (var["dash"])
ui->dashVarChanged = true;

ui->callVarFun(var, rowNr, f_ChangeFun);

Expand Down
2 changes: 1 addition & 1 deletion src/Sys/SysModUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
//init static variables (https://www.tutorialspoint.com/cplusplus/cpp_static_members.htm)
std::vector<VarFun> SysModUI::varFunctions;
std::vector<VarLoop> SysModUI::loopFunctions;
bool SysModUI::stageVarChanged = false;
bool SysModUI::dashVarChanged = false;

SysModUI::SysModUI() :SysModule("UI") {
};
Expand Down
2 changes: 1 addition & 1 deletion src/Sys/SysModUI.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ static unsigned8 linearToLogarithm(JsonObject var, unsigned8 value) {
class SysModUI:public SysModule {

public:
static bool stageVarChanged;// = false; //tbd: move mechanism to UserModInstances as there it will be used
static bool dashVarChanged;// = false; //tbd: move mechanism to UserModInstances as there it will be used
static std::vector<VarFun> varFunctions; //static because of static functions callChangeFun, processJson...

SysModUI();
Expand Down
2 changes: 1 addition & 1 deletion src/User/UserModE131.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class UserModE131:public SysModule {
return true;
default: return false;
}});
currentVar["stage"] = true;
currentVar["dash"] = true;

JsonObject tableVar = ui->initTable(parentVar, "e131Tbl", nullptr, true, [](JsonObject var, unsigned8 rowNr, unsigned8 funType) { switch (funType) { //varFun
case f_UIFun:
Expand Down
24 changes: 12 additions & 12 deletions src/User/UserModInstances.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ class UserModInstances:public SysModule {
// row.add(instance->version);
// row.add(instance->sys.upTime);

// mdl->findVars("stage", true, [instance, row](JsonObject var) { //findFun
// mdl->findVars("dash", true, [instance, row](JsonObject var) { //findFun
// //look for value in instance
// int value = instance->app.getVar(var["id"]);
// // USER_PRINTF("insTbl %s %s: %d\n", instance->name, varID, value);
Expand Down Expand Up @@ -298,12 +298,12 @@ class UserModInstances:public SysModule {
}
default: return false;
}}); //syncMaster
currentVar["stage"] = true;
currentVar["dash"] = true;

//find stage variables and add them to the table
mdl->findVars("stage", true, [tableVar, this](JsonObject var) { //findFun
//find dash variables and add them to the table
mdl->findVars("dash", true, [tableVar, this](JsonObject var) { //findFun

USER_PRINTF("stage %s %s found\n", mdl->varID(var), var["value"].as<String>().c_str());
USER_PRINTF("dash %s %s found\n", mdl->varID(var), var["value"].as<String>().c_str());

char columnVarID[32] = "ins";
strcat(columnVarID, var["id"]);
Expand All @@ -314,7 +314,7 @@ class UserModInstances:public SysModule {
case f_ValueFun:
//should not trigger chFun
for (unsigned8 rowNrL = 0; rowNrL < instances.size() && (rowNr == UINT8_MAX || rowNrL == rowNr); rowNrL++) {
// USER_PRINTF("initVar stage %s[%d]\n", mdl->varID(insVar), rowNrL);
// USER_PRINTF("initVar dash %s[%d]\n", mdl->varID(insVar), rowNrL);
//do what setValue is doing except calling changeFun
// insVar["value"][rowNrL] = instances[rowNrL].app.getVar(mdl->varID(var)); //only int values...
web->addResponse(insVar["id"], "value", instances[rowNrL].app.getVar(mdl->varID(var)), rowNrL); //only int values...);
Expand Down Expand Up @@ -412,8 +412,8 @@ class UserModInstances:public SysModule {

handleNotifications();

if (ui->stageVarChanged) {
ui->stageVarChanged = false;
if (ui->dashVarChanged) {
ui->dashVarChanged = false;
sendSysInfoUDP();
}
}
Expand Down Expand Up @@ -573,11 +573,11 @@ class UserModInstances:public SysModule {
}
#endif

//stage values default 0
//dash values default 0
starModMessage.app.initVars();

//send stage values
mdl->findVars("stage", true, [&starModMessage](JsonObject var) { //varFun
//send dash values
mdl->findVars("dash", true, [&starModMessage](JsonObject var) { //varFun
// print->printJson("setVar", var);
JsonArray valArray = mdl->varValArray(var);
if (valArray.isNull())
Expand Down Expand Up @@ -629,7 +629,7 @@ class UserModInstances:public SysModule {
instance.sys.dmx.start = 0;
instance.sys.dmx.count = 0;
instance.sys.syncMaster = 0;
//stage values default 0
//dash values default 0
instance.app.initVars();
}

Expand Down
Loading

0 comments on commit ab2c8dc

Please sign in to comment.