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: b9266a035fd4
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: 3f181657069d
Choose a head ref
  • 6 commits
  • 5 files changed
  • 1 contributor

Commits on May 23, 2020

  1. Copy the full SHA
    6ecde8c View commit details
  2. Copy the full SHA
    bf0b8ca View commit details
  3. Copy the full SHA
    79eb7c0 View commit details
  4. Removed special casing for FFT rendering now that frequency domain wa…

    …veforms are just analog waveforms with the Y axis unit in dB
    azonenberg committed May 23, 2020
    Copy the full SHA
    4930635 View commit details
  5. Fixed rounding on timeline

    azonenberg committed May 23, 2020
    Copy the full SHA
    4fb87f8 View commit details
  6. Copy the full SHA
    3f18165 View commit details
8 changes: 4 additions & 4 deletions glscopeclient/Timeline.cpp
Original file line number Diff line number Diff line change
@@ -234,7 +234,7 @@ void Timeline::Render(const Cairo::RefPtr<Cairo::Context>& cr, Unit xAxisUnit)
round_divisor = 1E12;

//Figure out about how much time per graduation to use
const double min_label_grad_width = 100; //Minimum distance between text labels, in pixels
const double min_label_grad_width = 75; //Minimum distance between text labels, in pixels
double grad_ps_nominal = min_label_grad_width / m_group->m_pixelsPerXUnit;

//Round so the division sizes are sane
@@ -243,7 +243,7 @@ void Timeline::Render(const Cairo::RefPtr<Cairo::Context>& cr, Unit xAxisUnit)
double log_units = log(units_per_grad) / log(base);
double log_units_rounded = ceil(log_units);
double units_rounded = pow(base, log_units_rounded);
int64_t grad_ps_rounded = units_rounded * round_divisor;
int64_t grad_ps_rounded = round(units_rounded * round_divisor);

//avoid divide-by-zero in weird cases with no waveform etc
if(grad_ps_rounded == 0)
@@ -253,8 +253,8 @@ void Timeline::Render(const Cairo::RefPtr<Cairo::Context>& cr, Unit xAxisUnit)
double nsubticks = 5;
double subtick = grad_ps_rounded / nsubticks;

//Find the start time (rounded down as needed)
double tstart = floor(m_group->m_xAxisOffset / grad_ps_rounded) * grad_ps_rounded;
//Find the start time (rounded as needed)
double tstart = round(m_group->m_xAxisOffset / grad_ps_rounded) * grad_ps_rounded;

//Print tick marks and labels
Glib::RefPtr<Pango::Layout> tlayout = Pango::Layout::create (cr);
28 changes: 12 additions & 16 deletions glscopeclient/WaveformArea_cairo.cpp
Original file line number Diff line number Diff line change
@@ -134,22 +134,27 @@ void WaveformArea::RenderGrid(Cairo::RefPtr< Cairo::Context > cr)
float top_edge = (ytop - theight/2);

//Calculate grid positions
//TODO: make this more efficient if we have large offsets
float vbot = YPositionToVolts(ybot);
float vtop = YPositionToVolts(ytop);
float vmid = (vbot + vtop)/2;
for(float dv=0; ; dv += selected_step)
{
float yt = VoltsToYPosition(dv);
float yb = VoltsToYPosition(-dv);
float vp = vmid + dv;
float vn = vmid - dv;

float yt = VoltsToYPosition(vp);
float yb = VoltsToYPosition(vn);

if(dv != 0)
{
if( (yb >= bottom_edge) && (yb <= top_edge ) )
gridmap[-dv] = yb;
gridmap[vn] = yb;

if( (yt >= bottom_edge ) && (yt <= top_edge) )
gridmap[dv] = yt;
gridmap[vp] = yt;
}
else
gridmap[dv] = yt;
gridmap[vp] = yt;

//Stop if we're off the edge
if( (yb > ytop) && (yt < ybot) )
@@ -188,16 +193,7 @@ void WaveformArea::RenderGrid(Cairo::RefPtr< Cairo::Context > cr)
for(auto it : gridmap)
{
float v = it.first;

if(IsFFT())
{
char tmp[32];
snprintf(tmp, sizeof(tmp), "%.0f dB", v);
tlayout->set_text(tmp);
}
else
tlayout->set_text(m_channel->GetYAxisUnits().PrettyPrint(v));

tlayout->set_text(m_channel->GetYAxisUnits().PrettyPrint(v));
float y = it.second;
if(!IsFFT())
y -= theight/2;
9 changes: 4 additions & 5 deletions glscopeclient/WaveformArea_rendering.cpp
Original file line number Diff line number Diff line change
@@ -359,19 +359,18 @@ void WaveformArea::RenderOverlayTraces()

void WaveformArea::RenderEye()
{
auto peye = dynamic_cast<EyeDecoder2*>(m_channel);
auto pcap = dynamic_cast<EyeWaveform*>(m_channel->GetData());
if(peye == NULL)
if(m_channel->GetType() != OscilloscopeChannel::CHANNEL_TYPE_EYE)
return;
auto pcap = dynamic_cast<EyeWaveform*>(m_channel->GetData());
if(pcap == NULL)
return;

//It's an eye pattern! Just copy it directly into the waveform texture.
m_eyeTexture.Bind();
ResetTextureFiltering();
m_eyeTexture.SetData(
peye->GetWidth(),
peye->GetHeight(),
pcap->GetWidth(),
pcap->GetHeight(),
pcap->GetData(),
GL_RED,
GL_FLOAT,
2 changes: 1 addition & 1 deletion glscopeclient/WaveformGroup.cpp
Original file line number Diff line number Diff line change
@@ -232,7 +232,7 @@ void WaveformGroup::RefreshMeasurements()
if(!stat->Calculate(chan, value))
row[m_treeColumns.m_columns[i]] = "(error)";
else
row[m_treeColumns.m_columns[i]] = chan->GetYAxisUnits().PrettyPrint(value);
row[m_treeColumns.m_columns[i]] = stat->GetUnits(chan).PrettyPrint(value);
}
}

1 change: 1 addition & 0 deletions glscopeclient/styles/glscopeclient.css
Original file line number Diff line number Diff line change
@@ -39,6 +39,7 @@ entry:focus
background-image: none;
background-color: @glscopeclient_bg_color;
color: @glscopeclient_text_color;
caret-color: @glscopeclient_text_color;
}

entry:disabled