From 27ea1a4355f8a9e4edd4ea05a392ed9cea85a46f Mon Sep 17 00:00:00 2001 From: John Melton G0ORX Date: Mon, 24 Feb 2020 11:44:18 +0000 Subject: [PATCH] Extened the upper limit in Watt Meter Calibration in the 30-100 watt range --- pa_menu.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pa_menu.c b/pa_menu.c index 4470b11..04e7d8a 100644 --- 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)); -- 2.45.2