mcallegari / qlcplus

Q Light Controller Plus (QLC+) is a free and cross-platform software to control DMX or analog lighting systems like moving heads, dimmers, scanners etc. This project is a fork of the great QLC project written by Heikki Junnila that aims to continue the QLC development and to introduce new features.
Apache License 2.0
1.02k stars 361 forks source link

QLC Webinterface/Websockets does not reset the selected Universe #1618

Closed tmolbergen closed 1 month ago

tmolbergen commented 1 month ago

Describe the bug When trying to reset the simple desk set values back to 'normal' operation, the webinterface will reset whatever universe is selected in the gui and not what is selected in the webinterface

I believe its because the sdResetUniverse function in the websockets api does not take a universe input and reset that specific universe. If you had taken 1 arg on sdResetUniverse, you could then reset the selected universe in the webinterface

I believe the specific culprit can be found in this file on line 743; https://github.com/mcallegari/qlcplus/blob/351ee83b9a3df810d41fd155728d10ae39d5aa6d/webaccess/src/webaccess.cpp#L743


else if (apiCmd == "sdResetUniverse")
        {
            if (m_auth && user && user->level < SIMPLE_DESK_AND_VC_LEVEL)
                return;

            m_sd->resetUniverse();

To Reproduce Steps to reproduce the behavior:

  1. Go to webinterface
  2. Set some sliders to various levels in some of the universes
  3. Try to reset the specific universe you have select - Note that the only universe which will be reset is the one selected in the Qt GUI application

Expected behavior The selected universe in the webinterface was reset

Screenshots N/A

Desktop (please complete the following information):

Additional context We are controlling some lights externally from a script, the reason for needing this method to function is to be able to reset the simple desk sliders so that we can use functions pre-setup in QLC (which we are also calling from the api)

tmolbergen commented 1 month ago

Without knowing too much about c++ or programming in general, what im suggesting is to do something along the lines of the singlechannel reset function observed here; https://github.com/mcallegari/qlcplus/blob/a76affda86cdae84d7886903c8954502e32615c1/webaccess/src/webaccess.cpp#L732

if (cmdList.count() < 3)
    return;

quint32 uniNum = cmdList[2].toUInt() - 1;
m_sd->resetUniverse(uniNum);
mcallegari commented 1 month ago

Fixed, thanks for reporting :+1: