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: 6c01f3cac929
Choose a base ref
...
head repository: ngscopeclient/scopehal
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: c4409184fa99
Choose a head ref
  • 1 commit
  • 8 files changed
  • 1 contributor

Commits on May 23, 2020

  1. Copy the full SHA
    c440918 View commit details
1 change: 0 additions & 1 deletion scopemeasurements/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -3,7 +3,6 @@ link_directories(${GTKMM_LIBRARY_DIRS} ${SIGCXX_LIBRARY_DIRS})

set(SCOPEMEASUREMENTS_SOURCES
#EyeHeightMeasurement.cpp
#EyePeriodMeasurement.cpp
#OvershootMeasurement.cpp
#PkPkVoltageMeasurement.cpp
#UndershootMeasurement.cpp
1 change: 0 additions & 1 deletion scopemeasurements/scopemeasurements.cpp
Original file line number Diff line number Diff line change
@@ -44,7 +44,6 @@ void ScopeMeasurementStaticInit()
{
/*
AddMeasurementClass(EyeHeightMeasurement);
AddMeasurementClass(EyePeriodMeasurement);
AddMeasurementClass(OvershootMeasurement);
AddMeasurementClass(PkPkVoltageMeasurement);
AddMeasurementClass(UndershootMeasurement);
1 change: 0 additions & 1 deletion scopemeasurements/scopemeasurements.h
Original file line number Diff line number Diff line change
@@ -41,7 +41,6 @@
#include "../scopehal/Measurement.h"

#include "EyeHeightMeasurement.h"
#include "EyePeriodMeasurement.h"
#include "OvershootMeasurement.h"
#include "PkPkVoltageMeasurement.h"
#include "UndershootMeasurement.h"
1 change: 1 addition & 0 deletions scopeprotocols/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -22,6 +22,7 @@ set(SCOPEPROTOCOLS_SOURCES
EyeBitRateMeasurementDecoder.cpp
EyeDecoder2.cpp
EyeJitterMeasurementDecoder.cpp
EyePeriodMeasurementDecoder.cpp
EyeWidthMeasurementDecoder.cpp
FallMeasurementDecoder.cpp
FFTDecoder.cpp
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
* *
* ANTIKERNEL v0.1 *
* *
* Copyright (c) 2012-2019 Andrew D. Zonenberg *
* Copyright (c) 2012-2020 Andrew D. Zonenberg *
* All rights reserved. *
* *
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the *
@@ -27,66 +27,98 @@
* *
***********************************************************************************************************************/

/**
@file
@author Andrew D. Zonenberg
@brief Declaration of EyePeriodMeasurement
*/

#include "scopemeasurements.h"
#include "EyePeriodMeasurement.h"
#include "../scopeprotocols/EyeDecoder2.h"
#include "scopeprotocols.h"
#include "EyePeriodMeasurementDecoder.h"
#include "EyeDecoder2.h"

using namespace std;

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Construction/destruction
// Construction / destruction

EyePeriodMeasurement::EyePeriodMeasurement()
: FloatMeasurement(TYPE_TIME)
EyePeriodMeasurementDecoder::EyePeriodMeasurementDecoder(string color)
: ProtocolDecoder(OscilloscopeChannel::CHANNEL_TYPE_ANALOG, color, CAT_MEASUREMENT)
{
//Configure for a single input
m_signalNames.push_back("Vin");
m_yAxisUnit = Unit(Unit::UNIT_PS);

//Set up channels
m_signalNames.push_back("Eye");
m_channels.push_back(NULL);

m_value = 0;
}

EyePeriodMeasurement::~EyePeriodMeasurement()
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Factory methods

bool EyePeriodMeasurementDecoder::ValidateChannel(size_t i, OscilloscopeChannel* channel)
{
if( (i == 0) && (channel->GetType() == OscilloscopeChannel::CHANNEL_TYPE_EYE) )
return true;
return false;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Accessors

Measurement::MeasurementType EyePeriodMeasurement::GetMeasurementType()
void EyePeriodMeasurementDecoder::SetDefaultName()
{
return Measurement::MEAS_HORZ;
char hwname[256];
snprintf(hwname, sizeof(hwname), "EyePeriod(%s)", m_channels[0]->m_displayname.c_str());
m_hwname = hwname;
m_displayname = m_hwname;
}

string EyePeriodMeasurement::GetMeasurementName()
string EyePeriodMeasurementDecoder::GetProtocolName()
{
return "Eye Period";
}

bool EyePeriodMeasurement::ValidateChannel(size_t i, OscilloscopeChannel* channel)
bool EyePeriodMeasurementDecoder::IsOverlay()
{
if( (i == 0) && dynamic_cast<EyeDecoder2*>(channel) != NULL )
return true;
//we create a new analog channel
return false;
}

bool EyePeriodMeasurementDecoder::NeedsConfig()
{
//automatic configuration
return false;
}

double EyePeriodMeasurementDecoder::GetVoltageRange()
{
return 10;
}

double EyePeriodMeasurementDecoder::GetOffset()
{
return -m_value;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Measurement processing
// Actual decoder logic

bool EyePeriodMeasurement::Refresh()
void EyePeriodMeasurementDecoder::Refresh()
{
//Get the input data
if(m_channels[0] == NULL)
return false;
auto chan = dynamic_cast<EyeDecoder2*>(m_channels[0]);
auto din = dynamic_cast<EyeCapture2*>(chan->GetData());
return;
auto din = dynamic_cast<EyeWaveform*>(m_channels[0]->GetData());
if(din == NULL)
return false;
return;

//Create the output
auto cap = new AnalogWaveform;
cap->m_offsets.push_back(0);
cap->m_durations.push_back(2 * din->m_uiWidth);
m_value = din->m_uiWidth;
cap->m_samples.push_back(m_value);

SetData(cap);

m_value = chan->GetUIWidth() * 1e-12f;
return true;
//Copy start time etc from the input. Timestamps are in picoseconds.
cap->m_timescale = 1;
cap->m_startTimestamp = din->m_startTimestamp;
cap->m_startPicoseconds = din->m_startPicoseconds;
}
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
* *
* ANTIKERNEL v0.1 *
* *
* Copyright (c) 2012-2019 Andrew D. Zonenberg *
* Copyright (c) 2012-2020 Andrew D. Zonenberg *
* All rights reserved. *
* *
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the *
@@ -30,27 +30,35 @@
/**
@file
@author Andrew D. Zonenberg
@brief Declaration of EyePeriodMeasurement
@brief Declaration of EyePeriodMeasurementDecoder
*/
#ifndef EyePeriodMeasurement_h
#define EyePeriodMeasurement_h
#ifndef EyePeriodMeasurementDecoder_h
#define EyePeriodMeasurementDecoder_h

#include "../scopehal/Measurement.h"
#include "../scopehal/ProtocolDecoder.h"

class EyePeriodMeasurement : public FloatMeasurement
class EyePeriodMeasurementDecoder : public ProtocolDecoder
{
public:
EyePeriodMeasurement();
virtual ~EyePeriodMeasurement();
EyePeriodMeasurementDecoder(std::string color);

virtual bool Refresh();
virtual void Refresh();

virtual bool NeedsConfig();
virtual bool IsOverlay();

static std::string GetProtocolName();
virtual void SetDefaultName();

virtual double GetVoltageRange();
virtual double GetOffset();

static std::string GetMeasurementName();
virtual bool ValidateChannel(size_t i, OscilloscopeChannel* channel);

virtual MeasurementType GetMeasurementType();
PROTOCOL_DECODER_INITPROC(EyePeriodMeasurementDecoder)

MEASUREMENT_INITPROC(EyePeriodMeasurement)
protected:
float m_value;
};

#endif
1 change: 1 addition & 0 deletions scopeprotocols/scopeprotocols.cpp
Original file line number Diff line number Diff line change
@@ -59,6 +59,7 @@ void ScopeProtocolStaticInit()
AddDecoderClass(EyeBitRateMeasurementDecoder);
AddDecoderClass(EyeDecoder2);
AddDecoderClass(EyeJitterMeasurementDecoder);
AddDecoderClass(EyePeriodMeasurementDecoder);
AddDecoderClass(EyeWidthMeasurementDecoder);
AddDecoderClass(FallMeasurementDecoder);
AddDecoderClass(FFTDecoder);
1 change: 1 addition & 0 deletions scopeprotocols/scopeprotocols.h
Original file line number Diff line number Diff line change
@@ -60,6 +60,7 @@
#include "EyeBitRateMeasurementDecoder.h"
#include "EyeDecoder2.h"
#include "EyeJitterMeasurementDecoder.h"
#include "EyePeriodMeasurementDecoder.h"
#include "EyeWidthMeasurementDecoder.h"
#include "FallMeasurementDecoder.h"
#include "FFTDecoder.h"