cleaned up a little, made var names consistent with plot spectrum
authordrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Tue, 23 Oct 2012 09:37:49 +0000 (09:37 +0000)
committerdrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Tue, 23 Oct 2012 09:37:49 +0000 (09:37 +0000)
git-svn-id: https://svn.code.sf.net/p/freetel/code@796 01035d8c-6547-0410-b346-abe4f91aad63

fdmdv2/src/fdmdv2_plot_waterfall_linux.cpp
fdmdv2/src/fdmdv2_plot_waterfall_linux.h

index 2339b5222e8d14f1944af216980a3e60b93de882..760ad8f2aa5c865dce7ec8502b76dcc8352fce11 100644 (file)
@@ -96,8 +96,8 @@ void PlotWaterfall::OnSize(wxSizeEvent& event) {
 //----------------------------------------------------------------
 void PlotWaterfall::OnPaint(wxPaintEvent & evt)
 {
-    wxAutoBufferedPaintDC pdc(this);
-    draw(pdc);
+    wxAutoBufferedPaintDC dc(this);
+    draw(dc);
 }
 
 //----------------------------------------------------------------
@@ -153,14 +153,14 @@ unsigned PlotWaterfall::heatmap(float val, float min, float max)
 //----------------------------------------------------------------
 // draw()
 //----------------------------------------------------------------
-void PlotWaterfall::draw(wxAutoBufferedPaintDC& pDC)
+void PlotWaterfall::draw(wxAutoBufferedPaintDC& dc)
 {
 
     if(m_newdata)
     {
         m_newdata = false;
         plotPixelData();
-       pDC.DrawBitmap(*m_pBmp, PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER);
+       dc.DrawBitmap(*m_pBmp, PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER);
     }
     else {
        
@@ -172,12 +172,12 @@ void PlotWaterfall::draw(wxAutoBufferedPaintDC& pDC)
 
        m_rPlot = wxRect(PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER, m_rGrid.GetWidth(), m_rGrid.GetHeight());
        wxBrush ltGraphBkgBrush = wxBrush(BLACK_COLOR);
-       pDC.SetBrush(ltGraphBkgBrush);
-       pDC.SetPen(wxPen(BLACK_COLOR, 0));
-       pDC.DrawRectangle(m_rPlot);
+       dc.SetBrush(ltGraphBkgBrush);
+       dc.SetPen(wxPen(BLACK_COLOR, 0));
+       dc.DrawRectangle(m_rPlot);
     }
     
-    drawGraticule(pDC);
+    drawGraticule(dc);
 
 }
 
@@ -185,7 +185,7 @@ void PlotWaterfall::draw(wxAutoBufferedPaintDC& pDC)
 //-------------------------------------------------------------------------
 // drawGraticule()
 //-------------------------------------------------------------------------
-void PlotWaterfall::drawGraticule(wxAutoBufferedPaintDC&  pDC)
+void PlotWaterfall::drawGraticule(wxAutoBufferedPaintDC& dc)
 {
     int p;
     char buf[15];
@@ -195,33 +195,33 @@ void PlotWaterfall::drawGraticule(wxAutoBufferedPaintDC&  pDC)
     wxBrush ltGraphBkgBrush;
     ltGraphBkgBrush.SetStyle(wxBRUSHSTYLE_TRANSPARENT);
     ltGraphBkgBrush.SetColour(*wxBLACK);
-    pDC.SetBrush(ltGraphBkgBrush);
-    pDC.SetPen(wxPen(BLACK_COLOR, 1));
+    dc.SetBrush(ltGraphBkgBrush);
+    dc.SetPen(wxPen(BLACK_COLOR, 1));
 
     // Vertical gridlines
-    pDC.SetPen(m_penShortDash);
+    dc.SetPen(m_penShortDash);
     for(p = (PLOT_BORDER + XLEFT_OFFSET + GRID_INCREMENT); p < ((m_rGrid.GetWidth() - XLEFT_OFFSET) + GRID_INCREMENT); p += GRID_INCREMENT)
     {
-        pDC.DrawLine(p, (m_rGrid.GetHeight() + PLOT_BORDER), p, PLOT_BORDER);
+        dc.DrawLine(p, (m_rGrid.GetHeight() + PLOT_BORDER), p, PLOT_BORDER);
     }
     // Horizontal gridlines
-    pDC.SetPen(m_penDotDash);
+    dc.SetPen(m_penDotDash);
     for(p = (m_rGrid.GetHeight() - GRID_INCREMENT); p > PLOT_BORDER; p -= GRID_INCREMENT)
     {
-        pDC.DrawLine(PLOT_BORDER + XLEFT_OFFSET, (p + PLOT_BORDER), (m_rGrid.GetWidth() + PLOT_BORDER + XLEFT_OFFSET), (p + PLOT_BORDER));
+        dc.DrawLine(PLOT_BORDER + XLEFT_OFFSET, (p + PLOT_BORDER), (m_rGrid.GetWidth() + PLOT_BORDER + XLEFT_OFFSET), (p + PLOT_BORDER));
     }
     // Label the X-Axis
-    pDC.SetPen(wxPen(GREY_COLOR, 1));
+    dc.SetPen(wxPen(GREY_COLOR, 1));
     for(p = GRID_INCREMENT; p < (m_rGrid.GetWidth() - YBOTTOM_OFFSET); p += GRID_INCREMENT)
     {
         sprintf(buf, "%1.1f Hz",(double)(p / 10));
-        pDC.DrawText(buf, p - PLOT_BORDER + XLEFT_OFFSET, m_rGrid.GetHeight() + YBOTTOM_OFFSET/3);
+        dc.DrawText(buf, p - PLOT_BORDER + XLEFT_OFFSET, m_rGrid.GetHeight() + YBOTTOM_OFFSET/3);
     }
     // Label the Y-Axis
     for(p = (m_rGrid.GetHeight() - GRID_INCREMENT); p > PLOT_BORDER; p -= GRID_INCREMENT)
     {
         sprintf(buf, "%1.0f", (double)((m_rGrid.GetHeight() - p) * 10));
-        pDC.DrawText(buf, XLEFT_TEXT_OFFSET, p);
+        dc.DrawText(buf, XLEFT_TEXT_OFFSET, p);
     }
 }
 
index b7eaf392d076a09df4eb4fcdb4316fd03a9899a4..258f303512656de17c229826072722d9819b4184 100644 (file)
@@ -43,18 +43,9 @@ class PlotWaterfall : public PlotPanel
     public:
         PlotWaterfall(wxFrame* parent);
         ~PlotWaterfall();
-//        bool                m_newdata;
 
-    enum
-    {
-        BORDER = 15,
-        SIZE = 150,
-        REAL_SIZE = SIZE - 2*BORDER
-    };
     protected:
-    //    unsigned    *m_pixel_buf;
         unsigned    m_heatmap_lut[256];
-        wxMemoryDC  m_mDC;
 
         unsigned    heatmap(float val, float min, float max);
 
@@ -62,7 +53,7 @@ class PlotWaterfall : public PlotPanel
         void        OnSize(wxSizeEvent& event);
         void        OnShow(wxShowEvent& event);
         void        drawGraticule(wxAutoBufferedPaintDC&  dc);
-        void        draw(wxAutoBufferedPaintDC& pdc);
+        void        draw(wxAutoBufferedPaintDC& dc);
         void        plotPixelData();
 
         DECLARE_EVENT_TABLE()