From bc1b57c3f027caae2bc23808d9aae34649f940ce Mon Sep 17 00:00:00 2001 From: TT Date: Tue, 16 Jun 2020 09:23:10 +0900 Subject: [PATCH] feat: add format quality factor --- main.c | 7 ++++--- nanovna.h | 4 ++-- plot.c | 19 +++++++++++++++++++ ui.c | 10 ++++++---- 4 files changed, 31 insertions(+), 9 deletions(-) diff --git a/main.c b/main.c index f5183c84..5dea4633 100644 --- a/main.c +++ b/main.c @@ -1550,7 +1550,8 @@ static const struct { { "REAL", NGRIDY/2, 0.25 }, { "IMAG", NGRIDY/2, 0.25 }, { "R", NGRIDY/2, 100.0 }, - { "X", NGRIDY/2, 100.0 } + { "X", NGRIDY/2, 100.0 }, + { "Q", 0, 10.0 } }; static const char * const trc_channel_name[] = { @@ -1654,8 +1655,8 @@ VNA_SHELL_FUNCTION(cmd_trace) #if MAX_TRACE_TYPE != 12 #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_OFF - static const char cmd_type_list[] = "logmag|phase|delay|smith|polar|linear|swr|real|imag|r|x|off"; + // 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 + static const char cmd_type_list[] = "logmag|phase|delay|smith|polar|linear|swr|real|imag|r|x|q|off"; int type = get_str_index(argv[1], cmd_type_list); if (type >= 0) { set_trace_type(t, type); diff --git a/nanovna.h b/nanovna.h index 79a6b154..b51ecf04 100644 --- a/nanovna.h +++ b/nanovna.h @@ -194,10 +194,10 @@ extern const uint16_t numfont16x22[]; #define MAX_TRACE_TYPE 12 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_OFF + 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 }; // Mask for define rectangular plot -#define RECTANGULAR_GRID_MASK ((1<