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

Commits on Aug 26, 2020

  1. Copy the full SHA
    7406b95 View commit details
Showing with 42 additions and 5 deletions.
  1. +13 −2 scopehal/Filter.cpp
  2. +27 −1 scopehal/Filter.h
  3. +1 −1 scopehal/MockOscilloscope.cpp
  4. +1 −1 scopehal/MockOscilloscope.h
15 changes: 13 additions & 2 deletions scopehal/Filter.cpp
Original file line number Diff line number Diff line change
@@ -53,6 +53,17 @@ Gdk::Color Filter::m_standardColors[STANDARD_COLOR_COUNT] =
Gdk::Color("#404040") //COLOR_IDLE
};

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// StreamDescriptor

string StreamDescriptor::GetName()
{
string name = m_channel->m_displayname;
if(m_channel->GetStreamCount() > 1)
name += string(".") + m_channel->GetStreamName(m_stream);
return name;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// FilterParameter

@@ -398,12 +409,12 @@ void Filter::EnumProtocols(vector<string>& names)
names.push_back(it->first);
}

Filter* Filter::CreateDecoder(string protocol, string color)
Filter* Filter::CreateFilter(string protocol, string color)
{
if(m_createprocs.find(protocol) != m_createprocs.end())
return m_createprocs[protocol](color);

LogError("Invalid decoder name: %s\n", protocol.c_str());
LogError("Invalid filter name: %s\n", protocol.c_str());
return NULL;
}

28 changes: 27 additions & 1 deletion scopehal/Filter.h
Original file line number Diff line number Diff line change
@@ -98,13 +98,39 @@ class FilterParameter
class StreamDescriptor
{
public:
StreamDescriptor()
: m_channel(NULL)
, m_stream(0)
{}

StreamDescriptor(OscilloscopeChannel* channel, size_t stream)
: m_channel(channel)
, m_stream(stream)
{}

std::string GetName();

OscilloscopeChannel* m_channel;
size_t m_stream;

WaveformBase* GetData()
{ return m_channel->GetData(m_stream); }

bool operator==(const StreamDescriptor& rhs) const
{ return (m_channel == rhs.m_channel) && (m_stream == rhs.m_stream); }

bool operator!=(const StreamDescriptor& rhs) const
{ return (m_channel != rhs.m_channel) || (m_stream != rhs.m_stream); }

bool operator<(const StreamDescriptor& rhs) const
{
if(m_channel < rhs.m_channel)
return true;
if( (m_channel == rhs.m_channel) && (m_stream < rhs.m_stream) )
return true;

return false;
}
};

/**
@@ -308,7 +334,7 @@ class Filter : public OscilloscopeChannel
static void DoAddDecoderClass(std::string name, CreateProcType proc);

static void EnumProtocols(std::vector<std::string>& names);
static Filter* CreateDecoder(std::string protocol, std::string color);
static Filter* CreateFilter(std::string protocol, std::string color);

protected:
//Class enumeration
2 changes: 1 addition & 1 deletion scopehal/MockOscilloscope.cpp
Original file line number Diff line number Diff line change
@@ -117,7 +117,7 @@ Oscilloscope::TriggerMode MockOscilloscope::PollTrigger()
return TRIGGER_MODE_STOP;
}

bool MockOscilloscope::AcquireData(bool /*toQueue*/)
bool MockOscilloscope::AcquireData()
{
//no new data possible
return false;
2 changes: 1 addition & 1 deletion scopehal/MockOscilloscope.h
Original file line number Diff line number Diff line change
@@ -69,7 +69,7 @@ class MockOscilloscope : public Oscilloscope

//Triggering
virtual Oscilloscope::TriggerMode PollTrigger();
virtual bool AcquireData(bool toQueue = false);
virtual bool AcquireData();
virtual void Start();
virtual void StartSingleTrigger();
virtual void Stop();