Change PASS BAND measurement not to ask for frequency

pull/5/head
erikkaashoek 5 years ago
parent 2b79faaeab
commit 47d41050ca

@ -2084,6 +2084,20 @@ static void cell_draw_marker_info(int x0, int y0)
if (setting.measurement == M_THD && active >= 1) if (setting.measurement == M_THD && active >= 1)
active = 2; active = 2;
for (int i = 0; i < MARKER_COUNT; i++) { for (int i = 0; i < MARKER_COUNT; i++) {
if (i == 3 && setting.measurement == M_PASS_BAND) {
uint32_t f;
if (markers[2].frequency>markers[1].frequency)
f = markers[2].frequency-markers[1].frequency;
else
f = markers[1].frequency-markers[2].frequency;
plot_printf(buf, sizeof buf, "WIDTH: %8.3qHz", f);
j = 3;
int xpos = 1 + (j%2)*(WIDTH/2) + CELLOFFSETX - x0;
int ypos = 1 + (j/2)*(16) - y0;
cell_drawstring_7x13(buf, xpos, ypos);
// cell_drawstring(buf, xpos, ypos);
break;
} else
if (i >= 2 && setting.measurement == M_THD) { if (i >= 2 && setting.measurement == M_THD) {
if (i == 2 && (markers[0].index << 5) > sweep_points ) { if (i == 2 && (markers[0].index << 5) > sweep_points ) {
int old_unit = setting.unit; int old_unit = setting.unit;

@ -2376,14 +2376,14 @@ sweep_again: // stay in sweep loop when output mo
} else if (setting.measurement == M_PASS_BAND && markers[0].index > 10) { // ----------------Pass band measurement } else if (setting.measurement == M_PASS_BAND && markers[0].index > 10) { // ----------------Pass band measurement
int t = markers[0].index; int t = markers[0].index;
float v = actual_t[t]; float v = actual_t[t];
while (t > 0 && actual_t[t] > v - 6.0) // Find left -3dB point while (t > 0 && actual_t[t] > v - 4.0) // Find left -3dB point
t --; t --;
if (t > 0) { if (t > 0) {
markers[1].index = t; markers[1].index = t;
markers[1].frequency = frequencies[t]; markers[1].frequency = frequencies[t];
} }
t = markers[0].index; t = markers[0].index;
while (t < setting._sweep_points - 1 && actual_t[t] > v - 6.0) // find right -3dB point while (t < setting._sweep_points - 1 && actual_t[t] > v - 4.0) // find right -3dB point
t ++; t ++;
if (t < setting._sweep_points - 1 ) { if (t < setting._sweep_points - 1 ) {
markers[2].index = t; markers[2].index = t;

@ -833,18 +833,20 @@ static UI_FUNCTION_ADV_CALLBACK(menu_measure_acb)
break; break;
case M_PASS_BAND: // STop band measurement case M_PASS_BAND: // STop band measurement
reset_settings(setting.mode); // reset_settings(setting.mode);
markers[0].enabled = M_ENABLED;
markers[0].mtype = M_REFERENCE | M_TRACKING;
markers[1].enabled = M_ENABLED; markers[1].enabled = M_ENABLED;
markers[1].mtype = M_DELTA; markers[1].mtype = M_DELTA;
markers[2].enabled = M_ENABLED; markers[2].enabled = M_ENABLED;
markers[2].mtype = M_DELTA; markers[2].mtype = M_DELTA;
kp_help_text = "Frequency of signal"; // kp_help_text = "Frequency of signal";
ui_mode_keypad(KM_CENTER); // ui_mode_keypad(KM_CENTER);
ui_process_keypad(); // ui_process_keypad();
kp_help_text = "Width of signal"; // kp_help_text = "Width of signal";
ui_mode_keypad(KM_SPAN); // ui_mode_keypad(KM_SPAN);
ui_process_keypad(); // ui_process_keypad();
set_sweep_frequency(ST_SPAN, uistat.value*2); // set_sweep_frequency(ST_SPAN, uistat.value*2);
set_measurement(M_PASS_BAND); set_measurement(M_PASS_BAND);
// SetAverage(4); // SetAverage(4);
@ -1695,7 +1697,7 @@ static const menuitem_t menu_measure[] = {
{ MT_ADV_CALLBACK, M_OIP3, "OIP3", menu_measure_acb}, { MT_ADV_CALLBACK, M_OIP3, "OIP3", menu_measure_acb},
{ MT_ADV_CALLBACK, M_PHASE_NOISE,"PHASE\nNOISE", menu_measure_acb}, { MT_ADV_CALLBACK, M_PHASE_NOISE,"PHASE\nNOISE", menu_measure_acb},
{ MT_ADV_CALLBACK, M_STOP_BAND, "SNR", menu_measure_acb}, { MT_ADV_CALLBACK, M_STOP_BAND, "SNR", menu_measure_acb},
{ MT_ADV_CALLBACK, M_PASS_BAND, "-6dB\nWIDTH", menu_measure_acb}, { MT_ADV_CALLBACK, M_PASS_BAND, "-3dB\nWIDTH", menu_measure_acb},
{ MT_SUBMENU, 0, S_RARROW" MORE", menu_measure2}, { MT_SUBMENU, 0, S_RARROW" MORE", menu_measure2},
{ MT_CANCEL, 0, S_LARROW" BACK", NULL }, { MT_CANCEL, 0, S_LARROW" BACK", NULL },
{ MT_NONE, 0, NULL, NULL } // sentinel { MT_NONE, 0, NULL, NULL } // sentinel

Loading…
Cancel
Save

Powered by TurnKey Linux.