Skip to content

Commit

Permalink
webaccess: add widget ID to getWidgetType and getWidgetStatus response
Browse files Browse the repository at this point in the history
  • Loading branch information
mcallegari committed Dec 21, 2024
1 parent c348c2b commit 1bd5524
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
5 changes: 3 additions & 2 deletions debian/changelog
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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 <[email protected]> Sun, 29 Dec 2024 18:19:20 +0200

Expand Down Expand Up @@ -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 <[email protected]> Thu, 30 May 2024 18:19:20 +0200

Expand Down
4 changes: 2 additions & 2 deletions webaccess/res/Test_Web_API.html
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
7 changes: 5 additions & 2 deletions webaccess/src/webaccess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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")
{
Expand All @@ -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:
Expand Down

0 comments on commit 1bd5524

Please sign in to comment.