mirror of
https://github.com/ttrftech/NanoVNA.git
synced 2026-04-05 14:35:50 +00:00
minor fixes
This commit is contained in:
parent
8f0bfacf3d
commit
b17ecfa533
2 changed files with 13 additions and 9 deletions
10
plot.c
10
plot.c
|
|
@ -701,6 +701,12 @@ trace_get_info(int t, char *buf, int len)
|
|||
}
|
||||
}
|
||||
|
||||
static float distance_of_index(int idx) {
|
||||
#define SPEED_OF_LIGHT 299792458
|
||||
float distance = ((float)idx * (float)SPEED_OF_LIGHT) / ( (float)(frequencies[1] - frequencies[0]) * 128.0 * 2.0);
|
||||
return distance * (velocity_factor / 100.0);
|
||||
}
|
||||
|
||||
static inline void
|
||||
mark_map(int x, int y)
|
||||
{
|
||||
|
|
@ -1371,9 +1377,7 @@ cell_draw_marker_info(int m, int n, int w, int h)
|
|||
frequency_string(buf, sizeof buf, frequencies[idx]);
|
||||
cell_drawstring_5x7(w, h, buf, xpos, ypos, 0xffff);
|
||||
} else {
|
||||
#define SPEED_OF_LIGHT 299792458
|
||||
float distance = ((float)idx * (float)SPEED_OF_LIGHT) / ( (float)(frequencies[1] - frequencies[0]) * 128.0 * 2.0);
|
||||
chsnprintf(buf, sizeof buf, "%.1f m (%d%%)", distance * (velocity_factor / 100.0), velocity_factor);
|
||||
chsnprintf(buf, sizeof buf, "%.1f m (VF=%d%%)", distance_of_index(idx), velocity_factor);
|
||||
cell_drawstring_5x7(w, h, buf, xpos, ypos, 0xffff);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue