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: abbf63c5c0e6
Choose a base ref
...
head repository: ngscopeclient/scopehal
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 256252ffcd83
Choose a head ref
  • 2 commits
  • 25 files changed
  • 1 contributor

Commits on Apr 30, 2021

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    2612042 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
    256252f View commit details
12 changes: 11 additions & 1 deletion scopehal/AgilentOscilloscope.cpp
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
* *
* ANTIKERNEL v0.1 *
* *
* Copyright (c) 2012-2020 Andrew D. Zonenberg, Mike Walters *
* Copyright (c) 2012-2021 Andrew D. Zonenberg, Mike Walters *
* All rights reserved. *
* *
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the *
@@ -242,6 +242,16 @@ void AgilentOscilloscope::DisableChannel(size_t i)
m_channelsEnabled[i] = false;
}

vector<OscilloscopeChannel::CouplingType> AgilentOscilloscope::GetAvailableCouplings(size_t /*i*/)
{
vector<OscilloscopeChannel::CouplingType> ret;
ret.push_back(OscilloscopeChannel::COUPLE_DC_1M);
ret.push_back(OscilloscopeChannel::COUPLE_AC_1M);
ret.push_back(OscilloscopeChannel::COUPLE_DC_50);
ret.push_back(OscilloscopeChannel::COUPLE_GND);
return ret;
}

OscilloscopeChannel::CouplingType AgilentOscilloscope::GetChannelCoupling(size_t i)
{
{
3 changes: 2 additions & 1 deletion scopehal/AgilentOscilloscope.h
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
* *
* ANTIKERNEL v0.1 *
* *
* Copyright (c) 2012-2020 Andrew D. Zonenberg, Mike Walters *
* Copyright (c) 2012-2021 Andrew D. Zonenberg, Mike Walters *
* All rights reserved. *
* *
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the *
@@ -57,6 +57,7 @@ class AgilentOscilloscope : public SCPIOscilloscope
virtual void DisableChannel(size_t i);
virtual OscilloscopeChannel::CouplingType GetChannelCoupling(size_t i);
virtual void SetChannelCoupling(size_t i, OscilloscopeChannel::CouplingType type);
virtual std::vector<OscilloscopeChannel::CouplingType> GetAvailableCouplings(size_t i);
virtual double GetChannelAttenuation(size_t i);
virtual void SetChannelAttenuation(size_t i, double atten);
virtual int GetChannelBandwidthLimit(size_t i);
9 changes: 8 additions & 1 deletion scopehal/AntikernelLabsOscilloscope.cpp
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
* *
* ANTIKERNEL v0.1 *
* *
* Copyright (c) 2012-2020 Andrew D. Zonenberg *
* Copyright (c) 2012-2021 Andrew D. Zonenberg *
* All rights reserved. *
* *
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the *
@@ -193,6 +193,13 @@ void AntikernelLabsOscilloscope::DisableChannel(size_t i)
m_transport->SendCommand(m_channels[i]->GetHwname() + ":DIS");
}

vector<OscilloscopeChannel::CouplingType> AntikernelLabsOscilloscope::GetAvailableCouplings(size_t /*i*/)
{
vector<OscilloscopeChannel::CouplingType> ret;
ret.push_back(OscilloscopeChannel::COUPLE_DC_50);
return ret;
}

OscilloscopeChannel::CouplingType AntikernelLabsOscilloscope::GetChannelCoupling(size_t /*i*/)
{
//All channels are 50 ohm all the time
3 changes: 2 additions & 1 deletion scopehal/AntikernelLabsOscilloscope.h
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
* *
* ANTIKERNEL v0.1 *
* *
* Copyright (c) 2012-2020 Andrew D. Zonenberg *
* Copyright (c) 2012-2021 Andrew D. Zonenberg *
* All rights reserved. *
* *
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the *
@@ -51,6 +51,7 @@ class AntikernelLabsOscilloscope : public SCPIOscilloscope
virtual void EnableChannel(size_t i);
virtual void DisableChannel(size_t i);
virtual OscilloscopeChannel::CouplingType GetChannelCoupling(size_t i);
virtual std::vector<OscilloscopeChannel::CouplingType> GetAvailableCouplings(size_t i);
virtual void SetChannelCoupling(size_t i, OscilloscopeChannel::CouplingType type);
virtual double GetChannelAttenuation(size_t i);
virtual void SetChannelAttenuation(size_t i, double atten);
9 changes: 8 additions & 1 deletion scopehal/AntikernelLogicAnalyzer.cpp
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
* *
* ANTIKERNEL v0.1 *
* *
* Copyright (c) 2012-2020 Andrew D. Zonenberg *
* Copyright (c) 2012-2021 Andrew D. Zonenberg *
* All rights reserved. *
* *
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the *
@@ -477,6 +477,13 @@ void AntikernelLogicAnalyzer::DisableChannel(size_t /*i*/)
//no-op, all channels are always on
}

vector<OscilloscopeChannel::CouplingType> AntikernelLogicAnalyzer::GetAvailableCouplings(size_t /*i*/)
{
vector<OscilloscopeChannel::CouplingType> ret;
ret.push_back(OscilloscopeChannel::COUPLE_SYNTHETIC);
return ret;
}

OscilloscopeChannel::CouplingType AntikernelLogicAnalyzer::GetChannelCoupling(size_t /*i*/)
{
return OscilloscopeChannel::COUPLE_SYNTHETIC;
3 changes: 2 additions & 1 deletion scopehal/AntikernelLogicAnalyzer.h
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
* *
* ANTIKERNEL v0.1 *
* *
* Copyright (c) 2012-2020 Andrew D. Zonenberg *
* Copyright (c) 2012-2021 Andrew D. Zonenberg *
* All rights reserved. *
* *
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the *
@@ -62,6 +62,7 @@ class AntikernelLogicAnalyzer
virtual void EnableChannel(size_t i);
virtual void DisableChannel(size_t i);
virtual OscilloscopeChannel::CouplingType GetChannelCoupling(size_t i);
virtual std::vector<OscilloscopeChannel::CouplingType> GetAvailableCouplings(size_t i);
virtual void SetChannelCoupling(size_t i, OscilloscopeChannel::CouplingType type);
virtual double GetChannelAttenuation(size_t i);
virtual void SetChannelAttenuation(size_t i, double atten);
9 changes: 8 additions & 1 deletion scopehal/DemoOscilloscope.cpp
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
* *
* ANTIKERNEL v0.1 *
* *
* Copyright (c) 2012-2020 Andrew D. Zonenberg *
* Copyright (c) 2012-2021 Andrew D. Zonenberg *
* All rights reserved. *
* *
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the *
@@ -228,6 +228,13 @@ OscilloscopeChannel::CouplingType DemoOscilloscope::GetChannelCoupling(size_t i)
return m_channelCoupling[i];
}

vector<OscilloscopeChannel::CouplingType> DemoOscilloscope::GetAvailableCouplings(size_t /*i*/)
{
vector<OscilloscopeChannel::CouplingType> ret;
ret.push_back(OscilloscopeChannel::COUPLE_DC_50);
return ret;
}

void DemoOscilloscope::SetChannelCoupling(size_t i, OscilloscopeChannel::CouplingType type)
{
m_channelCoupling[i] = type;
1 change: 1 addition & 0 deletions scopehal/DemoOscilloscope.h
Original file line number Diff line number Diff line change
@@ -60,6 +60,7 @@ class DemoOscilloscope : public SCPIOscilloscope
virtual void DisableChannel(size_t i);
virtual OscilloscopeChannel::CouplingType GetChannelCoupling(size_t i);
virtual void SetChannelCoupling(size_t i, OscilloscopeChannel::CouplingType type);
virtual std::vector<OscilloscopeChannel::CouplingType> GetAvailableCouplings(size_t i);
virtual double GetChannelAttenuation(size_t i);
virtual void SetChannelAttenuation(size_t i, double atten);
virtual int GetChannelBandwidthLimit(size_t i);
10 changes: 10 additions & 0 deletions scopehal/LeCroyOscilloscope.cpp
Original file line number Diff line number Diff line change
@@ -1146,6 +1146,16 @@ void LeCroyOscilloscope::DisableChannel(size_t i)
}
}

vector<OscilloscopeChannel::CouplingType> LeCroyOscilloscope::GetAvailableCouplings(size_t /*i*/)
{
vector<OscilloscopeChannel::CouplingType> ret;
ret.push_back(OscilloscopeChannel::COUPLE_DC_1M);
ret.push_back(OscilloscopeChannel::COUPLE_AC_1M);
ret.push_back(OscilloscopeChannel::COUPLE_DC_50);
ret.push_back(OscilloscopeChannel::COUPLE_GND);
return ret;
}

OscilloscopeChannel::CouplingType LeCroyOscilloscope::GetChannelCoupling(size_t i)
{
if(i >= m_analogChannelCount)
1 change: 1 addition & 0 deletions scopehal/LeCroyOscilloscope.h
Original file line number Diff line number Diff line change
@@ -83,6 +83,7 @@ class LeCroyOscilloscope
virtual void DisableChannel(size_t i);
virtual OscilloscopeChannel::CouplingType GetChannelCoupling(size_t i);
virtual void SetChannelCoupling(size_t i, OscilloscopeChannel::CouplingType type);
virtual std::vector<OscilloscopeChannel::CouplingType> GetAvailableCouplings(size_t i);
virtual double GetChannelAttenuation(size_t i);
virtual void SetChannelAttenuation(size_t i, double atten);
virtual int GetChannelBandwidthLimit(size_t i);
13 changes: 12 additions & 1 deletion scopehal/MockOscilloscope.cpp
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
* *
* ANTIKERNEL v0.1 *
* *
* Copyright (c) 2012-2020 Andrew D. Zonenberg *
* Copyright (c) 2012-2021 Andrew D. Zonenberg *
* All rights reserved. *
* *
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the *
@@ -199,6 +199,17 @@ void MockOscilloscope::DisableChannel(size_t i)
m_channelsEnabled[i] = false;
}

vector<OscilloscopeChannel::CouplingType> MockOscilloscope::GetAvailableCouplings(size_t /*i*/)
{
vector<OscilloscopeChannel::CouplingType> ret;
ret.push_back(OscilloscopeChannel::COUPLE_DC_1M);
ret.push_back(OscilloscopeChannel::COUPLE_AC_1M);
ret.push_back(OscilloscopeChannel::COUPLE_DC_50);
ret.push_back(OscilloscopeChannel::COUPLE_GND);
//TODO: other options? or none?
return ret;
}

OscilloscopeChannel::CouplingType MockOscilloscope::GetChannelCoupling(size_t i)
{
return m_channelCoupling[i];
3 changes: 2 additions & 1 deletion scopehal/MockOscilloscope.h
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
* *
* ANTIKERNEL v0.1 *
* *
* Copyright (c) 2012-2020 Andrew D. Zonenberg *
* Copyright (c) 2012-2021 Andrew D. Zonenberg *
* All rights reserved. *
* *
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the *
@@ -118,6 +118,7 @@ class MockOscilloscope : public Oscilloscope
virtual void DisableChannel(size_t i);
virtual OscilloscopeChannel::CouplingType GetChannelCoupling(size_t i);
virtual void SetChannelCoupling(size_t i, OscilloscopeChannel::CouplingType type);
virtual std::vector<OscilloscopeChannel::CouplingType> GetAvailableCouplings(size_t i);
virtual double GetChannelAttenuation(size_t i);
virtual void SetChannelAttenuation(size_t i, double atten);
virtual int GetChannelBandwidthLimit(size_t i);
9 changes: 8 additions & 1 deletion scopehal/Oscilloscope.h
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
* *
* ANTIKERNEL v0.1 *
* *
* Copyright (c) 2012-2020 Andrew D. Zonenberg *
* Copyright (c) 2012-2021 Andrew D. Zonenberg *
* All rights reserved. *
* *
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the *
@@ -155,6 +155,13 @@ class Oscilloscope : public virtual Instrument
*/
virtual void SetChannelCoupling(size_t i, OscilloscopeChannel::CouplingType type) =0;

/**
@brief Gets the set of legal coupling values for an input channel
@param i Zero-based index of channel
*/
virtual std::vector<OscilloscopeChannel::CouplingType> GetAvailableCouplings(size_t i) =0;

/**
@brief Gets the display name for a channel. This is an arbitrary user-selected string.
10 changes: 10 additions & 0 deletions scopehal/PicoOscilloscope.cpp
Original file line number Diff line number Diff line change
@@ -202,6 +202,16 @@ OscilloscopeChannel::CouplingType PicoOscilloscope::GetChannelCoupling(size_t i)
return m_channelCouplings[i];
}

vector<OscilloscopeChannel::CouplingType> PicoOscilloscope::GetAvailableCouplings(size_t /*i*/)
{
vector<OscilloscopeChannel::CouplingType> ret;
ret.push_back(OscilloscopeChannel::COUPLE_DC_1M);
ret.push_back(OscilloscopeChannel::COUPLE_AC_1M);
ret.push_back(OscilloscopeChannel::COUPLE_DC_50);
ret.push_back(OscilloscopeChannel::COUPLE_GND);
return ret;
}

void PicoOscilloscope::SetChannelCoupling(size_t i, OscilloscopeChannel::CouplingType type)
{
lock_guard<recursive_mutex> lock(m_mutex);
3 changes: 2 additions & 1 deletion scopehal/PicoOscilloscope.h
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
* *
* ANTIKERNEL v0.1 *
* *
* Copyright (c) 2012-2020 Andrew D. Zonenberg *
* Copyright (c) 2012-2021 Andrew D. Zonenberg *
* All rights reserved. *
* *
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the *
@@ -58,6 +58,7 @@ class PicoOscilloscope : public SCPIOscilloscope
virtual void DisableChannel(size_t i);
virtual OscilloscopeChannel::CouplingType GetChannelCoupling(size_t i);
virtual void SetChannelCoupling(size_t i, OscilloscopeChannel::CouplingType type);
virtual std::vector<OscilloscopeChannel::CouplingType> GetAvailableCouplings(size_t i);
virtual double GetChannelAttenuation(size_t i);
virtual void SetChannelAttenuation(size_t i, double atten);
virtual int GetChannelBandwidthLimit(size_t i);
Loading