Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ngscopeclient/scopehal-apps
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 69137e0b12e9
Choose a base ref
...
head repository: ngscopeclient/scopehal-apps
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 83091c5e1370
Choose a head ref
  • 1 commit
  • 3 files changed
  • 1 contributor

Commits on Aug 5, 2020

  1. UI for mask testing

    azonenberg committed Aug 5, 2020
    Copy the full SHA
    83091c5 View commit details
Showing with 30 additions and 9 deletions.
  1. +1 −1 lib
  2. +19 −5 src/glscopeclient/WaveformArea_cairo.cpp
  3. +10 −3 src/glscopeclient/WaveformArea_events.cpp
2 changes: 1 addition & 1 deletion lib
Submodule lib updated from f3be00 to 21ceef
24 changes: 19 additions & 5 deletions src/glscopeclient/WaveformArea_cairo.cpp
Original file line number Diff line number Diff line change
@@ -267,6 +267,8 @@ void WaveformArea::RenderEyeMask(Cairo::RefPtr< Cairo::Context > cr)
if(!eye)
return;
auto waveform = dynamic_cast<EyeWaveform*>(eye->GetData());
if(!waveform)
return;

//If no mask is selected, we have nothing to draw
auto& mask = eye->GetMask();
@@ -473,18 +475,30 @@ void WaveformArea::RenderChannelLabel(Cairo::RefPtr< Cairo::Context > cr)
float gbps = 1e3f / eye->GetUIWidth();

if(uis < 1e6)
snprintf(tmp, sizeof(tmp), "\n%.2fk UI %.4f Gbps", uis * 1e-3f, gbps);
snprintf(tmp, sizeof(tmp), "\n%6.2fk UI\t%.4f Gbps", uis * 1e-3f, gbps);
else if(uis < 1e9)
snprintf(tmp, sizeof(tmp), "\n%.2fM UI %.4f Gbps", uis * 1e-6f, gbps);
snprintf(tmp, sizeof(tmp), "\n%6.2fM UI\t%.4f Gbps", uis * 1e-6f, gbps);
else
snprintf(tmp, sizeof(tmp), "\n%.2fG UI %.4f Gbps", uis * 1e-6f, gbps);
snprintf(tmp, sizeof(tmp), "\n%6.2fG UI\t%.4f Gbps", uis * 1e-6f, gbps);
label += tmp;

auto maskname = ed->GetMask().GetMaskName();
auto mask = ed->GetMask();
auto maskname = mask.GetMaskName();
if(maskname != "")
{
snprintf(tmp, sizeof(tmp), "\nMask: %s", maskname.c_str());
//Mask information
snprintf(tmp, sizeof(tmp), "\nMask: %-10s", maskname.c_str());
label += tmp;

//Hit rate
auto rate = eye->GetMaskHitRate();
snprintf(tmp, sizeof(tmp), "\tHit rate: %.2e", rate);
label += tmp;

if(rate > mask.GetAllowedHitRate())
label += "(FAIL)";
else
label += "(PASS)";
}
}

13 changes: 10 additions & 3 deletions src/glscopeclient/WaveformArea_events.cpp
Original file line number Diff line number Diff line change
@@ -96,7 +96,7 @@ void WaveformArea::on_resize(int width, int height)
if(IsEye())
{
auto eye = dynamic_cast<EyeDecoder2*>(m_channel);
eye->SetWidth(m_width/4);
eye->SetWidth(m_width);
eye->SetHeight(m_height);
eye->Refresh();
}
@@ -780,7 +780,7 @@ void WaveformArea::OnDecodeSetupComplete()
auto eye = dynamic_cast<EyeDecoder2*>(m_pendingDecode);
if(eye != NULL)
{
eye->SetWidth(m_width / 4);
eye->SetWidth(m_width);
eye->SetHeight(m_height);
}
auto fall = dynamic_cast<WaterfallDecoder*>(m_pendingDecode);
@@ -867,7 +867,14 @@ void WaveformArea::OnWaveformDataReady()
eye_width_ps = 5;

m_group->m_pixelsPerXUnit = m_width * 1.0f / eye_width_ps;
m_group->m_xAxisOffset = -width;
m_group->m_xAxisOffset = -round(width);

auto d = dynamic_cast<EyeDecoder2*>(m_channel);
if(d)
{
d->SetXOffset(m_group->m_xAxisOffset);
d->SetXScale(m_group->m_pixelsPerXUnit);
}
}
}