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: 6462bc2628e0
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: e98bb60d3599
Choose a head ref
  • 1 commit
  • 3 files changed
  • 1 contributor

Commits on Aug 15, 2020

  1. FFT values are now displayed in dBm. Still no support for adjusting a…

    …xis scaling though, and Y axis units are still reported as dimensionless dB.
    azonenberg committed Aug 15, 2020
    Copy the full SHA
    e98bb60 View commit details
Showing with 21 additions and 7 deletions.
  1. +1 −1 lib
  2. +8 −2 src/glscopeclient/WaveformArea_events.cpp
  3. +12 −4 src/glscopeclient/WaveformArea_rendering.cpp
2 changes: 1 addition & 1 deletion lib
Submodule lib updated from 07d4bb to 56b6fc
10 changes: 8 additions & 2 deletions src/glscopeclient/WaveformArea_events.cpp
Original file line number Diff line number Diff line change
@@ -796,7 +796,14 @@ void WaveformArea::OnDecodeSetupComplete()

//Create a new waveform view for the generated signal
if(!m_pendingDecode->IsOverlay())
m_parent->DoAddChannel(m_pendingDecode, m_group, this);
{
auto area = m_parent->DoAddChannel(m_pendingDecode, m_group, this);

//If the decode is incompatible with our timebase, make a new group
//TODO: better way to determine fixed-width stuff like eye patterns
if(eye || (m_pendingDecode->GetXAxisUnits() != m_channel->GetXAxisUnits()) )
m_parent->OnMoveNewBelow(area);
}

//It's an overlay. Reference it and add to our overlay list
else
@@ -879,7 +886,6 @@ void WaveformArea::OnWaveformDataReady()
}

//Redraw everything
SetGeometryDirty();
queue_draw();
m_group->m_timeline.queue_draw();
}
16 changes: 12 additions & 4 deletions src/glscopeclient/WaveformArea_rendering.cpp
Original file line number Diff line number Diff line change
@@ -43,7 +43,6 @@
#include "../../lib/scopeprotocols/WaterfallDecoder.h"

using namespace std;
using namespace glm;

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// WaveformRenderData
@@ -175,10 +174,19 @@ void WaveformArea::PrepareGeometry(WaveformRenderData* wdata)
float* psamps = reinterpret_cast<float*>(__builtin_assume_aligned(&andat->m_samples[0], 16));
if(fft)
{
yoff = 0;
yscale = 1;
//Scaling for display
//TODO: don't hard code plot limits
float plotheight = m_height - 2*m_padding;
float db_range = 70;
float db_offset = -db_range/2;
yoff = plotheight;
yscale = plotheight / db_range;
offset = db_offset + db_range/2;

//Convert V to dBm
const float impedance = 50;
for(size_t j=0; j<wdata->m_count; j++)
wdata->m_mappedYBuffer[j] = DbToYPosition(-70 - (20 * log10(psamps[j]))); //TODO: don't hard code plot limits
wdata->m_mappedYBuffer[j] = (10 * log10(psamps[j]*psamps[j] / impedance) + 30);
}
else
{