modified Makefiles for DW cleanup, modified waterfall to handle slow waterfall update...
authordrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Fri, 23 Nov 2012 19:51:46 +0000 (19:51 +0000)
committerdrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Fri, 23 Nov 2012 19:51:46 +0000 (19:51 +0000)
git-svn-id: https://svn.code.sf.net/p/freetel/code@1052 01035d8c-6547-0410-b346-abe4f91aad63

fdmdv2/src/Makefile.linux
fdmdv2/src/Makefile.win32
fdmdv2/src/fdmdv2_defines.h
fdmdv2/src/fdmdv2_main.cpp
fdmdv2/src/fdmdv2_plot_waterfall_linux.cpp
fdmdv2/src/fdmdv2_plot_waterfall_linux.h

index bde04f041b0b5c0711a81d7baef47433af8e5de8..058d80728b1c5a4c518240d4d229abe1138a569c 100644 (file)
@@ -26,12 +26,10 @@ fdmdv2_plot_scatter.o \
 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
 
index 692605109c527d43b40d6ea33294728250e00617..f536fe8fe6b5b82769bb4616f7d816bdb57c5ac2 100644 (file)
@@ -26,12 +26,11 @@ fdmdv2_plot_scatter.o \
 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
 
index 576a7b8f93387fcc40d767ced8ccb3ca05b0d302..f71154d11ca3ccc74a725c16ba7f5682b6e571fe 100644 (file)
@@ -35,7 +35,7 @@
 #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          // 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
index a8602723a76f57ed431626b0319cf2463f16645b..f6ed9c65f6ee33220f8f8c727a86d22138e3ef2c 100644 (file)
@@ -475,8 +475,10 @@ MainFrame::~MainFrame()
 
 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();
index da8135c0d645cab57b0af4652995e8ab10f60d5d..15c88eac872548a3b5644bddc8dc08765ec29f34 100644 (file)
@@ -81,6 +81,8 @@ void PlotWaterfall::OnSize(wxSizeEvent& event)
     // we want a bit map the size of m_rGrid
 
     m_pBmp = new wxBitmap(m_rGrid.GetWidth(), m_rGrid.GetHeight(), 24);
+
+    m_dT = DT;
 }
 
 //----------------------------------------------------------------
@@ -152,11 +154,30 @@ unsigned PlotWaterfall::heatmap(float val, float min, float max)
     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
@@ -178,6 +199,7 @@ void PlotWaterfall::draw(wxAutoBufferedPaintDC& dc)
         m_newdata = false;
         plotPixelData();
         dc.DrawBitmap(*m_pBmp, PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER);
+        m_dT = DT;
     }
     else 
     {
@@ -254,7 +276,7 @@ void PlotWaterfall::plotPixelData()
     float       intensity_per_dB;
     float       px_per_sec;
     int         index;
-    int         dy;
+    float       dy;
     int         dy_blocks;
     int         b;
     int         px;
@@ -274,7 +296,7 @@ void PlotWaterfall::plotPixelData()
 
     // 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;
@@ -349,6 +371,7 @@ void PlotWaterfall::plotPixelData()
         p = rowStart;
         p.OffsetY(data, 1);
     }
+
 }
 
 //-------------------------------------------------------------------------
index 3efbf3f00e1977e4c45744d0e1f71092f45ceb4f..4a1d2aed9395f886c156f688b12154236b5c8706 100644 (file)
@@ -39,7 +39,8 @@ class PlotWaterfall : public PlotPanel
     public:
         PlotWaterfall(wxFrame* parent);
         ~PlotWaterfall();
+        bool checkDT(void);
+
     protected:
         unsigned    m_heatmap_lut[256];
 
@@ -54,6 +55,7 @@ class PlotWaterfall : public PlotPanel
         void        OnMouseDown(wxMouseEvent& event);
 
     private:
+        float       m_dT;
 
         DECLARE_EVENT_TABLE()
 };