]> git.rkrishnan.org Git - pihpsdr.git/commitdiff
modify rigctl to accept values only from 0 to 60 (-12 to 48)
authorRamakrishnan Muthukrishnan <ram@rkrishnan.org>
Fri, 14 Jan 2022 11:05:24 +0000 (16:35 +0530)
committerRamakrishnan Muthukrishnan <ram@rkrishnan.org>
Fri, 14 Jan 2022 11:05:24 +0000 (16:35 +0530)
rigctl.c
sliders.c

index 6ab71dc0d324880b9450d15fc0cd85a9b1312191..72d45e14f2c182abce8da92ffa730f824e1fc07c 100644 (file)
--- a/rigctl.c
+++ b/rigctl.c
@@ -3463,10 +3463,7 @@ int parse_cmd(void *data) {
       if (command[2] == ';') {
         double att = 0.0;
         if (have_rx_gain) {
-          att = adc[active_receiver->adc].attenuation_orig + 12.0;
-          printf("after stage 1: %f\n", att);
-          att = round(att * (99.0 / 60.0));
-          printf("after stage 2: %f\n", att);
+          att = adc[active_receiver->adc].attenuation + 12.0;
         } else {
           att = adc[active_receiver->adc].attenuation;
           att = round((att * 99.0) / 31.0);
@@ -3477,14 +3474,12 @@ int parse_cmd(void *data) {
           command[4] = '\0';
           int attI = strtol(&command[2], NULL, 10);
           double att = 0.0;
-          printf("setting attn level [0..99]: %d\n", attI);
 
           if (have_rx_gain) {
-              att = ((attI * 60.0) / 99.0) - 12.0;
+              att = attI - 12.0;
           } else {
               att = (attI * 31.0) / 99.0;
           }
-          printf("setting attn val [-12..48]: %f\n", att);
           set_attenuation_value(att);
       }
       break;
index f5d63ce1dc7faa832ea7107d8a2c8e4dff6599d9..c117af3d097e4f17a783997d04b6d1979744ed20 100644 (file)
--- a/sliders.c
+++ b/sliders.c
@@ -153,8 +153,6 @@ static void attenuation_value_changed_cb(GtkWidget *widget, gpointer data) {
 
 void set_attenuation_value(double value) {
   g_print("%s\n",__FUNCTION__);
-  printf("last attn value: %d, setting it to: %f\n", adc[active_receiver->adc].attenuation, value);
-  adc[active_receiver->adc].attenuation_orig = value;
   adc[active_receiver->adc].attenuation = (int)value;
   set_attenuation(adc[active_receiver->adc].attenuation);
   if(display_sliders) {
@@ -182,7 +180,6 @@ void set_attenuation_value(double value) {
       scale_dialog=gtk_dialog_new_with_buttons(title,GTK_WINDOW(top_window),GTK_DIALOG_DESTROY_WITH_PARENT,NULL,NULL);
       GtkWidget *content=gtk_dialog_get_content_area(GTK_DIALOG(scale_dialog));
       if (have_rx_gain) {
-          printf("************** set attenuation scale [-12, 48] \n");
         attenuation_scale=gtk_scale_new_with_range(GTK_ORIENTATION_HORIZONTAL,-12.0, 48.0, 1.00);
       } else {
         attenuation_scale=gtk_scale_new_with_range(GTK_ORIENTATION_HORIZONTAL,0.0, 31.0, 1.00);