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

Commits on Mar 5, 2020

  1. Copy the full SHA
    78d10f9 View commit details
Showing with 10 additions and 3 deletions.
  1. +2 −2 scopehal/ProtocolDecoder.cpp
  2. +8 −1 scopehal/ProtocolDecoder.h
4 changes: 2 additions & 2 deletions scopehal/ProtocolDecoder.cpp
Original file line number Diff line number Diff line change
@@ -567,8 +567,8 @@ string ProtocolDecoder::SerializeConfiguration(std::map<void*, int>& idmap, int&
config += tmp;

//Channel info
//snprintf(tmp, sizeof(tmp), " protocol: \"%s\"\n", GetProtocolName().c_str());
//config += tmp;
snprintf(tmp, sizeof(tmp), " protocol: \"%s\"\n", GetProtocolDisplayName().c_str());
config += tmp;
snprintf(tmp, sizeof(tmp), " color: \"%s\"\n", m_displaycolor.c_str());
config += tmp;
snprintf(tmp, sizeof(tmp), " nick: \"%s\"\n", m_displayname.c_str());
9 changes: 8 additions & 1 deletion scopehal/ProtocolDecoder.h
Original file line number Diff line number Diff line change
@@ -142,6 +142,11 @@ class ProtocolDecoder : public OscilloscopeChannel
void SetDirty()
{ m_dirty = true; }

/**
@brief Gets the display name of this protocol (for use in menus, save files, etc). Must be unique.
*/
virtual std::string GetProtocolDisplayName() =0;

/**
@brief Serialize this decoder's configuration to a string
*/
@@ -193,6 +198,8 @@ class ProtocolDecoder : public OscilloscopeChannel
static ProtocolDecoder* CreateInstance(std::string color) \
{ \
return new T(color); \
}
} \
virtual std::string GetProtocolDisplayName() \
{ return GetProtocolName(); }

#endif