Closed amwtech closed 7 months ago
Fix applied in https://github.com/CasparCG/client/commit/c79c5ff89222b4eab7f4bd5d6871fd2a697eb58e I havent tested it, hopefully it still works
Tested on Mac and Windows client build. Operates correctly.
I should also add that it looked like GpiPortModel
had the same bug, so I applied the same fix there
Problem observed in client versions 2.0.9 and 2.2
This problem shows when trying to use the GPO widget to pulse ouput 1, which does not react. Higher numbered outputs do switch correctly. Opening the configuration and changing the rising/falling status, for example swap the value, then swap again enables GPO 1 to respond to the widget until the client is restarted.
Configuring any output to have the opposite rising/falling state relative to the other outputs then restarting the client shows an offset of +1 output for the rising/falling state change. Looking at the database table with DB Browser for SQlite shows the configuration is stored in the correct lines of the table.
Investigation of the client code shows the internal GPO numbering is zero-based (eg 0 to 7), an offset of +1 is added to the GPO number when storing into the database. This offset is not removed when the config is recalled. The code error is in file
src/Core/DatabaseManager.cpp
. The code line numbers differ for the two clients, and the corrected lines are shown below.Client version 2.0.9 Line 1041 is:
models.push_back(GpoPortModel(sql.value(0).toInt(), sql.value(1).toInt() == 1, sql.value(2).toInt()));
It should be
models.push_back(GpoPortModel(sql.value(0).toInt() - 1, sql.value(1).toInt() == 1, sql.value(2).toInt()));
Client 2.2 Line 1050 is:
models.push_back(GpoPortModel(sql.value("Id").toInt(),
It should be:
models.push_back(GpoPortModel(sql.value("Id").toInt() - 1,