Skip to content

Commit 657fe00

Browse files
Paulchen-PantherPaulchen-Panther
authored andcommitted
Troubleshooting and ...
- More i18n - Easy use of mutual exclusion in JsonAPI with QMutexLocker - Smoothing type "linear" hidden in the WebUI, because there is currently only one - Message forwarding implemented again - For compatibility to home assistants and other remote controls, "activeEffects" and "activeLedColor" has been added to the JSON-RPC - FlatBuffer clear now the Priority on disconnect - The information "available V4L2 devices" is now only displayed if the device list is not empty - LED device "PiBlaster" excluded from OSX build
1 parent a412c34 commit 657fe00

28 files changed

+339
-146
lines changed

assets/webconfig/i18n/de.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -565,12 +565,14 @@
565565
"edt_conf_fw_proto_itemtitle" : "Proto Ziel",
566566
"edt_conf_js_heading_title" : "JSON Server",
567567
"edt_conf_fbs_heading_title" : "Flatbuffers Server",
568+
"edt_conf_fbs_timeout_title" : "Zeitüberschreitung",
569+
"edt_conf_fbs_timeout_expl" : "Wenn für die angegebene Zeit keine Daten empfangen werden, wird die Komponente (vorübergehend) deaktiviert",
568570
"edt_conf_bobls_heading_title" : "Boblight Server",
569571
"edt_conf_udpl_heading_title" : "UDP Listener",
570572
"edt_conf_udpl_address_title" : "Adresse",
571573
"edt_conf_udpl_address_expl" : "Die Adresse auf der UDP Pakete akzeptiert werden.",
572574
"edt_conf_udpl_timeout_title" : "Zeitüberschreitung",
573-
"edt_conf_udpl_timeout_expl" : "Wenn für die angegeben Zeit keine UDP Pakete empfangen werden, wird die Komponente (vorübergehend) deaktiviert",
575+
"edt_conf_udpl_timeout_expl" : "Wenn für die angegebene Zeit keine UDP Pakete empfangen werden, wird die Komponente (vorübergehend) deaktiviert",
574576
"edt_conf_udpl_shared_title" : "Gemeinsam genutzt",
575577
"edt_conf_udpl_shared_expl" : "Wird gemeinsam über alle Hyperion Instanzen genutzt.",
576578
"edt_conf_webc_heading_title" : "Web Konfiguration",

assets/webconfig/i18n/en.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,8 @@
566566
"edt_conf_fw_proto_itemtitle" : "Proto target",
567567
"edt_conf_js_heading_title" : "JSON Server",
568568
"edt_conf_fbs_heading_title" : "Flatbuffers Server",
569+
"edt_conf_fbs_timeout_title" : "Timeout",
570+
"edt_conf_fbs_timeout_expl" : "If no data are received for the given period, the component will be (soft) disabled.",
569571
"edt_conf_bobls_heading_title" : "Boblight Server",
570572
"edt_conf_udpl_heading_title" : "UDP Listener",
571573
"edt_conf_udpl_address_title" : "Address",

assets/webconfig/js/content_effectsconfigurator.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ $(document).ready( function() {
5050

5151
fileReader.onload = function () {
5252
imageData = this.result.split(',')[1];
53-
console.log(imageData);
5453
cbs.success(file.name);
5554
};
5655

assets/webconfig/js/ui_utils.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -587,6 +587,9 @@ function createHelpTable(list, phead){
587587
{
588588
if(list[key].access != 'system')
589589
{
590+
// break one iteration (in the loop), if the schema has the entry hidden=true
591+
if ("options" in list[key] && "hidden" in list[key].options && (list[key].options.hidden))
592+
continue;
590593
var text = list[key].title.replace('title', 'expl');
591594
tbody.appendChild(createTableRow([$.i18n(list[key].title), $.i18n(text)], false, false));
592595

@@ -595,7 +598,9 @@ function createHelpTable(list, phead){
595598
var ilist = sortProperties(list[key].items.properties);
596599
for (ikey in ilist)
597600
{
598-
601+
// break one iteration (in the loop), if the schema has the entry hidden=true
602+
if ("options" in ilist[ikey] && "hidden" in ilist[ikey].options && (ilist[ikey].options.hidden))
603+
continue;
599604
var itext = ilist[ikey].title.replace('title', 'expl');
600605
tbody.appendChild(createTableRow([$.i18n(ilist[ikey].title), $.i18n(itext)], false, false));
601606
}

include/hyperion/Hyperion.h

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -326,12 +326,6 @@ public slots:
326326
///
327327
ColorAdjustment * getAdjustment(const QString& id);
328328

329-
///
330-
/// Returns MessageForwarder Object
331-
/// @return instance of message forwarder object
332-
///
333-
MessageForwarder * getForwarder();
334-
335329
/// Tell Hyperion that the corrections have changed and the leds need to be updated
336330
void adjustmentsUpdated();
337331

@@ -345,7 +339,7 @@ public slots:
345339
const bool clear(int priority);
346340

347341
///
348-
/// Clears all priority channels. This will switch the leds off until a new priority is written.
342+
/// @brief Clears all priority channels. This will switch the leds off until a new priority is written.
349343
///
350344
void clearall(bool forceClearAll=false);
351345

@@ -416,6 +410,9 @@ public slots:
416410
/// Signal which is emitted, when a new json message should be forwarded
417411
void forwardJsonMessage(QJsonObject);
418412

413+
/// Signal which is emitted, when a new proto image should be forwarded
414+
void forwardProtoMessage(Image<ColorRgb>);
415+
419416
///
420417
/// @brief Is emitted from clients who request a videoMode change
421418
///

include/hyperion/MessageForwarder.h

Lines changed: 61 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,37 +18,86 @@
1818
#include <utils/ColorRgb.h>
1919
#include <utils/settings.h>
2020
#include <utils/Logger.h>
21+
#include <utils/Components.h>
22+
#include <utils/Image.h>
2123

24+
// Hyperion includes
25+
#include <hyperion/PriorityMuxer.h>
26+
27+
// Forward declaration
2228
class Hyperion;
29+
class QTcpSocket;
30+
class FlatBufferConnection;
2331

2432
class MessageForwarder : public QObject
2533
{
2634
Q_OBJECT
2735
public:
28-
29-
MessageForwarder(Hyperion* hyperion, const QJsonDocument & config);
36+
MessageForwarder(Hyperion* hyperion);
3037
~MessageForwarder();
3138

3239
void addJsonSlave(QString slave);
3340
void addProtoSlave(QString slave);
3441

35-
bool protoForwardingEnabled();
36-
bool jsonForwardingEnabled();
37-
bool forwardingEnabled() { return jsonForwardingEnabled() || protoForwardingEnabled(); };
38-
QStringList getProtoSlaves() const { return _protoSlaves; };
39-
QStringList getJsonSlaves() const { return _jsonSlaves; };
40-
4142
private slots:
4243
///
4344
/// @brief Handle settings update from Hyperion Settingsmanager emit or this constructor
4445
/// @param type settingyType from enum
4546
/// @param config configuration object
4647
///
47-
void handleSettingsUpdate(const settings::type& type, const QJsonDocument& config);
48+
void handleSettingsUpdate(const settings::type &type, const QJsonDocument &config);
49+
50+
///
51+
/// @brief Handle component state change MessageForwarder
52+
/// @param component The component from enum
53+
/// @param enable The new state
54+
///
55+
void componentStateChanged(const hyperion::Components component, bool enable);
56+
57+
///
58+
/// @brief Handle priority updates from Priority Muxer
59+
/// @param priority The new visible priority
60+
///
61+
void handlePriorityChanges(const quint8 &priority);
62+
63+
///
64+
/// @brief Forward message to all json slaves
65+
/// @param message The JSON message to send
66+
///
67+
void forwardJsonMessage(const QJsonObject &message);
68+
69+
///
70+
/// @brief Forward image to all proto slaves
71+
/// @param image The PROTO image to send
72+
///
73+
void forwardProtoMessage(const Image<ColorRgb> &image);
74+
75+
///
76+
/// @brief Forward message to a single json slave
77+
/// @param message The JSON message to send
78+
/// @param socket The TCP-Socket with the connection to the slave
79+
///
80+
void sendJsonMessage(const QJsonObject &message, QTcpSocket *socket);
4881

4982
private:
50-
Hyperion* _hyperion;
51-
Logger* _log;
52-
QStringList _protoSlaves;
83+
/// Hyperion instance
84+
Hyperion *_hyperion;
85+
86+
/// Logger instance
87+
Logger *_log;
88+
89+
/// Muxer instance
90+
PriorityMuxer *_muxer;
91+
92+
// JSON connection for forwarding
5393
QStringList _jsonSlaves;
94+
95+
/// Proto connection for forwarding
96+
QStringList _protoSlaves;
97+
QList<FlatBufferConnection*> _forwardClients;
98+
99+
/// Flag if forwarder is enabled
100+
bool _forwarder_enabled = true;
101+
102+
const int _priority;
54103
};

include/hyperion/PriorityMuxer.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ class PriorityMuxer : public QObject
107107
///
108108
/// @return The current priority
109109
///
110-
int getCurrentPriority() const;
110+
int getCurrentPriority() const { return _currentPriority; }
111111

112112
///
113113
/// Returns the state (enabled/disabled) of a specific priority channel
@@ -197,7 +197,7 @@ class PriorityMuxer : public QObject
197197

198198
///
199199
/// @brief Emits whenever the visible priority has changed
200-
/// @param priority The new visible prioritiy
200+
/// @param priority The new visible priority
201201
///
202202
void visiblePriorityChanged(const quint8& priority);
203203

include/jsonserver/JsonServer.h

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,9 @@ private slots:
4949
void closedConnection(void);
5050

5151
public slots:
52-
53-
///
54-
/// forward message to a single json slaves
55-
///
56-
/// @param message The JSON message to send
57-
///
58-
void sendMessage(const QJsonObject & message, QTcpSocket * socket);
59-
6052
///
6153
/// @brief Handle settings update from Hyperion Settingsmanager emit or this constructor
62-
/// @param type settingyType from enum
54+
/// @param type settings type from enum
6355
/// @param config configuration object
6456
///
6557
void handleSettingsUpdate(const settings::type& type, const QJsonDocument& config);

include/udplistener/UDPListener.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,6 @@ public slots:
7676
///
7777
const bool setGlobalInput(const int priority, const std::vector<ColorRgb>& ledColors, const int timeout_ms = -1, const bool& clearEffect = true);
7878

79-
///
80-
/// @brief forward clear to HyperionDaemon
81-
///
82-
void clearGlobalPriority(const int& _priority, const hyperion::Components& component);
83-
8479
private slots:
8580
///
8681
/// Slot which is called when a client tries to create a new connection

include/utils/hyperion.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#pragma once
22

3+
#include <sstream>
4+
35
#include <hyperion/ColorAdjustment.h>
46
#include <hyperion/MultiColorAdjustment.h>
57
#include <hyperion/LedString.h>

0 commit comments

Comments
 (0)