Rename "Stats" window to "Info" and remove "Stats" dock.
PiperOrigin-RevId: 936026479 Change-Id: I72e4f2cba6df255d5446faedc81727b39ef735bc
This commit is contained in:
committed by
Copybara-Service
parent
4b1320a5f9
commit
e2528cbd93
@@ -359,7 +359,7 @@ ImVec4 ConfigureDockingLayout() {
|
||||
|
||||
const float kOptionsRelWidth = 0.15f;
|
||||
const float kInspectorRelWidth = 0.22f;
|
||||
const float kStatsRelHeight = 0.3f;
|
||||
const float kPropertiesRelHeight = 0.3f;
|
||||
const float kToolsBarHeight = 36.f * scale * font_scale;
|
||||
const float kStatusBarHeight = 32.f * scale * font_scale;
|
||||
|
||||
@@ -388,12 +388,8 @@ ImVec4 ConfigureDockingLayout() {
|
||||
ImGui::DockBuilderSplitNode(main, ImGuiDir_Right, kInspectorRelWidth,
|
||||
&inspector, &main);
|
||||
|
||||
ImGuiID stats = 0;
|
||||
ImGui::DockBuilderSplitNode(options, ImGuiDir_Down, kStatsRelHeight, &stats,
|
||||
&options);
|
||||
|
||||
ImGuiID properties = 0;
|
||||
ImGui::DockBuilderSplitNode(inspector, ImGuiDir_Down, kStatsRelHeight,
|
||||
ImGui::DockBuilderSplitNode(inspector, ImGuiDir_Down, kPropertiesRelHeight,
|
||||
&properties, &inspector);
|
||||
|
||||
ImGuiID profiler = 0;
|
||||
@@ -405,7 +401,6 @@ ImVec4 ConfigureDockingLayout() {
|
||||
ImGui::DockBuilderDockWindow("Editor", inspector);
|
||||
ImGui::DockBuilderDockWindow("Inspector", inspector);
|
||||
ImGui::DockBuilderDockWindow("Properties", properties);
|
||||
ImGui::DockBuilderDockWindow("Stats", stats);
|
||||
ImGui::DockBuilderDockWindow("Profiler", profiler);
|
||||
ImGui::DockBuilderFinish(root);
|
||||
}
|
||||
@@ -1472,8 +1467,8 @@ void CountsGui(const mjModel* model, mjData* data, ImVec2 plot_size) {
|
||||
}
|
||||
}
|
||||
|
||||
void StatsGui(const mjModel* model, const mjData* data, bool paused,
|
||||
float fps) {
|
||||
void InfoGui(const mjModel* model, const mjData* data, bool paused,
|
||||
float fps) {
|
||||
const int num_islands = std::clamp(data->nisland, 1, mjNISLAND);
|
||||
|
||||
// compute solver error (maximum over islands)
|
||||
|
||||
@@ -61,8 +61,6 @@ void RescaleDock(float ratio);
|
||||
// or manipulating mjData elements (e.g. ControlsGui).
|
||||
// "Explorer": secondary tab connected to the Inspector; designed for
|
||||
// displaying the tree of mjSpec elements.
|
||||
// "Stats": resizable section below the options; designed for displaying
|
||||
// basic simulation statistics (e.g. StatsGui); hidden by default.
|
||||
// "Properties": resizable section below the explorer; designed for displaying
|
||||
// properties of mjSpec elements (e.g. BodyPropertiesGui); hidden by
|
||||
// default.
|
||||
@@ -161,7 +159,7 @@ void ProfilerGui(const mjModel* model, mjData* data, SimProfiler* profiler);
|
||||
|
||||
// UX for displaying basic simulation information. Note that the pause state and
|
||||
// FPS needs to be tracked by the caller and passed here to be displayed.
|
||||
void StatsGui(const mjModel* model, const mjData* data, bool paused, float fps);
|
||||
void InfoGui(const mjModel* model, const mjData* data, bool paused, float fps);
|
||||
|
||||
} // namespace mujoco::platform
|
||||
|
||||
|
||||
@@ -649,7 +649,7 @@ void App::HandleKeyboardEvents() {
|
||||
} else if (ImGui_IsChordJustPressed(ImGuiKey_F1)) {
|
||||
ToggleWindow(tmp_.help);
|
||||
} else if (ImGui_IsChordJustPressed(ImGuiKey_F2)) {
|
||||
ToggleWindow(tmp_.stats);
|
||||
ToggleWindow(tmp_.info);
|
||||
} else if (ImGui_IsChordJustPressed(ImGuiKey_F3)) {
|
||||
ToggleWindow(tmp_.profiler);
|
||||
} else if (ImGui_IsChordJustPressed(ImGuiKey_F6)) {
|
||||
@@ -934,7 +934,7 @@ void App::BuildGui() {
|
||||
ImGui::End();
|
||||
}
|
||||
|
||||
if (tmp_.stats) {
|
||||
if (tmp_.info) {
|
||||
platform::ScopedStyle style;
|
||||
style.Var(ImGuiStyleVar_Alpha, 0.8f);
|
||||
const float scale = ImGui::GetWindowDpiScale();
|
||||
@@ -952,7 +952,7 @@ void App::BuildGui() {
|
||||
ImGuiWindowFlags_NoSavedSettings;
|
||||
if (ImGui::Begin("Info", nullptr, flags)) {
|
||||
const float fps = renderer_->GetFps();
|
||||
platform::StatsGui(
|
||||
platform::InfoGui(
|
||||
model(), data(),
|
||||
step_control_.GetPauseState() == PauseState::kNormalPaused, fps);
|
||||
}
|
||||
@@ -1674,8 +1674,8 @@ void App::MainMenuGui() {
|
||||
}
|
||||
ImGui::Separator();
|
||||
|
||||
if (ImGui::MenuItem("Info", "F2", tmp_.stats)) {
|
||||
ToggleWindow(tmp_.stats);
|
||||
if (ImGui::MenuItem("Info", "F2", tmp_.info)) {
|
||||
ToggleWindow(tmp_.info);
|
||||
}
|
||||
if (ImGui::MenuItem("Profiler", "F3", tmp_.profiler)) {
|
||||
ToggleWindow(tmp_.profiler);
|
||||
|
||||
@@ -129,7 +129,7 @@ class App {
|
||||
|
||||
// Windows.
|
||||
bool help = false;
|
||||
bool stats = false;
|
||||
bool info = false;
|
||||
bool profiler = false;
|
||||
bool picture_in_picture = false;
|
||||
bool options_panel = true;
|
||||
|
||||
Reference in New Issue
Block a user