From afe0eaf02c8577bf6f54339e391041acedb1c71e Mon Sep 17 00:00:00 2001 From: "Michael J. Chudobiak" Date: Mon, 7 May 2018 10:13:41 -0400 Subject: add ability to just copy old-style ampl and os initial config data to new 32-ranges --- globals.h | 2 +- parser.c | 105 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 106 insertions(+), 1 deletion(-) diff --git a/globals.h b/globals.h index 54418ef..a8fae30 100644 --- a/globals.h +++ b/globals.h @@ -495,7 +495,7 @@ typedef struct { short rcl_misc[max_channels][max_stored_settings]; /* addr 1616 - another misc is stored below */ short rcl_unused[max_stored_settings]; /* addr 1632 */ - float mon_vi_ratio[max_channels][5][2]; /* addr 1640 */ + float mon_vi_ratio[max_channels][ampl_ranges][ampl_polarities]; /* addr 1640 */ float min_ampl[max_channels]; /* addr 1720 */ float max_ampl[max_channels]; /* addr 1728 */ diff --git a/parser.c b/parser.c index b3492f9..bcb2f46 100644 --- a/parser.c +++ b/parser.c @@ -117,6 +117,8 @@ static int Go_cal_interval_101(gchar** response, int channel, char *parameter,ch static int Go_eprom_reset_102(gchar** response, int channel, char *parameter,char *units,int command_type); static int Go_atten_103(gchar** response, int channel, char *parameter,char *units,int command_type); static int Go_eprom_resize_105(gchar** response, int channel, char *parameter,char *units,int command_type); +static int Go_eprom_resize_ampl_106(gchar** response, int channel, char *parameter,char *units,int command_type); +static int Go_eprom_resize_offset_107(gchar** response, int channel, char *parameter,char *units,int command_type); static int Parser_id_word(char *id_me, int *channel, int *with_id_code) { @@ -486,6 +488,8 @@ static int Parser_find_commands(int commands[], int command_depth) {23,109,16|optional}, /* diag:attenuator:state - 103 */ {23,32,110,88,93}, /* diag:ampl:distort:calib:point - 104 */ {23,57,111}, /* diag:eprom:resize - 105 */ + {23,57,111,32}, /* diag:eprom:resize:ampl - 106 */ + {23,57,111,33} /* diag:eprom:resize:offset - 107 */ }; @@ -1060,6 +1064,12 @@ void Parser_main (char *raw_in, int interactive_terminal, void(*cbfunc)(gpointer case 105: error_num=Go_eprom_resize_105(&response,channel,parameter,units,command_type); break; + case 106: + error_num=Go_eprom_resize_ampl_106(&response,channel,parameter,units,command_type); + break; + case 107: + error_num=Go_eprom_resize_offset_107(&response,channel,parameter,units,command_type); + break; case 9999: // was only whitespace, ignore @@ -4179,3 +4189,98 @@ static int Go_eprom_resize_105(gchar** response, int channel, char *parameter,ch return ThisShouldntHappen; } + +static int Go_eprom_resize_ampl_106(gchar** response, int channel, char *parameter,char *units,int command_type) +{ + /* copies data from old ten-point-ranges into new-style (May 2018) 32-point ranges */ + + int i, j, k, l; + + if (channel) { + return InvalidChannel; + } + + switch (command_type) { + case command_simple: + + for (i=0;i