43 #include <ilqgames/gui/control_sliders.h> 44 #include <ilqgames/utils/solver_log.h> 45 #include <ilqgames/utils/types.h> 47 #include <imgui/imgui.h> 53 void ControlSliders::Render() {
54 ImGui::Begin(
"Control Sliders");
57 if (!logs_for_each_problem_.empty())
58 ImGui::SliderInt(
"Log Index", &log_index_, 0, max_log_index_);
61 int max_solver_iterates = 0;
62 Time max_final_time = -std::numeric_limits<Time>::infinity();
63 Time min_initial_time = std::numeric_limits<Time>::infinity();
64 for (
size_t ii = 0; ii < logs_for_each_problem_.size(); ii++) {
65 const auto& logs = logs_for_each_problem_[ii];
68 std::max(max_solver_iterates,
69 static_cast<int>(logs[LogIndex(ii)]->NumIterates()) - 1);
70 max_final_time = std::max(max_final_time, logs[LogIndex(ii)]->FinalTime());
72 std::min(min_initial_time, logs[LogIndex(ii)]->InitialTime());
76 ImGui::SliderInt(
"Iterate", &solver_iterate_, 0, max_solver_iterates);
79 ImGui::SliderFloat(
"Interpolation Time (s)", &interpolation_time_,
80 min_initial_time, max_final_time);