Skip to content

Commit acf19fa

Browse files
committed
Updated WaveformArea for 3-level eye pattern mouseover BER
1 parent df97acb commit acf19fa

3 files changed

Lines changed: 24 additions & 5 deletions

File tree

release-notes/CHANGELOG.md

Lines changed: 1 addition & 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
* Filters: Eye pattern is now GPU accelerated for the common case (DDR clock on uniformly sampled input) and runs about 25x faster than before (no github ticket)
88
* Filters: CDR PLL is now GPU accelerated for the common case (no gating, deep waveform) and runs about 7.5x faster than before (https://github.com/ngscopeclient/scopehal/issues/977)
9+
* GUI: enabled mouseover BER measurements on MLT-3 / PAM-3 eyes as well as NRZ. PAM-4 and higher order don't work yet.
910

1011
## Bugs fixed since v0.1.1
1112

src/ngscopeclient/WaveformArea.cpp

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* *
33
* ngscopeclient *
44
* *
5-
* Copyright (c) 2012-2025 Andrew D. Zonenberg and contributors *
5+
* Copyright (c) 2012-2026 Andrew D. Zonenberg and contributors *
66
* All rights reserved. *
77
* *
88
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the *
@@ -2903,9 +2903,27 @@ void WaveformArea::RenderEyePatternTooltip(ImVec2 start, ImVec2 size)
29032903
if(ImGui::IsItemHovered(ImGuiHoveredFlags_DelayNone) && (m_dragState == DRAG_STATE_NONE) && !m_mouseOverButton )
29042904
{
29052905
//Calculate the BER at this point
2906-
//TODO: this currently assumes the midpoint of the waveform is the zero point,
2907-
//which is only true for NRZ waveforms (not PAM / MLT3)
2908-
auto ber = eyedata->GetBERAtPoint(delta.x, delta.y, eyedata->GetWidth() / 2, eyedata->GetHeight() / 2);
2906+
//Figure out which level we're targeting
2907+
int ymid = 0;
2908+
switch(eyedata->m_numLevels)
2909+
{
2910+
//NRZ: always use the midpoint
2911+
case 2:
2912+
ymid = eyedata->m_midpoints[0];
2913+
break;
2914+
2915+
//PAM3 / MLT3: decide upper or lower
2916+
case 3:
2917+
if(delta.y > (eyedata->GetHeight() / 2))
2918+
ymid = eyedata->m_midpoints[1];
2919+
else
2920+
ymid = eyedata->m_midpoints[0];
2921+
break;
2922+
2923+
default:
2924+
break;
2925+
}
2926+
auto ber = eyedata->GetBERAtPoint(delta.x, delta.y, eyedata->GetWidth() / 2, ymid);
29092927

29102928
ImGui::BeginTooltip();
29112929
ImGui::PushTextWrapPos(ImGui::GetFontSize() * 50);

0 commit comments

Comments
 (0)