diff --git a/plot.c b/plot.c index 3fc6041..cd86255 100644 --- a/plot.c +++ b/plot.c @@ -1445,15 +1445,18 @@ cell_draw_marker_info(int m, int n, int w, int h) xpos -= m * CELLWIDTH -CELLOFFSETX; ypos -= n * CELLHEIGHT; chsnprintf(buf, sizeof buf, "%d:", active_marker + 1); + xpos += 5; cell_drawstring_5x7(w, h, buf, xpos, ypos, 0xffff); - xpos += 16; + xpos += 14; if ((domain_mode & DOMAIN_MODE) == DOMAIN_FREQ) { - frequency_string(buf, sizeof buf, frequencies[idx]); - cell_drawstring_5x7(w, h, buf, xpos, ypos, 0xffff); + frequency_string(buf, sizeof buf, frequencies[idx]); } else { - chsnprintf(buf, sizeof buf, "%d ns %.1f m", (uint16_t)(time_of_index(idx) * 1e9), distance_of_index(idx)); - cell_drawstring_5x7(w, h, buf, xpos, ypos, 0xffff); + //chsnprintf(buf, sizeof buf, "%d ns %.1f m", (uint16_t)(time_of_index(idx) * 1e9), distance_of_index(idx)); + int n = string_value_with_prefix(buf, sizeof buf, time_of_index(idx), 's'); + buf[n++] = ' '; + string_value_with_prefix(&buf[n], sizeof buf-n, distance_of_index(idx), 'm'); } + cell_drawstring_5x7(w, h, buf, xpos, ypos, 0xffff); // draw marker delta if (previous_marker >= 0 && active_marker != previous_marker && markers[previous_marker].enabled) { @@ -1463,8 +1466,16 @@ cell_draw_marker_info(int m, int n, int w, int h) ypos += 7; chsnprintf(buf, sizeof buf, "\001%d:", previous_marker+1); cell_drawstring_5x7(w, h, buf, xpos, ypos, 0xffff); - xpos += 16; - frequency_string(buf, sizeof buf, frequencies[idx] - frequencies[idx0]); + xpos += 19; + if ((domain_mode & DOMAIN_MODE) == DOMAIN_FREQ) { + frequency_string(buf, sizeof buf, frequencies[idx] - frequencies[idx0]); + } else { + //chsnprintf(buf, sizeof buf, "%d ns %.1f m", (uint16_t)(time_of_index(idx) * 1e9 - time_of_index(idx0) * 1e9), + // distance_of_index(idx) - distance_of_index(idx0)); + int n = string_value_with_prefix(buf, sizeof buf, time_of_index(idx) - time_of_index(idx0), 's'); + buf[n++] = ' '; + string_value_with_prefix(&buf[n], sizeof buf - n, distance_of_index(idx) - distance_of_index(idx0), 'm'); + } cell_drawstring_5x7(w, h, buf, xpos, ypos, 0xffff); } }