Do not display dirty trace

Removed_REF_marker
erikkaashoek 5 years ago
parent 84c5595883
commit 22ad9ecd48

@ -104,7 +104,7 @@ static void transform_domain(void);
static int8_t drive_strength = DRIVE_STRENGTH_AUTO; static int8_t drive_strength = DRIVE_STRENGTH_AUTO;
#endif #endif
uint8_t sweep_mode = SWEEP_ENABLE; uint8_t sweep_mode = SWEEP_ENABLE;
uint8_t redraw_request = 0; // contains REDRAW_XXX flags uint16_t redraw_request = 0; // contains REDRAW_XXX flags
uint8_t auto_capture = false; uint8_t auto_capture = false;
// Version text, displayed in Config->Version menu, also send by info command // Version text, displayed in Config->Version menu, also send by info command
const char *info_about[]={ const char *info_about[]={
@ -192,7 +192,7 @@ static THD_FUNCTION(Thread1, arg)
ui_process(); ui_process();
// Process collected data, calculate trace coordinates and plot only if scan // Process collected data, calculate trace coordinates and plot only if scan
// completed // completed
if (/* sweep_mode & SWEEP_ENABLE && */ completed) { if ((redraw_request & (CLEAR_ACTUAL | CLEAR_STORED | CLEAR_TEMP) ) || completed) {
// START_PROFILE; // START_PROFILE;
// Prepare draw graphics, cache all lines, mark screen cells for redraw // Prepare draw graphics, cache all lines, mark screen cells for redraw
plot_into_index(measured); plot_into_index(measured);

@ -124,7 +124,7 @@
#define MARKER_COUNT 4 #define MARKER_COUNT 4
#define TRACES_MAX 3 #define TRACES_MAX 3
#define TRACE_ACTUAL 0 #define TRACE_ACTUAL 0 // order linked to redraw_request flags!!!!!
#define TRACE_STORED 1 #define TRACE_STORED 1
#define TRACE_TEMP 2 #define TRACE_TEMP 2
//#define TRACE_AGE 3 //#define TRACE_AGE 3
@ -797,7 +797,10 @@ int marker_search_right_min(int from);
#define REDRAW_BATTERY (1<<4) #define REDRAW_BATTERY (1<<4)
#define REDRAW_AREA (1<<5) #define REDRAW_AREA (1<<5)
#define REDRAW_TRIGGER (1<<6) #define REDRAW_TRIGGER (1<<6)
extern uint8_t redraw_request; #define CLEAR_ACTUAL (1<<7)
#define CLEAR_STORED (1<<8)
#define CLEAR_TEMP (1<<9)
extern uint16_t redraw_request;
/* /*
* ili9341.c * ili9341.c
@ -1297,6 +1300,10 @@ void touch_cal_exec(void);
void touch_draw_test(void); void touch_draw_test(void);
void enter_dfu(void); void enter_dfu(void);
#ifdef TINYSA4
extern char range_text[20];
#endif
/* /*
* adc.c * adc.c
*/ */

@ -24,7 +24,7 @@
#include "nanovna.h" #include "nanovna.h"
#pragma GCC push_options #pragma GCC push_options
#pragma GCC optimize ("O2") // Makes the code just a bit faster, disable during debugging. #pragma GCC optimize ("Og") // Makes the code just a bit faster, disable during debugging.
#ifdef __SCROLL__ #ifdef __SCROLL__
uint16_t _grid_y = (CHART_BOTTOM / NGRIDY); uint16_t _grid_y = (CHART_BOTTOM / NGRIDY);
@ -489,6 +489,8 @@ mark_cells_from_index(void)
for (t = 0; t < TRACES_MAX; t++) { for (t = 0; t < TRACES_MAX; t++) {
if (!trace[t].enabled) if (!trace[t].enabled)
continue; continue;
if ((CLEAR_ACTUAL << t ) & redraw_request )
continue; // dirty, do not draw
index_y_t *index_y = trace_index_y[t]; index_y_t *index_y = trace_index_y[t];
int m0 = index_x[0] / CELLWIDTH; int m0 = index_x[0] / CELLWIDTH;
int n0 = index_y[0] / CELLHEIGHT; int n0 = index_y[0] / CELLHEIGHT;
@ -823,6 +825,9 @@ plot_into_index(measurement_t measured)
for (t = 0; t < TRACES_MAX; t++) { for (t = 0; t < TRACES_MAX; t++) {
if (!trace[t].enabled) if (!trace[t].enabled)
continue; continue;
if ((CLEAR_ACTUAL << t ) & redraw_request ) {
continue; // dirty, do not draw
}
trace_into_index_y_array(trace_index_y[t], measured[t], sweep_points); trace_into_index_y_array(trace_index_y[t], measured[t], sweep_points);
} }
// STOP_PROFILE // STOP_PROFILE
@ -945,6 +950,9 @@ draw_cell(int m, int n)
for (t = 0; t < TRACES_MAX; t++) { for (t = 0; t < TRACES_MAX; t++) {
if (!trace[t].enabled) if (!trace[t].enabled)
continue; continue;
if ((CLEAR_ACTUAL << t ) & redraw_request )
continue; // dirty, do not draw
c = GET_PALTETTE_COLOR(LCD_TRACE_1_COLOR + t); c = GET_PALTETTE_COLOR(LCD_TRACE_1_COLOR + t);
index_y_t *index_y = trace_index_y[t]; index_y_t *index_y = trace_index_y[t];
for (i = i0; i < i1; i++) { for (i = i0; i < i1; i++) {

@ -141,6 +141,9 @@ void update_min_max_freq(void)
maxFreq = LOW_MAX_FREQ; maxFreq = LOW_MAX_FREQ;
#else #else
maxFreq = DEFAULT_MAX_FREQ; maxFreq = DEFAULT_MAX_FREQ;
#endif
#ifdef TINYSA4
plot_printf(range_text, sizeof range_text, "%QHz to %QHz", minFreq, maxFreq);
#endif #endif
break; break;
case M_GENLOW: case M_GENLOW:
@ -170,6 +173,9 @@ void update_min_max_freq(void)
#endif #endif
break; break;
} }
#ifdef TINYSA4
plot_printf(range_text, sizeof range_text, "%.3QHz to %.3QHz", minFreq, maxFreq);
#endif
} }
void reset_settings(int m) void reset_settings(int m)
@ -1080,11 +1086,7 @@ void set_average(int v)
&& (v != AV_QUASI) && (v != AV_QUASI)
#endif #endif
); );
if (trace[TRACE_TEMP].enabled) { if (trace[TRACE_TEMP].enabled) redraw_request |= REDRAW_AREA | REDRAW_CAL_STATUS | CLEAR_ACTUAL | CLEAR_TEMP;
for (int i=0; i<sweep_points; i++)
temp_t[i] = 0;
redraw_request |= REDRAW_AREA | REDRAW_CAL_STATUS;
}
//dirty = true; // No HW update required, only status panel refresh //dirty = true; // No HW update required, only status panel refresh
} }

@ -1446,9 +1446,9 @@ menu_invoke(int item)
kp_help_text = (char *)menu->reference; kp_help_text = (char *)menu->reference;
if (menu->data <= KM_CW) { // One of the frequency input keypads if (menu->data <= KM_CW) { // One of the frequency input keypads
if (MODE_LOW(setting.mode)) if (MODE_LOW(setting.mode))
kp_help_text = VARIANT("0..350MHz","0..800MHz"); kp_help_text = VARIANT("0..350MHz",range_text);
else else
kp_help_text = VARIANT("240..960Mhz","136..4350MHz"); kp_help_text = VARIANT("240..960Mhz",range_text);
} }
ui_mode_keypad(menu->data); ui_mode_keypad(menu->data);
redraw_request |= REDRAW_CAL_STATUS; redraw_request |= REDRAW_CAL_STATUS;

@ -518,6 +518,7 @@ static const menuitem_t menu_curve_confirm[];
#endif #endif
static const menuitem_t menu_sweep[]; static const menuitem_t menu_sweep[];
extern bool dirty; extern bool dirty;
char range_text[20];
static UI_FUNCTION_ADV_CALLBACK(menu_sweep_acb) static UI_FUNCTION_ADV_CALLBACK(menu_sweep_acb)
{ {
@ -1942,7 +1943,7 @@ static const menuitem_t menu_modulation[] = {
}; };
static const menuitem_t menu_sweep[] = { static const menuitem_t menu_sweep[] = {
{ MT_FORM | MT_KEYPAD, KM_SPAN, "SPAN: %s", VARIANT("0..350MHz", "0..800MHz")}, { MT_FORM | MT_KEYPAD, KM_SPAN, "SPAN: %s", VARIANT("0..350MHz", range_text)},
{ MT_FORM | MT_KEYPAD | MT_LOW, KM_LEVELSWEEP,"LEVEL CHANGE: %s", VARIANT("-70..70","-90..90")}, { MT_FORM | MT_KEYPAD | MT_LOW, KM_LEVELSWEEP,"LEVEL CHANGE: %s", VARIANT("-70..70","-90..90")},
{ 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_SUBMENU, 0, "SWEEP POINTS", menu_sweep_points_form}, { MT_FORM | MT_SUBMENU, 0, "SWEEP POINTS", menu_sweep_points_form},
@ -1973,7 +1974,7 @@ static const menuitem_t menu_lowoutputmode[] = {
static const menuitem_t menu_highoutputmode[] = { static const menuitem_t menu_highoutputmode[] = {
{ MT_FORM | MT_ADV_CALLBACK, 0, "HIGH OUTPUT %s", menu_outputmode_acb}, { MT_FORM | MT_ADV_CALLBACK, 0, "HIGH OUTPUT %s", menu_outputmode_acb},
{ MT_FORM | MT_KEYPAD, KM_CENTER, center_text, VARIANT("240MHz..960MHz","136MHz..4350MHz")}, { MT_FORM | MT_KEYPAD, KM_CENTER, center_text, VARIANT("240MHz..960MHz",range_text)},
{ MT_FORM | MT_KEYPAD, KM_HIGHOUTLEVEL, "LEVEL: %s", low_level_help_text /* "-76..-6" */}, { MT_FORM | MT_KEYPAD, KM_HIGHOUTLEVEL, "LEVEL: %s", low_level_help_text /* "-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_ADV_CALLBACK, 0, "%s", menu_sweep_acb}, { MT_FORM | MT_ADV_CALLBACK, 0, "%s", menu_sweep_acb},

Loading…
Cancel
Save

Powered by TurnKey Linux.