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: b9d6dcbb14cb
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: 5a5c289c9e9d
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on May 16, 2020

  1. Copy the full SHA
    5a5c289 View commit details
Showing with 27 additions and 4 deletions.
  1. +27 −4 glscopeclient/OscilloscopeWindow.cpp
31 changes: 27 additions & 4 deletions glscopeclient/OscilloscopeWindow.cpp
Original file line number Diff line number Diff line change
@@ -835,7 +835,20 @@ void OscilloscopeWindow::LoadDecodes(const YAML::Node& node, IDTable& table)
auto dnode = it.second;

//Create the decode
auto decode = ProtocolDecoder::CreateDecoder(dnode["protocol"].as<string>(), dnode["color"].as<string>());
auto proto = dnode["protocol"].as<string>();
auto decode = ProtocolDecoder::CreateDecoder(proto, dnode["color"].as<string>());
if(decode == NULL)
{
Gtk::MessageDialog dlg(
string("Unable to create filter \"") + proto + "\". Skipping...\n",
false,
Gtk::MESSAGE_ERROR,
Gtk::BUTTONS_OK,
true);
dlg.run();
continue;
}

table.emplace(dnode["id"].as<int>(), decode);
m_decoders.emplace(decode);

@@ -851,7 +864,8 @@ void OscilloscopeWindow::LoadDecodes(const YAML::Node& node, IDTable& table)
{
auto dnode = it.second;
auto decode = static_cast<ProtocolDecoder*>(table[dnode["id"].as<int>()]);
decode->LoadInputs(dnode, table);
if(decode)
decode->LoadInputs(dnode, table);
}
}

@@ -870,15 +884,22 @@ void OscilloscopeWindow::LoadUIConfiguration(const YAML::Node& node, IDTable& ta
{
//Load the area itself
auto an = it.second;
WaveformArea* area = new WaveformArea(static_cast<OscilloscopeChannel*>(table[an["channel"].as<int>()]), this);
auto channel = static_cast<OscilloscopeChannel*>(table[an["channel"].as<int>()]);
if(!channel) //don't crash on bad IDs or missing decodes
continue;
WaveformArea* area = new WaveformArea(channel, this);
table.emplace(an["id"].as<int>(), area);
area->SetPersistenceEnabled(an["persistence"].as<int>() ? true : false);
m_waveformAreas.emplace(area);

//Add any overlays
auto overlays = an["overlays"];
for(auto jt : overlays)
area->AddOverlay(static_cast<ProtocolDecoder*>(table[jt.second["id"].as<int>()]));
{
auto decode = static_cast<ProtocolDecoder*>(table[jt.second["id"].as<int>()]);
if(decode)
area->AddOverlay(decode);
}
}

//Waveform groups
@@ -940,6 +961,8 @@ void OscilloscopeWindow::LoadUIConfiguration(const YAML::Node& node, IDTable& ta
for(auto at : areas)
{
auto area = static_cast<WaveformArea*>(table[at.second["id"].as<int>()]);
if(!area)
continue;
area->m_group = group;
if(area->GetChannel()->GetType() == OscilloscopeChannel::CHANNEL_TYPE_DIGITAL)
group->m_waveformBox.pack_start(*area, Gtk::PACK_SHRINK);