Waterfall for any amounts of sweep points

Also remove bottom level indicator when in waterfall mode
pull/8/head
erikkaashoek 5 years ago
parent a54df8dad9
commit 566dbd0dfa

@ -2315,14 +2315,15 @@ static void update_waterfall(void){
int i; int i;
int w_width = area_width < POINTS_COUNT ? area_width : POINTS_COUNT; int w_width = area_width < POINTS_COUNT ? area_width : POINTS_COUNT;
// Waterfall only in 290 or 145 points // Waterfall only in 290 or 145 points
if (!(sweep_points == 290 || sweep_points == 145)) // if (!(sweep_points == 290 || sweep_points == 145))
return; // return;
for (i = CHART_BOTTOM-1; i >=graph_bottom+1; i--) { // Scroll down for (i = CHART_BOTTOM-1; i >=graph_bottom+1; i--) { // Scroll down
ili9341_read_memory(OFFSETX, i , w_width, 1, w_width*1, spi_buffer); ili9341_read_memory(OFFSETX, i , w_width, 1, w_width*1, spi_buffer);
ili9341_bulk(OFFSETX, i+1, w_width, 1); ili9341_bulk(OFFSETX, i+1, w_width, 1);
} }
index_t *index = trace_index[TRACE_ACTUAL]; index_t *index = trace_index[TRACE_ACTUAL];
for (i=0; i< w_width; i++) { // Add new topline int j = 0;
for (i=0; i< sweep_points; i++) { // Add new topline
uint16_t color; uint16_t color;
#ifdef _USE_WATERFALL_PALETTE #ifdef _USE_WATERFALL_PALETTE
uint16_t y = _PALETTE_ALIGN(CELL_Y(index[i])); // should be always in range 0 - graph_bottom uint16_t y = _PALETTE_ALIGN(CELL_Y(index[i])); // should be always in range 0 - graph_bottom
@ -2365,11 +2366,8 @@ static void update_waterfall(void){
else color = RGB565( 0, 124-((y-160)*4), 252-((y-160)*4)); else color = RGB565( 0, 124-((y-160)*4), 252-((y-160)*4));
#endif #endif
if (sweep_points == 290) while (j * sweep_points < (i+1) * 290) { // Scale waterfall to 290 points
spi_buffer[i] = color; spi_buffer[j++] = color;
else {
spi_buffer[2*i ] = color;
spi_buffer[2*i+1] = color;
} }
} }
ili9341_bulk(OFFSETX, graph_bottom+1, w_width, 1); ili9341_bulk(OFFSETX, graph_bottom+1, w_width, 1);

@ -2900,24 +2900,24 @@ void draw_cal_status(void)
ili9341_drawstring(buf, x, y); ili9341_drawstring(buf, x, y);
// ili9341_set_background(DEFAULT_BG_COLOR); // ili9341_set_background(DEFAULT_BG_COLOR);
if (!get_waterfall()) { // Do not draw bottom level if in waterfall mode
// Bottom level // Bottom level
y = area_height - 8 + OFFSETY; y = area_height - 8 + OFFSETY;
if (rounding) if (rounding)
plot_printf(buf, BLEN, "%4d", (int)(yMax - setting.scale * NGRIDY)); plot_printf(buf, BLEN, "%4d", (int)(yMax - setting.scale * NGRIDY));
else
plot_printf(buf, BLEN, "%+4.3F", ((yMax - setting.scale * NGRIDY)/setting.unit_scale));
// buf[5]=0;
if (level_is_calibrated())
if (setting.auto_reflevel)
color = DEFAULT_FG_COLOR;
else else
color = BRIGHT_COLOR_GREEN; plot_printf(buf, BLEN, "%+4.3F", ((yMax - setting.scale * NGRIDY)/setting.unit_scale));
else // buf[5]=0;
color = BRIGHT_COLOR_RED; if (level_is_calibrated())
ili9341_set_foreground(color); if (setting.auto_reflevel)
ili9341_drawstring(buf, x, y); color = DEFAULT_FG_COLOR;
else
color = BRIGHT_COLOR_GREEN;
else
color = BRIGHT_COLOR_RED;
ili9341_set_foreground(color);
ili9341_drawstring(buf, x, y);
}
} }
// -------------------- Self testing ------------------------------------------------- // -------------------- Self testing -------------------------------------------------

Loading…
Cancel
Save

Powered by TurnKey Linux.