Commit 6a67a6cd authored by Gauthier Quesnel's avatar Gauthier Quesnel
Browse files

gui: clean sources

parent 4bb296aa
Pipeline #16877 passed with stage
in 1 minute and 30 seconds
......@@ -2706,23 +2706,19 @@ editor::show_editor() noexcept
imnodes::GetSelectedNodes(selected_nodes.begin());
log_w.log(7, "%d model(s) to delete\n", num_selected_nodes);
free_children(selected_nodes);
// imnodes::ClearSelectedNodesAndLinks();
} else if (ImGui::IsKeyReleased('D')) {
imnodes::GetSelectedNodes(selected_nodes.begin());
log_w.log(7, "%d model(s)/group(s) to copy\n", num_selected_nodes);
copy(selected_nodes);
// imnodes::ClearSelectedNodesAndLinks();
} else if (ImGui::IsKeyReleased('G')) {
if (num_selected_nodes > 1) {
imnodes::GetSelectedNodes(selected_nodes.begin());
log_w.log(7, "%d model(s) to group\n", num_selected_nodes);
group(selected_nodes);
// imnodes::ClearSelectedNodesAndLinks();
} else if (num_selected_nodes == 1) {
imnodes::GetSelectedNodes(selected_nodes.begin());
log_w.log(7, "group to ungroup\n");
ungroup(selected_nodes[0]);
// imnodes::ClearSelectedNodesAndLinks();
}
}
selected_nodes.resize(0);
......@@ -2762,7 +2758,7 @@ editor::show_editor() noexcept
}
}
}
// imnodes::ClearSelectedNodesAndLinks();
selected_links.resize(0);
}
}
......
......@@ -383,123 +383,6 @@ show_simulation_box(window_logger& log_w, bool* show_simulation)
if (ImGui::CollapsingHeader("Debug simulation"))
show_simulation_run_debug(log_w, *ed);
// if (match(ed->st,
// simulation_status::success,
// simulation_status::running_step)) {
// if (ImGui::CollapsingHeader("Simulation step by step")) {
// if (ImGui::Button("init")) {
// ed->sim.clean();
// initialize_observation(log_w, ed);
// ed->simulation_current = ed->simulation_begin;
// if (auto ret =
// ed->sim.initialize(ed->simulation_current);
// irt::is_bad(ret)) {
// log_w.log(3,
// "Simulation initialization failure (%s)\n",
// irt::status_string(ret));
// ed->st = simulation_status::success;
// } else {
// ed->st = simulation_status::running_step;
// }
// }
// if (ed->st == simulation_status::running_step) {
// ImGui::SameLine();
// if (ImGui::Button("step")) {
// if (ed->simulation_current < ed->simulation_end) {
// if (auto ret =
// ed->sim.run(ed->simulation_current);
// irt::is_bad(ret)) {
// log_w.log(3,
// "Simulation failure (%s)\n",
// irt::status_string(ret));
// ed->st = simulation_status::success;
// }
// }
// }
// }
// if (ed->st == simulation_status::running_step) {
// ImGui::SameLine();
// if (ImGui::Button("step x10")) {
// for (int i = 0; i < 10; ++i) {
// if (ed->simulation_current < ed->simulation_end)
// {
// if (auto ret =
// ed->sim.run(ed->simulation_current);
// irt::is_bad(ret)) {
// log_w.log(3,
// "Simulation failure (%s)\n",
// irt::status_string(ret));
// ed->st = simulation_status::success;
// }
// }
// }
// }
// }
// if (ed->st == simulation_status::running_step) {
// ImGui::SameLine();
// if (ImGui::Button("step x100")) {
// for (int i = 0; i < 100; ++i) {
// if (ed->simulation_current < ed->simulation_end)
// {
// if (auto ret =
// ed->sim.run(ed->simulation_current);
// irt::is_bad(ret)) {
// log_w.log(3,
// "Simulation failure (%s)\n",
// irt::status_string(ret));
// ed->st = simulation_status::success;
// }
// }
// }
// }
// }
// }
// if (ImGui::CollapsingHeader("Simulation until")) {
// if (ImGui::Button("init")) {
// ed->sim.clean();
// initialize_observation(log_w, ed);
// ed->simulation_current = ed->simulation_begin;
// ed->simulation_until =
// static_cast<float>(ed->simulation_begin); if (auto ret =
// ed->sim.initialize(ed->simulation_current);
// irt::is_bad(ret)) {
// log_w.log(3,
// "Simulation initialization failure (%s)\n",
// irt::status_string(ret));
// ed->st = simulation_status::success;
// } else {
// ed->st = simulation_status::running_step;
// }
// }
// if (ed->st == simulation_status::running_step) {
// ImGui::SliderFloat("date",
// &ed->simulation_until,
// static_cast<float>(ed->simulation_current),
// static_cast<float>(ed->simulation_end));
// if (ImGui::Button("run until")) {
// while (ed->simulation_current <
// static_cast<double>(ed->simulation_until)) {
// if (auto ret = ed->sim.run(ed->simulation_current);
// irt::is_bad(ret)) {
// log_w.log(3,
// "Simulation failure (%s)\n",
// irt::status_string(ret));
// ed->st = simulation_status::success;
// }
// }
// }
// }
if (ed->st != editor_status::editing) {
ImGui::Text("Current: %g", ed->simulation_current);
......
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