mirror of
https://github.com/ttrftech/NanoVNA.git
synced 2026-04-09 00:13:59 +00:00
feat: add marker tracking
This commit is contained in:
parent
2d8be205d0
commit
18a1ca4e6e
4 changed files with 37 additions and 18 deletions
21
plot.c
21
plot.c
|
|
@ -658,7 +658,8 @@ format_smith_value(char *buf, int len, const float coeff[2], uint32_t frequency)
|
|||
|
||||
case MS_RX:
|
||||
n = string_value_with_prefix(buf, len, zr, S_OHM[0]);
|
||||
buf[n++] = ' ';
|
||||
if (zi >= 0)
|
||||
buf[n++] = ' ';
|
||||
string_value_with_prefix(buf+n, len-n, zi, 'j');
|
||||
break;
|
||||
|
||||
|
|
@ -1161,19 +1162,14 @@ static int greater(int x, int y) { return x > y; }
|
|||
static int lesser(int x, int y) { return x < y; }
|
||||
|
||||
static int (*compare)(int x, int y) = lesser;
|
||||
|
||||
int8_t marker_tracking = false;
|
||||
|
||||
int
|
||||
marker_search(int mode)
|
||||
marker_search(void)
|
||||
{
|
||||
int i;
|
||||
int found = 0;
|
||||
|
||||
if (mode == 0)
|
||||
compare = greater;
|
||||
else
|
||||
compare = lesser;
|
||||
|
||||
if (uistat.current_trace == -1)
|
||||
return -1;
|
||||
|
||||
|
|
@ -1189,6 +1185,15 @@ marker_search(int mode)
|
|||
return found;
|
||||
}
|
||||
|
||||
void
|
||||
set_marker_search(int mode)
|
||||
{
|
||||
if (mode == 0)
|
||||
compare = greater;
|
||||
else
|
||||
compare = lesser;
|
||||
}
|
||||
|
||||
int
|
||||
marker_search_left(int from)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue