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: 83e8a0e5c299
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: ca98bf1f2d8c
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on May 12, 2020

  1. Copy the full SHA
    ca98bf1 View commit details
Showing with 8 additions and 1 deletion.
  1. +8 −1 glscopeclient/WaveformArea_cairo.cpp
9 changes: 8 additions & 1 deletion glscopeclient/WaveformArea_cairo.cpp
Original file line number Diff line number Diff line change
@@ -111,7 +111,7 @@ void WaveformArea::RenderGrid(Cairo::RefPtr< Cairo::Context > cr)
std::map<float, float> gridmap;

//Spectra are printed on a logarithmic scale
if(IsFFT())
if(m_channel->GetYAxisUnits() == Unit::UNIT_DB)
{
for(float db=0; db >= -60; db -= 10)
gridmap[db] = DbToYPosition(db);
@@ -126,6 +126,10 @@ void WaveformArea::RenderGrid(Cairo::RefPtr< Cairo::Context > cr)
//Decide what voltage step to use. Pick from a list (in volts)
float selected_step = PickStepSize(volts_per_half_span);

//Special case a few values
if(m_channel->GetYAxisUnits() == Unit::UNIT_LOG_BER)
selected_step = 2;

float bottom_edge = (ybot + theight/2);
float top_edge = (ytop - theight/2);

@@ -159,6 +163,9 @@ void WaveformArea::RenderGrid(Cairo::RefPtr< Cairo::Context > cr)
cr->stroke();
}

if(gridmap.size() > 50)
LogFatal("gridmap way too big (%zu)\n", gridmap.size());

//Dimmed lines above and below
cr->set_source_rgba(0.7, 0.7, 0.7, 0.25);
for(auto it : gridmap)