Skip to content

Commit

Permalink
AppDemo: add on variable with dash property
Browse files Browse the repository at this point in the history
Remove SysModWorkFlow and UserModExample (AppDemo is now the example)
  • Loading branch information
ewoudwijma committed Apr 23, 2024
1 parent f18e191 commit a976206
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 145 deletions.
2 changes: 1 addition & 1 deletion platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ build_flags =
${STARMOD_USERMOD_E131.build_flags}
; ${STARMOD_USERMOD_HA.build_flags}
-DAPP=StarMod
-DVERSION=24041415
-DVERSION=24042319 ; Date and time (GMT!)
-DPIOENV=$PIOENV
lib_deps =
${starmod.lib_deps}
Expand Down
14 changes: 11 additions & 3 deletions src/App/AppModDemo.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,22 @@ class AppModDemo: public SysModule {
AppModDemo() :SysModule("AppMod Demo") {
};

//setup filesystem
void setup() {
SysModule::setup();

parentVar = ui->initAppMod(parentVar, name, 1100);

JsonObject currentVar = ui->initCheckBox(parentVar, "on", true, false, [](JsonObject var, unsigned8 rowNr, unsigned8 funType) { switch (funType) { //varFun
case f_UIFun:
ui->setLabel(var, "On");
return true;
case f_ChangeFun:
ui->callVarFun("bri", UINT8_MAX, f_ChangeFun); //set FastLed brightness
return true;
default: return false;
}});
currentVar["dash"] = true;

ui->initText(parentVar, "textField", "text");

ui->initPin(parentVar, "blinkPin", blinkPin, false, [this](JsonObject var, unsigned8 rowNr, unsigned8 funType) { switch (funType) { //varFun
Expand All @@ -45,8 +55,6 @@ class AppModDemo: public SysModule {
default: return false;
}});

ui->initCheckBox(parentVar, "on");

ui->initSlider(parentVar, "frequency", frequency, 0, UINT8_MAX, false, [this](JsonObject var, unsigned8 rowNr, unsigned8 funType) { switch (funType) { //varFun
case f_ChangeFun:
frequency = var["value"];
Expand Down
1 change: 0 additions & 1 deletion src/Sys/SysModFiles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ SysModFiles::SysModFiles() :SysModule("Files") {
}
};

//setup filesystem
void SysModFiles::setup() {
SysModule::setup();
parentVar = ui->initSysMod(parentVar, name, 2101);
Expand Down
101 changes: 0 additions & 101 deletions src/Sys/SysModWorkFlow.h

This file was deleted.

1 change: 0 additions & 1 deletion src/User/UserModE131.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ class UserModE131:public SysModule {
isEnabled = false; //default not enabled
};

//setup filesystem
void setup() {
SysModule::setup();

Expand Down
36 changes: 0 additions & 36 deletions src/User/UserModExample.h

This file was deleted.

1 change: 0 additions & 1 deletion src/User/UserModInstances.h
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@ class UserModInstances:public SysModule {
// });
// }

//setup filesystem
void setup() {
SysModule::setup();

Expand Down
1 change: 0 additions & 1 deletion src/User/UserModMDNS.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ class UserModMDNS:public SysModule {
UserModMDNS() :SysModule("MDNS") {
};

//setup filesystem
void setup() {
SysModule::setup();

Expand Down
8 changes: 8 additions & 0 deletions tools/misc.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
Copy System Modules from MoonModules/StarModLeds to upstream
(as should only be modified in upstream)
============================================================
cd /Users/ewoudwijma/Developer/GitHub/MoonModules/StarModLeds
ls ../../ewowi/StarMod/src/Sys
cp ./src/Sys/* ../../ewowi/StarMod/src/Sys
cp ./tools/* ../../ewowi/StarMod/tools


search range-based for loop
===========================
Expand Down

0 comments on commit a976206

Please sign in to comment.