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
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 3817297c845c
Choose a base ref
...
head repository: ngscopeclient/scopehal
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 474ad03b63f6
Choose a head ref
  • 2 commits
  • 1 file changed
  • 1 contributor

Commits on Apr 25, 2021

  1. MockOscilloscope: when importing CSVs with column headers, don't add …

    …a newline to the end of the last channel's name
    azonenberg committed Apr 25, 2021
    Copy the full SHA
    4963db8 View commit details
  2. MockOscilloscope: discard offsets of imported CSVs so they all start …

    …at time zero (might change this later)
    azonenberg committed Apr 25, 2021
    Copy the full SHA
    474ad03 View commit details
Showing with 11 additions and 2 deletions.
  1. +11 −2 scopehal/MockOscilloscope.cpp
13 changes: 11 additions & 2 deletions scopehal/MockOscilloscope.cpp
Original file line number Diff line number Diff line change
@@ -494,7 +494,7 @@ bool MockOscilloscope::LoadCSV(const string& path)
else
tmp = "";
}
else
else if(line[i] != '\n')
tmp += line[i];
}

@@ -516,6 +516,8 @@ bool MockOscilloscope::LoadCSV(const string& path)
//If we don't have any channels, create them
if(GetChannelCount() == 0)
{
LogTrace("Creating channels\n");

//Create the columns
for(size_t i=0; i<ncols; i++)
{
@@ -536,6 +538,8 @@ bool MockOscilloscope::LoadCSV(const string& path)
//Create waveforms if needed
if(waveforms.empty())
{
LogTrace("Creating waveforms\n");

for(size_t i=0; i<ncols; i++)
{
//Create the waveform for the channel
@@ -636,8 +640,13 @@ void MockOscilloscope::NormalizeTimebases()
//If we get here, assume uniform sampling.
//Use time zero as the trigger phase.
//TODO: is sign correct here or do we need to invert?
LogTrace("Waveform appears to be uniform sampling rate, converting to dense packed\n");
int64_t phase = wfm->m_offsets[0];
LogTrace("Waveform appears to be uniform sampling rate, converting to dense packed (phase=%s)\n",
fs.PrettyPrint(phase).c_str());

//For now, throw away the phase and have all dense packed imports start at time zero
phase = 0;

for(size_t i=0; i<GetChannelCount(); i++)
{
auto w = GetChannel(i)->GetData(0);