From b8215bc0b7b32d391e4ff3dae17f7825c8010429 Mon Sep 17 00:00:00 2001 From: erikkaashoek Date: Thu, 20 Jan 2022 10:16:42 +0100 Subject: [PATCH] Small UI repairs --- main.c | 6 +++--- plot.c | 6 ++++-- ui_sa.c | 6 +++--- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/main.c b/main.c index 8e16f95..6b07f40 100644 --- a/main.c +++ b/main.c @@ -725,7 +725,7 @@ void send_region(remote_region_t *rd, uint8_t * buf, uint16_t size) if (SDU1.config->usbp->state == USB_ACTIVE) { streamWrite(shell_stream, (void*) rd, sizeof(remote_region_t)); streamWrite(shell_stream, (void*) buf, size); - streamWrite(shell_stream, (void*)"ch> \r\n", 6); + streamWrite(shell_stream, (void*)"ch> ", 4); } else auto_capture = false; @@ -1620,7 +1620,7 @@ VNA_SHELL_FUNCTION(cmd_marker) return; } usage: - shell_printf("marker [n] [%s|{freq}] [{index}|%s]\r\n", cmd_marker_list, cmd_marker_on_off); + shell_printf("marker [n] [%s|{freq}|{index}] [{n}|%s]\r\n", cmd_marker_list, cmd_marker_on_off); } VNA_SHELL_FUNCTION(cmd_touchcal) @@ -2020,7 +2020,7 @@ VNA_SHELL_FUNCTION(cmd_help) shell_printf(" %s", scp->sc_name); scp++; } - shell_printf("\r\nEnter for more info: {command} ?\r\n"); +// shell_printf("\r\nEnter for more info: {command} ?\r\n"); return; } diff --git a/plot.c b/plot.c index 27b47cd..162a409 100644 --- a/plot.c +++ b/plot.c @@ -1535,7 +1535,7 @@ static void trace_print_value_string( // Only used at one place cell_printf(xpos, ypos, format, buf2, v, unit_string[unit_index], (mtype & M_NOISE?"/Hz":""), (mtype & M_AVER?"/T":"")); #ifdef __LEVEL_METER__ if (level_text[0] == 0) - plot_printf(level_text, sizeof(level_text), &format[3], v, "", "" ,""); + plot_printf(level_text, sizeof(level_text), &format[3], v, unit_string[unit_index], (mtype & M_NOISE?"/Hz":"") ,(mtype & M_AVER?"/T":"")); #endif } @@ -2069,7 +2069,9 @@ static void update_level_meter(void){ // ili9341_fill(OFFSETX+minimum_text_width, graph_bottom+1, area_width-minimum_text_width, CHART_BOTTOM - graph_bottom); ili9341_set_foreground(LCD_FG_COLOR); int x_max = area_width+OFFSETX; - int w = ili9341_drawstring_size(level_text,OFFSETX, graph_bottom+1,4, x_max) + OFFSETX; + int w = ili9341_drawstring_size(level_text,OFFSETX, graph_bottom+1,3, x_max); // TODO Size 4 does not transfer to remote desktop?????? + ili9341_fill(OFFSETX, graph_bottom+34, x_max - OFFSETX, 11); + if (w < x_max) ili9341_fill(w, graph_bottom+1, x_max - w, CHART_BOTTOM - graph_bottom+1); } diff --git a/ui_sa.c b/ui_sa.c index 7c1a1ac..007ef6d 100644 --- a/ui_sa.c +++ b/ui_sa.c @@ -2794,8 +2794,8 @@ static const menuitem_t menu_actual_power[] = static const menuitem_t menu_settings[] = { - { MT_ADV_CALLBACK | MT_LOW, 0,"LO OUTPUT", menu_lo_output_acb}, { MT_SUBMENU, 0, "LEVEL\nCORRECTION", menu_actual_power}, + { MT_ADV_CALLBACK | MT_LOW, 0,"LO OUTPUT", menu_lo_output_acb}, { MT_KEYPAD | MT_LOW, KM_IF, "IF FREQ", "0=auto IF"}, { MT_SUBMENU,0, "SCAN\nSPEED", menu_scanning_speed}, #ifndef TINYSA4 @@ -2860,7 +2860,7 @@ static const menuitem_t menu_calibrate[] = { { MT_FORM | MT_TITLE, 0, "Connect HIGH and LOW", NULL}, { MT_FORM | MT_CALLBACK, 0, "CALIBRATE", menu_calibrate_cb}, - { MT_FORM | MT_CALLBACK, 0, "RESET CALBRATION", menu_calibrate_cb}, + { MT_FORM | MT_CALLBACK, 0, "RESET CALIBRATION", menu_calibrate_cb}, { MT_FORM | MT_NONE, 0, NULL, menu_back} // next-> menu_back }; #endif @@ -3495,7 +3495,7 @@ float my_round(float v) } return v; } -const char * const unit_string[MAX_UNIT_TYPE*2] = { "dBm", "dBmV", "dB"S_MICRO"V", "RAW", "V", "W", "dB", "dBmV", "dB"S_MICRO"V", "RAW", "V", "W" }; // unit + 6 is delta unit +const char * const unit_string[MAX_UNIT_TYPE*2] = { "dBm", "dBmV", "dB"S_MICRO"V", "RAW", "V", "W", "dB", "dB", "dB", "RAW", "V", "W" }; // unit + 6 is delta unit static const float scale_value[]={50000, 20000, 10000, 5000, 2000, 1000, 500, 200, 100, 50, 20,10,5,2,1,0.5,0.2,0.1,0.05,0.02,0.01,0.005,0.002, 0.001,0.0005,0.0002, 0.0001}; static const char * const scale_vtext[]= {"50000", "20000", "10000", "5000", "2000", "1000", "500", "200", "100", "50", "20","10","5","2","1","0.5","0.2","0.1","0.05","0.02","0.01", "0.005","0.002","0.001", "0.0005","0.0002","0.0001"};