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

Commits on Mar 11, 2020

  1. Copy the full SHA
    effea8a View commit details
Showing with 12 additions and 12 deletions.
  1. +3 −3 scopehal/Oscilloscope.cpp
  2. +9 −9 scopehal/ProtocolDecoder.cpp
6 changes: 3 additions & 3 deletions scopehal/Oscilloscope.cpp
Original file line number Diff line number Diff line change
@@ -160,7 +160,7 @@ string Oscilloscope::SerializeConfiguration(map<void*, int>& idmap, int& nextID)

//Save basic scope info
char tmp[1024];
snprintf(tmp, sizeof(tmp), " : %%\n");
snprintf(tmp, sizeof(tmp), " : \n");
string config = tmp;
snprintf(tmp, sizeof(tmp), " id: %d\n", id);
config += tmp;
@@ -176,7 +176,7 @@ string Oscilloscope::SerializeConfiguration(map<void*, int>& idmap, int& nextID)
config += tmp;

//Save channels
config += " channels: @\n";
config += " channels:\n";
for(size_t i=0; i<GetChannelCount(); i++)
{
auto chan = GetChannel(i);
@@ -187,7 +187,7 @@ string Oscilloscope::SerializeConfiguration(map<void*, int>& idmap, int& nextID)
idmap[chan] = id;

//Basic channel info
snprintf(tmp, sizeof(tmp), " : %%\n");
snprintf(tmp, sizeof(tmp), " : \n");
config += tmp;
snprintf(tmp, sizeof(tmp), " id: %d\n", id);
config += tmp;
18 changes: 9 additions & 9 deletions scopehal/ProtocolDecoder.cpp
Original file line number Diff line number Diff line change
@@ -568,29 +568,29 @@ string ProtocolDecoder::SerializeConfiguration(std::map<void*, int>& idmap, int&

//Save basic decode info
char tmp[1024];
snprintf(tmp, sizeof(tmp), " : %%\n");
snprintf(tmp, sizeof(tmp), " : \n");
string config = tmp;
snprintf(tmp, sizeof(tmp), " id: %d\n", id);
snprintf(tmp, sizeof(tmp), " id: %d\n", id);
config += tmp;

//Channel info
snprintf(tmp, sizeof(tmp), " protocol: \"%s\"\n", GetProtocolDisplayName().c_str());
snprintf(tmp, sizeof(tmp), " protocol: \"%s\"\n", GetProtocolDisplayName().c_str());
config += tmp;
snprintf(tmp, sizeof(tmp), " color: \"%s\"\n", m_displaycolor.c_str());
snprintf(tmp, sizeof(tmp), " color: \"%s\"\n", m_displaycolor.c_str());
config += tmp;
snprintf(tmp, sizeof(tmp), " nick: \"%s\"\n", m_displayname.c_str());
snprintf(tmp, sizeof(tmp), " nick: \"%s\"\n", m_displayname.c_str());
config += tmp;
snprintf(tmp, sizeof(tmp), " name: \"%s\"\n", GetHwname().c_str());
snprintf(tmp, sizeof(tmp), " name: \"%s\"\n", GetHwname().c_str());
config += tmp;

//Inputs
snprintf(tmp, sizeof(tmp), " inputs: %%\n");
snprintf(tmp, sizeof(tmp), " inputs: \n");
config += tmp;
for(size_t i=0; i<m_channels.size(); i++)
{
auto chan = m_channels[i];
if(chan == NULL)
snprintf(tmp, sizeof(tmp), " %s: 0\n", m_signalNames[i].c_str());
snprintf(tmp, sizeof(tmp), " %-20s 0\n", (m_signalNames[i] + ":").c_str());
else
{
if(idmap.find(chan) == idmap.end())
@@ -608,7 +608,7 @@ string ProtocolDecoder::SerializeConfiguration(std::map<void*, int>& idmap, int&
}

//Parameters
snprintf(tmp, sizeof(tmp), " parameters: %%\n");
snprintf(tmp, sizeof(tmp), " parameters: \n");
config += tmp;
for(auto it : m_parameters)
{