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: 65879714bcbd
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: ebf06cd506e9
Choose a head ref
  • 1 commit
  • 4 files changed
  • 1 contributor

Commits on Oct 1, 2020

  1. Copy the full SHA
    ebf06cd View commit details
Showing with 41 additions and 18 deletions.
  1. +1 −1 lib
  2. +33 −15 src/glscopeclient/ChannelPropertiesDialog.cpp
  3. +5 −0 src/glscopeclient/ChannelPropertiesDialog.h
  4. +2 −2 src/glscopeclient/OscilloscopeWindow.cpp
2 changes: 1 addition & 1 deletion lib
48 changes: 33 additions & 15 deletions src/glscopeclient/ChannelPropertiesDialog.cpp
Original file line number Diff line number Diff line change
@@ -49,23 +49,26 @@ ChannelPropertiesDialog::ChannelPropertiesDialog(
, m_chan(chan)
, m_hasThreshold(false)
, m_hasHysteresis(false)
, m_hasFrequency(false)
{
add_button("OK", Gtk::RESPONSE_OK);
add_button("Cancel", Gtk::RESPONSE_CANCEL);

char buf[128];
auto scope = chan->GetScope();
auto index = chan->GetIndex();

Unit ps(Unit::UNIT_PS);
Unit volts(Unit::UNIT_VOLTS);
Unit hz(Unit::UNIT_HZ);

get_vbox()->pack_start(m_grid, Gtk::PACK_EXPAND_WIDGET);
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, 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_scopeNameEntry.set_text(
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");
@@ -95,20 +98,14 @@ ChannelPropertiesDialog::ChannelPropertiesDialog(
m_deskewLabel.set_halign(Gtk::ALIGN_START);
m_grid.attach_next_to(m_deskewEntry, m_deskewLabel, Gtk::POS_RIGHT, 1, 1);

Unit unit(Unit::UNIT_PS);
m_deskewEntry.set_text(unit.PrettyPrint(chan->GetDeskew()));
m_deskewEntry.set_text(ps.PrettyPrint(chan->GetDeskew()));

anchorLabel = &m_deskewLabel;
}

//Logic properties - only on physical digital channels
if(chan->IsPhysicalChannel() && chan->GetType() == (OscilloscopeChannel::CHANNEL_TYPE_DIGITAL) )
if(chan->IsPhysicalChannel() && (chan->GetType() == OscilloscopeChannel::CHANNEL_TYPE_DIGITAL) )
{
auto scope = chan->GetScope();
auto index = chan->GetIndex();

Unit volts(Unit::UNIT_VOLTS);

if(scope->IsDigitalThresholdConfigurable())
{
m_grid.attach_next_to(m_thresholdLabel, *anchorLabel, Gtk::POS_BOTTOM, 1, 1);
@@ -155,9 +152,26 @@ ChannelPropertiesDialog::ChannelPropertiesDialog(
}

m_groupList.set_headers_visible(false);

anchorLabel = &m_groupLabel;
}
}

//Spectrum properties - only on physical frequency domain channels
if(chan->IsPhysicalChannel() && (chan->GetXAxisUnits() == hz) )
{
m_grid.attach_next_to(m_centerLabel, *anchorLabel, Gtk::POS_BOTTOM, 1, 1);
m_centerLabel.set_text("Center Frequency");
m_centerLabel.set_halign(Gtk::ALIGN_START);
m_grid.attach_next_to(m_centerEntry, m_centerLabel, Gtk::POS_RIGHT, 1, 1);

anchorLabel = &m_centerLabel;

m_centerEntry.set_text(hz.PrettyPrint(scope->GetCenterFrequency(index)));

m_hasFrequency = true;
}

show_all();
}

@@ -175,14 +189,18 @@ void ChannelPropertiesDialog::ConfigureChannel()
m_chan->m_displaycolor = m_channelColorButton.get_color().to_string();

Unit volts(Unit::UNIT_VOLTS);
Unit ps(Unit::UNIT_PS);
Unit hz(Unit::UNIT_HZ);

if(m_hasThreshold)
m_chan->SetDigitalThreshold(volts.ParseString(m_thresholdEntry.get_text()));

if(m_hasHysteresis)
m_chan->SetDigitalHysteresis(volts.ParseString(m_hysteresisEntry.get_text()));

Unit ps(Unit::UNIT_PS);
if(m_hasFrequency)
m_chan->SetCenterFrequency(hz.ParseString(m_centerEntry.get_text()));

m_chan->SetDeskew(ps.ParseString(m_deskewEntry.get_text()));
}

5 changes: 5 additions & 0 deletions src/glscopeclient/ChannelPropertiesDialog.h
Original file line number Diff line number Diff line change
@@ -70,10 +70,15 @@ class ChannelPropertiesDialog : public Gtk::Dialog
Gtk::Label m_groupLabel;
Gtk::ListViewText m_groupList;

//Frequency domain channel configuration
Gtk::Label m_centerLabel;
Gtk::Entry m_centerEntry;

OscilloscopeChannel* m_chan;

bool m_hasThreshold;
bool m_hasHysteresis;
bool m_hasFrequency;
};

#endif
4 changes: 2 additions & 2 deletions src/glscopeclient/OscilloscopeWindow.cpp
Original file line number Diff line number Diff line change
@@ -2596,9 +2596,9 @@ void OscilloscopeWindow::OnAboutDialog()
"antikerneldev",
"Benjamin Vernoux",
"four0four",
"miek",
"Katharina B",
"Mike Walters",
"noopwafel",
"nshcat",
"Pepijn De Vos",
"randomplum",
"rqou",