1
0
mirror of https://github.com/s00500/ESPUI.git synced 2024-11-21 12:30:55 +00:00

Removed conditional flags for the large tests.

This commit is contained in:
Martin 2024-07-14 13:08:15 -04:00
parent 8bca2e503b
commit 47db2ad6d8
2 changed files with 2 additions and 18 deletions

View File

@ -43,8 +43,6 @@ board = esp32dev
monitor_filters = esp32_exception_decoder monitor_filters = esp32_exception_decoder
board_build.flash_mode = dout board_build.flash_mode = dout
build_flags = build_flags =
-D TEST_HUGE_TEXT
-D TEST_FILEDISPLAY
; -D DEBUG_ESPUI ; -D DEBUG_ESPUI
lib_deps = lib_deps =

View File

@ -16,10 +16,8 @@ const char* password = "YourNetworkPassphrase";
const char* hostname = "espui"; const char* hostname = "espui";
#ifdef TEST_FILEDISPLAY
String DisplayTestFileName = "/FileName.txt"; String DisplayTestFileName = "/FileName.txt";
int fileDisplayId = Control::noParent; int fileDisplayId = Control::noParent;
#endif // def TEST_FILEDISPLAY
int statusLabelId = Control::noParent; int statusLabelId = Control::noParent;
@ -29,9 +27,7 @@ int graphId = Control::noParent;
int millisLabelId = Control::noParent; int millisLabelId = Control::noParent;
int testSwitchId = Control::noParent; int testSwitchId = Control::noParent;
#ifdef TEST_HUGE_TEXT
char HugeText[1025]; char HugeText[1025];
#endif // def TEST_HUGE_TEXT
void numberCall(Control* sender, int type) void numberCall(Control* sender, int type)
{ {
@ -176,10 +172,8 @@ void setup(void)
ESPUI.setVerbosity(Verbosity::VerboseJSON); ESPUI.setVerbosity(Verbosity::VerboseJSON);
Serial.begin(115200); Serial.begin(115200);
#ifdef TEST_HUGE_TEXT
memset(HugeText, 0x0, sizeof(HugeText)); memset(HugeText, 0x0, sizeof(HugeText));
memset(HugeText, 'a', sizeof(HugeText)-1); memset(HugeText, 'a', sizeof(HugeText)-1);
#endif // def TEST_HUGE_TEXT
#if defined(ESP32) #if defined(ESP32)
WiFi.setHostname(hostname); WiFi.setHostname(hostname);
@ -255,15 +249,11 @@ void setup(void)
ESPUI.slider("Slider two", &slider, ControlColor::None, 100); ESPUI.slider("Slider two", &slider, ControlColor::None, 100);
ESPUI.text("Text Test:", &textCall, ControlColor::Alizarin, "a Text Field"); ESPUI.text("Text Test:", &textCall, ControlColor::Alizarin, "a Text Field");
#ifdef TEST_HUGE_TEXT
ESPUI.text("Huge Text Test:", &textCall, ControlColor::Alizarin, HugeText); ESPUI.text("Huge Text Test:", &textCall, ControlColor::Alizarin, HugeText);
#endif // def TEST_HUGE_TEXT
ESPUI.number("Numbertest", &numberCall, ControlColor::Alizarin, 5, 0, 10); ESPUI.number("Numbertest", &numberCall, ControlColor::Alizarin, 5, 0, 10);
#ifdef TEST_FILEDISPLAY
fileDisplayId = ESPUI.fileDisplay("Filetest", ControlColor::Turquoise, DisplayTestFileName); fileDisplayId = ESPUI.fileDisplay("Filetest", ControlColor::Turquoise, DisplayTestFileName);
#endif // def TEST_FILEDISPLAY
#ifdef TEST_GRAPH #ifdef TEST_GRAPH
graphId = ESPUI.graph("Graph Test", ControlColor::Wetasphalt); graphId = ESPUI.graph("Graph Test", ControlColor::Wetasphalt);
@ -295,10 +285,8 @@ void setup(void)
ESPUI.writeFile("/wpad.dat", " "); ESPUI.writeFile("/wpad.dat", " ");
ESPUI.writeFile("/connecttest.txt", " "); ESPUI.writeFile("/connecttest.txt", " ");
#ifdef TEST_FILEDISPLAY
// create a text file // create a text file
ESPUI.writeFile("/DisplayFile.txt", "Test Line\n"); ESPUI.writeFile("/DisplayFile.txt", "Test Line\n");
#endif // def TEST_FILEDISPLAY
} }
void loop(void) void loop(void)
@ -320,7 +308,6 @@ void loop(void)
testSwitchState = !testSwitchState; testSwitchState = !testSwitchState;
ESPUI.updateSwitcher(testSwitchId, testSwitchState); ESPUI.updateSwitcher(testSwitchId, testSwitchState);
#ifdef TEST_FILEDISPLAY
// update the file Display file. // update the file Display file.
File testFile = ESPUI.EspuiLittleFS.open(String("/") + DisplayTestFileName, "a"); File testFile = ESPUI.EspuiLittleFS.open(String("/") + DisplayTestFileName, "a");
uint32_t filesize = testFile.size(); uint32_t filesize = testFile.size();
@ -335,7 +322,6 @@ void loop(void)
// Serial.println(TestLine); // Serial.println(TestLine);
} }
testFile.close(); testFile.close();
#endif // def TEST_FILEDISPLAY
oldTime = millis(); oldTime = millis();
} }