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: 8f47d72b4f0e
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: 71c265f2f10b
Choose a head ref
  • 2 commits
  • 6 files changed
  • 1 contributor

Commits on May 10, 2020

  1. Removed dead example code

    azonenberg committed May 10, 2020

    Verified

    This commit was signed with the committer’s verified signature.
    makenowjust Hiroya Fujinami
    Copy the full SHA
    2bddc44 View commit details
  2. Updated WaveformArea context menu to put decoder categories at top le…

    …vel of context menu instead of under a "decode" menu
    azonenberg committed May 10, 2020
    Copy the full SHA
    71c265f View commit details
Showing with 77 additions and 243 deletions.
  1. +0 −21 examples/freqresp/CMakeLists.txt
  2. +0 −168 examples/freqresp/main.cpp
  3. +27 −27 glscopeclient/WaveformArea.cpp
  4. +16 −18 glscopeclient/WaveformArea.h
  5. +13 −4 glscopeclient/WaveformArea_events.cpp
  6. +21 −5 glscopeclient/WaveformArea_rendering.cpp
21 changes: 0 additions & 21 deletions examples/freqresp/CMakeLists.txt

This file was deleted.

168 changes: 0 additions & 168 deletions examples/freqresp/main.cpp

This file was deleted.

54 changes: 27 additions & 27 deletions glscopeclient/WaveformArea.cpp
Original file line number Diff line number Diff line change
@@ -332,33 +332,30 @@ void WaveformArea::CreateWidgets()
m_contextMenu.append(*Gtk::manage(new Gtk::SeparatorMenuItem));

//Decode
m_contextMenu.append(m_decodeItem);
m_decodeItem.set_label("Filter");
m_decodeItem.set_submenu(m_decodeMenu);
m_decodeMenu.append(m_decodeAnalysisItem);
m_decodeAnalysisItem.set_label("Analysis");
m_decodeAnalysisItem.set_submenu(m_decodeAnalysisMenu);
m_decodeMenu.append(m_decodeClockItem);
m_decodeClockItem.set_label("Clocking");
m_decodeClockItem.set_submenu(m_decodeClockMenu);
m_decodeMenu.append(m_decodeConversionItem);
m_decodeConversionItem.set_label("Conversion");
m_decodeConversionItem.set_submenu(m_decodeConversionMenu);
m_decodeMenu.append(m_decodeMathItem);
m_decodeMathItem.set_label("Math");
m_decodeMathItem.set_submenu(m_decodeMathMenu);
m_decodeMenu.append(m_decodeMeasurementItem);
m_decodeMeasurementItem.set_label("Measurement");
m_decodeMeasurementItem.set_submenu(m_decodeMeasurementMenu);
m_decodeMenu.append(m_decodeMemoryItem);
m_decodeMemoryItem.set_label("Memory");
m_decodeMemoryItem.set_submenu(m_decodeMemoryMenu);
m_decodeMenu.append(m_decodeMiscItem);
m_decodeMiscItem.set_label("Misc");
m_decodeMiscItem.set_submenu(m_decodeMiscMenu);
m_decodeMenu.append(m_decodeSerialItem);
m_decodeSerialItem.set_label("Serial");
m_decodeSerialItem.set_submenu(m_decodeSerialMenu);
m_contextMenu.append(m_decodeAnalysisItem);
m_decodeAnalysisItem.set_label("Analysis");
m_decodeAnalysisItem.set_submenu(m_decodeAnalysisMenu);
m_contextMenu.append(m_decodeClockItem);
m_decodeClockItem.set_label("Clocking");
m_decodeClockItem.set_submenu(m_decodeClockMenu);
m_contextMenu.append(m_decodeConversionItem);
m_decodeConversionItem.set_label("Conversion");
m_decodeConversionItem.set_submenu(m_decodeConversionMenu);
m_contextMenu.append(m_decodeMathItem);
m_decodeMathItem.set_label("Math");
m_decodeMathItem.set_submenu(m_decodeMathMenu);
m_contextMenu.append(m_decodeMeasurementItem);
m_decodeMeasurementItem.set_label("Measurement");
m_decodeMeasurementItem.set_submenu(m_decodeMeasurementMenu);
m_contextMenu.append(m_decodeMemoryItem);
m_decodeMemoryItem.set_label("Memory");
m_decodeMemoryItem.set_submenu(m_decodeMemoryMenu);
m_contextMenu.append(m_decodeMiscItem);
m_decodeMiscItem.set_label("Misc");
m_decodeMiscItem.set_submenu(m_decodeMiscMenu);
m_contextMenu.append(m_decodeSerialItem);
m_decodeSerialItem.set_label("Serial");
m_decodeSerialItem.set_submenu(m_decodeSerialMenu);


vector<string> names;
@@ -409,6 +406,9 @@ void WaveformArea::CreateWidgets()
delete d;
}

//TODO: delete measurements once we get rid of them all
m_contextMenu.append(*Gtk::manage(new Gtk::SeparatorMenuItem));

//Measurements
m_contextMenu.append(m_measureItem);
m_measureItem.set_label("Measure");
34 changes: 16 additions & 18 deletions glscopeclient/WaveformArea.h
Original file line number Diff line number Diff line change
@@ -192,24 +192,22 @@ class WaveformArea : public Gtk::GLArea
Gtk::MenuItem m_copyNewGroupBelowItem;
Gtk::MenuItem m_copyNewGroupRightItem;
std::set<Gtk::MenuItem*> m_copyExistingGroupItems;
Gtk::MenuItem m_decodeItem;
Gtk::Menu m_decodeMenu;
Gtk::MenuItem m_decodeAnalysisItem;
Gtk::Menu m_decodeAnalysisMenu;
Gtk::MenuItem m_decodeClockItem;
Gtk::Menu m_decodeClockMenu;
Gtk::MenuItem m_decodeConversionItem;
Gtk::Menu m_decodeConversionMenu;
Gtk::MenuItem m_decodeMathItem;
Gtk::Menu m_decodeMathMenu;
Gtk::MenuItem m_decodeMeasurementItem;
Gtk::Menu m_decodeMeasurementMenu;
Gtk::MenuItem m_decodeMemoryItem;
Gtk::Menu m_decodeMemoryMenu;
Gtk::MenuItem m_decodeMiscItem;
Gtk::Menu m_decodeMiscMenu;
Gtk::MenuItem m_decodeSerialItem;
Gtk::Menu m_decodeSerialMenu;
Gtk::MenuItem m_decodeAnalysisItem;
Gtk::Menu m_decodeAnalysisMenu;
Gtk::MenuItem m_decodeClockItem;
Gtk::Menu m_decodeClockMenu;
Gtk::MenuItem m_decodeConversionItem;
Gtk::Menu m_decodeConversionMenu;
Gtk::MenuItem m_decodeMathItem;
Gtk::Menu m_decodeMathMenu;
Gtk::MenuItem m_decodeMeasurementItem;
Gtk::Menu m_decodeMeasurementMenu;
Gtk::MenuItem m_decodeMemoryItem;
Gtk::Menu m_decodeMemoryMenu;
Gtk::MenuItem m_decodeMiscItem;
Gtk::Menu m_decodeMiscMenu;
Gtk::MenuItem m_decodeSerialItem;
Gtk::Menu m_decodeSerialMenu;
Gtk::MenuItem m_measureItem;
Gtk::Menu m_measureMenu;
Gtk::MenuItem m_measureVertItem;
17 changes: 13 additions & 4 deletions glscopeclient/WaveformArea_events.cpp
Original file line number Diff line number Diff line change
@@ -727,10 +727,19 @@ void WaveformArea::UpdateContextMenu()
m_copyMenu.show_all();

//Gray out decoders that don't make sense for the type of channel we've selected
auto children = m_decodeMenu.get_children();
for(auto submenu : children)
vector<Gtk::Menu*> childMenus;
childMenus.push_back(&m_decodeAnalysisMenu);
childMenus.push_back(&m_decodeClockMenu);
childMenus.push_back(&m_decodeConversionMenu);
childMenus.push_back(&m_decodeMathMenu);
childMenus.push_back(&m_decodeMeasurementMenu);
childMenus.push_back(&m_decodeMemoryMenu);
childMenus.push_back(&m_decodeMiscMenu);
childMenus.push_back(&m_decodeSerialMenu);

for(auto submenu : childMenus)
{
auto subchildren = dynamic_cast<Gtk::MenuItem*>(submenu)->get_submenu()->get_children();
auto subchildren = submenu->get_children();
for(auto item : subchildren)
{
Gtk::MenuItem* menu = dynamic_cast<Gtk::MenuItem*>(item);
@@ -746,7 +755,7 @@ void WaveformArea::UpdateContextMenu()
}

//Gray out measurements that don't make sense for the type of channel we've selected
children = m_measureHorzMenu.get_children();
auto children = m_measureHorzMenu.get_children();
UpdateMeasureContextMenu(children);
children = m_measureVertMenu.get_children();
UpdateMeasureContextMenu(children);
26 changes: 21 additions & 5 deletions glscopeclient/WaveformArea_rendering.cpp
Original file line number Diff line number Diff line change
@@ -634,7 +634,7 @@ float WaveformArea::YPositionToVolts(float y)

float WaveformArea::PickStepSize(float volts_per_half_span, int min_steps, int max_steps)
{
static const float step_sizes[24]=
static const float step_sizes[]=
{
//mV per div
0.001,
@@ -665,12 +665,28 @@ float WaveformArea::PickStepSize(float volts_per_half_span, int min_steps, int m
2500,
5000,

10000,
25000,
50000
1.0e4,
2.5e4,
5.0e4,

1.0e5,
2.5e5,
5.0e5,

1.0e6,
2.5e6,
5.0e6,

1.0e7,
2.5e7,
5.0e7,

1.0e8,
2.5e8,
5.0e8
};

for(int i=0; i<24; i++)
for(int i=0; i<sizeof(step_sizes)/sizeof(step_sizes[0]); i++)
{
float step = step_sizes[i];
float steps_per_half_span = volts_per_half_span / step;