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 --- parser.c | 105 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) (limited to 'parser.c') 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