|
@@ -6,7 +6,7 @@ namespace mdd{
|
|
json jparse = json::parse(base_config);
|
|
json jparse = json::parse(base_config);
|
|
if (jparse.contains("configure"))
|
|
if (jparse.contains("configure"))
|
|
{
|
|
{
|
|
- _base_config = base_config;
|
|
|
|
|
|
+ _base_config = jparse;
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
_base_config["configure"] = jparse;
|
|
_base_config["configure"] = jparse;
|
|
@@ -68,7 +68,6 @@ namespace mdd{
|
|
if (auto module_ptr = modules.back())
|
|
if (auto module_ptr = modules.back())
|
|
{
|
|
{
|
|
module_ptr->setParent(shared_from_this());
|
|
module_ptr->setParent(shared_from_this());
|
|
- module_ptr->setName(jmodule["type"].get<std::string>());
|
|
|
|
module_ptr->setAppendix(jmodule["appendix"].get<int>());
|
|
module_ptr->setAppendix(jmodule["appendix"].get<int>());
|
|
module_ptr->load(jmodule["load"]);
|
|
module_ptr->load(jmodule["load"]);
|
|
}
|
|
}
|
|
@@ -99,11 +98,6 @@ 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;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -129,15 +123,6 @@ namespace mdd{
|
|
return key;
|
|
return key;
|
|
}
|
|
}
|
|
|
|
|
|
- std::string ProcessorBase::setName(const std::string& name) {
|
|
|
|
- _name = name;
|
|
|
|
- return getID();
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- std::string ProcessorBase::getName() {
|
|
|
|
- return _name;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
std::string ProcessorBase::setAppendix(int appendix) {
|
|
std::string ProcessorBase::setAppendix(int appendix) {
|
|
_appendix = appendix;
|
|
_appendix = appendix;
|
|
return getID();
|
|
return getID();
|
|
@@ -282,7 +267,6 @@ namespace mdd{
|
|
if (j.contains("ID"))
|
|
if (j.contains("ID"))
|
|
{
|
|
{
|
|
setAppendix(j["ID"]["appendix"].get<int>());
|
|
setAppendix(j["ID"]["appendix"].get<int>());
|
|
- setName(j["ID"]["name"].get<std::string>());
|
|
|
|
j["ID"]["type"];
|
|
j["ID"]["type"];
|
|
|
|
|
|
}
|
|
}
|
|
@@ -609,6 +593,13 @@ namespace mdd{
|
|
json jid_copy = jid;
|
|
json jid_copy = jid;
|
|
auto jid_typ = jid.find("type");
|
|
auto jid_typ = jid.find("type");
|
|
auto jid_copy_pref = jid_copy.find("prefix");
|
|
auto jid_copy_pref = jid_copy.find("prefix");
|
|
|
|
+ //check if called non recursive
|
|
|
|
+ json own_prefix = getIdentifier()["prefix"];
|
|
|
|
+ if (jid_copy_pref->dump() == own_prefix.dump())
|
|
|
|
+ {
|
|
|
|
+ jid_copy_pref->clear();
|
|
|
|
+ }
|
|
|
|
+ //recursive call
|
|
if (!jid_copy_pref->empty())
|
|
if (!jid_copy_pref->empty())
|
|
{
|
|
{
|
|
jid_copy_pref->erase(jid_copy_pref->begin());
|
|
jid_copy_pref->erase(jid_copy_pref->begin());
|
|
@@ -617,14 +608,20 @@ namespace mdd{
|
|
if (jid_typ != jid.end())
|
|
if (jid_typ != jid.end())
|
|
{
|
|
{
|
|
std::string sid;
|
|
std::string sid;
|
|
- if (*jid_typ == "input" || *jid_typ == "output")
|
|
|
|
|
|
+ if (jid_copy_pref->empty())
|
|
{
|
|
{
|
|
- final_size = 1;
|
|
|
|
- sid = jid_copy_pref->at(0).get<std::string>();
|
|
|
|
|
|
+ if (*jid_typ == "input" || *jid_typ == "output")
|
|
|
|
+ {
|
|
|
|
+ final_size = 1;
|
|
|
|
+ sid = jid_copy_pref->at(0).get<std::string>();
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ sid = jid_copy["key"].get<std::string>() + std::to_string(jid_copy["appendix"].get<int>());
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- else
|
|
|
|
- {
|
|
|
|
- sid = jid_copy["key"].get<std::string>() + std::to_string(jid_copy["appendix"].get<int>());
|
|
|
|
|
|
+ else {
|
|
|
|
+ sid = jid_copy_pref->begin()->get<std::string>();
|
|
}
|
|
}
|
|
|
|
|
|
IModule::Ptr module_ptr;
|
|
IModule::Ptr module_ptr;
|