fdmdv2_plot_spectrum.o \
fdmdv2_plot_waterfall_linux.o \
fdmdv2_pa_wrapper.o \
-dlg_about.o \
dlg_audiooptions.o \
-dlg_comports.o \
-dlg_options.o
+dlg_comports.o
-HDRS = fdmdv2_main.h fdmdv2_defines.h fdmdv2_plot.h fdmdv2_plot_scalar.h fdmdv2_plot_waterfall_linux.h fdmdv2_plot_scatter.h fdmdv2_plot_spectrum.h fdmdv2_pa_wrapper.h topFrame.h dlg_audiooptions.h
+HDRS = dlg_audiooptions.h dlg_comports.h fdmdv2_main.h fdmdv2_defines.h fdmdv2_plot.h fdmdv2_plot_scalar.h fdmdv2_plot_waterfall_linux.h fdmdv2_plot_scatter.h fdmdv2_plot_spectrum.h fdmdv2_pa_wrapper.h
all: freedv
fdmdv2_plot_spectrum.o \
fdmdv2_plot_waterfall_linux.o \
fdmdv2_pa_wrapper.o \
-dlg_about.o \
dlg_audiooptions.o \
dlg_comports.o \
dlg_options.o
-HDRS = fdmdv2_main.h fdmdv2_defines.h fdmdv2_plot.h fdmdv2_plot_scalar.h fdmdv2_plot_waterfall_linux.h fdmdv2_plot_scatter.h fdmdv2_plot_spectrum.h fdmdv2_pa_wrapper.h topFrame.h dlg_audiooptions.h
+HDRS = dlg_audiooptions.h dlg_comports.h fdmdv2_main.h fdmdv2_defines.h fdmdv2_plot.h fdmdv2_plot_scalar.h fdmdv2_plot_waterfall_linux.h fdmdv2_plot_scatter.h fdmdv2_plot_spectrum.h fdmdv2_pa_wrapper.h topFrame.h dlg_audiooptions.h
all: freedv
#define MIN_F_HZ 0 // min freq on Waterfall and Spectrum
#define MAX_F_HZ 4000 // max freq on Waterfall and Spectrum
#define STEP_F_HZ 500 // freq step on Waterfall and Spectrum graticule
-#define WATERFALL_SECS_Y 5 // number of seconds respresented by y axis of waterfall
+#define WATERFALL_SECS_Y 30 // number of seconds respresented by y axis of waterfall
#define WATERFALL_SECS_STEP 5 // graticule y axis steps of waterfall
#define DT 0.1 // time between real time graphing updates
#define FS 8000 // FDMDV modem sample rate
void MainFrame::OnTimer(wxTimerEvent &evt)
{
- m_panelWaterfall->m_newdata = true;
- m_panelWaterfall->Refresh();
+ if (m_panelWaterfall->checkDT()) {
+ m_panelWaterfall->m_newdata = true;
+ m_panelWaterfall->Refresh();
+ }
m_panelSpectrum->m_newdata = true;
m_panelSpectrum->Refresh();
// we want a bit map the size of m_rGrid
m_pBmp = new wxBitmap(m_rGrid.GetWidth(), m_rGrid.GetHeight(), 24);
+
+ m_dT = DT;
}
//----------------------------------------------------------------
return (b << 16) + (g << 8) + r;
}
+bool PlotWaterfall::checkDT(void)
+{
+ // Check dY is > 1 pixel before proceeding. For small screens
+ // and large WATERFALL_SECS_Y we might have less than one
+ // block per pixel. In this case increase m_dT and perform draw
+ // less often
+
+ float px_per_sec = (float)m_rGrid.GetHeight() / WATERFALL_SECS_Y;
+ float dy = m_dT * px_per_sec;
+
+ if (dy < 1.0) {
+ m_dT += DT;
+ return false;
+ }
+ else
+ return true;
+}
+
//----------------------------------------------------------------
// draw()
//----------------------------------------------------------------
void PlotWaterfall::draw(wxAutoBufferedPaintDC& dc)
{
+
m_rCtrl = GetClientRect();
// m_rGrid is coords of inner window we actually plot to. We deflate it a bit
m_newdata = false;
plotPixelData();
dc.DrawBitmap(*m_pBmp, PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER);
+ m_dT = DT;
}
else
{
float intensity_per_dB;
float px_per_sec;
int index;
- int dy;
+ float dy;
int dy_blocks;
int b;
int px;
// determine dy, the height of one "block"
px_per_sec = (float)m_rGrid.GetHeight() / WATERFALL_SECS_Y;
- dy = DT * px_per_sec;
+ dy = m_dT * px_per_sec;
// number of dy high blocks in spectrogram
dy_blocks = m_rGrid.GetHeight()/ dy;
p = rowStart;
p.OffsetY(data, 1);
}
+
}
//-------------------------------------------------------------------------
public:
PlotWaterfall(wxFrame* parent);
~PlotWaterfall();
-
+ bool checkDT(void);
+
protected:
unsigned m_heatmap_lut[256];
void OnMouseDown(wxMouseEvent& event);
private:
+ float m_dT;
DECLARE_EVENT_TABLE()
};