mirror of
https://github.com/s00500/ESPUI.git
synced 2024-12-22 09:10:51 +00:00
Removed conditional flags for the large tests.
This commit is contained in:
parent
8bca2e503b
commit
47db2ad6d8
@ -43,8 +43,6 @@ board = esp32dev
|
||||
monitor_filters = esp32_exception_decoder
|
||||
board_build.flash_mode = dout
|
||||
build_flags =
|
||||
-D TEST_HUGE_TEXT
|
||||
-D TEST_FILEDISPLAY
|
||||
; -D DEBUG_ESPUI
|
||||
|
||||
lib_deps =
|
||||
|
@ -16,10 +16,8 @@ const char* password = "YourNetworkPassphrase";
|
||||
|
||||
const char* hostname = "espui";
|
||||
|
||||
#ifdef TEST_FILEDISPLAY
|
||||
String DisplayTestFileName = "/FileName.txt";
|
||||
int fileDisplayId = Control::noParent;
|
||||
#endif // def TEST_FILEDISPLAY
|
||||
|
||||
int statusLabelId = Control::noParent;
|
||||
|
||||
@ -29,9 +27,7 @@ int graphId = Control::noParent;
|
||||
int millisLabelId = Control::noParent;
|
||||
int testSwitchId = Control::noParent;
|
||||
|
||||
#ifdef TEST_HUGE_TEXT
|
||||
char HugeText[1025];
|
||||
#endif // def TEST_HUGE_TEXT
|
||||
|
||||
void numberCall(Control* sender, int type)
|
||||
{
|
||||
@ -176,11 +172,9 @@ void setup(void)
|
||||
ESPUI.setVerbosity(Verbosity::VerboseJSON);
|
||||
Serial.begin(115200);
|
||||
|
||||
#ifdef TEST_HUGE_TEXT
|
||||
memset(HugeText, 0x0, sizeof(HugeText));
|
||||
memset(HugeText, 'a', sizeof(HugeText)-1);
|
||||
#endif // def TEST_HUGE_TEXT
|
||||
|
||||
|
||||
#if defined(ESP32)
|
||||
WiFi.setHostname(hostname);
|
||||
#else
|
||||
@ -255,15 +249,11 @@ void setup(void)
|
||||
ESPUI.slider("Slider two", &slider, ControlColor::None, 100);
|
||||
ESPUI.text("Text Test:", &textCall, ControlColor::Alizarin, "a Text Field");
|
||||
|
||||
#ifdef TEST_HUGE_TEXT
|
||||
ESPUI.text("Huge Text Test:", &textCall, ControlColor::Alizarin, HugeText);
|
||||
#endif // def TEST_HUGE_TEXT
|
||||
|
||||
ESPUI.number("Numbertest", &numberCall, ControlColor::Alizarin, 5, 0, 10);
|
||||
|
||||
#ifdef TEST_FILEDISPLAY
|
||||
fileDisplayId = ESPUI.fileDisplay("Filetest", ControlColor::Turquoise, DisplayTestFileName);
|
||||
#endif // def TEST_FILEDISPLAY
|
||||
|
||||
#ifdef TEST_GRAPH
|
||||
graphId = ESPUI.graph("Graph Test", ControlColor::Wetasphalt);
|
||||
@ -295,10 +285,8 @@ void setup(void)
|
||||
ESPUI.writeFile("/wpad.dat", " ");
|
||||
ESPUI.writeFile("/connecttest.txt", " ");
|
||||
|
||||
#ifdef TEST_FILEDISPLAY
|
||||
// create a text file
|
||||
ESPUI.writeFile("/DisplayFile.txt", "Test Line\n");
|
||||
#endif // def TEST_FILEDISPLAY
|
||||
}
|
||||
|
||||
void loop(void)
|
||||
@ -320,7 +308,6 @@ void loop(void)
|
||||
testSwitchState = !testSwitchState;
|
||||
ESPUI.updateSwitcher(testSwitchId, testSwitchState);
|
||||
|
||||
#ifdef TEST_FILEDISPLAY
|
||||
// update the file Display file.
|
||||
File testFile = ESPUI.EspuiLittleFS.open(String("/") + DisplayTestFileName, "a");
|
||||
uint32_t filesize = testFile.size();
|
||||
@ -330,12 +317,11 @@ void loop(void)
|
||||
{
|
||||
testFile.write((const uint8_t*)TestLine.c_str(), TestLine.length());
|
||||
ESPUI.updateControl(fileDisplayId);
|
||||
|
||||
|
||||
TestLine += String("filesize: ") + String(filesize);
|
||||
// Serial.println(TestLine);
|
||||
}
|
||||
testFile.close();
|
||||
#endif // def TEST_FILEDISPLAY
|
||||
|
||||
oldTime = millis();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user