Commit abdf6593 authored by Gauthier Quesnel's avatar Gauthier Quesnel
Browse files

wip

parent 3ae9f505
Pipeline #39436 failed with stage
in 1 minute and 17 seconds
......@@ -174,8 +174,8 @@ compute_connection_distance(const model& mdl, editor& ed, const float k)
{
dispatch(mdl, [&mdl, &ed, k]<typename Dynamics>(Dynamics& dyn) -> void {
if constexpr (is_detected_v<has_output_port_t, Dynamics>) {
for (auto& elem : dyn.y) {
auto list = ed.sim.allocs.get_node(elem);
for (const auto elem : dyn.y) {
auto list = get_node(ed.sim, elem);
for (auto& dst : list)
compute_connection_distance(
......@@ -362,8 +362,8 @@ copy_port(simulation& sim,
return status::success;
}
auto src_list = sim.allocs.get_node(src);
auto dst_list = sim.allocs.get_node(dst);
auto src_list = get_node(sim, src);
auto dst_list = append_node(sim, dst);
auto it = src_list.begin();
auto et = src_list.end();
......@@ -632,7 +632,7 @@ show_connection(editor& ed, model& mdl, int connection_id)
[&ed, &mdl, &connection_id]<typename Dynamics>(Dynamics& dyn) -> void {
if constexpr (is_detected_v<has_output_port_t, Dynamics>) {
for (int i = 0, e = length(dyn.y); i != e; ++i) {
auto list = ed.sim.allocs.get_node(dyn.y[i]);
auto list = append_node(ed.sim, dyn.y[i]);
auto it = list.begin();
auto et = list.end();
......@@ -975,7 +975,7 @@ show_dynamics_values(simulation& sim, const queue& dyn)
if (dyn.fifo == u64(-1)) {
ImGui::TextFormat("empty");
} else {
auto list = sim.allocs.get_dated_message(dyn.fifo);
auto list = get_dated_message(sim, dyn.fifo);
ImGui::TextFormat("next ta {}", list.front().data[0]);
ImGui::TextFormat("next value {}", list.front().data[1]);
}
......@@ -987,7 +987,7 @@ show_dynamics_values(simulation& sim, const dynamic_queue& dyn)
if (dyn.fifo == u64(-1)) {
ImGui::TextFormat("empty");
} else {
auto list = sim.allocs.get_dated_message(dyn.fifo);
auto list = get_dated_message(sim, dyn.fifo);
ImGui::TextFormat("next ta {}", list.front().data[0]);
ImGui::TextFormat("next value {}", list.front().data[1]);
}
......@@ -999,7 +999,7 @@ show_dynamics_values(simulation& sim, const priority_queue& dyn)
if (dyn.fifo == u64(-1)) {
ImGui::TextFormat("empty");
} else {
auto list = sim.allocs.get_dated_message(dyn.fifo);
auto list = get_dated_message(sim, dyn.fifo);
ImGui::TextFormat("next ta {}", list.front().data[0]);
ImGui::TextFormat("next value {}", list.front().data[1]);
}
......@@ -1676,7 +1676,7 @@ make_input_tooltip(simulation& sim, Dynamics& dyn, std::string& out)
fmt::format_to(std::back_inserter(out), "x[{}]: ", i);
auto list = sim.allocs.get_message(dyn.x[i]);
auto list = get_message(sim, dyn.x[i]);
for (const auto& msg : list) {
switch (msg.size()) {
case 0:
......@@ -2055,10 +2055,9 @@ editor::show_editor() noexcept
int j = 0;
while (j < e && link_id_to_delete != -1) {
auto list =
this->sim.allocs.get_node(dyn.y[j]);
auto it = list.begin();
auto et = list.end();
auto list = append_node(sim, dyn.y[j]);
auto it = list.begin();
auto et = list.end();
while (it != et && link_id_to_delete != -1) {
if (current_link_id ==
......
This diff is collapsed.
......@@ -1601,8 +1601,8 @@ struct writer
*mdl, [this, &sim, &mdl]<typename Dynamics>(Dynamics& dyn) {
if constexpr (is_detected_v<has_output_port_t, Dynamics>) {
int i = 0;
for (auto& elem : dyn.y) {
auto list = sim.allocs.get_node(elem);
for (const auto elem : dyn.y) {
auto list = get_node(sim, elem);
for (const auto& cnt : list) {
auto* dst = sim.models.try_to_get(cnt.model);
if (dst) {
......@@ -2131,8 +2131,8 @@ public:
*mdl, [this, &sim, &mdl]<typename Dynamics>(Dynamics& dyn) {
if constexpr (is_detected_v<has_output_port_t, Dynamics>) {
int i = 0;
for (auto& elem : dyn.y) {
auto list = sim.allocs.get_node(elem);
for (const auto elem : dyn.y) {
auto list = get_node(sim, elem);
for (const auto& cnt : list) {
auto* dst = sim.models.try_to_get(cnt.model);
if (dst) {
......
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