]> git.rkrishnan.org Git - pihpsdr.git/commitdiff
We needed a more permanent solution to the problem of RX panels
authorc vw <dl1ycf@darc.de>
Fri, 31 May 2019 15:44:51 +0000 (17:44 +0200)
committerc vw <dl1ycf@darc.de>
Fri, 31 May 2019 15:44:51 +0000 (17:44 +0200)
that are un-used at program startup.

Makefile.mac
radio.c
rigctl.c
transmitter.h

index 980dca8c770a33df708e8aa6b63db4462253242f..ec053b989857a2b1a484e871fe0b1db5f563b2db 100644 (file)
@@ -481,7 +481,9 @@ hpsdrsim:       hpsdrsim.o
 #       =========
 #       Upon starting a freshly built application in an "app" bundle,
 #       it will do the FFT calculations required for wdsp-Wisdom, since
-#       this is then stored *within* the app bundle.
+#       this is then stored *within* the app bundle. For experimentation,
+#       use "make localapp", this will copy such run-time files (WDSP wisom,
+#       ".props" files and the definition of the MIDI device) to the app bundle.
 #
 #############################################################################
 app:   $(OBJS) $(REMOTE_OBJS) $(USBOZY_OBJS) $(LIMESDR_OBJS) $(FREEDV_OBJS) \
diff --git a/radio.c b/radio.c
index b52f5f869fc982b9578cca0ee5a0ca183b009ad6..82c6fbf9f1e05c6659ccabc4b383c6901dfd7ab9 100644 (file)
--- a/radio.c
+++ b/radio.c
@@ -564,30 +564,22 @@ void start_radio() {
     rx_height-=SLIDERS_HEIGHT;
   }
   int tx_height=rx_height;
-  rx_height=rx_height/receivers;
+  rx_height=rx_height/RECEIVERS;
 
 
-//fprintf(stderr,"Create %d receivers: height=%d\n",receivers,rx_height);
+  //
+  // To be on the safe side, we create ALL receiver panels here
+  // If upon startup, we only should display one panel, we do the switch below
+  //
   for(i=0;i<RECEIVERS;i++) {
-    // A receiver may be un-unsed upon program start, but can be activated through the radio menu later.
-    // Create it here with height 0. Make sure to call g_object_ref for this one as well,
-    // this cures the seg-faults observed when switching beteen 1 and 2 RX in the radio menu.
-    if(i<receivers) {
-      receiver[i]=create_receiver(i, buffer_size, fft_size, display_width, updates_per_second, display_width, rx_height);
-    } else {
-      receiver[i]=create_receiver(i, buffer_size, fft_size, display_width, updates_per_second, display_width, 0        );
-    }
+    receiver[i]=create_receiver(i, buffer_size, fft_size, display_width, updates_per_second, display_width, rx_height);
     setSquelch(receiver[i]);
     receiver[i]->x=0;
     receiver[i]->y=y;
     gtk_fixed_put(GTK_FIXED(fixed),receiver[i]->panel,0,y);
     g_object_ref((gpointer)receiver[i]->panel);
-    if (i<receivers) {
-      set_displaying(receiver[i],1);
-      y+=rx_height;
-    } else {
-      set_displaying(receiver[i],0);
-    }
+    set_displaying(receiver[i],1);
+    y+=rx_height;
   }
 
   if((protocol==ORIGINAL_PROTOCOL) && (RECEIVERS==2) && (receiver[0]->sample_rate!=receiver[1]->sample_rate)) {
@@ -658,6 +650,18 @@ void start_radio() {
   gtk_fixed_put(GTK_FIXED(fixed),toolbar,0,y);
   y+=TOOLBAR_HEIGHT;
 
+//
+// Now, if there should only one receiver be displayed
+// at startup, do the change. We must momentarily fake
+// the number of receivers otherwise radio_change_receivers
+// will do nothing.
+//
+  if (receivers != RECEIVERS) {
+    i=receivers,
+    receivers=RECEIVERS;
+    radio_change_receivers(i);
+  }
+
   gtk_widget_show_all (fixed);
 //#ifdef FREEDV
 //  if(!active_receiver->freedv) {
@@ -746,8 +750,8 @@ void radio_change_sample_rate(int rate) {
         old_protocol_run();
 #ifdef PURESIGNAL
         tx_set_ps_sample_rate(transmitter,rate);
-      }
 #endif
+      }
       break;
 #ifdef LIMESDR
     case LIMESDR_PROTOCOL:
index e1dcc8d02db38f37a74d6dd64852057665cdaf23..ddb6f87f64d65959577b3a349881dc926cad60e1 100644 (file)
--- a/rigctl.c
+++ b/rigctl.c
@@ -302,8 +302,6 @@ static long dashlen;
 static int  dotsamples;
 static int  dashsamples;
 
-extern int cw_key_up, cw_key_down, cw_not_ready;
-
 //
 // send_dash()         send a "key-down" of a dashlen, followed by a "key-up" of a dotlen
 // send_dot()          send a "key-down" of a dotlen,  followed by a "key-up" of a dotlen
index 177075ee71c0f27990d8c84e821a632d1f605386..ed8d82f605c4ade7c848e2872f734cfe820b2dac 100644 (file)
@@ -121,6 +121,12 @@ extern TRANSMITTER *create_transmitter(int id, int buffer_size, int fft_size, in
 
 void reconfigure_transmitter(TRANSMITTER *tx,int height);
 
+//
+// CW pulse shaper variables, needed by rigctl (CAT CW) and iambic.c (LOCALCW)
+//
+extern int cw_key_up;
+extern int cw_key_down;
+extern int cw_not_ready;
 
 extern void tx_set_mode(TRANSMITTER* tx,int m);
 extern void tx_set_filter(TRANSMITTER *tx,int low,int high);