]> git.rkrishnan.org Git - pihpsdr.git/commitdiff
Fixes for STEMlab/HAMlab, plus removal of tons of debug output from rigctl.
authorc vw <dl1ycf@darc.de>
Sat, 9 Jun 2018 15:49:48 +0000 (17:49 +0200)
committerc vw <dl1ycf@darc.de>
Sat, 9 Jun 2018 15:49:48 +0000 (17:49 +0200)
meter.c
rigctl.c
rx_menu.c
sliders.c

diff --git a/meter.c b/meter.c
index 358c851620e74d620815dbd433d559aab6f883f3..4f90e91b42509ad69690dbddace9372a051f4b60 100644 (file)
--- a/meter.c
+++ b/meter.c
@@ -232,6 +232,11 @@ if(analog_meter) {
     case SMETER:
       {
       double level=value+(double)adc_attenuation[rx->adc];
+      if (filter_board == CHARLY25) {
+       // preamp/dither encodes the preamp level
+        if (rx->preamp) level -= 18.0;
+        if (rx->dither) level -= 18.0;
+      }
       offset=210.0;
 
       int i;
@@ -529,6 +534,11 @@ if(analog_meter) {
       text_location=10;
       offset=5.0;
       double level=value+(double)adc_attenuation[rx->adc];
+      if (filter_board == CHARLY25) {
+       // preamp/dither encodes the preamp level
+        if (rx->preamp) level -= 18.0;
+        if (rx->dither) level -= 18.0;
+      }
       if(meter_width>=114) {
         //int db=meter_width/114; // S9+60 (9*6)+60
         //if(db>2) db=2;
index c12139280f22b6e5bb5d9bd1b9f041329796314a..06a841bdb2d1787863bbca40bd0175c09dd71762 100644 (file)
--- a/rigctl.c
+++ b/rigctl.c
@@ -58,8 +58,8 @@
 #include <sys/socket.h>
 #include <arpa/inet.h> //inet_addr
 
-//#undef RIGCTL_DEBUG
-#define RIGCTL_DEBUG
+#undef RIGCTL_DEBUG
+//#define RIGCTL_DEBUG
 
 int rigctl_port_base=19090;
 int rigctl_enable=0;
index 3e83bb166ae768d2483a4e548cd14fd7027c492e..70f0565ce7ae51d64828cb10d187e424b34e460e 100644 (file)
--- a/rx_menu.c
+++ b/rx_menu.c
@@ -119,9 +119,8 @@ static void mute_radio_cb(GtkWidget *widget, gpointer data) {
 // call audo_close_output with old device, audio_open_output with new one
 //
 static void local_output_changed_cb(GtkWidget *widget, gpointer data) {
-//active_receiver->audio_device=(int)(long)data;
   int newdev = (int)(long)data;
-fprintf(stderr,"local_output_changed rx=%d from %d to %d\n",active_receiver->id,active_receiver->audio_device,newdev);
+  fprintf(stderr,"local_output_changed rx=%d from %d to %d\n",active_receiver->id,active_receiver->audio_device,newdev);
   if(active_receiver->local_audio) {
     audio_close_output(active_receiver);                     // audio_close with OLD device
     active_receiver->audio_device=newdev;                    // update rx to NEW device
@@ -130,7 +129,10 @@ fprintf(stderr,"local_output_changed rx=%d from %d to %d\n",active_receiver->id,
     } else {
       active_receiver->local_audio=0;
     }
-fprintf(stderr,"local_output_changed rx=%d local_audio=%d\n",active_receiver->id,active_receiver->local_audio);
+    fprintf(stderr,"local_output_changed rx=%d local_audio=%d\n",active_receiver->id,active_receiver->local_audio);
+  } else {
+    // If not (currently) using local audio, just change dev num
+    active_receiver->audio_device=newdev;
   }
 }
 
index acf78d787d78bba3eae4b95ba5fae6256c188bfb..1f127dbbeb71d79d75f150f57ec27afb969214ec 100644 (file)
--- a/sliders.c
+++ b/sliders.c
@@ -217,11 +217,15 @@ static gboolean load_att_type_cb(gpointer data) {
 
 static void c25_att_combobox_changed(GtkWidget *widget, gpointer data) {
   int id = atoi(gtk_combo_box_get_active_id(GTK_COMBO_BOX(widget)));
+  //DL1YCF: store attenuation, such that in meter.c the correct level is displayed
+  adc_attenuation[active_receiver->adc] = 12.0*id;
   set_alex_attenuation(id);
 }
 
 static void c25_preamp_combobox_changed(GtkWidget *widget, gpointer data) {
   int id = atoi(gtk_combo_box_get_active_id(GTK_COMBO_BOX(widget)));
+  //DL1YCF comment: dither and preamp are "misused" to store the PreAmp value.
+  //                this has to be exploited in meter.c
   active_receiver->dither = id >= 2;
   active_receiver->preamp = id >= 1;
 }