plotview: Store time selection

This commit is contained in:
Mike Walters
2016-03-05 19:15:55 +00:00
parent 158e95c54a
commit c6166d70f9
3 changed files with 20 additions and 3 deletions

View File

@@ -90,8 +90,12 @@ TracePlot* PlotView::createQuadratureDemodPlot(SampleSource<std::complex<float>>
void PlotView::cursorsMoved()
{
int selection = cursors.selection().length();
off_t sampleCount = selection * samplesPerLine();
selectedSamples = {
horizontalScrollBar()->value() + cursors.selection().minimum * samplesPerLine(),
horizontalScrollBar()->value() + cursors.selection().maximum * samplesPerLine()
};
off_t sampleCount = selectedSamples.length();
float selectionTime = sampleCount / (float)mainSampleSource->rate();
emit timeSelectionChanged(selectionTime);
viewport()->update();