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: ee991eaa7493
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: 69137e0b12e9
Choose a head ref
  • 1 commit
  • 4 files changed
  • 1 contributor

Commits on Aug 5, 2020

  1. Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    jluttine Jaakko Luttinen
    Copy the full SHA
    69137e0 View commit details
Showing with 87 additions and 4 deletions.
  1. +1 −1 lib
  2. +2 −1 src/glscopeclient/WaveformArea.h
  3. +39 −2 src/glscopeclient/WaveformArea_cairo.cpp
  4. +45 −0 src/glscopeclient/masks/xfi.yml
2 changes: 1 addition & 1 deletion lib
Submodule lib updated from fe28a7 to f3be00
3 changes: 2 additions & 1 deletion src/glscopeclient/WaveformArea.h
Original file line number Diff line number Diff line change
@@ -277,7 +277,7 @@ class WaveformArea : public Gtk::GLArea
//Display options
bool m_persistence;
bool m_persistenceClear;

// Whether GLEW is already initialized
static bool m_isGlewInitialized;

@@ -332,6 +332,7 @@ class WaveformArea : public Gtk::GLArea
void DoRenderCairoOverlays(Cairo::RefPtr< Cairo::Context > cr);
void RenderCursors(Cairo::RefPtr< Cairo::Context > cr);
void RenderChannelLabel(Cairo::RefPtr< Cairo::Context > cr);
void RenderEyeMask(Cairo::RefPtr< Cairo::Context > cr);
void RenderDecodeOverlays(Cairo::RefPtr< Cairo::Context > cr);
void InitializeCairoPass();
Texture m_cairoTexture;
41 changes: 39 additions & 2 deletions src/glscopeclient/WaveformArea_cairo.cpp
Original file line number Diff line number Diff line change
@@ -251,9 +251,37 @@ void WaveformArea::RenderGrid(Cairo::RefPtr< Cairo::Context > cr)

void WaveformArea::DoRenderCairoOverlays(Cairo::RefPtr< Cairo::Context > cr)
{
//Eye mask should be under channel infobox and other stuff
if(IsEye())
RenderEyeMask(cr);

RenderDecodeOverlays(cr);
RenderChannelLabel(cr);
RenderCursors(cr);
RenderChannelLabel(cr);
}

void WaveformArea::RenderEyeMask(Cairo::RefPtr< Cairo::Context > cr)
{
//Make sure it's really an eye
auto eye = dynamic_cast<EyeDecoder2*>(m_channel);
if(!eye)
return;
auto waveform = dynamic_cast<EyeWaveform*>(eye->GetData());

//If no mask is selected, we have nothing to draw
auto& mask = eye->GetMask();
if(mask.GetMaskName() == "")
return;

//Do the actual drawing
mask.RenderForDisplay(
cr,
waveform,
m_group->m_pixelsPerXUnit,
m_group->m_xAxisOffset,
m_pixelsPerVolt,
m_channel->GetOffset(),
m_height);
}

void WaveformArea::RenderDecodeOverlays(Cairo::RefPtr< Cairo::Context > cr)
@@ -426,6 +454,7 @@ void WaveformArea::RenderChannelLabel(Cairo::RefPtr< Cairo::Context > cr)
auto data = m_channel->GetData();

auto eye = dynamic_cast<EyeWaveform*>(data);
auto ed = dynamic_cast<EyeDecoder2*>(m_channel);

//Add RBW to frequency domain channels
char tmp[256];
@@ -437,8 +466,9 @@ void WaveformArea::RenderChannelLabel(Cairo::RefPtr< Cairo::Context > cr)
}

//Add count info to eye channels
else if(eye != NULL)
else if( (eye != NULL) && (ed != NULL) )
{

size_t uis = eye->GetTotalUIs();
float gbps = 1e3f / eye->GetUIWidth();

@@ -449,6 +479,13 @@ void WaveformArea::RenderChannelLabel(Cairo::RefPtr< Cairo::Context > cr)
else
snprintf(tmp, sizeof(tmp), "\n%.2fG UI %.4f Gbps", uis * 1e-6f, gbps);
label += tmp;

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

//Add sample rate info to physical analog channels
45 changes: 45 additions & 0 deletions src/glscopeclient/masks/xfi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
protocol:
name: XFI
reference: SFF-8431 table 12
displaylimits:
ymin: -400
ymax: 400
units:
xscale: ui
yscale: mv
mask:
- points:
- x: -0.38
y: 0
- x: -0.17
y: -95
- x: 0.17
y: -95
- x: 0.38
y: 0
- x: 0.17
y: 95
- x: -0.17
y: 95

- points:
- x: -2
y: -350
- x: 2
y: -350
- x: 2
y: -500
- x: -2
y: -500

- points:
- x: -2
y: 350
- x: 2
y: 350
- x: 2
y: 500
- x: -2
y: 500
conditions:
hitrate: 5.0e-5