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: 3d123c4545b8
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: b33d998e568f
Choose a head ref
  • 1 commit
  • 2 files changed
  • 1 contributor

Commits on Mar 5, 2020

  1. WaveformAreas are now mostly serialized. Still need to do measurement…

    …s but UI config is otherwise done.
    azonenberg committed Mar 5, 2020
    Copy the full SHA
    b33d998 View commit details
Showing with 31 additions and 1 deletion.
  1. +22 −1 glscopeclient/OscilloscopeWindow.cpp
  2. +9 −0 glscopeclient/WaveformArea.h
23 changes: 22 additions & 1 deletion glscopeclient/OscilloscopeWindow.cpp
Original file line number Diff line number Diff line change
@@ -566,7 +566,7 @@ string OscilloscopeWindow::SerializeUIConfiguration(std::map<void*, int>& idmap,
config += tmp;

//Waveform areas
config += " areas: %\n";
config += " areas: @\n";
for(auto area : m_waveformAreas)
idmap[area] = nextID++;
for(auto area : m_waveformAreas)
@@ -576,8 +576,29 @@ string OscilloscopeWindow::SerializeUIConfiguration(std::map<void*, int>& idmap,
config += tmp;
snprintf(tmp, sizeof(tmp), " id: %d\n", id);
config += tmp;
snprintf(tmp, sizeof(tmp), " persistence: %d\n", area->GetPersistenceEnabled());
config += tmp;

//Channels
//By the time we get here, all channels should be accounted for.
//So there should be no reason to assign names to channels at this point - just use what's already there
snprintf(tmp, sizeof(tmp), " channel: %d\n", idmap[area->GetChannel()]);
config += tmp;

//Overlays
if(area->GetOverlayCount() != 0)
{
snprintf(tmp, sizeof(tmp), " overlays: @\n");
config += tmp;

for(size_t i=0; i<area->GetOverlayCount(); i++)
{
snprintf(tmp, sizeof(tmp), " : %%\n");
config += tmp;
snprintf(tmp, sizeof(tmp), " id: %d\n", idmap[area->GetOverlay(i)]);
config += tmp;
}
}
}

//Waveform groups
9 changes: 9 additions & 0 deletions glscopeclient/WaveformArea.h
Original file line number Diff line number Diff line change
@@ -137,6 +137,15 @@ class WaveformArea : public Gtk::GLArea
bool IsFFT();
bool IsTime();

size_t GetOverlayCount()
{ return m_overlays.size(); }

ProtocolDecoder* GetOverlay(size_t i)
{ return m_overlays[i]; }

bool GetPersistenceEnabled()
{ return m_persistence; }

protected:
void SharedCtorInit();