Skip to content

Commit

Permalink
chore: delta symbol
Browse files Browse the repository at this point in the history
  • Loading branch information
edy555 committed Nov 30, 2019
1 parent 481fa99 commit 75ea464
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
1 change: 1 addition & 0 deletions nanovna.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ extern int area_height;
extern const uint8_t x5x7_bits [];
extern const uint8_t numfont20x22[][22 * 3];

#define S_DELTA "\004"
#define S_PI "\034"
#define S_MICRO "\035"
#define S_OHM "\036"
Expand Down
22 changes: 12 additions & 10 deletions plot.c
Original file line number Diff line number Diff line change
Expand Up @@ -756,34 +756,34 @@ trace_get_value_string_delta(int t, char *buf, int len, float array[101][2], int
case TRC_LOGMAG:
v = logmag(coeff) - logmag(coeff_ref);
if (v == -INFINITY)
chsnprintf(buf, len, "\004-INF dB");
chsnprintf(buf, len, S_DELTA "-INF dB");
else
chsnprintf(buf, len, "\004%.2fdB", v);
chsnprintf(buf, len, S_DELTA "%.2fdB", v);
break;
case TRC_PHASE:
v = phase(coeff) - phase(coeff_ref);
chsnprintf(buf, len, "\004%.2f" S_DEGREE, v);
chsnprintf(buf, len, S_DELTA "%.2f" S_DEGREE, v);
break;
case TRC_DELAY:
v = groupdelay_from_array(index, array) - groupdelay_from_array(index_ref, array);
string_value_with_prefix(buf, len, v, 's');
break;
case TRC_LINEAR:
v = linear(coeff) - linear(coeff_ref);
chsnprintf(buf, len, "\004%.2f", v);
chsnprintf(buf, len, S_DELTA "%.2f", v);
break;
case TRC_SWR:
v = swr(coeff) - swr(coeff_ref);
chsnprintf(buf, len, "\004%.2f", v);
chsnprintf(buf, len, S_DELTA "%.2f", v);
break;
case TRC_SMITH:
format_smith_value(buf, len, coeff, frequencies[index]);
break;
case TRC_REAL:
chsnprintf(buf, len, "\004%.2f", coeff[0] - coeff_ref[0]);
chsnprintf(buf, len, S_DELTA "%.2f", coeff[0] - coeff_ref[0]);
break;
case TRC_IMAG:
chsnprintf(buf, len, "\004%.2fj", coeff[1] - coeff_ref[1]);
chsnprintf(buf, len, S_DELTA "%.2fj", coeff[1] - coeff_ref[1]);
break;
case TRC_R:
gamma2resistance(buf, len, coeff);
Expand Down Expand Up @@ -1594,7 +1594,7 @@ cell_draw_marker_info(int m, int n, int w, int h)
int32_t freq = frequencies[markers[mk].index];
if (uistat.marker_delta && mk != active_marker) {
freq -= frequencies[markers[active_marker].index];
frequency_string_short(buf, sizeof buf, freq, '\004');
frequency_string_short(buf, sizeof buf, freq, S_DELTA[0]);
} else {
frequency_string_short(buf, sizeof buf, freq, 0);
}
Expand All @@ -1615,7 +1615,8 @@ cell_draw_marker_info(int m, int n, int w, int h)
int ypos = 1 + (j/2)*7;
xpos -= m * CELLWIDTH -CELLOFFSETX;
ypos -= n * CELLHEIGHT;
chsnprintf(buf, sizeof buf, "\004%d:", previous_marker+1);
strcpy(buf, S_DELTA "1:");
buf[1] += previous_marker;
cell_drawstring_5x7(w, h, buf, xpos, ypos, 0xffff);
xpos += 19;
if ((domain_mode & DOMAIN_MODE) == DOMAIN_FREQ) {
Expand Down Expand Up @@ -1655,7 +1656,8 @@ cell_draw_marker_info(int m, int n, int w, int h)
int ypos = 1 + (j/2)*7;
xpos -= m * CELLWIDTH -CELLOFFSETX;
ypos -= n * CELLHEIGHT;
chsnprintf(buf, sizeof buf, "%d:", active_marker + 1);
strcpy(buf, "1:");
buf[0] += active_marker;
xpos += 5;
cell_drawstring_invert_5x7(w, h, buf, xpos, ypos, 0xffff, uistat.lever_mode == LM_MARKER);
xpos += 14;
Expand Down

0 comments on commit 75ea464

Please sign in to comment.