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: a4512050053b
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: 6e9010a9127d
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Mar 1, 2020

  1. Copy the full SHA
    6e9010a View commit details
Showing with 28 additions and 9 deletions.
  1. +28 −9 glscopeclient/HistoryWindow.cpp
37 changes: 28 additions & 9 deletions glscopeclient/HistoryWindow.cpp
Original file line number Diff line number Diff line change
@@ -199,16 +199,35 @@ void HistoryWindow::OnWaveformDataReady(Oscilloscope* scope)
hist = (*it)[m_columns.m_history];
for(auto jt : hist)
{
//TODO: support digital etc captures
auto acap = dynamic_cast<AnalogCapture*>(jt.second);
if(acap == NULL)
continue;

//Add static size of the capture object
bytes_used += sizeof(AnalogCapture);

//Add size of each sample
bytes_used += sizeof(AnalogSample) * acap->m_samples.capacity();
if(acap != NULL)
{
//Add static size of the capture object
bytes_used += sizeof(AnalogCapture);

//Add size of each sample
bytes_used += sizeof(AnalogSample) * acap->m_samples.capacity();
}

auto dcap = dynamic_cast<DigitalCapture*>(jt.second);
if(dcap != NULL)
{
//Add static size of the capture object
bytes_used += sizeof(DigitalCapture);

//Add size of each sample
bytes_used += sizeof(DigitalSample) * dcap->m_samples.capacity();
}

auto bcap = dynamic_cast<DigitalBusCapture*>(jt.second);
if(bcap != NULL)
{
//Add static size of the capture object
bytes_used += sizeof(DigitalBusCapture);

//Add size of each sample
bytes_used += (sizeof(DigitalBusSample) + bcap->m_samples[0].m_sample.size()) * bcap->m_samples.capacity();
}
}
}