Skip to content

Commit

Permalink
Add freq big number
Browse files Browse the repository at this point in the history
  • Loading branch information
erikkaashoek committed Dec 14, 2022
1 parent 1da836e commit 47a9cbc
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion plot.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ static void update_waterfall(void);
#ifdef __LEVEL_METER__
static void update_level_meter(void);
char level_text[20];
char freq_text[20];
#endif
void cell_draw_test_info(int x0, int y0);
int cell_printf(int16_t x, int16_t y, const char *fmt, ...);
Expand Down Expand Up @@ -1255,6 +1256,9 @@ draw_all(bool flush)
if (isFullScreenMode()) return;
#ifdef __LEVEL_METER__
level_text[0] = 0; // Clear level text
#ifdef TINYSA4
freq_text[0] = 0; // Clear level text
#endif
#endif
if (redraw_request & REDRAW_AREA) // this set all area for update
force_set_markmap();
Expand Down Expand Up @@ -1544,6 +1548,11 @@ static void trace_print_value_string( // Only used at one place
#endif
plot_printf(ptr2, sizeof(buf2) - 9, "%9.*QHz", digits, freq);
}
#ifdef __LEVEL_METER__
#ifdef TINYSA4
if (freq_text[0] == 0) strcpy(freq_text, &ptr2[3]);
#endif
#endif
const char *format;
if (UNIT_IS_LINEAR(setting.unit))
format = FONT_s"%s %.3F%s%s%s%s"; // 5 characters incl u, m, etc...
Expand All @@ -1556,8 +1565,9 @@ static void trace_print_value_string( // Only used at one place
#endif
cell_printf(xpos, ypos, format, buf2, v, unit_string[unit_index], (mtype & M_DELTA?"c":"") , (mtype & M_NOISE?"/Hz":""), (mtype & M_AVER?"/T":""));
#ifdef __LEVEL_METER__
if (level_text[0] == 0)
if (level_text[0] == 0){
plot_printf(level_text, sizeof(level_text), &format[3], v, unit_string[unit_index], (mtype & M_DELTA?"c":"") , (mtype & M_NOISE?"/Hz":"") ,(mtype & M_AVER?"/T":""));
}
#endif
}

Expand Down Expand Up @@ -2118,6 +2128,11 @@ static void update_level_meter(void){
int w = ili9341_drawstring_size(level_text, OFFSETX + 3, graph_bottom + 3,BIG_SIZE, x_max); // TODO Size 4 does not transfer to remote desktop??????
if (w < x_max)
ili9341_fill(w, graph_bottom+3, x_max - w, BIG_SIZE * wFONT_GET_HEIGHT);
#ifdef TINYSA4
w = ili9341_drawstring_size(freq_text, OFFSETX + 3, graph_bottom + 3 + BIG_SIZE * wFONT_STR_HEIGHT ,BIG_SIZE, x_max); // TODO Size 4 does not transfer to remote desktop??????
if (w < x_max)
ili9341_fill(w, graph_bottom+3+ BIG_SIZE * wFONT_STR_HEIGHT, x_max - w, BIG_SIZE * wFONT_GET_HEIGHT);
#endif
}

void
Expand Down

0 comments on commit 47a9cbc

Please sign in to comment.