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
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 19a3a0f8db2f
Choose a base ref
...
head repository: ngscopeclient/scopehal
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: fe28a7dacc03
Choose a head ref
  • 2 commits
  • 2 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
    a8472ab View commit details
  2. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    fe28a7d View commit details
Showing with 9 additions and 15 deletions.
  1. +5 −8 scopeprotocols/EyeDecoder2.cpp
  2. +4 −7 scopeprotocols/EyeDecoder2.h
13 changes: 5 additions & 8 deletions scopeprotocols/EyeDecoder2.cpp
Original file line number Diff line number Diff line change
@@ -98,7 +98,6 @@ EyeDecoder2::EyeDecoder2(string color)
m_signalNames.push_back("clk");
m_channels.push_back(NULL);

m_uiWidth = 0;
m_width = 0;
m_height = 0;

@@ -311,7 +310,6 @@ void EyeDecoder2::ClearSweeps()
{
if(m_data != NULL)
{
m_uiWidth = 0;
delete m_data;
m_data = NULL;
}
@@ -377,11 +375,10 @@ void EyeDecoder2::Refresh()
//Calculate average period of the clock
//TODO: All of this code assumes a fully RLE'd clock with one sample per toggle.
//We probably need a preprocessing filter to handle analog etc clock sources.
if(m_uiWidth == 0)
if(cap->m_uiWidth < FLT_EPSILON)
{
double tlastclk = clock->m_offsets[cend-1] + clock->m_durations[cend-1];
m_uiWidth = tlastclk / cend;
cap->m_uiWidth = m_uiWidth;
cap->m_uiWidth = tlastclk / cend;
}

//Process the eye
@@ -392,9 +389,9 @@ void EyeDecoder2::Refresh()
float ymid = m_height / 2;
float yoff = -center*yscale + ymid;
size_t wend = waveform->m_samples.size()-1;
int64_t halfwidth = m_uiWidth / 2;
float scale = fwidth / m_uiWidth;
int64_t tscale = floor(m_uiWidth * scale);
int64_t halfwidth = cap->m_uiWidth / 2;
float scale = fwidth / cap->m_uiWidth;
int64_t tscale = floor(cap->m_uiWidth * scale);
for(size_t i=0; i<wend; i++)
{
//Stop when we get to the end of the clock
11 changes: 4 additions & 7 deletions scopeprotocols/EyeDecoder2.h
Original file line number Diff line number Diff line change
@@ -67,6 +67,9 @@ class EyeWaveform : public WaveformBase
void IntegrateUIs(size_t uis)
{ m_totalUIs += uis; }

float GetUIWidth()
{ return m_uiWidth; }

float m_uiWidth;

float m_saturationLevel;
@@ -102,10 +105,6 @@ class EyeDecoder2 : public ProtocolDecoder

virtual void ClearSweeps();

//TODO: this should be a property of the capture, not the decode
int64_t GetUIWidth()
{ return m_uiWidth; }

void SetWidth(size_t width)
{
m_width = width;
@@ -128,10 +127,8 @@ class EyeDecoder2 : public ProtocolDecoder

protected:

size_t m_width;
size_t m_height;

size_t m_uiWidth;
size_t m_width;

std::string m_saturationName;
std::string m_centerName;