From 1bd5524f85408704a80a18ee6871308f7c02a254 Mon Sep 17 00:00:00 2001 From: Massimo Callegari Date: Sat, 21 Dec 2024 11:54:49 +0100 Subject: [PATCH] webaccess: add widget ID to getWidgetType and getWidgetStatus response --- debian/changelog | 5 +++-- webaccess/res/Test_Web_API.html | 4 ++-- webaccess/src/webaccess.cpp | 7 +++++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/debian/changelog b/debian/changelog index fa4e71d461..c91679d586 100644 --- a/debian/changelog +++ b/debian/changelog @@ -12,6 +12,7 @@ qlcplus (4.13.2) stable; urgency=low * Web Access: reworked websocket implementation * Web Access: fix grand master stopping running functions * Web Access: fix simple desk not resetting the current universe + * Web Access: add widget ID to getWidgetType and getWidgetStatus response * RGB scripts: added 'Sine Wave' script * RGB scripts: fix Vertical Fall not allowing changing color when cloned * New fixtures: GLP Impression X5, Ayrton Rivale Profile, Ayrton Kyalami (thanks to Masatoshi Fujino) @@ -28,6 +29,8 @@ qlcplus (4.13.2) stable; urgency=low * New fixture: Showtec Luna Par 120 Q4, Showtec Phantom 180 Wash, Stairville Infinite Pixel 250 * New fixture: Ghost Lumy (thanks to Manu) * New fixture: Shehds LED 200W RGB FLASH, GalaxyJet LED Beam 300W Beam&Spot&Wash, Constellaser 12W Waterproof Scan Laser (thanks to Tóth János) + * New fixture: Chauvet Ovation H-605FC (thanks to Ken Coughlin) + * New fixture: Martin smartMAC (thanks to Mads Vejrup) -- Massimo Callegari Sun, 29 Dec 2024 18:19:20 +0200 @@ -62,8 +65,6 @@ qlcplus (4.13.1) stable; urgency=low * New fixture: UKing 36W PAR UV ZQ01087 (thanks to Lance Moore) * New fixture: Showtec Club Par 12-4 RGBW (thanks to Simon Dovicovic) * New fixture: Fun-Generation PicoWash 40Z Pixel Quad LED (thanks to Kristers) - * New fixture: Chauvet Ovation H-605FC (thanks to Ken Coughlin) - * New fixture: Martin smartMAC (thanks to Mads Vejrup) -- Massimo Callegari Thu, 30 May 2024 18:19:20 +0200 diff --git a/webaccess/res/Test_Web_API.html b/webaccess/res/Test_Web_API.html index 52c6b6fa09..813776abc5 100644 --- a/webaccess/res/Test_Web_API.html +++ b/webaccess/res/Test_Web_API.html @@ -213,11 +213,11 @@ } else if (msgParams[1] === "getWidgetType") { - document.getElementById('getWidgetTypeBox').innerHTML = msgParams[2]; + document.getElementById('getWidgetTypeBox').innerHTML = msgParams[3]; } else if (msgParams[1] === "getWidgetStatus") { - var status = msgParams[2]; + var status = msgParams[3]; if (msgParams[2] === "PLAY") status = msgParams[2] + "(Step: " + msgParams[3] + ")"; document.getElementById('getWidgetStatusBox').innerHTML = status; diff --git a/webaccess/src/webaccess.cpp b/webaccess/src/webaccess.cpp index 87bc4f229e..60a7db3c99 100644 --- a/webaccess/src/webaccess.cpp +++ b/webaccess/src/webaccess.cpp @@ -622,9 +622,9 @@ void WebAccess::slotHandleWebSocketRequest(QHttpConnection *conn, QString data) quint32 wID = cmdList[2].toUInt(); VCWidget *widget = m_vc->widget(wID); if (widget != NULL) - wsAPIMessage.append(widget->typeToString(widget->type())); + wsAPIMessage.append(QString("%1|%2").arg(widget->id()).arg(widget->typeToString(widget->type()))); else - wsAPIMessage.append(widget->typeToString(VCWidget::UnknownWidget)); + wsAPIMessage.append(QString("%1|%2").arg(widget->id()).arg(widget->typeToString(VCWidget::UnknownWidget))); } else if (apiCmd == "getWidgetStatus") { @@ -635,6 +635,9 @@ void WebAccess::slotHandleWebSocketRequest(QHttpConnection *conn, QString data) VCWidget *widget = m_vc->widget(wID); if (widget != NULL) { + // add widget ID to the response + wsAPIMessage.append(QString("%1|").arg(widget->id())); + switch(widget->type()) { case VCWidget::ButtonWidget: