Correct wrong marker frequencies

pull/8/head
erikkaashoek 5 years ago
parent b798ea2649
commit 8a4179c684

@ -185,6 +185,8 @@ static THD_FUNCTION(Thread1, arg)
int i = marker_search();
if (i != -1 && active_marker != -1) {
markers[active_marker].index = i;
markers[active_marker].frequency = frequencies[i];
redraw_request |= REDRAW_MARKER;
}
}
@ -1054,6 +1056,7 @@ update_marker_index(void)
for (i = 0; i < sweep_points-1; i++) {
if (frequencies[i] <= f && f < frequencies[i+1]) {
markers[m].index = f < (frequencies[i] / 2 + frequencies[i + 1] / 2) ? i : i + 1;
markers[m].frequency = frequencies[markers[m].index ];
break;
}
}

@ -1328,6 +1328,7 @@ search_maximum(int m, int center, int span)
}
}
markers[m].index = max_index[0];
markers[m].frequency = frequencies[markers[m].index];
return found;
}
@ -2272,10 +2273,14 @@ sweep_again: // stay in sweep loop when output mo
}
uint32_t lf = frequencies[l];
uint32_t rf = frequencies[r];
markers[0].frequency = lf;
markers[1].frequency = rf;
markers[2].enabled = search_maximum(2, lf - (rf - lf), 12);
markers[3].enabled = search_maximum(3, rf + (rf - lf), 12);
} else if (setting.measurement == M_PHASE_NOISE && markers[0].index > 10) { // ------------Phase noise measurement
markers[1].index = markers[0].index + (setting.mode == M_LOW ? 290/4 : -290/4); // Position phase noise marker at requested offset
markers[1].frequency = frequencies[markers[1].index];
} else if (setting.measurement == M_STOP_BAND && markers[0].index > 10) { // -------------Stop band measurement
markers[1].index = marker_search_left_min(markers[0].index);
if (markers[1].index < 0) markers[1].index = 0;

@ -948,6 +948,7 @@ static UI_FUNCTION_ADV_CALLBACK(menu_marker_select_acb)
return;
}
markers[data-1].enabled = true;
markers[data-1].frequency = frequencies[markers[data-1].index];
active_marker_select(data-1);
menu_push_submenu(menu_marker_modify);
redraw_marker(active_marker);

Loading…
Cancel
Save

Powered by TurnKey Linux.