cleaner window set up
authordrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Fri, 22 Jun 2012 22:23:19 +0000 (22:23 +0000)
committerdrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Fri, 22 Jun 2012 22:23:19 +0000 (22:23 +0000)
git-svn-id: https://svn.code.sf.net/p/freetel/code@575 01035d8c-6547-0410-b346-abe4f91aad63

codec2-dev/fltk/Makefile
codec2-dev/fltk/fl_fdmdv.cxx

index df2ddfac3d0314c6c39fa663629fbf6825d1a5b9..7a3824d447c1bee6e1f4a8afefd0f4679074fd51 100644 (file)
@@ -1,3 +1,5 @@
+# Requires FLTK 1.3
+
 FLTK_CFLAGS += $(shell fltk-config --ldstaticflags)
 CFLAGS = -O3 -g
 
index 726200744c2b11dcecfc02751767a68a1093d932..12fa2fb294b070741927b52bce4cf888934335f7 100644 (file)
@@ -3,7 +3,7 @@
   Created 14 June 2012
   David Rowe
 
-  Fltk based GUI program to prototype spectrum, waterfall, and other
+  Fltk 1.3 based GUI program to prototype spectrum, waterfall, and other
   FDMDV GUI displays.
 */
 
 #define DT                   0.1  // time between samples 
 #define FS                8000
 
+#define W                  800
+#define W2                 (W/2)
+#define H                  600
+#define H2                 (H/2)
+#define SP                  20
+
+
 class Spectrum;
 class Waterfall;
 
@@ -271,6 +278,8 @@ void new_data(float mag_dB[]) {
        av_mag[i] = (1.0 - BETA)*av_mag[i] + BETA*mag_dB[i];
 }
 
+// simulates real time operation by reading a raw file then pausing
+
 void idle(void*) {
     int   nin = FDMDV_NOM_SAMPLES_PER_FRAME;
     short rx_fdm_scaled[FDMDV_MAX_SAMPLES_PER_FRAME];
@@ -331,11 +340,11 @@ int main(int argc, char **argv) {
 
     Fl::visual(FL_RGB);
 
-    window = new Fl_Window(800, 20+300+20+20+300+20, "fl_fmdv");
-    window->size_range(100,100);
+    window = new Fl_Window(W, SP+H2+SP+SP+H2+SP, "fl_fmdv");
+    window->size_range(100, 100);
     window->resizable();
-    aSpectrum = new Spectrum(20, 20, 800-40, 300);
-    aWaterfall = new Waterfall(20, 20+300+20+20, 800-40, 300);
+    aSpectrum = new Spectrum(SP, SP, W-2*SP, H2);
+    aWaterfall = new Waterfall(SP, SP+H2+SP+SP, W-2*SP, H2);
     fdmdv = fdmdv_create();
 
     Fl::add_idle(idle);