|
@@ -384,7 +384,7 @@ namespace mdd{
|
|
|
json jout = jcon["output"];
|
|
|
IModule::Ptr module_out_ptr = getModule(jout);
|
|
|
IOutput::Ptr out_ptr = nullptr;
|
|
|
- std::string id = jout["name"].get<std::string>() + std::to_string(jout["appendix"].get<int>());
|
|
|
+ std::string id = jout["key"].get<std::string>() + std::to_string(jout["appendix"].get<int>());
|
|
|
for (size_t i = 0; i < module_out_ptr->getNumOutputs(); i++)
|
|
|
{
|
|
|
auto out = module_out_ptr->getOutput(i);
|
|
@@ -398,7 +398,7 @@ namespace mdd{
|
|
|
{
|
|
|
IModule::Ptr module_in_ptr = getModule(jin);
|
|
|
IInput::Ptr in_ptr = nullptr;
|
|
|
- std::string id = jin["name"].get<std::string>() + std::to_string(jin["appendix"].get<int>());
|
|
|
+ std::string id = jin["key"].get<std::string>() + std::to_string(jin["appendix"].get<int>());
|
|
|
for (size_t i = 0; i < module_in_ptr->getNumInputs(); i++)
|
|
|
{
|
|
|
auto in = module_in_ptr->getInput(i);
|
|
@@ -529,19 +529,16 @@ namespace mdd{
|
|
|
{
|
|
|
if (auto module_ptr = mod)
|
|
|
{
|
|
|
- for (size_t j = 0; j < module_ptr->getNumOutputs(); j++)
|
|
|
+ auto input_connections = module_ptr->getOutput(0)->getConnections();
|
|
|
+ if (!input_connections.empty())
|
|
|
{
|
|
|
- auto input_connections = module_ptr->getOutput(j)->getConnections();
|
|
|
- if (!input_connections.empty())
|
|
|
+ json connect;
|
|
|
+ connect["output"] = module_ptr->getOutput(0)->getIdentifier();
|
|
|
+ for (size_t k = 0; k < input_connections.size(); k++)
|
|
|
{
|
|
|
- json connect;
|
|
|
- connect["output"] = module_ptr->getOutput(j)->getIdentifier();
|
|
|
- for (size_t k = 0; k < input_connections.size(); k++)
|
|
|
- {
|
|
|
- connect["inputs"].push_back(input_connections[k]->getIdentifier());
|
|
|
- }
|
|
|
- ret["connections"].push_back(connect);
|
|
|
+ connect["inputs"].push_back(input_connections[k]->getIdentifier());
|
|
|
}
|
|
|
+ ret["connections"].push_back(connect);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -736,6 +733,24 @@ namespace mdd{
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
+ if (module_ptr == nullptr)
|
|
|
+ {
|
|
|
+ for (auto& module : inputs) {
|
|
|
+ if (module->getID() == sid) {
|
|
|
+ module_ptr = module;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (module_ptr == nullptr)
|
|
|
+ {
|
|
|
+ for (auto& module : outputs) {
|
|
|
+ if (module->getID() == sid) {
|
|
|
+ module_ptr = module;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
if (module_ptr != nullptr)
|
|
|
{
|