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: 1a85e3e59181
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: edc17a50b2c4
Choose a head ref
  • 1 commit
  • 5 files changed
  • 1 contributor

Commits on Mar 2, 2020

  1. Setup menu finally does something! Added a trigger submenu with an en…

    …try for each scope that pops up a trigger-properties dialog. No actual content yet.
    azonenberg committed Mar 2, 2020
    Copy the full SHA
    edc17a5 View commit details
1 change: 1 addition & 0 deletions glscopeclient/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -17,6 +17,7 @@ add_executable(glscopeclient
ShaderStorageBuffer.cpp
Texture.cpp
Timeline.cpp
TriggerPropertiesDialog.cpp
VertexArray.cpp
VertexBuffer.cpp
WaveformArea.cpp
21 changes: 21 additions & 0 deletions glscopeclient/OscilloscopeWindow.cpp
Original file line number Diff line number Diff line change
@@ -36,6 +36,7 @@
#include "glscopeclient.h"
#include "../scopehal/Instrument.h"
#include "OscilloscopeWindow.h"
#include "TriggerPropertiesDialog.h"
#include <unistd.h>
#include <fcntl.h>
#include <map>
@@ -174,6 +175,9 @@ void OscilloscopeWindow::CreateWidgets()
m_menu.append(m_setupMenuItem);
m_setupMenuItem.set_label("Setup");
m_setupMenuItem.set_submenu(m_setupMenu);
m_setupMenu.append(m_setupTriggerMenuItem);
m_setupTriggerMenuItem.set_label("Trigger");
m_setupTriggerMenuItem.set_submenu(m_setupTriggerMenu);
m_menu.append(m_viewMenuItem);
m_viewMenuItem.set_label("View");
m_viewMenuItem.set_submenu(m_viewMenu);
@@ -320,6 +324,15 @@ void OscilloscopeWindow::CreateWidgets()
}
}

//Add trigger config menu items for each scope
for(auto scope : m_scopes)
{
item = Gtk::manage(new Gtk::MenuItem(scope->m_nickname, false));
item->signal_activate().connect(
sigc::bind<Oscilloscope*>(sigc::mem_fun(*this, &OscilloscopeWindow::OnTriggerProperties), scope));
m_setupTriggerMenu.append(*item);
}

m_channelsMenu.show_all();

m_historyWindow.hide();
@@ -726,6 +739,14 @@ void OscilloscopeWindow::OnAlphaChanged()
ClearAllPersistence();
}

void OscilloscopeWindow::OnTriggerProperties(Oscilloscope* scope)
{
TriggerPropertiesDialog dlg(this, scope);
if(Gtk::RESPONSE_OK != dlg.run())
return;
dlg.ConfigureTrigger();
}

void OscilloscopeWindow::OnEyeColorChanged(EyeColor color, Gtk::RadioMenuItem* item)
{
if(!item->get_active())
3 changes: 3 additions & 0 deletions glscopeclient/OscilloscopeWindow.h
Original file line number Diff line number Diff line change
@@ -137,6 +137,8 @@ class OscilloscopeWindow : public Gtk::Window
Gtk::Menu m_fileMenu;
Gtk::MenuItem m_setupMenuItem;
Gtk::Menu m_setupMenu;
Gtk::MenuItem m_setupTriggerMenuItem;
Gtk::Menu m_setupTriggerMenu;
Gtk::MenuItem m_channelsMenuItem;
Gtk::Menu m_channelsMenu;
Gtk::MenuItem m_viewMenuItem;
@@ -185,6 +187,7 @@ class OscilloscopeWindow : public Gtk::Window
//Menu event handlers
void OnFileSave(bool saveToCurrentFile, bool saveLayout, bool saveWaveforms);
void OnEyeColorChanged(EyeColor color, Gtk::RadioMenuItem* item);
void OnTriggerProperties(Oscilloscope* scope);

Glib::RefPtr<Gtk::CssProvider> m_css;

103 changes: 103 additions & 0 deletions glscopeclient/TriggerPropertiesDialog.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
/***********************************************************************************************************************
* *
* ANTIKERNEL v0.1 *
* *
* Copyright (c) 2012-2020 Andrew D. Zonenberg *
* All rights reserved. *
* *
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the *
* following conditions are met: *
* *
* * Redistributions of source code must retain the above copyright notice, this list of conditions, and the *
* following disclaimer. *
* *
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the *
* following disclaimer in the documentation and/or other materials provided with the distribution. *
* *
* * Neither the name of the author nor the names of any contributors may be used to endorse or promote products *
* derived from this software without specific prior written permission. *
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL *
* THE AUTHORS BE HELD LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR *
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE *
* POSSIBILITY OF SUCH DAMAGE. *
* *
***********************************************************************************************************************/

/**
@file
@author Andrew D. Zonenberg
@brief Implementation of TriggerPropertiesDialog
*/
#include "glscopeclient.h"
#include "OscilloscopeWindow.h"
#include "TriggerPropertiesDialog.h"

using namespace std;

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Construction / destruction

TriggerPropertiesDialog::TriggerPropertiesDialog(
OscilloscopeWindow* parent,
Oscilloscope* scope)
: Gtk::Dialog(string("Trigger properties"), *parent, Gtk::DIALOG_MODAL)
, m_scope(scope)
{
add_button("OK", Gtk::RESPONSE_OK);
add_button("Cancel", Gtk::RESPONSE_CANCEL);

char buf[128];

get_vbox()->pack_start(m_scopeNameBox, Gtk::PACK_SHRINK);
m_scopeNameBox.pack_start(m_scopeNameLabel, Gtk::PACK_SHRINK);
m_scopeNameLabel.set_text("Scope");
m_scopeNameBox.pack_start(m_scopeNameEntry, Gtk::PACK_EXPAND_WIDGET);
m_scopeNameLabel.set_size_request(150, 1);
m_scopeNameLabel.set_halign(Gtk::ALIGN_START);
m_scopeNameEntry.set_halign(Gtk::ALIGN_START);
snprintf(buf, sizeof(buf), "%s (%s, serial %s)",
scope->m_nickname.c_str(),
scope->GetName().c_str(),
scope->GetSerial().c_str());
m_scopeNameEntry.set_text(buf);

/*
get_vbox()->pack_start(m_channelNameBox, Gtk::PACK_SHRINK);
m_channelNameBox.pack_start(m_channelNameLabel, Gtk::PACK_SHRINK);
m_channelNameLabel.set_text("Trigger");
m_channelNameBox.pack_start(m_channelNameEntry, Gtk::PACK_EXPAND_WIDGET);
m_channelNameLabel.set_size_request(150, 1);
m_channelNameLabel.set_halign(Gtk::ALIGN_START);
m_channelNameEntry.set_text(chan->GetHwname());
m_channelNameEntry.set_halign(Gtk::ALIGN_START);
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(chan->m_displayname);
*/
show_all();
}

TriggerPropertiesDialog::~TriggerPropertiesDialog()
{

}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Output

void TriggerPropertiesDialog::ConfigureTrigger()
{
//m_chan->m_displayname = m_channelDisplayNameEntry.get_text();
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Event handlers
67 changes: 67 additions & 0 deletions glscopeclient/TriggerPropertiesDialog.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/***********************************************************************************************************************
* *
* ANTIKERNEL v0.1 *
* *
* Copyright (c) 2012-2020 Andrew D. Zonenberg *
* All rights reserved. *
* *
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the *
* following conditions are met: *
* *
* * Redistributions of source code must retain the above copyright notice, this list of conditions, and the *
* following disclaimer. *
* *
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the *
* following disclaimer in the documentation and/or other materials provided with the distribution. *
* *
* * Neither the name of the author nor the names of any contributors may be used to endorse or promote products *
* derived from this software without specific prior written permission. *
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL *
* THE AUTHORS BE HELD LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR *
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE *
* POSSIBILITY OF SUCH DAMAGE. *
* *
***********************************************************************************************************************/

/**
@file
@author Andrew D. Zonenberg
@brief Dialog for configuring trigger properties
*/

#ifndef TriggerPropertiesDialog_h
#define TriggerPropertiesDialog_h

/**
@brief Dialog for configuring trigger settings for a scope
*/
class TriggerPropertiesDialog : public Gtk::Dialog
{
public:
TriggerPropertiesDialog(OscilloscopeWindow* parent, Oscilloscope* scope);
virtual ~TriggerPropertiesDialog();

void ConfigureTrigger();

protected:
Gtk::HBox m_scopeNameBox;
Gtk::Label m_scopeNameLabel;
Gtk::Label m_scopeNameEntry;

/*
Gtk::HBox m_channelNameBox;
Gtk::Label m_channelNameLabel;
Gtk::Label m_channelNameEntry;
Gtk::HBox m_channelDisplayNameBox;
Gtk::Label m_channelDisplayNameLabel;
Gtk::Entry m_channelDisplayNameEntry;
*/

Oscilloscope* m_scope;
};

#endif