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: 361221f5263e
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: e2efbc9dcd55
Choose a head ref
  • 1 commit
  • 3 files changed
  • 1 contributor

Commits on Oct 9, 2020

  1. Copy the full SHA
    e2efbc9 View commit details
Showing with 25 additions and 0 deletions.
  1. +16 −0 src/glscopeclient/OscilloscopeWindow.cpp
  2. +6 −0 src/glscopeclient/WaveformArea.cpp
  3. +3 −0 src/glscopeclient/WaveformArea_events.cpp
16 changes: 16 additions & 0 deletions src/glscopeclient/OscilloscopeWindow.cpp
Original file line number Diff line number Diff line change
@@ -2565,6 +2565,22 @@ void OscilloscopeWindow::RefreshChannelsMenu()
}
}

//Add filters
auto filters = Filter::GetAllInstances();
for(auto f : filters)
{
//For now, only add ones that are not overlays.
//TODO: we want to be able to add overlays, but how do we decide where to attach them??
if(f->IsOverlay())
continue;

auto item = Gtk::manage(new Gtk::MenuItem(f->GetDisplayName(), false));
item->signal_activate().connect(
sigc::bind<StreamDescriptor>(sigc::mem_fun(*this, &OscilloscopeWindow::OnAddChannel),
StreamDescriptor(f, 0) ));
m_channelsMenu.append(*item);
}

m_channelsMenu.show_all();
}

6 changes: 6 additions & 0 deletions src/glscopeclient/WaveformArea.cpp
Original file line number Diff line number Diff line change
@@ -131,6 +131,9 @@ WaveformArea::~WaveformArea()
{
m_channel.m_channel->Release();

//Need to reload the menu in case we deleted the last reference to this channel
m_parent->RefreshChannelsMenu();

for(auto d : m_overlays)
OnRemoveOverlay(d);
m_overlays.clear();
@@ -156,6 +159,9 @@ void WaveformArea::OnRemoveOverlay(StreamDescriptor filter)
m_overlayRenderData.erase(it);

filter.m_channel->Release();

//Need to reload the menu in case we deleted the last reference to this overlay
m_parent->RefreshChannelsMenu();
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
3 changes: 3 additions & 0 deletions src/glscopeclient/WaveformArea_events.cpp
Original file line number Diff line number Diff line change
@@ -1011,6 +1011,9 @@ void WaveformArea::OnDecodeSetupComplete()

SetGeometryDirty();
queue_draw();

//Refresh the channels menu with the new channel name etc
m_parent->RefreshChannelsMenu();
}

void WaveformArea::OnBandwidthLimit(int mhz, Gtk::RadioMenuItem* item)