]> git.rkrishnan.org Git - pihpsdr.git/commitdiff
Extened the upper limit in Watt Meter Calibration in the 30-100 watt range
authorJohn Melton G0ORX <john.d.melton@googlemail.com>
Mon, 24 Feb 2020 11:44:18 +0000 (11:44 +0000)
committerJohn Melton G0ORX <john.d.melton@googlemail.com>
Mon, 24 Feb 2020 11:44:18 +0000 (11:44 +0000)
pa_menu.c

index 4470b114c1251533f4540beb1907b4ddf2a2e3c4..04e7d8a740bde18a1f75d26759a3a5b0d25cb942 100644 (file)
--- a/pa_menu.c
+++ b/pa_menu.c
@@ -100,6 +100,7 @@ static void show_W(int watts,gboolean reset) {
   int i;
   char text[16];
   int increment=watts/10;
+  double limit;
 
   if(reset) {
     for(i=0;i<11;i++) {
@@ -112,8 +113,13 @@ static void show_W(int watts,gboolean reset) {
     GtkWidget *label=gtk_label_new(NULL);
     gtk_label_set_markup(GTK_LABEL(label), text);
     gtk_grid_attach(GTK_GRID(grid2),label,0,i,1,1);
+    if(watts>=30 && watts <=100) {
+      limit=(double)((i*increment)+100);
+    } else {
+      limit=(double)((i+2)*increment);
+    }
 
-    GtkWidget *spin=gtk_spin_button_new_with_range(0.0,(double)((i+2)*increment),1.0);
+    GtkWidget *spin=gtk_spin_button_new_with_range(0.0,limit,1.0);
     gtk_grid_attach(GTK_GRID(grid2),spin,1,i,1,1);
     gtk_spin_button_set_value(GTK_SPIN_BUTTON(spin),(double)pa_trim[i]);
     g_signal_connect(spin,"value_changed",G_CALLBACK(trim_changed_cb),GINT_TO_POINTER(i));