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: 6b1e125e9f86
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: 3e9523cc9226
Choose a head ref
  • 2 commits
  • 4 files changed
  • 1 contributor

Commits on May 18, 2021

  1. Copy the full SHA
    63162d9 View commit details
  2. Copy the full SHA
    3e9523c View commit details
Showing with 23 additions and 16 deletions.
  1. +1 −1 lib
  2. +4 −2 src/glscopeclient/HistoryWindow.cpp
  3. +11 −8 src/glscopeclient/OscilloscopeWindow.cpp
  4. +7 −5 src/glscopeclient/WaveformGroup.cpp
2 changes: 1 addition & 1 deletion lib
6 changes: 4 additions & 2 deletions src/glscopeclient/HistoryWindow.cpp
Original file line number Diff line number Diff line change
@@ -360,7 +360,8 @@ void HistoryWindow::SerializeWaveforms(
TimePoint key = (*it)[m_columns.m_capturekey];

//Save metadata
config += " :\n";
snprintf(tmp, sizeof(tmp), " wfm%d:\n", id);
config += tmp;
snprintf(tmp, sizeof(tmp), " timestamp: %ld\n", key.first);
config += tmp;
snprintf(tmp, sizeof(tmp), " time_fsec: %ld\n", key.second);
@@ -424,7 +425,8 @@ void HistoryWindow::SerializeWaveforms(
if(wave == NULL)
continue;

config += " :\n";
snprintf(tmp, sizeof(tmp), " ch%d:\n", index);
config += tmp;
if(wave->m_densePacked)
snprintf(tmp, sizeof(tmp), " format: densev1\n");
else
19 changes: 11 additions & 8 deletions src/glscopeclient/OscilloscopeWindow.cpp
Original file line number Diff line number Diff line change
@@ -2007,9 +2007,10 @@ string OscilloscopeWindow::SerializeUIConfiguration(IDTable& table)
table.emplace(area);
for(auto area : m_waveformAreas)
{
snprintf(tmp, sizeof(tmp), " : \n");
int id = table[area];
snprintf(tmp, sizeof(tmp), " area%d:\n", id);
config += tmp;
snprintf(tmp, sizeof(tmp), " id: %d\n", table[area]);
snprintf(tmp, sizeof(tmp), " id: %d\n", id);
config += tmp;
snprintf(tmp, sizeof(tmp), " persistence: %d\n", area->GetPersistenceEnabled());
config += tmp;
@@ -2031,13 +2032,14 @@ string OscilloscopeWindow::SerializeUIConfiguration(IDTable& table)

for(size_t i=0; i<area->GetOverlayCount(); i++)
{
snprintf(tmp, sizeof(tmp), " :\n");
config += tmp;

//The ID table uses the FlowGraphNode pointer, not the OscilloscopeChannel pointer
auto filter = dynamic_cast<Filter*>(area->GetOverlay(i).m_channel);
auto node = static_cast<FlowGraphNode*>(filter);
snprintf(tmp, sizeof(tmp), " id: %d\n", table[node]);
int oid = table[node];

snprintf(tmp, sizeof(tmp), " overlay%d:\n", oid);
config += tmp;
snprintf(tmp, sizeof(tmp), " id: %d\n", oid);
config += tmp;
snprintf(tmp, sizeof(tmp), " stream: %zu\n", area->GetOverlay(i).m_stream);
config += tmp;
@@ -2059,9 +2061,10 @@ string OscilloscopeWindow::SerializeUIConfiguration(IDTable& table)
for(auto split : m_splitters)
{
//Splitter config
snprintf(tmp, sizeof(tmp), " : \n");
int sid = table[split];
snprintf(tmp, sizeof(tmp), " split%d: \n", sid);
config += tmp;
snprintf(tmp, sizeof(tmp), " id: %d\n", table[split]);
snprintf(tmp, sizeof(tmp), " id: %d\n", sid);
config += tmp;

if(split->get_orientation() == Gtk::ORIENTATION_HORIZONTAL)
12 changes: 7 additions & 5 deletions src/glscopeclient/WaveformGroup.cpp
Original file line number Diff line number Diff line change
@@ -252,10 +252,10 @@ void WaveformGroup::RefreshMeasurements()
string WaveformGroup::SerializeConfiguration(IDTable& table)
{
char tmp[1024];

snprintf(tmp, sizeof(tmp), " : \n");
int id = table.emplace(&m_frame);
snprintf(tmp, sizeof(tmp), " group%d:\n", id);
string config = tmp;
snprintf(tmp, sizeof(tmp), " id: %d\n", table.emplace(&m_frame));
snprintf(tmp, sizeof(tmp), " id: %d\n", id);
config += tmp;

config += " name: \"" + m_realframe.get_label() + "\"\n";
@@ -306,8 +306,10 @@ string WaveformGroup::SerializeConfiguration(IDTable& table)
auto children = m_waveformBox.get_children();
for(size_t i=0; i<children.size(); i++)
{
config += " : \n";
snprintf(tmp, sizeof(tmp), " id: %d\n", table[children[i]]);
int aid = table[children[i]];
snprintf(tmp, sizeof(tmp), " area%d:\n", aid);
config += tmp;
snprintf(tmp, sizeof(tmp), " id: %d\n", aid);
config += tmp;
}