Fix MAX_TRACE_TYPE to 13

Increase digit for show Q factor (use %.3f format)
This commit is contained in:
DiSlord 2020-06-21 08:00:01 +03:00
parent 76223f5e25
commit 3213a8022c
3 changed files with 4 additions and 4 deletions

2
main.c
View file

@ -1773,7 +1773,7 @@ VNA_SHELL_FUNCTION(cmd_trace)
shell_printf("%d %s %s\r\n", t, type, channel);
return;
}
#if MAX_TRACE_TYPE != 12
#if MAX_TRACE_TYPE != 13
#error "Trace type enum possibly changed, check cmd_trace function"
#endif
// enum TRC_LOGMAG, TRC_PHASE, TRC_DELAY, TRC_SMITH, TRC_POLAR, TRC_LINEAR, TRC_SWR, TRC_REAL, TRC_IMAG, TRC_R, TRC_X, TRC_Q, TRC_OFF

View file

@ -228,7 +228,7 @@ extern const uint16_t numfont16x22[];
#define S_OHM "\036"
// trace
#define MAX_TRACE_TYPE 12
#define MAX_TRACE_TYPE 13
enum trace_type {
TRC_LOGMAG=0, TRC_PHASE, TRC_DELAY, TRC_SMITH, TRC_POLAR, TRC_LINEAR, TRC_SWR, TRC_REAL, TRC_IMAG, TRC_R, TRC_X, TRC_Q, TRC_OFF
};

4
plot.c
View file

@ -665,7 +665,7 @@ trace_get_value_string(int t, char *buf, int len, float array[POINTS_COUNT][2],
v = reactance(coeff);
break;
case TRC_Q:
format = "%.1f";
format = "%.3f";
v = qualityfactor(coeff);
break;
case TRC_SMITH:
@ -729,7 +729,7 @@ trace_get_value_string_delta(int t, char *buf, int len, float array[POINTS_COUNT
v = reactance(coeff);
break;
case TRC_Q:
format = "%.1f";
format = "%.3f";
v = qualityfactor(coeff);
break;
//case TRC_ADMIT: