|
@@ -19,7 +19,7 @@ namespace mdd{
|
|
auto jit = jconfig.find("GUI");
|
|
auto jit = jconfig.find("GUI");
|
|
if (jit != jconfig.end())
|
|
if (jit != jconfig.end())
|
|
{
|
|
{
|
|
- _base_config["GUI"] = jit.value();
|
|
|
|
|
|
+ _base_config["GUI"].merge_patch(jit.value());
|
|
}
|
|
}
|
|
jit = jconfig.find("params");
|
|
jit = jconfig.find("params");
|
|
if (jit != jconfig.end())
|
|
if (jit != jconfig.end())
|
|
@@ -98,7 +98,12 @@ namespace mdd{
|
|
}
|
|
}
|
|
|
|
|
|
const json& ProcessorBase::getConfiguration() {
|
|
const json& ProcessorBase::getConfiguration() {
|
|
- //update module apendix ?
|
|
|
|
|
|
+ //update module apendix ?
|
|
|
|
+ auto jit = _base_config.find("GUI");
|
|
|
|
+ if (jit == _base_config.end())
|
|
|
|
+ {
|
|
|
|
+ _base_config["GUI"]["name"] = _name;
|
|
|
|
+ }
|
|
return _base_config;
|
|
return _base_config;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -143,7 +148,7 @@ namespace mdd{
|
|
}
|
|
}
|
|
|
|
|
|
std::string ProcessorBase::getID() {
|
|
std::string ProcessorBase::getID() {
|
|
- return _name + std::to_string(_appendix);
|
|
|
|
|
|
+ return key + std::to_string(_appendix);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -380,7 +385,7 @@ namespace mdd{
|
|
}
|
|
}
|
|
|
|
|
|
json ProcessorBase::dump() {
|
|
json ProcessorBase::dump() {
|
|
- json ret = _base_config;
|
|
|
|
|
|
+ json ret = getConfiguration();
|
|
ret["ID"] = getIdentifier();
|
|
ret["ID"] = getIdentifier();
|
|
ret["type"] = type;
|
|
ret["type"] = type;
|
|
ret["key"] = key;
|
|
ret["key"] = key;
|
|
@@ -469,7 +474,7 @@ namespace mdd{
|
|
|
|
|
|
json ProcessorBase::getIdentifier() {
|
|
json ProcessorBase::getIdentifier() {
|
|
json jID;
|
|
json jID;
|
|
- jID["name"] = _name;
|
|
|
|
|
|
+ jID["key"] = key;
|
|
jID["appendix"] = getAppendix();
|
|
jID["appendix"] = getAppendix();
|
|
jID["type"] = type;
|
|
jID["type"] = type;
|
|
jID["prefix"] = getParentID();
|
|
jID["prefix"] = getParentID();
|
|
@@ -534,15 +539,27 @@ namespace mdd{
|
|
}
|
|
}
|
|
|
|
|
|
std::shared_ptr<IOutput> ProcessorBase::getOutput(const json& jid){
|
|
std::shared_ptr<IOutput> ProcessorBase::getOutput(const json& jid){
|
|
- std::string sid = jid["name"].get<std::string>() + std::to_string(jid["appendix"].get<int>());
|
|
|
|
- for (auto& output : processor_outputs) {
|
|
|
|
- if(output->getID() == sid){
|
|
|
|
- return output;
|
|
|
|
|
|
+ auto jid_pref = jid.find("prefix");
|
|
|
|
+ if (jid_pref != jid.end())
|
|
|
|
+ {
|
|
|
|
+ auto mod = getModule(jid);
|
|
|
|
+ if (mod == shared_from_this())
|
|
|
|
+ {
|
|
|
|
+ std::string sid = jid["key"].get<std::string>() + std::to_string(jid["appendix"].get<int>());
|
|
|
|
+ for (auto& output : processor_outputs) {
|
|
|
|
+ if (output->getID() == sid) {
|
|
|
|
+ return output;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ for (auto& output : outputs) {
|
|
|
|
+ if (output->getOutput(0)->getID() == sid) {
|
|
|
|
+ return output->getOutput(0);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- }
|
|
|
|
- for (auto& output : outputs) {
|
|
|
|
- if(output->getOutput(0)->getID() == sid){
|
|
|
|
- return output->getOutput(0);
|
|
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ return mod->getOutput(jid);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return nullptr;
|
|
return nullptr;
|
|
@@ -568,7 +585,7 @@ namespace mdd{
|
|
auto mod = getModule(jid);
|
|
auto mod = getModule(jid);
|
|
if (mod == shared_from_this())
|
|
if (mod == shared_from_this())
|
|
{
|
|
{
|
|
- std::string sid = jid["name"].get<std::string>() + std::to_string(jid["appendix"].get<int>());
|
|
|
|
|
|
+ std::string sid = jid["key"].get<std::string>() + std::to_string(jid["appendix"].get<int>());
|
|
for (auto& input : processor_inputs) {
|
|
for (auto& input : processor_inputs) {
|
|
if (input->getID() == sid) {
|
|
if (input->getID() == sid) {
|
|
return input;
|
|
return input;
|
|
@@ -607,7 +624,7 @@ namespace mdd{
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- sid = jid_copy["name"].get<std::string>() + std::to_string(jid_copy["appendix"].get<int>());
|
|
|
|
|
|
+ sid = jid_copy["key"].get<std::string>() + std::to_string(jid_copy["appendix"].get<int>());
|
|
}
|
|
}
|
|
|
|
|
|
IModule::Ptr module_ptr;
|
|
IModule::Ptr module_ptr;
|