mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
Merge pull request #615 from Paulchen-Panther/forwarder
Changed proto title in forwarder to flatbuffer
This commit is contained in:
commit
c94bcd8911
@ -510,9 +510,9 @@
|
||||
"edt_conf_fw_json_title": "Seznam klientů json",
|
||||
"edt_conf_fw_json_expl": "Jeden z cílů na jeden řádek. Obsahuje IP:PORT (Příklad: 127.0.0.1:19446)",
|
||||
"edt_conf_fw_json_itemtitle": "Json cíl",
|
||||
"edt_conf_fw_proto_title": "Seznam proto klientů",
|
||||
"edt_conf_fw_proto_expl": "Jeden cíl na každý řádek. Obsahuje IP:PORT (Příklad: 127.0.0.1:19401)",
|
||||
"edt_conf_fw_proto_itemtitle": "Proto cíl",
|
||||
"edt_conf_fw_flat_title": "Seznam flatbuffer klientů",
|
||||
"edt_conf_fw_flat_expl": "Jeden cíl na každý řádek. Obsahuje IP:PORT (Příklad: 127.0.0.1:19401)",
|
||||
"edt_conf_fw_flat_itemtitle": "flatbuffer cíl",
|
||||
"edt_conf_js_heading_title": "JSON Server",
|
||||
"edt_conf_ps_heading_title": "PROTO Server",
|
||||
"edt_conf_bobls_heading_title": "Boblight Server",
|
||||
|
@ -599,9 +599,9 @@
|
||||
"edt_conf_fw_json_title": "Liste von Json zielen",
|
||||
"edt_conf_fw_json_expl": "Ein Json Ziel pro Zeile. Bestehend aus IP:PORT (Beispiel: 127.0.0.1:19446)",
|
||||
"edt_conf_fw_json_itemtitle": "Json Ziel",
|
||||
"edt_conf_fw_proto_title": "Liste von Proto zielen",
|
||||
"edt_conf_fw_proto_expl": "Ein Proto Ziel pro Zeile. Bestehend aus IP:PORT (Beispiel: 127.0.0.1:19401)",
|
||||
"edt_conf_fw_proto_itemtitle": "Proto Ziel",
|
||||
"edt_conf_fw_flat_title": "Liste von Flatbuffer zielen",
|
||||
"edt_conf_fw_flat_expl": "Ein Flatbuffer Ziel pro Zeile. Bestehend aus IP:PORT (Beispiel: 127.0.0.1:19401)",
|
||||
"edt_conf_fw_flat_itemtitle": "Flatbuffer Ziel",
|
||||
"edt_conf_net_heading_title" : "Network",
|
||||
"edt_conf_net_internetAccessAPI_title":"Internet API Zugriff",
|
||||
"edt_conf_net_internetAccessAPI_expl":"Erlaube Zugriff auf die Hyperion API/Webinterface aus dem Internet, deaktivieren für höhere Sicherheit.",
|
||||
|
@ -598,9 +598,9 @@
|
||||
"edt_conf_fw_json_title" : "List of json clients",
|
||||
"edt_conf_fw_json_expl" : "One json target per line. Contains IP:PORT (Example: 127.0.0.1:19446)",
|
||||
"edt_conf_fw_json_itemtitle" : "Json target",
|
||||
"edt_conf_fw_proto_title" : "List of proto clients",
|
||||
"edt_conf_fw_proto_expl" : "One proto target per line. Contains IP:PORT (Example: 127.0.0.1:19401)",
|
||||
"edt_conf_fw_proto_itemtitle" : "Proto target",
|
||||
"edt_conf_fw_flat_title" : "List of flatbuffer clients",
|
||||
"edt_conf_fw_flat_expl" : "One flatbuffer target per line. Contains IP:PORT (Example: 127.0.0.1:19401)",
|
||||
"edt_conf_fw_flat_itemtitle" : "flatbuffer target",
|
||||
"edt_conf_net_heading_title" : "Network",
|
||||
"edt_conf_net_internetAccessAPI_title":"Internet API Access",
|
||||
"edt_conf_net_internetAccessAPI_expl":"Allow access to the Hyperion API/Webinterface from the internet, disable for higher security.",
|
||||
|
@ -510,9 +510,9 @@
|
||||
"edt_conf_fw_json_title": "Lista de clientes JSON",
|
||||
"edt_conf_fw_json_expl": "Un destino json por línea. Contiene IP:PUERTO (Ejemplo: 127.0.0.1:19446)",
|
||||
"edt_conf_fw_json_itemtitle": "Destino json",
|
||||
"edt_conf_fw_proto_title": "Lista de clientes proto",
|
||||
"edt_conf_fw_proto_expl": "Un destino proto por línea. Contiene IP:PUERTO (Ejemplo: 127.0.0.1:19446)",
|
||||
"edt_conf_fw_proto_itemtitle": "Destino proto",
|
||||
"edt_conf_fw_flat_title": "Lista de clientes flatbuffer",
|
||||
"edt_conf_fw_flat_expl": "Un destino flatbuffer por línea. Contiene IP:PUERTO (Ejemplo: 127.0.0.1:19446)",
|
||||
"edt_conf_fw_flat_itemtitle": "Destino flatbuffer",
|
||||
"edt_conf_js_heading_title": "Servidor JSON",
|
||||
"edt_conf_ps_heading_title": "Servidor PROTO",
|
||||
"edt_conf_bobls_heading_title": "Servidor Boblight",
|
||||
|
@ -510,9 +510,9 @@
|
||||
"edt_conf_fw_json_title": "Lista dei client json",
|
||||
"edt_conf_fw_json_expl": "Una destinazione json per riga. Contiene IP:PORTA:(Esempio: 127.0.0.1:19446)",
|
||||
"edt_conf_fw_json_itemtitle": "Destinatario json",
|
||||
"edt_conf_fw_proto_title": "Lista dei client proto",
|
||||
"edt_conf_fw_proto_expl": "Una destinazione proto per riga. Contiene IP:PORTA:(Esempio: 127.0.0.1:19401)",
|
||||
"edt_conf_fw_proto_itemtitle": "Destinatario proto",
|
||||
"edt_conf_fw_flat_title": "Lista dei client flatbuffer",
|
||||
"edt_conf_fw_flat_expl": "Una destinazione flatbuffer per riga. Contiene IP:PORTA:(Esempio: 127.0.0.1:19401)",
|
||||
"edt_conf_fw_flat_itemtitle": "Destinatario flatbuffer",
|
||||
"edt_conf_js_heading_title": "Server JSON",
|
||||
"edt_conf_ps_heading_title": "Server PROTO",
|
||||
"edt_conf_bobls_heading_title": "Srtver Boblight",
|
||||
|
@ -223,7 +223,7 @@
|
||||
"forwarder" :
|
||||
{
|
||||
"enable" : false,
|
||||
"proto" : ["127.0.0.1:19401"],
|
||||
"flat" : ["127.0.0.1:19401"],
|
||||
"json" : ["127.0.0.1:19446"]
|
||||
},
|
||||
|
||||
|
@ -122,7 +122,7 @@
|
||||
{
|
||||
"enable" : false,
|
||||
"json" : ["127.0.0.1:19446"],
|
||||
"proto" : ["127.0.0.1:19401"]
|
||||
"flat" : ["127.0.0.1:19401"]
|
||||
},
|
||||
|
||||
"jsonServer" :
|
||||
|
@ -37,7 +37,7 @@ public:
|
||||
~MessageForwarder();
|
||||
|
||||
void addJsonSlave(QString slave);
|
||||
void addProtoSlave(QString slave);
|
||||
void addFlatbufferSlave(QString slave);
|
||||
|
||||
private slots:
|
||||
///
|
||||
@ -67,10 +67,10 @@ private slots:
|
||||
void forwardJsonMessage(const QJsonObject &message);
|
||||
|
||||
///
|
||||
/// @brief Forward image to all proto slaves
|
||||
/// @param image The PROTO image to send
|
||||
/// @brief Forward image to all flatbuffer slaves
|
||||
/// @param image The flatbuffer image to send
|
||||
///
|
||||
void forwardProtoMessage(const QString& name, const Image<ColorRgb> &image);
|
||||
void forwardFlatbufferMessage(const QString& name, const Image<ColorRgb> &image);
|
||||
|
||||
///
|
||||
/// @brief Forward message to a single json slave
|
||||
@ -93,7 +93,7 @@ private:
|
||||
QStringList _jsonSlaves;
|
||||
|
||||
/// Proto connection for forwarding
|
||||
QStringList _protoSlaves;
|
||||
QStringList _flatSlaves;
|
||||
QList<FlatBufferConnection*> _forwardClients;
|
||||
|
||||
/// Flag if forwarder is enabled
|
||||
|
@ -49,7 +49,7 @@ void MessageForwarder::handleSettingsUpdate(const settings::type &type, const QJ
|
||||
{
|
||||
// clear the current targets
|
||||
_jsonSlaves.clear();
|
||||
_protoSlaves.clear();
|
||||
_flatSlaves.clear();
|
||||
while (!_forwardClients.isEmpty())
|
||||
delete _forwardClients.takeFirst();
|
||||
|
||||
@ -64,12 +64,12 @@ void MessageForwarder::handleSettingsUpdate(const settings::type &type, const QJ
|
||||
}
|
||||
}
|
||||
|
||||
if ( !obj["proto"].isNull() )
|
||||
if ( !obj["flat"].isNull() )
|
||||
{
|
||||
const QJsonArray & addr = obj["proto"].toArray();
|
||||
const QJsonArray & addr = obj["flat"].toArray();
|
||||
for (const auto& entry : addr)
|
||||
{
|
||||
addProtoSlave(entry.toString());
|
||||
addFlatbufferSlave(entry.toString());
|
||||
}
|
||||
}
|
||||
|
||||
@ -80,11 +80,11 @@ void MessageForwarder::handleSettingsUpdate(const settings::type &type, const QJ
|
||||
} else if (_jsonSlaves.isEmpty() || ! obj["enable"].toBool() || !_forwarder_enabled)
|
||||
disconnect(_hyperion, &Hyperion::forwardJsonMessage, 0, 0);
|
||||
|
||||
if (!_protoSlaves.isEmpty() && obj["enable"].toBool() && _forwarder_enabled)
|
||||
if (!_flatSlaves.isEmpty() && obj["enable"].toBool() && _forwarder_enabled)
|
||||
{
|
||||
InfoIf(obj["enable"].toBool(true), _log, "Forward now to proto targets '%s'", QSTRING_CSTR(_protoSlaves.join(", ")));
|
||||
// connect(_hyperion, &Hyperion::forwardProtoMessage, this, &MessageForwarder::forwardProtoMessage, Qt::UniqueConnection);
|
||||
} else if ( _protoSlaves.isEmpty() || ! obj["enable"].toBool() || !_forwarder_enabled)
|
||||
InfoIf(obj["enable"].toBool(true), _log, "Forward now to flatbuffer targets '%s'", QSTRING_CSTR(_flatSlaves.join(", ")));
|
||||
}
|
||||
else if ( _flatSlaves.isEmpty() || ! obj["enable"].toBool() || !_forwarder_enabled)
|
||||
{
|
||||
disconnect(_hyperion, &Hyperion::forwardSystemProtoMessage, 0, 0);
|
||||
disconnect(_hyperion, &Hyperion::forwardV4lProtoMessage, 0, 0);
|
||||
@ -111,7 +111,7 @@ void MessageForwarder::handlePriorityChanges(const quint8 &priority)
|
||||
const QJsonObject obj = _hyperion->getSetting(settings::NETFORWARD).object();
|
||||
if (priority != 0 && _forwarder_enabled && obj["enable"].toBool())
|
||||
{
|
||||
_protoSlaves.clear();
|
||||
_flatSlaves.clear();
|
||||
while (!_forwardClients.isEmpty())
|
||||
delete _forwardClients.takeFirst();
|
||||
|
||||
@ -123,7 +123,7 @@ void MessageForwarder::handlePriorityChanges(const quint8 &priority)
|
||||
const QJsonArray & addr = obj["proto"].toArray();
|
||||
for (const auto& entry : addr)
|
||||
{
|
||||
addProtoSlave(entry.toString());
|
||||
addFlatbufferSlave(entry.toString());
|
||||
}
|
||||
}
|
||||
|
||||
@ -132,13 +132,13 @@ void MessageForwarder::handlePriorityChanges(const quint8 &priority)
|
||||
case hyperion::COMP_GRABBER:
|
||||
{
|
||||
disconnect(_hyperion, &Hyperion::forwardV4lProtoMessage, 0, 0);
|
||||
connect(_hyperion, &Hyperion::forwardSystemProtoMessage, this, &MessageForwarder::forwardProtoMessage, Qt::UniqueConnection);
|
||||
connect(_hyperion, &Hyperion::forwardSystemProtoMessage, this, &MessageForwarder::forwardFlatbufferMessage, Qt::UniqueConnection);
|
||||
}
|
||||
break;
|
||||
case hyperion::COMP_V4L:
|
||||
{
|
||||
disconnect(_hyperion, &Hyperion::forwardSystemProtoMessage, 0, 0);
|
||||
connect(_hyperion, &Hyperion::forwardV4lProtoMessage, this, &MessageForwarder::forwardProtoMessage, Qt::UniqueConnection);
|
||||
connect(_hyperion, &Hyperion::forwardV4lProtoMessage, this, &MessageForwarder::forwardFlatbufferMessage, Qt::UniqueConnection);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@ -185,7 +185,7 @@ void MessageForwarder::addJsonSlave(QString slave)
|
||||
_jsonSlaves << slave;
|
||||
}
|
||||
|
||||
void MessageForwarder::addProtoSlave(QString slave)
|
||||
void MessageForwarder::addFlatbufferSlave(QString slave)
|
||||
{
|
||||
QStringList parts = slave.split(":");
|
||||
if (parts.size() != 2)
|
||||
@ -206,13 +206,13 @@ void MessageForwarder::addProtoSlave(QString slave)
|
||||
const QJsonObject &obj = _hyperion->getSetting(settings::FLATBUFSERVER).object();
|
||||
if(QHostAddress(parts[0]) == QHostAddress::LocalHost && parts[1].toInt() == obj["port"].toInt())
|
||||
{
|
||||
Error(_log, "Loop between ProtoServer and Forwarder! (%s)",QSTRING_CSTR(slave));
|
||||
Error(_log, "Loop between Flatbuffer Server and Forwarder! (%s)",QSTRING_CSTR(slave));
|
||||
return;
|
||||
}
|
||||
|
||||
if (_forwarder_enabled)
|
||||
{
|
||||
_protoSlaves << slave;
|
||||
_flatSlaves << slave;
|
||||
FlatBufferConnection* flatbuf = new FlatBufferConnection("Forwarder", slave.toLocal8Bit().constData(), _priority, false);
|
||||
_forwardClients << flatbuf;
|
||||
}
|
||||
@ -236,7 +236,7 @@ void MessageForwarder::forwardJsonMessage(const QJsonObject &message)
|
||||
}
|
||||
}
|
||||
|
||||
void MessageForwarder::forwardProtoMessage(const QString& name, const Image<ColorRgb> &image)
|
||||
void MessageForwarder::forwardFlatbufferMessage(const QString& name, const Image<ColorRgb> &image)
|
||||
{
|
||||
if (_forwarder_enabled)
|
||||
{
|
||||
|
@ -24,15 +24,15 @@
|
||||
},
|
||||
"propertyOrder" : 2
|
||||
},
|
||||
"proto" :
|
||||
"flat" :
|
||||
{
|
||||
"type" : "array",
|
||||
"title" : "edt_conf_fw_proto_title",
|
||||
"title" : "edt_conf_fw_flat_title",
|
||||
"required" : true,
|
||||
"default" : ["127.0.0.1:19401"],
|
||||
"items" : {
|
||||
"type": "string",
|
||||
"title" : "edt_conf_fw_proto_itemtitle"
|
||||
"title" : "edt_conf_fw_flat_itemtitle"
|
||||
},
|
||||
"propertyOrder" : 3
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user