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: 9d9b7c255fa6
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: 9b840b28ea51
Choose a head ref
  • 1 commit
  • 4 files changed
  • 1 contributor

Commits on Oct 28, 2020

  1. Copy the full SHA
    9b840b2 View commit details
Showing with 38 additions and 28 deletions.
  1. +1 −1 lib
  2. +3 −0 src/glscopeclient/WaveformArea.h
  3. +26 −19 src/glscopeclient/WaveformArea_events.cpp
  4. +8 −8 src/glscopeclient/masks/dphy.yml
2 changes: 1 addition & 1 deletion lib
3 changes: 3 additions & 0 deletions src/glscopeclient/WaveformArea.h
Original file line number Diff line number Diff line change
@@ -41,6 +41,7 @@
#include "Rect.h"

class WaveformArea;
class EyeWaveform;

/**
@brief GL buffers etc needed to render a single waveform
@@ -191,6 +192,8 @@ class WaveformArea : public Gtk::GLArea
void OnSingleClick(GdkEventButton* event, int64_t timestamp);
void OnDoubleClick(GdkEventButton* event, int64_t timestamp);

void RescaleEye(Filter* f, EyeWaveform* eye);

void CreateWidgets();

//Context menu
45 changes: 26 additions & 19 deletions src/glscopeclient/WaveformArea_events.cpp
Original file line number Diff line number Diff line change
@@ -96,6 +96,10 @@ void WaveformArea::on_resize(int width, int height)
auto eye = dynamic_cast<EyePattern*>(m_channel.m_channel);
eye->SetWidth(m_width);
eye->SetHeight(m_height);
eye->ClearSweeps();
eye->RecalculateUIWidth();
auto wave = dynamic_cast<EyeWaveform*>(eye->GetData(0));
RescaleEye(eye, wave);
eye->Refresh();
}
else if(IsWaterfall())
@@ -1061,31 +1065,34 @@ void WaveformArea::OnWaveformDataReady()
if(eye == NULL)
eye = dynamic_cast<EyeWaveform*>(f->GetInput(0).m_channel->GetData(0));
if(eye != NULL)
{
float width = eye->GetUIWidth();
RescaleEye(f, eye);
}
}

//eye is two UIs wide
float eye_width_ps = 2 * width;
void WaveformArea::RescaleEye(Filter* f, EyeWaveform* eye)
{
float width = eye->GetUIWidth();

//If decode fails for some reason, don't have an invalid timeline
if(eye_width_ps == 0)
eye_width_ps = 5;
//eye is two UIs wide
float eye_width_ps = 2 * width;

m_group->m_pixelsPerXUnit = m_width * 1.0f / eye_width_ps;
m_group->m_xAxisOffset = -round(width);
//If decode fails for some reason, don't have an invalid timeline
if(eye_width_ps == 0)
eye_width_ps = 5;

auto d = dynamic_cast<EyePattern*>(f);
if(d)
{
d->SetXOffset(m_group->m_xAxisOffset);
d->SetXScale(m_group->m_pixelsPerXUnit);
}
m_group->m_pixelsPerXUnit = m_width * 1.0f / eye_width_ps;
m_group->m_xAxisOffset = -round(width);

//TODO: only if stuff changed
//TODO: clear sweeps if this happens?
m_group->m_timeline.queue_draw();
}
auto d = dynamic_cast<EyePattern*>(f);
if(d)
{
d->SetXOffset(m_group->m_xAxisOffset);
d->SetXScale(m_group->m_pixelsPerXUnit);
}

//TODO: only if stuff changed
//TODO: clear sweeps if this happens?
m_group->m_timeline.queue_draw();
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
16 changes: 8 additions & 8 deletions src/glscopeclient/masks/dphy.yml
Original file line number Diff line number Diff line change
@@ -10,23 +10,23 @@ units:
mask:

- points:
- x: -2
- x: -1
y: -270
- x: 2
- x: 1
y: -270
- x: 2
- x: 1
y: -450
- x: -2
- x: -1
y: -450

- points:
- x: -2
- x: -1
y: 270
- x: 2
- x: 1
y: 270
- x: 2
- x: 1
y: 450
- x: -2
- x: -1
y: 450

- points: