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: a7273e479ba4
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: 06bfaf49c747
Choose a head ref
  • 2 commits
  • 3 files changed
  • 1 contributor

Commits on May 11, 2021

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    3386659 View commit details
  2. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    06bfaf4 View commit details
Showing with 27 additions and 5 deletions.
  1. +1 −1 lib
  2. +22 −4 src/glscopeclient/ChannelPropertiesDialog.cpp
  3. +4 −0 src/glscopeclient/ChannelPropertiesDialog.h
26 changes: 22 additions & 4 deletions src/glscopeclient/ChannelPropertiesDialog.cpp
Original file line number Diff line number Diff line change
@@ -72,13 +72,17 @@ ChannelPropertiesDialog::ChannelPropertiesDialog(
m_grid.attach_next_to(m_scopeNameEntry, m_scopeNameLabel, Gtk::POS_RIGHT, 1, 1);
m_scopeNameEntry.set_halign(Gtk::ALIGN_START);
m_scopeNameEntry.set_text(
scope->m_nickname + "(" + scope->GetName() + ", serial " + scope->GetSerial() + ")");
scope->m_nickname + " (" + scope->GetName() + ", serial " + scope->GetSerial() + ")");

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, 1, 1);
m_channelNameEntry.set_text(chan->GetHwname());
string probename = chan->GetProbeName();
if(probename.empty())
m_channelNameEntry.set_text(chan->GetHwname() + " (passive or no probe connected)");
else
m_channelNameEntry.set_text(chan->GetHwname() + " (" + probename + ")");
m_channelNameEntry.set_halign(Gtk::ALIGN_START);

m_grid.attach_next_to(m_channelDisplayNameLabel, m_channelNameLabel, Gtk::POS_BOTTOM, 1, 1);
@@ -194,11 +198,20 @@ ChannelPropertiesDialog::ChannelPropertiesDialog(
for(auto mode : modes)
m_adcModeBox.append(mode);
m_adcModeBox.set_active_text(modes[scope->GetADCMode(index)]);

anchorLabel = &m_adcModeLabel;

m_hasAdcMode = true;
}

if(scope->CanAutoZero(index))
{
m_grid.attach_next_to(m_autoZeroLabel, *anchorLabel, Gtk::POS_BOTTOM, 1, 1);
m_grid.attach_next_to(m_autoZeroButton, m_autoZeroLabel, Gtk::POS_RIGHT, 1, 1);
m_autoZeroButton.set_label("Auto Zero");
anchorLabel = &m_autoZeroLabel;

m_autoZeroButton.signal_clicked().connect(
sigc::mem_fun(*this, &ChannelPropertiesDialog::OnAutoZero));
}
}
break;

@@ -332,3 +345,8 @@ void ChannelPropertiesDialog::ConfigureChannel()

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Event handlers

void ChannelPropertiesDialog::OnAutoZero()
{
m_chan->AutoZero();
}
4 changes: 4 additions & 0 deletions src/glscopeclient/ChannelPropertiesDialog.h
Original file line number Diff line number Diff line change
@@ -68,6 +68,8 @@ class ChannelPropertiesDialog : public Gtk::Dialog
Gtk::Entry m_attenuationEntry;
Gtk::Label m_invertLabel;
Gtk::CheckButton m_invertButton;
Gtk::Label m_autoZeroLabel;
Gtk::Button m_autoZeroButton;

//Analog channel configuration
Gtk::Label m_bandwidthLabel;
@@ -101,6 +103,8 @@ class ChannelPropertiesDialog : public Gtk::Dialog
bool m_hasAttenuation;
bool m_hasAdcMode;
bool m_hasInvert;

void OnAutoZero();
};

#endif