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

Commits on May 2, 2020

  1. Copy the full SHA
    90b0216 View commit details
  2. Copy the full SHA
    c2a649a View commit details
  3. Copy the full SHA
    35ded8d View commit details
Showing with 736 additions and 2 deletions.
  1. +618 −0 scopehal/AntikernelLabsOscilloscope.cpp
  2. +113 −0 scopehal/AntikernelLabsOscilloscope.h
  3. +1 −0 scopehal/CMakeLists.txt
  4. +1 −1 scopehal/SCPISocketTransport.cpp
  5. +1 −1 scopehal/Unit.cpp
  6. +2 −0 scopehal/scopehal.cpp
618 changes: 618 additions & 0 deletions scopehal/AntikernelLabsOscilloscope.cpp

Large diffs are not rendered by default.

113 changes: 113 additions & 0 deletions scopehal/AntikernelLabsOscilloscope.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
/***********************************************************************************************************************
* *
* ANTIKERNEL v0.1 *
* *
* 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 *
* following conditions are met: *
* *
* * Redistributions of source code must retain the above copyright notice, this list of conditions, and the *
* following disclaimer. *
* *
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the *
* following disclaimer in the documentation and/or other materials provided with the distribution. *
* *
* * Neither the name of the author nor the names of any contributors may be used to endorse or promote products *
* derived from this software without specific prior written permission. *
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL *
* THE AUTHORS BE HELD LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR *
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE *
* POSSIBILITY OF SUCH DAMAGE. *
* *
***********************************************************************************************************************/

#ifndef AntikernelLabsOscilloscope_h
#define AntikernelLabsOscilloscope_h

class AntikernelLabsOscilloscope : public SCPIOscilloscope
{
public:
AntikernelLabsOscilloscope(SCPITransport* transport);
virtual ~AntikernelLabsOscilloscope();

public:
//Device information
virtual unsigned int GetInstrumentTypes();

virtual void FlushConfigCache();

//Channel configuration
virtual bool IsChannelEnabled(size_t i);
virtual void EnableChannel(size_t i);
virtual void DisableChannel(size_t i);
virtual OscilloscopeChannel::CouplingType GetChannelCoupling(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);
virtual int GetChannelBandwidthLimit(size_t i);
virtual void SetChannelBandwidthLimit(size_t i, unsigned int limit_mhz);
virtual double GetChannelVoltageRange(size_t i);
virtual void SetChannelVoltageRange(size_t i, double range);
virtual OscilloscopeChannel* GetExternalTrigger();
virtual double GetChannelOffset(size_t i);
virtual void SetChannelOffset(size_t i, double offset);

//Triggering
virtual void ResetTriggerConditions();
virtual Oscilloscope::TriggerMode PollTrigger();
virtual bool AcquireData(bool toQueue = false);
virtual void Start();
virtual void StartSingleTrigger();
virtual void Stop();
virtual bool IsTriggerArmed();
virtual size_t GetTriggerChannelIndex();
virtual void SetTriggerChannelIndex(size_t i);
virtual float GetTriggerVoltage();
virtual void SetTriggerVoltage(float v);
virtual Oscilloscope::TriggerType GetTriggerType();
virtual void SetTriggerType(Oscilloscope::TriggerType type);
virtual void SetTriggerForChannel(OscilloscopeChannel* channel, std::vector<TriggerType> triggerbits);

virtual std::vector<uint64_t> GetSampleRatesNonInterleaved();
virtual std::vector<uint64_t> GetSampleRatesInterleaved();
virtual std::set<InterleaveConflict> GetInterleaveConflicts();
virtual std::vector<uint64_t> GetSampleDepthsNonInterleaved();
virtual std::vector<uint64_t> GetSampleDepthsInterleaved();

protected:

//OscilloscopeChannel* m_extTrigChannel;

//Mutexing for thread safety
std::recursive_mutex m_mutex;
std::recursive_mutex m_cacheMutex;

//hardware analog channel count, independent of LA option etc
unsigned int m_analogChannelCount;

//config cache
//std::map<size_t, double> m_channelOffsets;
std::map<size_t, double> m_channelVoltageRanges;
/*
std::map<int, bool> m_channelsEnabled;
bool m_triggerChannelValid;
size_t m_triggerChannel;
bool m_triggerLevelValid;
float m_triggerLevel;
bool m_triggerArmed;
bool m_triggerOneShot;
*/

public:
static std::string GetDriverNameInternal();
OSCILLOSCOPE_INITPROC(AntikernelLabsOscilloscope)
};

#endif
1 change: 1 addition & 0 deletions scopehal/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -24,6 +24,7 @@ set(SCOPEHAL_SOURCES
OscilloscopeChannel.cpp
SCPIOscilloscope.cpp
AgilentOscilloscope.cpp
AntikernelLabsOscilloscope.cpp
AntikernelLogicAnalyzer.cpp
LeCroyOscilloscope.cpp
MockOscilloscope.cpp
2 changes: 1 addition & 1 deletion scopehal/SCPISocketTransport.cpp
Original file line number Diff line number Diff line change
@@ -57,7 +57,7 @@ SCPISocketTransport::SCPISocketTransport(string args)
m_port = port;
}

LogDebug("Connecting to VICP oscilloscope at %s:%d\n", m_hostname.c_str(), m_port);
LogDebug("Connecting to SCPI oscilloscope at %s:%d\n", m_hostname.c_str(), m_port);

if(!m_socket.Connect(m_hostname, m_port))
{
2 changes: 1 addition & 1 deletion scopehal/Unit.cpp
Original file line number Diff line number Diff line change
@@ -54,7 +54,7 @@ string Unit::PrettyPrint(double value)
value_rescaled /= 1e3;
scale = "k";
}
else if(fabs(value) < 1e-3)
else if(fabs(value) < 1)
{
value_rescaled *= 1e3;
scale = "m";
2 changes: 2 additions & 0 deletions scopehal/scopehal.cpp
Original file line number Diff line number Diff line change
@@ -35,6 +35,7 @@
#include "scopehal.h"
#include <gtkmm/drawingarea.h>
#include "AgilentOscilloscope.h"
#include "AntikernelLabsOscilloscope.h"
#include "AntikernelLogicAnalyzer.h"
#include "LeCroyOscilloscope.h"
#include "RigolOscilloscope.h"
@@ -60,6 +61,7 @@ void TransportStaticInit()
void DriverStaticInit()
{
AddDriverClass(AgilentOscilloscope);
AddDriverClass(AntikernelLabsOscilloscope);
AddDriverClass(AntikernelLogicAnalyzer);
AddDriverClass(LeCroyOscilloscope);
AddDriverClass(RigolOscilloscope);