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: 40835c185585
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: 29a5860cbcf5
Choose a head ref
  • 4 commits
  • 8 files changed
  • 1 contributor

Commits on May 24, 2020

  1. Copy the full SHA
    84dda9f View commit details
  2. Copy the full SHA
    5abb6df View commit details
  3. Copy the full SHA
    4342bdd View commit details
  4. Copy the full SHA
    29a5860 View commit details
1 change: 0 additions & 1 deletion glscopeclient/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -8,7 +8,6 @@ add_executable(glscopeclient
ChannelPropertiesDialog.cpp
Framebuffer.cpp
HistoryWindow.cpp
MeasurementDialog.cpp
OscilloscopeWindow.cpp
Program.cpp
ProtocolAnalyzerWindow.cpp
16 changes: 8 additions & 8 deletions glscopeclient/ChannelPropertiesDialog.cpp
Original file line number Diff line number Diff line change
@@ -53,34 +53,34 @@ ChannelPropertiesDialog::ChannelPropertiesDialog(
char buf[128];

get_vbox()->pack_start(m_grid, Gtk::PACK_EXPAND_WIDGET);
m_grid.attach(m_scopeNameLabel, 0, 0);
m_grid.attach(m_scopeNameLabel, 0, 0, 1, 1);
m_scopeNameLabel.set_text("Scope");
m_scopeNameLabel.set_halign(Gtk::ALIGN_START);
m_grid.attach_next_to(m_scopeNameEntry, m_scopeNameLabel, Gtk::POS_RIGHT);
m_grid.attach_next_to(m_scopeNameEntry, m_scopeNameLabel, Gtk::POS_RIGHT, 1, 1);
m_scopeNameEntry.set_halign(Gtk::ALIGN_START);
snprintf(buf, sizeof(buf), "%s (%s, serial %s)",
chan->GetScope()->m_nickname.c_str(),
chan->GetScope()->GetName().c_str(),
chan->GetScope()->GetSerial().c_str());
m_scopeNameEntry.set_text(buf);

m_grid.attach_next_to(m_channelNameLabel, m_scopeNameLabel, Gtk::POS_BOTTOM);
m_grid.attach_next_to(m_channelNameLabel, m_scopeNameLabel, Gtk::POS_BOTTOM, 1, 1);
m_channelNameLabel.set_text("Channel");
m_channelNameLabel.set_halign(Gtk::ALIGN_START);
m_grid.attach_next_to(m_channelNameEntry, m_channelNameLabel, Gtk::POS_RIGHT);
m_grid.attach_next_to(m_channelNameEntry, m_channelNameLabel, Gtk::POS_RIGHT, 1, 1);
m_channelNameEntry.set_text(chan->GetHwname());
m_channelNameEntry.set_halign(Gtk::ALIGN_START);

m_grid.attach_next_to(m_channelDisplayNameLabel, m_channelNameLabel, Gtk::POS_BOTTOM);
m_grid.attach_next_to(m_channelDisplayNameLabel, m_channelNameLabel, Gtk::POS_BOTTOM, 1, 1);
m_channelDisplayNameLabel.set_text("Display name");
m_channelDisplayNameLabel.set_halign(Gtk::ALIGN_START);
m_grid.attach_next_to(m_channelDisplayNameEntry, m_channelDisplayNameLabel, Gtk::POS_RIGHT);
m_grid.attach_next_to(m_channelDisplayNameEntry, m_channelDisplayNameLabel, Gtk::POS_RIGHT, 1, 1);
m_channelDisplayNameEntry.set_text(chan->m_displayname);

m_grid.attach_next_to(m_channelColorLabel, m_channelDisplayNameLabel, Gtk::POS_BOTTOM);
m_grid.attach_next_to(m_channelColorLabel, m_channelDisplayNameLabel, Gtk::POS_BOTTOM, 1, 1);
m_channelColorLabel.set_text("Waveform color");
m_channelColorLabel.set_halign(Gtk::ALIGN_START);
m_grid.attach_next_to(m_channelColorButton, m_channelColorLabel, Gtk::POS_RIGHT);
m_grid.attach_next_to(m_channelColorButton, m_channelColorLabel, Gtk::POS_RIGHT, 1, 1);
m_channelColorButton.set_color(Gdk::Color(chan->m_displaycolor));

show_all();
146 changes: 0 additions & 146 deletions glscopeclient/MeasurementDialog.cpp

This file was deleted.

59 changes: 0 additions & 59 deletions glscopeclient/MeasurementDialog.h

This file was deleted.

34 changes: 23 additions & 11 deletions glscopeclient/ProtocolDecoderDialog.cpp
Original file line number Diff line number Diff line change
@@ -43,7 +43,7 @@ ProtocolDecoderDialog::ProtocolDecoderDialog(
OscilloscopeWindow* parent,
ProtocolDecoder* decoder,
OscilloscopeChannel* chan)
: Gtk::Dialog("Protocol Decode", *parent, Gtk::DIALOG_MODAL)
: Gtk::Dialog(decoder->GetProtocolDisplayName(), *parent, Gtk::DIALOG_MODAL)
, m_decoder(decoder)
{
add_button("OK", Gtk::RESPONSE_OK);
@@ -52,20 +52,28 @@ ProtocolDecoderDialog::ProtocolDecoderDialog(
//hide close button to force user to pick OK or cancel
set_deletable(false);

get_vbox()->pack_start(m_channelDisplayNameBox, Gtk::PACK_SHRINK);
m_channelDisplayNameBox.pack_start(m_channelDisplayNameLabel, Gtk::PACK_SHRINK);
m_channelDisplayNameLabel.set_text("Display name");
m_channelDisplayNameBox.pack_start(m_channelDisplayNameEntry, Gtk::PACK_EXPAND_WIDGET);
m_channelDisplayNameLabel.set_size_request(150, 1);
m_channelDisplayNameLabel.set_halign(Gtk::ALIGN_START);
m_channelDisplayNameEntry.set_text(decoder->m_displayname);
get_vbox()->pack_start(m_grid, Gtk::PACK_EXPAND_WIDGET);
m_grid.attach(m_channelDisplayNameLabel, 0, 0, 1, 1);
m_channelDisplayNameLabel.set_text("Display name");
m_grid.attach_next_to(m_channelDisplayNameEntry, m_channelDisplayNameLabel, Gtk::POS_RIGHT, 1, 1);
m_channelDisplayNameLabel.set_halign(Gtk::ALIGN_START);
m_channelDisplayNameEntry.set_text(decoder->m_displayname);

m_grid.attach_next_to(m_channelColorLabel, m_channelDisplayNameLabel, Gtk::POS_BOTTOM, 1, 1);
m_channelColorLabel.set_text("Waveform color");
m_channelColorLabel.set_halign(Gtk::ALIGN_START);
m_grid.attach_next_to(m_channelColorButton, m_channelColorLabel, Gtk::POS_RIGHT, 1, 1);
m_channelColorButton.set_color(Gdk::Color(decoder->m_displaycolor));

Gtk::Widget* last_label = &m_channelColorLabel;
for(size_t i=0; i<decoder->GetInputCount(); i++)
{
//Add the row
auto row = new ChannelSelectorRow;
get_vbox()->pack_start(row->m_box, Gtk::PACK_SHRINK);
m_grid.attach_next_to(row->m_label, *last_label, Gtk::POS_BOTTOM, 1, 1);
m_grid.attach_next_to(row->m_chans, row->m_label, Gtk::POS_RIGHT, 1, 1);
m_rows.push_back(row);
last_label = &row->m_label;

//Label is just the channel name
row->m_label.set_label(decoder->GetInputName(i));
@@ -114,15 +122,16 @@ ProtocolDecoderDialog::ProtocolDecoderDialog(
for(auto it = decoder->GetParamBegin(); it != decoder->GetParamEnd(); it ++)
{
auto row = new ParameterRow;
get_vbox()->pack_start(row->m_box, Gtk::PACK_SHRINK);
m_grid.attach_next_to(row->m_label, *last_label, Gtk::POS_BOTTOM, 1, 1);
m_grid.attach_next_to(row->m_entry, row->m_label, Gtk::POS_RIGHT, 1, 1);
last_label = &row->m_label;
m_prows.push_back(row);

row->m_label.set_label(it->first);

//Set initial value
row->m_entry.set_text(it->second.ToString());
}

show_all();
}

@@ -152,8 +161,11 @@ void ProtocolDecoderDialog::ConfigureDecoder()
m_prows[i]->m_entry.get_text());
}

m_decoder->m_displaycolor = m_channelColorButton.get_color().to_string();

//Set the name of the decoder based on the input channels etc
//TODO: do this any time we change an input or configure stuff
//(we should have a "default name" flag)
m_decoder->SetDefaultName();
auto dname = m_channelDisplayNameEntry.get_text();
if(dname != "")
34 changes: 8 additions & 26 deletions glscopeclient/ProtocolDecoderDialog.h
Original file line number Diff line number Diff line change
@@ -43,37 +43,17 @@
class ChannelSelectorRow
{
public:
ChannelSelectorRow()
{
m_box.pack_start(m_label, Gtk::PACK_SHRINK);
m_box.pack_start(m_chans, Gtk::PACK_EXPAND_WIDGET);
m_label.set_size_request(150, 1);
m_label.set_halign(Gtk::ALIGN_END);
m_chans.set_size_request(100, 1);
}

Gtk::HBox m_box;
Gtk::Label m_label;
Gtk::ComboBoxText m_chans;
Gtk::Label m_label;
Gtk::ComboBoxText m_chans;

std::map<std::string, OscilloscopeChannel*> m_chanptrs;
};

class ParameterRow
{
public:
ParameterRow()
{
m_box.pack_start(m_label, Gtk::PACK_SHRINK);
m_box.pack_start(m_entry, Gtk::PACK_EXPAND_WIDGET);
m_label.set_size_request(150, 1);
m_label.set_halign(Gtk::ALIGN_END);
m_entry.set_size_request(100, 1);
}

Gtk::HBox m_box;
Gtk::Label m_label;
Gtk::Entry m_entry;
Gtk::Label m_label;
Gtk::Entry m_entry;
};

/**
@@ -90,9 +70,11 @@ class ProtocolDecoderDialog : public Gtk::Dialog
protected:
ProtocolDecoder* m_decoder;

Gtk::HBox m_channelDisplayNameBox;
Gtk::Grid m_grid;
Gtk::Label m_channelDisplayNameLabel;
Gtk::Entry m_channelDisplayNameEntry;
Gtk::Entry m_channelDisplayNameEntry;
Gtk::Label m_channelColorLabel;
Gtk::ColorButton m_channelColorButton;

std::vector<ChannelSelectorRow*> m_rows;
std::vector<ParameterRow*> m_prows;
Loading