Added external amp in output mode

master
erikkaashoek 5 years ago
parent 8921e10de4
commit ac6dd84250

@ -992,7 +992,7 @@ typedef struct uistat {
uint8_t marker_noise; uint8_t marker_noise;
uint8_t marker_tracking; uint8_t marker_tracking;
uint8_t auto_center_marker; uint8_t auto_center_marker;
char text[20]; char text[28];
} uistat_t; } uistat_t;
typedef struct ui_button { typedef struct ui_button {

@ -303,8 +303,8 @@ void set_sweep_time_us(uint32_t t) // Set the sweep time as the user wa
if (t > MAXIMUM_SWEEP_TIME) if (t > MAXIMUM_SWEEP_TIME)
t = MAXIMUM_SWEEP_TIME; t = MAXIMUM_SWEEP_TIME;
setting.sweep_time_us = t; setting.sweep_time_us = t;
if (MODE_OUTPUT(setting.mode)) // if (MODE_OUTPUT(setting.mode))
setting.actual_sweep_time_us = t; // To ensure time displayed is correct before first sweep is completed // setting.actual_sweep_time_us = t; // To ensure time displayed is correct before first sweep is completed
#if 0 #if 0
uint32_t ta = calc_min_sweep_time_us(); // Can not be faster than minimum sweep time uint32_t ta = calc_min_sweep_time_us(); // Can not be faster than minimum sweep time
if (ta < t) if (ta < t)

@ -491,8 +491,8 @@ enum {
MT_LOW = 0x40, // Only applicable to low mode MT_LOW = 0x40, // Only applicable to low mode
MT_FORM = 0x80, // Large button menu MT_FORM = 0x80, // Large button menu
}; };
#define MT_BACK 0x40 //#define MT_BACK 0x40
#define MT_LEAVE 0x20 //#define MT_LEAVE 0x20
#define MT_MASK(x) (0xF & (x)) #define MT_MASK(x) (0xF & (x))
// Call back functions for MT_CALLBACK type // Call back functions for MT_CALLBACK type

@ -455,6 +455,7 @@ static const menuitem_t menu_top[];
static const menuitem_t menu_reffer[]; static const menuitem_t menu_reffer[];
static const menuitem_t menu_modulation[]; static const menuitem_t menu_modulation[];
static const menuitem_t menu_drive_wide[]; static const menuitem_t menu_drive_wide[];
static const menuitem_t menu_sweep[];
#ifdef __ULTRA__ #ifdef __ULTRA__
static const menuitem_t menu_tophigh[]; static const menuitem_t menu_tophigh[];
static const menuitem_t menu_topultra[]; static const menuitem_t menu_topultra[];
@ -462,6 +463,25 @@ static const menuitem_t menu_topultra[];
#define AUTO_ICON(S) (S>=2?BUTTON_ICON_CHECK_AUTO:S) // Depends on order of ICONs!!!!! #define AUTO_ICON(S) (S>=2?BUTTON_ICON_CHECK_AUTO:S) // Depends on order of ICONs!!!!!
static UI_FUNCTION_ADV_CALLBACK(menu_sweep_acb)
{
(void)data;
if (b){
if (setting.level_sweep != 0 || get_sweep_frequency(ST_SPAN) != 0) {
plot_printf(uistat.text, sizeof uistat.text, "SW:%3.2fMHz %+ddB %.3Fs",
get_sweep_frequency(ST_SPAN) / 1000000.0,
(int)setting.level_sweep,
setting.sweep_time_us/(float)ONE_SECOND_TIME);
b->param_1.text = uistat.text;
}
else
b->param_1.text = "SWEEP: OFF";
return;
}
menu_push_submenu(menu_sweep);
}
static UI_FUNCTION_ADV_CALLBACK(menu_mode_acb) static UI_FUNCTION_ADV_CALLBACK(menu_mode_acb)
{ {
(void)data; (void)data;
@ -701,7 +721,7 @@ static UI_FUNCTION_ADV_CALLBACK(menu_drive_acb)
{ {
(void)item; (void)item;
if(b){ if(b){
b->param_1.i = menu_drive_value[data]; b->param_1.i = menu_drive_value[data] + (setting.mode==M_GENHIGH ? setting.offset : 0);
b->icon = data == setting.drive ? BUTTON_ICON_GROUP_CHECKED : BUTTON_ICON_GROUP; b->icon = data == setting.drive ? BUTTON_ICON_GROUP_CHECKED : BUTTON_ICON_GROUP;
return; return;
} }
@ -716,7 +736,7 @@ static UI_FUNCTION_ADV_CALLBACK(menu_sdrive_acb){
(void)item; (void)item;
(void)data; (void)data;
if(b){ if(b){
b->param_1.i = menu_drive_value[setting.drive]; b->param_1.i = menu_drive_value[setting.drive] + (setting.mode==M_GENHIGH ? setting.offset : 0);
return; return;
} }
menu_push_submenu(menu_drive_wide); menu_push_submenu(menu_drive_wide);
@ -1448,14 +1468,25 @@ static const menuitem_t menu_modulation[] = {
{ MT_FORM | MT_NONE, 0, NULL, NULL } // sentinel { MT_FORM | MT_NONE, 0, NULL, NULL } // sentinel
}; };
static const menuitem_t menu_sweep[] = {
{ MT_FORM | MT_KEYPAD, KM_SPAN, "SPAN: %s", "0..350MHz"},
{ MT_FORM | MT_KEYPAD | MT_LOW, KM_LEVELSWEEP,"LEVEL CHANGE: %s", "-70..70"},
{ MT_FORM | MT_KEYPAD, KM_SWEEP_TIME, "SWEEP TIME: %s", "0..600 seconds"},
{ MT_FORM | MT_CANCEL, 0, S_LARROW" BACK",NULL },
{ MT_FORM | MT_NONE, 0, NULL, NULL } // sentinel
};
static const menuitem_t menu_lowoutputmode[] = { static const menuitem_t menu_lowoutputmode[] = {
{ MT_FORM | MT_ADV_CALLBACK, 0, "LOW OUTPUT %s", menu_outputmode_acb}, { MT_FORM | MT_ADV_CALLBACK, 0, "LOW OUTPUT %s", menu_outputmode_acb},
{ MT_FORM | MT_KEYPAD, KM_CENTER, "FREQ: %s", "10kHz..350MHz"}, { MT_FORM | MT_KEYPAD, KM_CENTER, "FREQ: %s", "10kHz..350MHz"},
{ MT_FORM | MT_KEYPAD, KM_LOWOUTLEVEL, "LEVEL: %s", "-76..-6"}, { MT_FORM | MT_KEYPAD, KM_LOWOUTLEVEL, "LEVEL: %s", "-76..-6"},
{ MT_FORM | MT_ADV_CALLBACK, 0, "MOD: %s", menu_smodulation_acb}, { MT_FORM | MT_ADV_CALLBACK, 0, "MOD: %s", menu_smodulation_acb},
{ MT_FORM | MT_KEYPAD, KM_SPAN, "SPAN: %s", "0..350MHz"}, { MT_FORM | MT_ADV_CALLBACK, 0, "%s", menu_sweep_acb},
{ MT_FORM | MT_KEYPAD | MT_LOW, KM_LEVELSWEEP,"LEVEL CHANGE: %s", "-70..70"}, // { MT_FORM | MT_KEYPAD, KM_SPAN, "SPAN: %s", "0..350MHz"},
{ MT_FORM | MT_KEYPAD, KM_SWEEP_TIME, "SWEEP TIME: %s", "0..600 seconds"}, // { MT_FORM | MT_KEYPAD | MT_LOW, KM_LEVELSWEEP,"LEVEL CHANGE: %s", "-70..70"},
// { MT_FORM | MT_KEYPAD, KM_SWEEP_TIME, "SWEEP TIME: %s", "0..600 seconds"},
{ MT_FORM | MT_KEYPAD, KM_OFFSET, "AMP: %s", "-100..+100"},
{ MT_FORM | MT_CANCEL, 0, "MODE", NULL }, { MT_FORM | MT_CANCEL, 0, "MODE", NULL },
{ MT_FORM | MT_NONE, 0, NULL, NULL } // sentinel { MT_FORM | MT_NONE, 0, NULL, NULL } // sentinel
}; };
@ -1467,6 +1498,7 @@ static const menuitem_t menu_highoutputmode[] = {
{ MT_FORM | MT_ADV_CALLBACK, 0, "MOD: %s", menu_smodulation_acb}, { MT_FORM | MT_ADV_CALLBACK, 0, "MOD: %s", menu_smodulation_acb},
{ MT_FORM | MT_KEYPAD, KM_SPAN, "SPAN: %s", NULL}, { MT_FORM | MT_KEYPAD, KM_SPAN, "SPAN: %s", NULL},
{ MT_FORM | MT_KEYPAD, KM_SWEEP_TIME,"SWEEP TIME: %s", "0..600 seconds"}, { MT_FORM | MT_KEYPAD, KM_SWEEP_TIME,"SWEEP TIME: %s", "0..600 seconds"},
{ MT_FORM | MT_KEYPAD, KM_OFFSET, "AMP: %s", "-100..+100"},
{ MT_FORM | MT_CANCEL, 0, "MODE", NULL }, { MT_FORM | MT_CANCEL, 0, "MODE", NULL },
{ MT_FORM | MT_NONE, 0, NULL, NULL } // sentinel { MT_FORM | MT_NONE, 0, NULL, NULL } // sentinel
}; };
@ -2042,6 +2074,8 @@ static void fetch_numeric_target(void)
end_level = -76; end_level = -76;
if (end_level > -6) if (end_level > -6)
end_level = -6; end_level = -6;
uistat.value += setting.offset;
end_level += setting.offset;
if (setting.level_sweep != 0) if (setting.level_sweep != 0)
plot_printf(uistat.text, sizeof uistat.text, "%d to %ddBm", ((int32_t)uistat.value), end_level); plot_printf(uistat.text, sizeof uistat.text, "%d to %ddBm", ((int32_t)uistat.value), end_level);
else else
@ -2164,7 +2198,7 @@ set_numeric_value(void)
set_drive(uistat.value); set_drive(uistat.value);
break; break;
case KM_LOWOUTLEVEL: case KM_LOWOUTLEVEL:
set_level(uistat.value); set_level(uistat.value - setting.offset);
break; break;
case KM_DECAY: case KM_DECAY:
set_decay(uistat.value); set_decay(uistat.value);

Loading…
Cancel
Save

Powered by TurnKey Linux.