Skip to content

Commit

Permalink
TriggerPropertiesDialog: now provide control of trigger offset. See #12.
Browse files Browse the repository at this point in the history
  • Loading branch information
azonenberg committed Sep 16, 2020
1 parent c3964ab commit 5488366
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/glscopeclient/TriggerPropertiesDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,14 @@ TriggerPropertiesDialog::TriggerPropertiesDialog(
m_triggerTypeBox.signal_changed().connect(
sigc::mem_fun(*this, &TriggerPropertiesDialog::OnTriggerTypeChanged));

//Trigger horizontal offset
Unit ps(Unit::UNIT_PS);
m_grid.attach_next_to(m_triggerOffsetLabel, m_triggerTypeLabel, Gtk::POS_BOTTOM, 1, 1);
m_triggerOffsetLabel.set_text("Trigger Offset");
m_grid.attach_next_to(m_triggerOffsetEntry, m_triggerOffsetLabel, Gtk::POS_RIGHT, 1, 1);
auto offset = m_scope->GetTriggerOffset();
m_triggerOffsetEntry.set_text(ps.PrettyPrint(offset));

//Actual content
get_vbox()->pack_start(m_contentGrid, Gtk::PACK_SHRINK);
AddRows(trig);
Expand Down Expand Up @@ -120,6 +128,10 @@ void TriggerPropertiesDialog::ConfigureTrigger()

//and feed it to the scope
m_scope->SetTrigger(trig);

//Also, set the trigger offset
Unit ps(Unit::UNIT_PS);
m_scope->SetTriggerOffset(ps.ParseString(m_triggerOffsetEntry.get_text()));
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down
2 changes: 2 additions & 0 deletions src/glscopeclient/TriggerPropertiesDialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ class TriggerPropertiesDialog : public Gtk::Dialog
Gtk::Label m_scopeNameEntry;
Gtk::Label m_triggerTypeLabel;
Gtk::ComboBoxText m_triggerTypeBox;
Gtk::Label m_triggerOffsetLabel;
Gtk::Entry m_triggerOffsetEntry;
Gtk::Grid m_contentGrid;

Oscilloscope* m_scope;
Expand Down

0 comments on commit 5488366

Please sign in to comment.