Skip to content

Commit

Permalink
spectrum analyzer/waterfall: added cursors with lock between plots
Browse files Browse the repository at this point in the history
- reworked plot axis
- changed sample rate label format
- fixed plot emit signals causing unsynced plots when pressing single button

Signed-off-by: Andrei Popa <[email protected]>
  • Loading branch information
andrei47w authored and adisuciu committed Mar 17, 2023
1 parent 940810c commit e0e3e8c
Show file tree
Hide file tree
Showing 9 changed files with 488 additions and 171 deletions.
11 changes: 6 additions & 5 deletions src/DisplayPlot.h
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,12 @@ protected Q_SLOTS:
void mousePressEvent(QMouseEvent *event);
#endif

public:
PlotLineHandleV *d_vCursorHandle1;
PlotLineHandleV *d_vCursorHandle2;
PlotLineHandleH *d_hCursorHandle1;
PlotLineHandleH *d_hCursorHandle2;

protected:

enum PlotMarker
Expand Down Expand Up @@ -663,11 +669,6 @@ protected Q_SLOTS:
HorizBar *d_hBar2;
SymbolController *d_symbolCtrl;

PlotLineHandleV *d_vCursorHandle1;
PlotLineHandleV *d_vCursorHandle2;
PlotLineHandleH *d_hCursorHandle1;
PlotLineHandleH *d_hCursorHandle2;

struct cursorReadoutsText d_cursorReadoutsText;
CursorReadouts *d_cursorReadouts;

Expand Down
4 changes: 2 additions & 2 deletions src/FftDisplayPlot.cc
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,7 @@ void FftDisplayPlot::plotData(const std::vector<double *> &pts,
_editFirstPoint();
replot();

Q_EMIT newData();
Q_EMIT newFFTData();
}

void FftDisplayPlot::_editFirstPoint()
Expand Down Expand Up @@ -1752,7 +1752,7 @@ void FftDisplayPlot::recalculateMagnitudes()
averageDataAndComputeMagnitude(y_original_data, y_data, d_numPoints);
detectMarkers();

Q_EMIT newData();
Q_EMIT newFFTData();
}

/*
Expand Down
3 changes: 1 addition & 2 deletions src/FftDisplayPlot.h
Original file line number Diff line number Diff line change
Expand Up @@ -260,10 +260,9 @@ namespace adiscope {
void enableYaxisLabels();
QString formatXValue(double value, int precision) const;
QString formatYValue(double value, int precision) const;

Q_SIGNALS:
void channelAdded(int);
void newData();
void newFFTData();
void sampleRateUpdated(double);
void sampleCountUpdated(uint);
void newMarkerData();
Expand Down
Loading

0 comments on commit e0e3e8c

Please sign in to comment.