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

Commits on Mar 14, 2020

  1. Copy the full SHA
    583c6a9 View commit details
Showing with 20 additions and 6 deletions.
  1. +2 −2 scopehal/Measurement.cpp
  2. +8 −4 scopehal/Oscilloscope.cpp
  3. +10 −0 scopehal/ProtocolDecoder.cpp
4 changes: 2 additions & 2 deletions scopehal/Measurement.cpp
Original file line number Diff line number Diff line change
@@ -570,7 +570,7 @@ string Measurement::SerializeConfiguration(IDTable& table, string nick)
{
//Save basic info
char tmp[1024];
snprintf(tmp, sizeof(tmp), " : %%\n");
snprintf(tmp, sizeof(tmp), " : \n");
string config = tmp;
snprintf(tmp, sizeof(tmp), " id: %d\n", table.emplace(this));
config += tmp;
@@ -582,7 +582,7 @@ string Measurement::SerializeConfiguration(IDTable& table, string nick)
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++)
{
12 changes: 8 additions & 4 deletions scopehal/Oscilloscope.cpp
Original file line number Diff line number Diff line change
@@ -323,9 +323,13 @@ void Oscilloscope::LoadConfiguration(const YAML::Node& node, IDTable& table)
else if(coupling == "gnd")
chan->SetCoupling(OscilloscopeChannel::COUPLE_GND);

chan->SetAttenuation(cnode["attenuation"].as<float>());
chan->SetBandwidthLimit(cnode["bwlimit"].as<int>());
chan->SetVoltageRange(cnode["vrange"].as<float>());
chan->SetOffset(cnode["offset"].as<float>());
//only load gain/offset for actual inputs
if(chan->GetType() == OscilloscopeChannel::CHANNEL_TYPE_ANALOG)
{
chan->SetAttenuation(cnode["attenuation"].as<float>());
chan->SetBandwidthLimit(cnode["bwlimit"].as<int>());
chan->SetVoltageRange(cnode["vrange"].as<float>());
chan->SetOffset(cnode["offset"].as<float>());
}
}
}
10 changes: 10 additions & 0 deletions scopehal/ProtocolDecoder.cpp
Original file line number Diff line number Diff line change
@@ -556,7 +556,17 @@ void ProtocolDecoder::FindZeroCrossings(AnalogCapture* data, float threshold, st

void ProtocolDecoder::LoadConfiguration(const YAML::Node& node, IDTable& table)
{
//id, protocol, color are already loaded
m_displayname = node["nick"].as<string>();
m_hwname = node["name"].as<string>();

auto inputs = node["inputs"];
for(auto it : inputs)
SetInput(it.first.as<string>(), static_cast<OscilloscopeChannel*>(table[it.second.as<int>()]) );

auto parameters = node["parameters"];
for(auto it : parameters)
GetParameter(it.first.as<string>()).ParseString(it.second.as<string>());
}

string ProtocolDecoder::SerializeConfiguration(IDTable& table)