Commit 946810e3 authored by Robert Schmidt's avatar Robert Schmidt

Merge remote-tracking branch 'origin/refactor-imscope' into integration_2025_w46 (!3748)

Refactor imscope

This MR refactors imscope by introducing changes to the default layout
in the config file imgui.ini. The global settings are moved to a new
menu item. This modified layout is intended as a suggestion subject to
change based on feedback. This MR also adds PDCCH LLR and IQ plots to
the UE scope and set axes to AutoFit by default.

The MR has a screenshot of the new layout.
parents d3026267 1d235ce6
[Window][WindowOverViewport_11111111]
Pos=0,19
Size=1920,927
Collapsed=0
[Window][Debug##Default] [Window][Debug##Default]
Pos=60,60 Pos=60,60
Size=400,400 Size=400,400
Collapsed=0 Collapsed=0
[Window][Status bar]
Pos=0,914
Size=1920,32
Collapsed=0
DockId=0x00000004,0
[Window][Global scope settings]
Pos=697,153
Size=545,478
Collapsed=0
[Window][PUSCH SLOT IQ]
Pos=0,257
Size=789,655
Collapsed=0
DockId=0x0000000B,0
[Window][PUSCH LLRs]
Pos=791,257
Size=1129,655
Collapsed=0
DockId=0x0000000C,0
[Window][Time domain samples]
Pos=997,201
Size=923,711
Collapsed=0
DockId=0x0000000E,0
[Window][NR KPI] [Window][NR KPI]
Pos=0,19 Pos=0,19
Size=1133,667 Size=1133,667
Collapsed=0 Collapsed=0
DockId=0x00000005,0 DockId=0x00000007,0
[Window][Dear ImGui Demo] [Window][Dear ImGui Demo]
Pos=531,19 Pos=531,19
...@@ -21,79 +55,223 @@ Size=529,667 ...@@ -21,79 +55,223 @@ Size=529,667
Collapsed=0 Collapsed=0
DockId=0x00000002,0 DockId=0x00000002,0
[Window][WindowOverViewport_11111111] [Window][UE KPI]
Pos=0,19 Pos=0,19
Size=1280,701 Size=1920,180
Collapsed=0 Collapsed=0
DockId=0x00000007,0
[Window][Status bar] [Window][UE PDSCH IQ]
Pos=0,688 Pos=997,201
Size=1280,32 Size=923,711
Collapsed=0 Collapsed=0
DockId=0x00000004,0 DockId=0x0000000E,3
[Window][Global scope settings] [Window][Time domain samples - before sync]
Pos=1038,19 Pos=0,201
Size=242,667 Size=995,711
Collapsed=0 Collapsed=0
DockId=0x00000006,0 DockId=0x0000000D,0
[Window][UE KPI] [Window][Broadcast channel]
Pos=997,201
Size=923,711
Collapsed=0
DockId=0x0000000E,1
[Window][RX IQ]
Pos=532,19 Pos=532,19
Size=528,667 Size=528,667
Collapsed=0 Collapsed=0
DockId=0x00000008,0 DockId=0x00000001,0
[Window][UE PDSCH IQ] [Window][UE PDSCH Chan est]
Pos=0,19 Pos=997,201
Size=530,667 Size=923,711
Collapsed=0 Collapsed=0
DockId=0x00000005,1 DockId=0x0000000E,2
[Window][Time domain samples] [Window][UE PDSCH IQ before compensation]
Pos=0,19 Pos=0,201
Size=1036,667 Size=995,711
Collapsed=0 Collapsed=0
DockId=0x00000005,0 DockId=0x0000000D,1
[Window][Time domain samples - before sync] [Window][gNB Scope]
Pos=0,19 Pos=-4,30
Size=530,667 Size=1728,834
Collapsed=0 Collapsed=0
DockId=0x00000005,2
[Window][Broadcast channel] [Window][UE Scope]
Pos=0,19 Pos=-1,23
Size=530,667 Size=1922,902
Collapsed=0 Collapsed=0
DockId=0x00000005,3
[Window][RX IQ] [Window][Dear ImGui Demo/##Basket_379447C1]
Pos=532,19 IsChild=1
Size=528,667 Size=1202,260
[Window][Dear ImGui Demo/ResizableChild_D5443E47]
IsChild=1
Size=1153,32
[Window][Dear ImGui Demo/Red_1D4E05CE]
IsChild=1
Size=200,100
[Window][Delete?]
Pos=804,420
Size=311,105
Collapsed=0 Collapsed=0
DockId=0x00000008,0
[Window][PUSCH SLOT IQ] [Window][Stacked 1]
Pos=0,19 Pos=755,387
Size=1036,667 Size=409,172
Collapsed=0 Collapsed=0
DockId=0x00000005,1
[Window][PUSCH LLRs] [Window][Example: Simple layout]
Pos=0,19 Pos=354,164
Size=1036,667 Size=981,698
Collapsed=0
[Window][Example: Simple layout/left pane_AED60EF8]
IsChild=1
Size=150,644
[Window][Example: Log]
Pos=60,60
Size=500,400
Collapsed=0 Collapsed=0
DockId=0x00000005,2
[Window][Example: Auto-resizing window]
Pos=179,108
Size=654,437
Collapsed=0
[Window][gNB Scope/##pusch_time_domain_5637DE0C]
IsChild=1
Size=1728,302
[Window][gNB Scope/##pusch_iq_903C5250]
IsChild=1
Size=408,500
[Window][gNB Scope/##pusch_llr_FE553CCC]
IsChild=1
Size=1443,502
[Window][Dear ImGui Demo/##Tree_C1CE970E]
IsChild=1
Size=1132,260
[Window][Dear ImGui Demo/##Basket_97A64F14]
IsChild=1
Size=1132,260
[Window][Dear ImGui Demo/##Basket_745C408A]
IsChild=1
Size=1132,260
[Window][UE Scope/##ue_kpi_A22981AC]
IsChild=1
Size=1839,183
[Window][UE Scope/##ue_iq_plots_F23AA7B4]
IsChild=1
Size=814,517
[Window][UE Scope/##ue_plots0_D75041C0]
IsChild=1
Size=1067,610
[Window][UE Scope/##ue_plots1_A0577156]
IsChild=1
Size=733,604
[Window][UE PDCCH IQ]
Pos=997,201
Size=923,711
Collapsed=0
DockId=0x0000000E,4
[Window][UE PDCCH LLR]
Pos=0,201
Size=995,711
Collapsed=0
DockId=0x0000000D,2
[Table][0xC9935533,3]
Column 0 Weight=1.0000
Column 1 Weight=1.0000
Column 2 Weight=1.0000
[Table][0xE0773582,3]
Column 0 Weight=1.0000
Column 1 Weight=1.0000
Column 2 Weight=1.0000
[Table][0x45A0E60D,7]
RefScale=13
Column 0 Width=49
Column 1 Width=112
Column 2 Width=112
Column 3 Width=112
Column 4 Width=112
Column 5 Width=112
Column 6 Width=112
[Table][0xDA36A7E0,6]
RefScale=13
Column 0 Width=28 Sort=0v
Column 1 Width=42
Column 2 Width=73
Column 3 Width=68
Column 4 Weight=1.0000
Column 5 Width=-1
[Table][0x0919F5A2,14]
RefScale=13
Column 0 Width=56
Column 1 Width=19
Column 2 Width=19
Column 3 Width=19
Column 4 Width=19
Column 5 Width=19
Column 6 Width=19
Column 7 Width=19
Column 8 Width=19
Column 9 Width=19
Column 10 Width=19
Column 11 Width=19
Column 12 Width=19
Column 13 Width=19
[Table][0x8DFA6E86,2]
Column 0 Weight=1.0000
Column 1 Weight=1.0000
[Table][0xFABAAEF7,2]
Column 0 Weight=1.0000
Column 1 Weight=1.0000
[Table][0xC179E37C,3]
RefScale=13
Column 0 Width=108 Sort=0v
Column 1 Width=63
Column 2 Width=-1
[Docking][Data] [Docking][Data]
DockSpace ID=0x7C6B3D9B Window=0xA87D555D Pos=0,19 Size=1280,701 Split=Y Selected=0x71C89FCB DockSpace ID=0x7C6B3D9B Window=0xA87D555D Pos=0,19 Size=1920,927 Split=Y Selected=0x71C89FCB
DockNode ID=0x00000003 Parent=0x7C6B3D9B SizeRef=1280,667 Split=X DockNode ID=0x00000003 Parent=0x7C6B3D9B SizeRef=1280,667 Split=X
DockNode ID=0x00000001 Parent=0x00000003 SizeRef=1319,720 Split=X Selected=0x6627CA6C DockNode ID=0x00000001 Parent=0x00000003 SizeRef=1319,720 Split=Y Selected=0x6627CA6C
DockNode ID=0x00000007 Parent=0x00000001 SizeRef=530,667 Split=X Selected=0x93FDECFF DockNode ID=0x00000009 Parent=0x00000001 SizeRef=1920,236 Split=Y Selected=0x6627CA6C
DockNode ID=0x00000005 Parent=0x00000007 SizeRef=1036,334 CentralNode=1 Selected=0x93FDECFF DockNode ID=0x00000007 Parent=0x00000009 SizeRef=1920,180 CentralNode=1 Selected=0x6627CA6C
DockNode ID=0x00000006 Parent=0x00000007 SizeRef=242,334 Selected=0xFAA8D9D5 DockNode ID=0x00000008 Parent=0x00000009 SizeRef=1920,711 Split=X Selected=0x3A5D5B36
DockNode ID=0x00000008 Parent=0x00000001 SizeRef=528,667 Selected=0x6627CA6C DockNode ID=0x0000000D Parent=0x00000008 SizeRef=995,711 Selected=0xF0B5A18D
DockNode ID=0x0000000E Parent=0x00000008 SizeRef=923,711 Selected=0x752F58D8
DockNode ID=0x0000000A Parent=0x00000001 SizeRef=1920,655 Split=X Selected=0x93FDECFF
DockNode ID=0x0000000B Parent=0x0000000A SizeRef=789,444 Selected=0x93FDECFF
DockNode ID=0x0000000C Parent=0x0000000A SizeRef=1129,444 Selected=0x43E927D5
DockNode ID=0x00000002 Parent=0x00000003 SizeRef=529,720 Selected=0xB903C8C9 DockNode ID=0x00000002 Parent=0x00000003 SizeRef=529,720 Selected=0xB903C8C9
DockNode ID=0x00000004 Parent=0x7C6B3D9B SizeRef=1280,32 HiddenTabBar=1 Selected=0xD9B9B9C7 DockNode ID=0x00000004 Parent=0x7C6B3D9B SizeRef=1280,32 HiddenTabBar=1 Selected=0xD9B9B9C7
...@@ -100,6 +100,7 @@ class LLRPlot { ...@@ -100,6 +100,7 @@ class LLRPlot {
ImScopeDataWrapper &scope_data = scope_array[type]; ImScopeDataWrapper &scope_data = scope_array[type];
if (ImPlot::BeginPlot(label)) { if (ImPlot::BeginPlot(label)) {
ImPlot::SetupAxes(nullptr, nullptr, ImPlotAxisFlags_AutoFit, ImPlotAxisFlags_AutoFit);
if (!frozen || next) { if (!frozen || next) {
if (scope_data.is_data_ready) { if (scope_data.is_data_ready) {
iq_procedure_timer.Add(scope_data.data.time_taken_in_ns); iq_procedure_timer.Add(scope_data.data.time_taken_in_ns);
...@@ -205,6 +206,7 @@ class IQHist { ...@@ -205,6 +206,7 @@ class IQHist {
if (plot_type == 0) { if (plot_type == 0) {
float x = ImGui::CalcItemWidth(); float x = ImGui::CalcItemWidth();
if (ImPlot::BeginPlot(label.c_str(), {x, x})) { if (ImPlot::BeginPlot(label.c_str(), {x, x})) {
ImPlot::SetupAxes(nullptr, nullptr, ImPlotAxisFlags_AutoFit, ImPlotAxisFlags_AutoFit);
ImPlot::PlotHistogram2D(label.c_str(), ImPlot::PlotHistogram2D(label.c_str(),
iq_data->real.data(), iq_data->real.data(),
iq_data->imag.data(), iq_data->imag.data(),
...@@ -217,6 +219,7 @@ class IQHist { ...@@ -217,6 +219,7 @@ class IQHist {
} else if (plot_type == 2) { } else if (plot_type == 2) {
float x = ImGui::CalcItemWidth(); float x = ImGui::CalcItemWidth();
if (ImPlot::BeginPlot(label.c_str(), {x, x})) { if (ImPlot::BeginPlot(label.c_str(), {x, x})) {
ImPlot::SetupAxes(nullptr, nullptr, ImPlotAxisFlags_AutoFit, ImPlotAxisFlags_AutoFit);
int points_drawn = 0; int points_drawn = 0;
while (points_drawn < iq_data->len) { while (points_drawn < iq_data->len) {
// Limit the amount of data plotted with PlotScatter call (issue with vertices/draw call) // Limit the amount of data plotted with PlotScatter call (issue with vertices/draw call)
...@@ -232,6 +235,7 @@ class IQHist { ...@@ -232,6 +235,7 @@ class IQHist {
} }
} else if (plot_type == 1) { } else if (plot_type == 1) {
if (ImPlot::BeginPlot(label.c_str())) { if (ImPlot::BeginPlot(label.c_str())) {
ImPlot::SetupAxes(nullptr, nullptr, ImPlotAxisFlags_AutoFit, ImPlotAxisFlags_AutoFit);
ImPlot::PlotLine(label.c_str(), iq_data->power.data(), iq_data->len); ImPlot::PlotLine(label.c_str(), iq_data->power.data(), iq_data->len);
ImPlot::EndPlot(); ImPlot::EndPlot();
} }
...@@ -364,6 +368,7 @@ class IQSlotHeatmap { ...@@ -364,6 +368,7 @@ class IQSlotHeatmap {
static std::vector<int> symbol_boundaries = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}; static std::vector<int> symbol_boundaries = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13};
if (ImPlot::BeginPlot(label.c_str(), {(float)ImGui::GetWindowWidth() * 0.9f, 0})) { if (ImPlot::BeginPlot(label.c_str(), {(float)ImGui::GetWindowWidth() * 0.9f, 0})) {
auto num_sc = num_rb * NR_NB_SC_PER_RB; auto num_sc = num_rb * NR_NB_SC_PER_RB;
ImPlot::SetupAxes(nullptr, nullptr, ImPlotAxisFlags_AutoFit, ImPlotAxisFlags_AutoFit);
ImPlot::SetupAxes("symbols", "subcarriers"); ImPlot::SetupAxes("symbols", "subcarriers");
ImPlot::SetupAxisLimits(ImAxis_X1, num_symbols, 0); ImPlot::SetupAxisLimits(ImAxis_X1, num_symbols, 0);
ImPlot::SetupAxisLimits(ImAxis_Y1, num_sc, 0); ImPlot::SetupAxisLimits(ImAxis_Y1, num_sc, 0);
...@@ -429,6 +434,7 @@ void ShowUeScope(void *data_void_ptr, float t) ...@@ -429,6 +434,7 @@ void ShowUeScope(void *data_void_ptr, float t)
rbs_buffer.AddPoint(t, getKPIUE()->nofRBs); rbs_buffer.AddPoint(t, getKPIUE()->nofRBs);
bler.AddPoint(t, (float)getKPIUE()->nb_nack / (float)getKPIUE()->nb_total); bler.AddPoint(t, (float)getKPIUE()->nb_nack / (float)getKPIUE()->nb_total);
mcs.AddPoint(t, (float)getKPIUE()->dl_mcs); mcs.AddPoint(t, (float)getKPIUE()->dl_mcs);
ImPlot::SetupAxes(nullptr, nullptr, ImPlotAxisFlags_AutoFit, ImPlotAxisFlags_AutoFit);
ImPlot::SetupAxes("time", "noOfRbs"); ImPlot::SetupAxes("time", "noOfRbs");
ImPlot::SetupAxisLimits(ImAxis_X1, t - history, t, ImGuiCond_Always); ImPlot::SetupAxisLimits(ImAxis_X1, t - history, t, ImGuiCond_Always);
ImPlot::SetupAxisLimits(ImAxis_Y1, 0, NR_MAX_RB); ImPlot::SetupAxisLimits(ImAxis_Y1, 0, NR_MAX_RB);
...@@ -444,6 +450,23 @@ void ShowUeScope(void *data_void_ptr, float t) ...@@ -444,6 +450,23 @@ void ShowUeScope(void *data_void_ptr, float t)
} }
ImGui::End(); ImGui::End();
if (ImGui::Begin("UE PDCCH IQ")) {
static auto iq_data = new IQData();
static auto pdcch_iq_hist = new IQHist("PDCCH IQ");
bool new_data = false;
if (pdcch_iq_hist->ShouldReadData()) {
new_data = iq_data->TryCollect(&scope_array[pdcchRxdataF_comp], t, pdcch_iq_hist->GetEpsilon(), iq_procedure_timer);
}
pdcch_iq_hist->Draw(iq_data, t, new_data);
}
ImGui::End();
if (ImGui::Begin("UE PDCCH LLR")) {
static auto llr_plot = new LLRPlot();
llr_plot->Draw(t, pdcchLlr, "PDCCH LLR");
}
ImGui::End();
if (ImGui::Begin("UE PDSCH IQ")) { if (ImGui::Begin("UE PDSCH IQ")) {
static auto iq_data = new IQData(); static auto iq_data = new IQData();
static auto pdsch_iq_hist = new IQHist("PDSCH IQ"); static auto pdsch_iq_hist = new IQHist("PDSCH IQ");
...@@ -710,6 +733,7 @@ void *imscope_thread(void *data_void_ptr) ...@@ -710,6 +733,7 @@ void *imscope_thread(void *data_void_ptr)
static float t = 0; static float t = 0;
static bool show_imgui_demo_window = false; static bool show_imgui_demo_window = false;
static bool show_implot_demo_window = false; static bool show_implot_demo_window = false;
static bool show_scope_settings_window = false;
ImGui::DockSpaceOverViewport(); ImGui::DockSpaceOverViewport();
if (ImGui::BeginMainMenuBar()) { if (ImGui::BeginMainMenuBar()) {
if (ImGui::BeginMenu("File")) { if (ImGui::BeginMenu("File")) {
...@@ -729,6 +753,12 @@ void *imscope_thread(void *data_void_ptr) ...@@ -729,6 +753,12 @@ void *imscope_thread(void *data_void_ptr)
} }
ImGui::EndMenu(); ImGui::EndMenu();
} }
if (ImGui::BeginMenu("Settings")) {
if (ImGui::MenuItem("Global scope settings")) {
show_scope_settings_window = !show_scope_settings_window;
}
ImGui::EndMenu();
}
ImGui::EndMainMenuBar(); ImGui::EndMainMenuBar();
} }
...@@ -739,16 +769,6 @@ void *imscope_thread(void *data_void_ptr) ...@@ -739,16 +769,6 @@ void *imscope_thread(void *data_void_ptr)
} }
ImGui::End(); ImGui::End();
ImGui::Begin("Global scope settings");
ImGui::ShowStyleSelector("ImGui Style");
ImPlot::ShowStyleSelector("ImPlot Style");
ImPlot::ShowColormapSelector("ImPlot Colormap");
ImGui::SliderInt("FPS target", &target_fps, 12, 60);
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Reduces scope flickering in unfrozen mode. Can reduce impact on perfromance of the modem");
}
ImGui::End();
t += ImGui::GetIO().DeltaTime; t += ImGui::GetIO().DeltaTime;
iq_procedure_timer.UpdateAverage(t); iq_procedure_timer.UpdateAverage(t);
...@@ -765,7 +785,19 @@ void *imscope_thread(void *data_void_ptr) ...@@ -765,7 +785,19 @@ void *imscope_thread(void *data_void_ptr)
ImPlot::ShowDemoWindow(); ImPlot::ShowDemoWindow();
if (show_imgui_demo_window) if (show_imgui_demo_window)
ImGui::ShowDemoWindow(); ImGui::ShowDemoWindow();
// Settings
if (show_scope_settings_window) {
ImGui::SetNextWindowPos(ImGui::GetMainViewport()->GetCenter(), ImGuiCond_FirstUseEver, ImVec2(0.5f, 0.5f));
ImGui::Begin("Global scope settings", &show_scope_settings_window);
ImGui::ShowStyleSelector("ImGui Style");
ImPlot::ShowStyleSelector("ImPlot Style");
ImPlot::ShowColormapSelector("ImPlot Colormap");
ImGui::SliderInt("FPS target", &target_fps, 12, 60);
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Reduces scope flickering in unfrozen mode. Can reduce impact on perfromance of the modem");
}
ImGui::End();
}
// Rendering // Rendering
ImGui::Render(); ImGui::Render();
glViewport(0, 0, display_w, display_h); glViewport(0, 0, display_w, display_h);
......
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