mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
JsonUtils & improvements (#476)
* add JsonUtils * update * repair * update * ident * Schema correct msg other adjusts * fix effDel, ExceptionLog, cleanup * fix travis qt5.2 * not so funny * use Qthread interrupt instead abort bool * update services
This commit is contained in:
@@ -35,11 +35,11 @@
|
||||
|
||||
Hyperion* Hyperion::_hyperion = nullptr;
|
||||
|
||||
Hyperion* Hyperion::initInstance(const QJsonObject& qjsonConfig, const QString configFile) // REMOVE jsonConfig variable when the conversion from jsonCPP to QtJSON is finished
|
||||
Hyperion* Hyperion::initInstance(const QJsonObject& qjsonConfig, const QString configFile, const QString rootPath)
|
||||
{
|
||||
if ( Hyperion::_hyperion != nullptr )
|
||||
throw std::runtime_error("Hyperion::initInstance can be called only one time");
|
||||
Hyperion::_hyperion = new Hyperion(qjsonConfig, configFile);
|
||||
Hyperion::_hyperion = new Hyperion(qjsonConfig, configFile, rootPath);
|
||||
|
||||
return Hyperion::_hyperion;
|
||||
}
|
||||
@@ -381,7 +381,7 @@ MessageForwarder * Hyperion::getForwarder()
|
||||
return _messageForwarder;
|
||||
}
|
||||
|
||||
Hyperion::Hyperion(const QJsonObject &qjsonConfig, const QString configFile)
|
||||
Hyperion::Hyperion(const QJsonObject &qjsonConfig, const QString configFile, const QString rootPath)
|
||||
: _ledString(createLedString(qjsonConfig["leds"], createColorOrder(qjsonConfig["device"].toObject())))
|
||||
, _ledStringClone(createLedStringClone(qjsonConfig["leds"], createColorOrder(qjsonConfig["device"].toObject())))
|
||||
, _muxer(_ledString.leds().size())
|
||||
@@ -390,6 +390,7 @@ Hyperion::Hyperion(const QJsonObject &qjsonConfig, const QString configFile)
|
||||
, _messageForwarder(createMessageForwarder(qjsonConfig["forwarder"].toObject()))
|
||||
, _qjsonConfig(qjsonConfig)
|
||||
, _configFile(configFile)
|
||||
, _rootPath(rootPath)
|
||||
, _timer()
|
||||
, _timerBonjourResolver()
|
||||
, _log(CORE_LOGGER)
|
||||
@@ -439,7 +440,7 @@ Hyperion::Hyperion(const QJsonObject &qjsonConfig, const QString configFile)
|
||||
_timerBonjourResolver.start();
|
||||
|
||||
// create the effect engine, must be initialized after smoothing!
|
||||
_effectEngine = new EffectEngine(this,qjsonConfig["effects"].toObject() );
|
||||
_effectEngine = new EffectEngine(this,qjsonConfig["effects"].toObject());
|
||||
|
||||
const QJsonObject& device = qjsonConfig["device"].toObject();
|
||||
unsigned int hwLedCount = device["ledCount"].toInt(getLedCount());
|
||||
@@ -468,9 +469,6 @@ Hyperion::Hyperion(const QJsonObject &qjsonConfig, const QString configFile)
|
||||
_fsi_timer.setSingleShot(true);
|
||||
_fsi_blockTimer.setSingleShot(true);
|
||||
|
||||
const QJsonObject & generalConfig = qjsonConfig["general"].toObject();
|
||||
_configVersionId = generalConfig["configVersion"].toInt(-1);
|
||||
|
||||
// initialize the leds
|
||||
update();
|
||||
}
|
||||
|
@@ -15,7 +15,7 @@
|
||||
"type" : "integer",
|
||||
"required" : true,
|
||||
"title" : "edt_conf_general_port_title",
|
||||
"minimum" : 0,
|
||||
"minimum" : 1024,
|
||||
"maximum" : 65535,
|
||||
"propertyOrder" : 2
|
||||
},
|
||||
|
@@ -7,7 +7,7 @@
|
||||
{
|
||||
"type" : "array",
|
||||
"title" : "edt_conf_effp_paths_title",
|
||||
"default" : ["../custom-effects"],
|
||||
"default" : ["$ROOT/custom-effects"],
|
||||
"items" : {
|
||||
"type": "string",
|
||||
"title" : "edt_conf_effp_paths_itemtitle"
|
||||
|
@@ -9,7 +9,7 @@
|
||||
"type" : "integer",
|
||||
"required" : true,
|
||||
"title" : "edt_conf_general_port_title",
|
||||
"minimum" : 0,
|
||||
"minimum" : 1024,
|
||||
"maximum" : 65535,
|
||||
"default" : 19444
|
||||
}
|
||||
|
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"type":"array",
|
||||
"required":true,
|
||||
"minItems":1,
|
||||
"items":
|
||||
{
|
||||
"type":"object",
|
||||
|
@@ -9,7 +9,7 @@
|
||||
"type" : "integer",
|
||||
"required" : true,
|
||||
"title" : "edt_conf_general_port_title",
|
||||
"minimum" : 0,
|
||||
"minimum" : 1024,
|
||||
"maximum" : 65535,
|
||||
"default" : 19445
|
||||
}
|
||||
|
@@ -22,9 +22,9 @@
|
||||
{
|
||||
"type" : "integer",
|
||||
"title" : "edt_conf_general_port_title",
|
||||
"minimum" : 0,
|
||||
"minimum" : 80,
|
||||
"maximum" : 65535,
|
||||
"default" : 8099,
|
||||
"default" : 8090,
|
||||
"access" : "expert",
|
||||
"propertyOrder" : 3
|
||||
}
|
||||
|
Reference in New Issue
Block a user