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: 43e87760b4f6
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: ee991eaa7493
Choose a head ref
  • 1 commit
  • 3 files changed
  • 1 contributor

Commits on Aug 4, 2020

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    ee991ea View commit details
Showing with 32 additions and 11 deletions.
  1. +1 −1 lib
  2. +18 −0 src/glscopeclient/WaveformArea_cairo.cpp
  3. +13 −10 src/glscopeclient/WaveformArea_events.cpp
2 changes: 1 addition & 1 deletion lib
Submodule lib updated from a8472a to fe28a7
18 changes: 18 additions & 0 deletions src/glscopeclient/WaveformArea_cairo.cpp
Original file line number Diff line number Diff line change
@@ -44,6 +44,7 @@
#include <random>
#include <map>
#include "ProfileBlock.h"
#include "../scopeprotocols/EyeDecoder2.h"

using namespace std;
using namespace glm;
@@ -424,6 +425,8 @@ void WaveformArea::RenderChannelLabel(Cairo::RefPtr< Cairo::Context > cr)
string label = m_channel->m_displayname;
auto data = m_channel->GetData();

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

//Add RBW to frequency domain channels
char tmp[256];
auto xunits = m_channel->GetXAxisUnits();
@@ -433,6 +436,21 @@ void WaveformArea::RenderChannelLabel(Cairo::RefPtr< Cairo::Context > cr)
label += tmp;
}

//Add count info to eye channels
else if(eye != NULL)
{
size_t uis = eye->GetTotalUIs();
float gbps = 1e3f / eye->GetUIWidth();

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

//Add sample rate info to physical analog channels
//TODO: do this to some decodes too?
else if(m_channel->IsPhysicalChannel() && (data != NULL))
23 changes: 13 additions & 10 deletions src/glscopeclient/WaveformArea_events.cpp
Original file line number Diff line number Diff line change
@@ -852,20 +852,23 @@ void WaveformArea::OnWaveformDataReady()
//If we're a fixed width curve, refresh the parent's time scale
if(IsEyeOrBathtub())
{
auto eye = dynamic_cast<EyeDecoder2*>(m_channel);
auto eye = dynamic_cast<EyeWaveform*>(m_channel->GetData());
if(eye == NULL)
eye = dynamic_cast<EyeDecoder2*>(dynamic_cast<ProtocolDecoder*>(m_channel)->GetInput(0));
int64_t width = eye->GetUIWidth();
eye = dynamic_cast<EyeWaveform*>(dynamic_cast<ProtocolDecoder*>(m_channel)->GetInput(0)->GetData());
if(eye != NULL)
{
float width = eye->GetUIWidth();

//eye is two UIs wide
int64_t eye_width_ps = 2 * width;
//eye is two UIs wide
float eye_width_ps = 2 * width;

//If decode fails for some reason, don't have an invalid timeline
if(eye_width_ps == 0)
eye_width_ps = 5;
//If decode fails for some reason, don't have an invalid timeline
if(eye_width_ps == 0)
eye_width_ps = 5;

m_group->m_pixelsPerXUnit = m_width * 1.0f / eye_width_ps;
m_group->m_xAxisOffset = -width;
m_group->m_pixelsPerXUnit = m_width * 1.0f / eye_width_ps;
m_group->m_xAxisOffset = -width;
}
}

//Update our measurements and redraw the waveform