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

Commits on Mar 22, 2020

  1. Copy the full SHA
    5589b27 View commit details
Showing with 12 additions and 3 deletions.
  1. +7 −2 glscopeclient/OscilloscopeWindow.cpp
  2. +5 −1 glscopeclient/ProtocolDecoderDialog.cpp
9 changes: 7 additions & 2 deletions glscopeclient/OscilloscopeWindow.cpp
Original file line number Diff line number Diff line change
@@ -750,15 +750,20 @@ void OscilloscopeWindow::LoadDecodes(const YAML::Node& node, IDTable& table)
auto decode = ProtocolDecoder::CreateDecoder(dnode["protocol"].as<string>(), dnode["color"].as<string>());
table.emplace(dnode["id"].as<int>(), decode);
m_decoders.emplace(decode);

//Load parameters during the first pass.
//Parameters can't have dependencies on other channels etc.
//More importantly, parameters may change bus width etc
decode->LoadParameters(dnode, table);
}

//Make a second pass to configure the decodes, once all of them have been instantiated.
//Make a second pass to configure the decoder inputs, once all of them have been instantiated.
//Decoders may depend on other decoders as inputs, and serialization is not guaranteed to be a topological sort.
for(auto it : node)
{
auto dnode = it.second;
auto decode = static_cast<ProtocolDecoder*>(table[dnode["id"].as<int>()]);
decode->LoadConfiguration(dnode, table);
decode->LoadInputs(dnode, table);
}
}

6 changes: 5 additions & 1 deletion glscopeclient/ProtocolDecoderDialog.cpp
Original file line number Diff line number Diff line change
@@ -71,6 +71,10 @@ ProtocolDecoderDialog::ProtocolDecoderDialog(
row->m_chans.append("NULL");
row->m_chanptrs["NULL"] = NULL;

//Handle null inputs
if(decoder->GetInput(i) == NULL)
row->m_chans.set_active_text("NULL");

//Fill the channel list with all channels that are legal to use here
for(size_t j=0; j<parent->GetScopeCount(); j++)
{
@@ -82,7 +86,7 @@ ProtocolDecoderDialog::ProtocolDecoderDialog(
{
row->m_chans.append(c->m_displayname);
row->m_chanptrs[c->m_displayname] = c;
if( (c == chan) || (c == decoder->GetInput(i)) )
if( (c == chan && i==0) || (c == decoder->GetInput(i)) )
row->m_chans.set_active_text(c->m_displayname);
}
}