Skip to content

Commit 864d0c2

Browse files
committed
ProtocolAnalyzerDialog: display improvements for marker text when no data column is visible. Fixes #926.
1 parent 6d3a71d commit 864d0c2

3 files changed

Lines changed: 23 additions & 22 deletions

File tree

release-notes/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ This is a running list of significant bug fixes and new features since the last
66

77
* ThunderScope: updates for SCPI / binary waveform format API changes in TS.NET
88
* SiniLink: Added driver for ModBus control of XYS3580 and related PSUs (https://github.com/ngscopeclient/scopehal/pull/1003)
9+
* 8B/10B decode now tries more aggressively to recover comma sync after bitslipping when decoding jittery or noisy data, rather than giving decode errors for the remainder of the waveform (https://github.com/ngscopeclient/scopehal/issues/1025)
910

1011
## Bugs fixed since v0.1
1112

@@ -18,8 +19,10 @@ This is a running list of significant bug fixes and new features since the last
1819
* ThunderScope: trigger position would occasionally be corrupted and get stuck at -9223 seconds (no github ticket)
1920
* Typing a new trigger position into the text box in the trigger properties dialog does not actually change the trigger position in hardware (no github ticket)
2021
* Protocol analyzer dialogs still show the old title if a filter is renamed (https://github.com/ngscopeclient/scopehal-apps/issues/923)
22+
* PCIe link training decode got confused if the waveform started with the link in L0 then it dropped (https://github.com/ngscopeclient/scopehal/issues/1024)
2123

2224
## Other changes since v0.1
2325

2426
* Updated to latest upstream imgui (1.92.4 WIP)
2527
* Unit tests now use FFTW instead of FFTS because FFTS had portability issues and a GPL dependency is fine for unit tests we don't redistribute (https://github.com/ngscopeclient/scopehal/issues/757)
28+
* Protocol analyzer now displays marker text in the rightmost column if there is no hexdump column, and stretches the column width to leave room for text (https://github.com/ngscopeclient/scopehal/issues/926) rather than defaulting to the leftmost which might be too small to read clearly

src/ngscopeclient/ProtocolAnalyzerDialog.cpp

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -188,14 +188,26 @@ bool ProtocolAnalyzerDialog::DoRender()
188188
auto& rows = m_mgr->GetRows();
189189

190190
m_firstDataBlockOfFrame = true;
191+
int lastTextColumn = 0;
191192
if(!rows.empty() && ImGui::BeginTable("table", ncols, flags))
192193
{
193194
ImGui::TableSetupScrollFreeze(0, 1); //Header row does not scroll
194195
ImGui::TableSetupColumn("Timestamp", ImGuiTableColumnFlags_WidthFixed, 12*width);
195-
for(auto c : cols)
196-
ImGui::TableSetupColumn(c.c_str(), ImGuiTableColumnFlags_WidthFixed, 0.0f);
196+
for(size_t i=0; i<cols.size(); i++)
197+
{
198+
//Stretch the last text column if we have no data column
199+
if( (i == (cols.size() - 1)) && !m_filter->GetShowDataColumn() )
200+
ImGui::TableSetupColumn(cols[i].c_str(), ImGuiTableColumnFlags_WidthStretch, 0.0f);
201+
else
202+
ImGui::TableSetupColumn(cols[i].c_str(), ImGuiTableColumnFlags_WidthFixed, 0.0f);
203+
204+
lastTextColumn ++;
205+
}
197206
if(m_filter->GetShowDataColumn())
207+
{
198208
ImGui::TableSetupColumn("Data", ImGuiTableColumnFlags_WidthStretch, 0.0f);
209+
lastTextColumn ++;
210+
}
199211
if(m_filter->GetShowImageColumn())
200212
ImGui::TableSetupColumn("Image", ImGuiTableColumnFlags_WidthFixed, 0.0f);
201213
ImGui::TableHeadersRow();
@@ -381,26 +393,12 @@ bool ProtocolAnalyzerDialog::DoRender()
381393
//Marker name
382394
else
383395
{
384-
//TODO: which column to use for marker text??)
385-
if(m_filter->GetShowDataColumn())
396+
//Use the rightmost text column (not the image column, if present) for marker text
397+
if(ImGui::TableSetColumnIndex(lastTextColumn))
386398
{
387-
if(ImGui::TableSetColumnIndex(datacol))
388-
{
389-
if(firstRow)
390-
ImGui::SetCursorPosY(ImGui::GetCursorPosY() - (ImGui::GetScrollY() - rowStart));
391-
ImGui::TextUnformatted(row.m_marker.m_name.c_str());
392-
}
393-
}
394-
395-
//if no data column, use first column whatever it is
396-
else
397-
{
398-
if(ImGui::TableSetColumnIndex(1))
399-
{
400-
if(firstRow)
401-
ImGui::SetCursorPosY(ImGui::GetCursorPosY() - (ImGui::GetScrollY() - rowStart));
402-
ImGui::TextUnformatted(row.m_marker.m_name.c_str());
403-
}
399+
if(firstRow)
400+
ImGui::SetCursorPosY(ImGui::GetCursorPosY() - (ImGui::GetScrollY() - rowStart));
401+
ImGui::TextUnformatted(row.m_marker.m_name.c_str());
404402
}
405403
}
406404

0 commit comments

Comments
 (0)