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

Merge pull request #155 from d-a-v/emuAsync

minor adjustments for emulation on host via emuAsync lib (see readme)
This commit is contained in:
Lukas Bachschwell 2022-02-07 14:51:10 +01:00 committed by GitHub
commit b1fd9f71a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 6 deletions

View File

@ -564,6 +564,17 @@ If you change something in HTML/CSS/JS and want to create a pull request, please
do include the minified versions and corresponding C header files in your do include the minified versions and corresponding C header files in your
commits. (Do **NOT** commit all the minified versions for the non changed files) commits. (Do **NOT** commit all the minified versions for the non changed files)
# Experimental debugging environment using emulation on host
It is possible to run or debug this library on a unix-like computer (Linux,
macOS, WSL) without flashing on hardware, and with your favourite debugging
tools (gdb, valgrind, ...). This is accomplished through the
esp8266/Arduino "emulation on host" environment.
A fake AsyncWebserver library is needed because lwIP is not yet ported to
the emulation environment. Full instructions can be found in this project's
[readme page](https://github.com/d-a-v/emuAsync).
## Changelog for 2.1: ## Changelog for 2.1:
- Adds the ability to have inline styles for widgets and panels - Adds the ability to have inline styles for widgets and panels

View File

@ -783,9 +783,9 @@ void ESPUIClass::updateControl(Control* control, int clientId)
root["id"] = control->id; root["id"] = control->id;
root["visible"] = control->visible; root["visible"] = control->visible;
root["color"] = (int)control->color; root["color"] = (int)control->color;
if (control->panelStyle != 0) if (control->panelStyle.length())
root["panelStyle"] = control->panelStyle; root["panelStyle"] = control->panelStyle;
if (control->elementStyle != 0) if (control->elementStyle.length())
root["elementStyle"] = control->elementStyle; root["elementStyle"] = control->elementStyle;
serializeJson(document, json); serializeJson(document, json);
@ -811,7 +811,7 @@ void ESPUIClass::updateControl(Control* control, int clientId)
// function like this and it's clients array is private // function like this and it's clients array is private
int tryId = 0; int tryId = 0;
for (size_t count = 0; count < this->ws->count();) for (size_t count = 0; tryId < (int)this->ws->count() && count < this->ws->count();)
{ {
if (this->ws->hasClient(tryId)) if (this->ws->hasClient(tryId))
{ {
@ -1003,7 +1003,7 @@ void ESPUIClass::addGraphPoint(uint16_t id, int nValue, int clientId)
// function like this and it's clients array is private // function like this and it's clients array is private
int tryId = 0; int tryId = 0;
for (size_t count = 0; count < this->ws->count();) for (size_t count = 0; tryId < (int)this->ws->count() && count < this->ws->count();)
{ {
if (this->ws->hasClient(tryId)) if (this->ws->hasClient(tryId))
{ {
@ -1108,9 +1108,9 @@ void ESPUIClass::prepareJSONChunk(AsyncWebSocketClient* client, uint16_t startin
item["value"] = String(control->value); item["value"] = String(control->value);
item["color"] = (int)control->color; item["color"] = (int)control->color;
item["visible"] = (int)control->visible; item["visible"] = (int)control->visible;
if (control->panelStyle != 0) if (control->panelStyle.length())
item["panelStyle"] = String(control->panelStyle); item["panelStyle"] = String(control->panelStyle);
if (control->elementStyle != 0) if (control->elementStyle.length())
item["elementStyle"] = String(control->elementStyle); item["elementStyle"] = String(control->elementStyle);
if (control->wide == true) if (control->wide == true)
item["wide"] = true; item["wide"] = true;