Commit 2f45b03e authored by Gauthier Quesnel's avatar Gauthier Quesnel
Browse files

WIP

parent 88d11dbc
Pipeline #40980 failed with stage
in 1 minute and 17 seconds
......@@ -1087,7 +1087,9 @@ private:
irt_return_if_bad(ret);
map[id] = sim.models.get_id(mdl);
(void)id;
// @todo Prepare for connection
// map[id] = sim.models.get_id(mdl);
}
return status::success;
......@@ -1377,7 +1379,7 @@ private:
external_source_type source_type;
if (external_source_type_cast(type, &source_type)) {
if (!read_source(sim, dyn.default_source_ta, index, source_type))
if (!read_source(dyn.default_source_ta, index, source_type))
return false;
}
......@@ -1395,13 +1397,12 @@ private:
external_source_type source_type;
if (external_source_type_cast(type[0], &source_type)) {
if (!read_source(sim, dyn.default_source_ta, index[0], source_type))
if (!read_source(dyn.default_source_ta, index[0], source_type))
return false;
}
if (external_source_type_cast(type[1], &source_type)) {
if (!read_source(
sim, dyn.default_source_value, index[1], source_type))
if (!read_source(dyn.default_source_value, index[1], source_type))
return false;
}
......
......@@ -32,12 +32,12 @@ struct component_ref;
struct modeling;
struct description;
status add_cpp_component_ref(const char* buffer,
modeling& mod,
component& com) noexcept;
status add_cpp_component_ref(const char* buffer,
modeling& mod,
component& compo) noexcept;
status add_cpp_component_ref(const char* buffer,
modeling& mod,
component_ref_id parent) noexcept;
status add_file_component_ref(const char* buffer,
modeling& mod,
component_ref_id parent) noexcept;
status build_simulation(const modeling& mod, simulation& sim) noexcept;
......
......@@ -930,33 +930,35 @@ static component* find_cpp_component(modeling& mod,
{
component* compo = nullptr;
while (mod.components.next(compo)) {
if (compo.type == type)
if (compo->type == type)
return compo;
}
irt_unreachable();
}
status add_cpp_component_ref(const char* file_path,
modeling& mod,
component& compo) noexcept
status add_file_component_ref(const char* file_path,
modeling& mod,
component_ref_id parent) noexcept
{
auto* file_compo = find_file_component(mod, file_path);
if (!file_compo)
return status::io_file_format_error;
irt_return_if_fail(mod.component_refs.can_alloc(),
status::io_file_format_error);
auto& compo_ref = mod.component_refs.alloc();
compo_ref.id = mod.components.get_id(*file_compo);
auto* file_compo = find_file_component(mod, file_path);
auto& compo_ref = mod.component_refs.alloc();
compo_ref.id = mod.components.get_id(*file_compo);
auto* parent_ref = mod.component_refs.try_to_get(parent);
if (parent_ref) {
compo_ref.tree.parent_to(*parent_ref);
}
return status::success;
}
status add_cpp_component_ref(const char* buffer,
modeling& mod,
component& compo) noexcept
status add_cpp_component_ref(const char* buffer,
modeling& mod,
component_ref_id parent) noexcept
{
struct cpp_component_entry
{
......@@ -1003,7 +1005,7 @@ status add_cpp_component_ref(const char* buffer,
irt_return_if_fail(compo.children.can_alloc(),
status::io_file_format_error);
auto* cpp_compo = find_cpp_component(mod, t->type);
auto* cpp_compo = find_cpp_component(mod, it->type);
auto& compo_ref = mod.component_refs.alloc();
compo_ref.id = mod.components.get_id(*cpp_compo);
// @todo compo_ref.tree.parent_to(*cpp_compo);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment