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: 19e8b03db98f
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: 11453b8e81d5
Choose a head ref
  • 1 commit
  • 2 files changed
  • 1 contributor

Commits on Sep 7, 2020

  1. ProtocolAnalyzerWindow: laid initial groundwork for display filters (…

    …see #168). No actual filtering is performed, but the m_visible bit now controls row visibility.
    azonenberg committed Sep 7, 2020
    Copy the full SHA
    11453b8 View commit details
Showing with 9 additions and 4 deletions.
  1. +7 −4 src/glscopeclient/ProtocolAnalyzerWindow.cpp
  2. +2 −0 src/glscopeclient/ProtocolAnalyzerWindow.h
11 changes: 7 additions & 4 deletions src/glscopeclient/ProtocolAnalyzerWindow.cpp
Original file line number Diff line number Diff line change
@@ -44,6 +44,8 @@ using namespace std;

ProtocolAnalyzerColumns::ProtocolAnalyzerColumns(PacketDecoder* decoder)
{
add(m_visible);
add(m_color);
add(m_timestamp);
add(m_capturekey);
add(m_offset);
@@ -57,7 +59,6 @@ ProtocolAnalyzerColumns::ProtocolAnalyzerColumns(PacketDecoder* decoder)

add(m_image);
add(m_data);
add(m_color);
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -84,7 +85,9 @@ ProtocolAnalyzerWindow::ProtocolAnalyzerWindow(

//Set up the tree view
m_model = Gtk::TreeStore::create(m_columns);
m_tree.set_model(m_model);
m_filtermodel = Gtk::TreeModelFilter::create(m_model);
m_tree.set_model(m_filtermodel);
m_filtermodel->set_visible_column(m_columns.m_visible);

//Add the columns
m_tree.append_column("Time", m_columns.m_timestamp);
@@ -100,13 +103,12 @@ ProtocolAnalyzerWindow::ProtocolAnalyzerWindow(

//Set background color
int ncols = headers.size() + 2;
int ncolorcol = m_columns.size() - 1;
for(int col=0; col<ncols; col ++)
{
auto pcol = m_tree.get_column(col);
vector<Gtk::CellRenderer*> cells = pcol->get_cells();
for(auto c : cells)
pcol->add_attribute(*c, "background-gdk", ncolorcol);
pcol->add_attribute(*c, "background-gdk", 1); //column 1 is color
}

m_tree.get_selection()->signal_changed().connect(
@@ -216,6 +218,7 @@ void ProtocolAnalyzerWindow::FillOutRow(
row[m_columns.m_timestamp] = stime;
row[m_columns.m_capturekey] = TimePoint(data->m_startTimestamp, data->m_startPicoseconds);
row[m_columns.m_offset] = p->m_offset;
row[m_columns.m_visible] = true;

//Just copy headers without any processing
for(size_t i=0; i<headers.size(); i++)
2 changes: 2 additions & 0 deletions src/glscopeclient/ProtocolAnalyzerWindow.h
Original file line number Diff line number Diff line change
@@ -53,6 +53,7 @@ class ProtocolAnalyzerColumns : public Gtk::TreeModel::ColumnRecord
Gtk::TreeModelColumn<Glib::ustring> m_data;
Gtk::TreeModelColumn<Glib::RefPtr<Gdk::Pixbuf>> m_image;
Gtk::TreeModelColumn<Gdk::Color> m_color;
Gtk::TreeModelColumn<bool> m_visible;
};

/**
@@ -75,6 +76,7 @@ class ProtocolAnalyzerWindow : public Gtk::Dialog
Gtk::ScrolledWindow m_scroller;
Gtk::TreeView m_tree;
Glib::RefPtr<Gtk::TreeStore> m_model;
Glib::RefPtr<Gtk::TreeModelFilter> m_filtermodel;
ProtocolAnalyzerColumns m_columns;

void OnSelectionChanged();