From 89042d318edfe2001f7373a6cc66824d70661345 Mon Sep 17 00:00:00 2001 From: John Melton G0ORX Date: Sun, 1 Mar 2020 16:48:28 +0000 Subject: [PATCH] Changed S9 Meter reading to -93dBm for frequencies above 30MHz --- meter.c | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/meter.c b/meter.c index f77b9f5..1a691d5 100644 --- a/meter.c +++ b/meter.c @@ -33,6 +33,7 @@ #include "mode.h" #include "vox.h" #include "new_menu.h" +#include "vfo.h" static GtkWidget *parent_window; @@ -298,6 +299,13 @@ if(analog_meter) { cairo_set_source_rgb(cr, 1.0, 1.0, 1.0); angle=fmax(-127.0,level)+127.0+offset; + + // if frequency > 30MHz then -93 is S9 + if(vfo[active_receiver->id].frequency>30000000LL) { + angle=angle+20; + } + + radians=angle*M_PI/180.0; cairo_arc(cr, cx, cy, radius+8, radians, radians); cairo_line_to(cr, cx, cy); @@ -593,8 +601,6 @@ if(analog_meter) { } if(meter_width>=114) { - //int db=meter_width/114; // S9+60 (9*6)+60 - //if(db>2) db=2; int db=1; int i; cairo_set_line_width(cr, 1.0); @@ -636,15 +642,21 @@ if(analog_meter) { cairo_show_text(cr, "+60"); cairo_set_source_rgb(cr, 0.0, 1.0, 0.0); - cairo_rectangle(cr, offset+0.0, (double)(meter_height-40), (double)((fmax(-127.0,level)+127.0)*db), 20.0); + // if frequency > 30MHz then -93 is S9 + double l=fmax(-127.0,level); + if(vfo[active_receiver->id].frequency>30000000LL) { + l=level+20.0; + } + + cairo_rectangle(cr, offset+0.0, (double)(meter_height-40), (double)((l+127.0)*db), 20.0); cairo_fill(cr); - if(level>max_level || max_count==10) { - max_level=level; + if(l>max_level || max_count==10) { + max_level=l; max_count=0; } - if(max_level!=0) { + if(l!=0) { cairo_set_source_rgb(cr, 1.0, 1.0, 0.0); cairo_move_to(cr,offset+(double)((max_level+127.0)*db),(double)meter_height-20); cairo_line_to(cr,offset+(double)((max_level+127.0)*db),(double)(meter_height-40)); -- 2.45.2