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: 56a0310cbb6e
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: c7da605b32e4
Choose a head ref
  • 1 commit
  • 4 files changed
  • 1 contributor

Commits on Mar 15, 2020

  1. Copy the full SHA
    c7da605 View commit details
Showing with 30 additions and 3 deletions.
  1. +15 −0 glscopeclient/HistoryWindow.cpp
  2. +2 −0 glscopeclient/HistoryWindow.h
  3. +12 −2 glscopeclient/OscilloscopeWindow.cpp
  4. +1 −1 glscopeclient/OscilloscopeWindow.h
15 changes: 15 additions & 0 deletions glscopeclient/HistoryWindow.cpp
Original file line number Diff line number Diff line change
@@ -397,3 +397,18 @@ void HistoryWindow::SerializeWaveforms(string dir, IDTable& table)
}
fclose(fp);
}

void HistoryWindow::ReplayHistory()
{
//TODO: is there a way to binary search a tree view?
//Or get *stable* iterators that aren't invalidated by adding/removing items?
auto children = m_model->children();
for(auto it : children)
{
//Select will update all the protocol decoders etc
m_tree.get_selection()->select(it);

//Update analyzers
m_parent->OnHistoryUpdated(true);
}
}
2 changes: 2 additions & 0 deletions glscopeclient/HistoryWindow.h
Original file line number Diff line number Diff line change
@@ -59,6 +59,8 @@ class HistoryWindow : public Gtk::Window
HistoryWindow(OscilloscopeWindow* parent, Oscilloscope* scope);
~HistoryWindow();

void ReplayHistory();

void OnWaveformDataReady();
void JumpToHistory(TimePoint timestamp);

14 changes: 12 additions & 2 deletions glscopeclient/OscilloscopeWindow.cpp
Original file line number Diff line number Diff line change
@@ -505,11 +505,17 @@ void OscilloscopeWindow::DoFileOpen(string filename, bool loadLayout, bool loadW

auto analyzer = new ProtocolAnalyzerWindow(title, this, pdecode, area);
m_analyzers.emplace(analyzer);

//Done
analyzer->show();
}
}
}

//TODO: make this work properly if we have decodes spanning multiple scopes
for(auto it : m_historyWindows)
it.second->ReplayHistory();

//Start threads to poll scopes etc
g_app->StartScopeThreads();
}
@@ -1709,7 +1715,7 @@ void OscilloscopeWindow::ArmTrigger(bool oneshot)
/**
@brief Called when the history view selects an old waveform
*/
void OscilloscopeWindow::OnHistoryUpdated()
void OscilloscopeWindow::OnHistoryUpdated(bool refreshAnalyzers)
{
//Stop triggering if we select a saved waveform
OnStop();
@@ -1731,7 +1737,11 @@ void OscilloscopeWindow::OnHistoryUpdated()
w->OnWaveformDataReady();
}

//Don't update the protocol analyzers, they should already have this waveform saved
if(refreshAnalyzers)
{
for(auto a : m_analyzers)
a->OnWaveformDataReady();
}
}

void OscilloscopeWindow::RemoveHistory(TimePoint timestamp)
2 changes: 1 addition & 1 deletion glscopeclient/OscilloscopeWindow.h
Original file line number Diff line number Diff line change
@@ -88,7 +88,7 @@ class OscilloscopeWindow : public Gtk::Window
void HideHistory()
{ m_btnHistory.set_active(0); }

void OnHistoryUpdated();
void OnHistoryUpdated(bool refreshAnalyzers = false);
void RemoveHistory(TimePoint timestamp);

void JumpToHistory(TimePoint timestamp);