Radio Control  Control Software and GUI for the Panoradio SDR, by DC9ST 2016
Signals | Public Member Functions | Private Member Functions | Private Attributes | List of all members
WaterfallPlot Class Reference

Top class for Waterfall Plots ,. More...

#include <waterfallplot.h>

Inheritance diagram for WaterfallPlot:

Signals

void audio_frequency_clicked (double frequency)
 sends the frequency for tuning the audio receiver (when right clicking in the waterfall) More...
 

Public Member Functions

 WaterfallPlot (QWidget *parent=0)
 constructor
 
 ~WaterfallPlot ()
 destructor
 
void init (int spectrogram_data_width, int spectrogram_data_depth, double max_frequency, double data_min, double data_max, int zoom_init, double span_init, double center_frequency_init)
 initializing function, creates data structures for spectrogram and its display important: the user needs to make sure, that the values specified here fit to the data, which is passed in set_next_data_line that means: zoom level and its corresponding span needs to fit the fft data passed to this class! if this is not ensured, the displayed waterfall has nothing to do with the frequency scale displayed More...
 
void set_max_zoom (int max_zoom)
 sets the maximum possible zoom level
 
void set_min_zoom (int min_zoom)
 sets the minimum possible zoom level
 
void set_color_map (QwtLinearColorMap color_map)
 changes the color map of the waterfall plot (a default is assinged in the constructor)
 
void set_next_data_line (double *array)
 sets one line in the 2 dim data array for spectrogram More...
 
void correct_size ()
 corrects the size of the plot area, so that the data width always matches the display width in pixels
 
void set_center_frequency (double center_frequency)
 sets center frequency in kHz (in this case the waterfall display is emptied completely)
 
void set_wheel_action (int wheel_action)
 sets, what happens if the user turn the mouse wheel in the plot area More...
 
bool receiver_update_required ()
 
void reset_receiver_update ()
 confirms, that a receiver update has been recognized and resets the internal memeber, which signals "update required"
 
int get_zoom_level ()
 
double get_center_frequency ()
 
double get_start_frequency ()
 
double get_stop_frequency ()
 
double get_frequency_span ()
 
double get_max_frequency ()
 
double get_data_min ()
 
double get_data_max ()
 

Private Member Functions

void wheelEvent (QWheelEvent *event)
 handels wheel events (for zoom) and decides if zoom in or out or nothing (max or min zoom exeeded) is done and calls method zoom_update_axis
 
void zoom_update_axis (int x, bool zoom_in)
 calls zoom functions of waterfalldata, calculates new frequencies (start/stop/span etc.) and sets new plot scales More...
 
void shift_frequency (double frequency_shift)
 shifts the waterfall ny the specified shift
 
void mouseMoveEvent (QMouseEvent *event)
 event handler for mouse moves for shift functionality
 
void mousePressEvent (QMouseEvent *event)
 event handler for mouse clicks for shift functionality and audio tuning
 

Private Attributes

QwtPlotSpectrogram * spectrogram_plot_
 
RasterDataraster_data_
 
WaterfallDatawaterfall_data_
 
int zoom_level_
 
int max_zoom_
 
int min_zoom_
 
double data_min_
 
double data_max_
 
double max_frequency_
 
double start_frequency_
 
double stop_frequency_
 
double center_frequency_
 
double frequency_span_
 
int spectrogram_data_width_
 
int spectrogram_data_depth_
 
double scroll_start_frequency_
 
int left_border_
 
int right_border_
 
bool receiver_update_required_
 
int wheel_action_
 

Detailed Description

Top class for Waterfall Plots ,.

Member Function Documentation

void WaterfallPlot::audio_frequency_clicked ( double  frequency)
signal

sends the frequency for tuning the audio receiver (when right clicking in the waterfall)

Parameters
frequencyfrequency in kHz
void WaterfallPlot::init ( int  spectrogram_data_width,
int  spectrogram_data_depth,
double  max_frequency,
double  data_min,
double  data_max,
int  zoom_init,
double  span_init,
double  center_frequency_init 
)

initializing function, creates data structures for spectrogram and its display important: the user needs to make sure, that the values specified here fit to the data, which is passed in set_next_data_line that means: zoom level and its corresponding span needs to fit the fft data passed to this class! if this is not ensured, the displayed waterfall has nothing to do with the frequency scale displayed

Parameters
spectrogram_data_widthwidth of 2 dimensional data array (and display area in px)
spectrogram_data_depthdepth/height of 2 dimensional data array (and display area in px)
max_frequencymaximum frequency for display scale in kHz
data_minexpected minimum data value required by rasterdata.h
data_maxexpected maximum data value required by rasterdata.h
zoom_initinital zoom level
span_initinital span in KHz
center_frequency_initinital center frequency in kHz
bool WaterfallPlot::receiver_update_required ( )
inline

@ brief returns if a receiver update is required (happens if a change in the waterfall has been made, e.g. zoom or shift)

void WaterfallPlot::set_next_data_line ( double *  array)

sets one line in the 2 dim data array for spectrogram

Parameters
arraydouble array for one line
void WaterfallPlot::set_wheel_action ( int  wheel_action)
inline

sets, what happens if the user turn the mouse wheel in the plot area

Parameters
wheel_action0=zoom with wheel (default), 1=shift frequency by a small frequency (e.g. 20 Hz for audio waterfall)
void WaterfallPlot::zoom_update_axis ( int  x,
bool  zoom_in 
)
private

calls zoom functions of waterfalldata, calculates new frequencies (start/stop/span etc.) and sets new plot scales

Parameters
xzoom position (position of mouse pointer relative to left border of plot)
zoom_intrue: zoom in, false: zoom out

The documentation for this class was generated from the following files: