1
0
mirror of https://github.com/s00500/ESPUI.git synced 2025-07-03 19:50:20 +00:00

Changes to support keeping multiple Browser Clients in sync

This commit is contained in:
MartinMueller2003
2023-11-09 11:06:44 -05:00
parent 85ccff0ee0
commit 00841ce32d
8 changed files with 81 additions and 86 deletions

View File

@ -18,6 +18,7 @@ Control::Control(ControlType type, const char* label, std::function<void(Control
next(nullptr)
{
id = ++idCounter;
ControlChangeID = 1;
}
Control::Control(const Control& Control)
@ -29,7 +30,8 @@ Control::Control(const Control& Control)
color(Control.color),
visible(Control.visible),
parentControl(Control.parentControl),
next(Control.next)
next(Control.next),
ControlChangeID(Control.ControlChangeID)
{ }
void Control::SendCallback(int type)
@ -42,7 +44,7 @@ void Control::SendCallback(int type)
void Control::DeleteControl()
{
ControlSyncState = ControlSyncState_t::deleted;
_ToBeDeleted = true;
callback = nullptr;
}
@ -150,6 +152,8 @@ void Control::onWsEvent(String & cmd, String& data)
{
do // once
{
// Serial.println(String(F("Control::onWsEvent")));
SetControlChangedId(ESPUI.GetNextControlChangeId());
if (!HasCallback())
{
#if defined(DEBUG_ESPUI)