Adding the possibility to test new Effects ... (#282)

* Update effects_configurator.html

* Update content_effectsconfigurator.js

* Update hyperion.js

* Update de.json

* Add argument QString "pythonScript" to runEffect function

* Update Hyperion.h

* Update EffectEngine.cpp

* Update Hyperion.cpp

* Update JsonClientConnection.cpp

* Update schema-effect.json
This commit is contained in:
Paulchen Panther
2016-10-30 22:59:45 +01:00
committed by brindosch
parent 864538f188
commit 08dfec20c5
10 changed files with 59 additions and 22 deletions

View File

@@ -48,6 +48,30 @@ $(hyperion).one("cmd-config-getschema", function(event) {
});
$('#btn_test').off().on('click',function() {
effectName = $('#name-input').val();
if (effectName == "")
{
showInfoDialog('error','INVALID NAME FIELD','Effect name is empty! Please fill in a name and try again.')
}
else
{
var errors = effects_editor.validate();
if(errors.length)
{
showInfoDialog('error','INVALID VALUES','Please check for red marked inputs and try again.')
}
else
{
var args = effects_editor.getEditor('root.args');
requestTestEffect(effectName, ":/effects/" + effectPy.slice(1), JSON.stringify(args.getValue()));
showInfoDialog('success','SUCCESS!','Your effect has been started!')
}
}
});
$(document).ready( function() {
requestServerConfigSchema();
});

View File

@@ -208,4 +208,8 @@ function requestWriteEffect(effectName,effectPy,effectArgs)
{
var cutArgs = effectArgs.slice(1, -1);
websocket.send('{"command":"create-effect","name":"'+effectName+'", "script":"'+effectPy+'", '+cutArgs+'}');
}
}
function requestTestEffect(effectName,effectPy,effectArgs) {
websocket.send('{"command":"effect", "tan":'+wsTan+',"effect":{"name":"'+effectName+'", "args":'+effectArgs+'},"priority":1, "pythonScript":"'+effectPy+'"}');
}