summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--parser.c867
1 files changed, 434 insertions, 433 deletions
diff --git a/parser.c b/parser.c
index e5a1643..1c3adde 100644
--- a/parser.c
+++ b/parser.c
@@ -653,481 +653,482 @@ void Parser_main (char *raw_in, int interactive_terminal, void(*cbfunc)(gpointer
int str_chunk;
for (str_chunk=0; v[str_chunk] > 0; ++str_chunk) {
- gchar *in = filter_input (v[str_chunk]);
-
- int in_pos; /* this identifies the single character of in being processed */
- int command_depth; /* how many command words have been parsed */
- int old_command_depth; /* save this if in case of a compound message */
- int commands[max_commands_in_input]; /* list of identified command tokens */
- int old_commands[max_commands_in_input]; /* list of identified command tokens from */
- /* last non-common, non-colon-started command*/
- int space_found; /* if true, a space was found. parameter may follow */
- int parameter_found; /* if true, there is a parameter at the end of the command string */
- int semicolon_found; /* to break up lines */
- int units_found; /* text found after parameter must be units */
- int i; /* counter */
- int routine_num; /* routine to execute, based on command */
- int dont_use_this_header; /* the old head is saved in case of compound message, unless this is set */
- int compound_message; /* this indicates that at least one semicolon has been found, so */
- /* the message is a compound one */
-
- int is_query;
- int command_type; /* combination of is_query, parameter_found, and units_found */
-
- int channel;
- int with_id_code;
-
- in_pos = 0; /* start at the beginning of the input string */
- semicolon_found = 0;
- compound_message = 0;
- command_depth=0;
- old_command_depth=0;
- dont_use_this_header=NO;
-
- /* examine each letter in the string until EOS */
- while (in[in_pos] != 0) {
-
- gchar *units = NULL;
- gchar *response = NULL;
- gchar *error_response = NULL;
- gchar *parameter = NULL;
-
- channel=-1;
- with_id_code=0;
- space_found = 0;
- parameter_found = 0; /* no numeric parameters yet */
- units_found = 0;
- is_query = 0;
-
- GString *current_word = g_string_new ("");
-
- if (semicolon_found && !dont_use_this_header) {
- old_command_depth=command_depth-2;
- for (i=0; i<old_command_depth; ++i) {
- old_commands[i]=commands[i];
- }
- }
- command_depth=old_command_depth;
- for (i=0; i<command_depth; ++i) {
- commands[i]=old_commands[i];
- }
-
- semicolon_found=0;
+ gchar *in = filter_input (v[str_chunk]);
+
+ int in_pos; /* this identifies the single character of in being processed */
+ int command_depth; /* how many command words have been parsed */
+ int old_command_depth; /* save this if in case of a compound message */
+ int commands[max_commands_in_input]; /* list of identified command tokens */
+ int old_commands[max_commands_in_input]; /* list of identified command tokens from */
+ /* last non-common, non-colon-started command*/
+ int space_found; /* if true, a space was found. parameter may follow */
+ int parameter_found; /* if true, there is a parameter at the end of the command string */
+ int semicolon_found; /* to break up lines */
+ int units_found; /* text found after parameter must be units */
+ int i; /* counter */
+ int routine_num; /* routine to execute, based on command */
+ int dont_use_this_header; /* the old head is saved in case of compound message, unless this is set */
+ int compound_message; /* this indicates that at least one semicolon has been found, so */
+ /* the message is a compound one */
+
+ int is_query;
+ int command_type; /* combination of is_query, parameter_found, and units_found */
+
+ int channel;
+ int with_id_code;
+
+ in_pos = 0; /* start at the beginning of the input string */
+ semicolon_found = 0;
+ compound_message = 0;
+ command_depth=0;
+ old_command_depth=0;
dont_use_this_header=NO;
- /* break it up if semicolons are present */
- while (!semicolon_found && in[in_pos] != 0) {
+ /* examine each letter in the string until EOS */
+ while (in[in_pos] != 0) {
- in[in_pos]=tolower(in[in_pos]);
- /* everything to lowercase */
+ gchar *units = NULL;
+ gchar *response = NULL;
+ gchar *error_response = NULL;
+ gchar *parameter = NULL;
- /* words are separated by white space or colons or semicolons */
- if ( isspace(in[in_pos]) || in[in_pos] == ':' || in[in_pos] == ';')
+ channel=-1;
+ with_id_code=0;
+ space_found = 0;
+ parameter_found = 0; /* no numeric parameters yet */
+ units_found = 0;
+ is_query = 0;
- {
+ GString *current_word = g_string_new ("");
- if (in[in_pos] == ';') {
- ++semicolon_found;
+ if (semicolon_found && !dont_use_this_header) {
+ old_command_depth=command_depth-2;
+ for (i=0; i<old_command_depth; ++i) {
+ old_commands[i]=commands[i];
}
- ++compound_message;
-
- /* if it is a separator, ignore it if it is duplicated */
- if ( !isspace(in[in_pos-1]) && (in[in_pos-1] != ':') && (in[in_pos-1] != ';')) {
- /* valid separator, so terminate current command word string */
-
- if (space_found) {
- /* Just end things if it is a semicolon */
- if (in[in_pos]!=';') {
- g_string_append_c (current_word, in[in_pos]);
- }
-
- ++parameter_found;
+ }
- // the parameter may have multiple words,
- // so this branch may be called repeatedly
- g_free (parameter);
- parameter = g_strdup (current_word->str);
+ command_depth=old_command_depth;
+ for (i=0; i<command_depth; ++i) {
+ commands[i]=old_commands[i];
+ }
- } else if (!space_found) {
- /* end of a regular command word - use it */
+ semicolon_found=0;
+ dont_use_this_header=NO;
- commands[command_depth]=Parser_id_word( current_word->str,
- &channel,
- &with_id_code);
+ /* break it up if semicolons are present */
+ while (!semicolon_found && in[in_pos] != 0) {
- /* get ready for the next token */
- g_string_free (current_word, 1);
- current_word = g_string_new ("");
+ in[in_pos]=tolower(in[in_pos]);
+ /* everything to lowercase */
- if ( commands[command_depth]<13
- || commands[command_depth]==63
- || commands[command_depth]==64) {
- dont_use_this_header=YES;
- commands[0]=commands[command_depth];
- command_depth=0;
- }
+ /* words are separated by white space or colons or semicolons */
+ if ( isspace(in[in_pos]) || in[in_pos] == ':' || in[in_pos] == ';')
- ++command_depth; /* indicate that a new command word is ready */
+ {
- /* indicate if the separator was a space - next bit parameter then */
- if (in[in_pos]==' ') {
- ++space_found;
+ if (in[in_pos] == ';') {
+ ++semicolon_found;
+ }
+ ++compound_message;
+
+ /* if it is a separator, ignore it if it is duplicated */
+ if ( !isspace(in[in_pos-1]) && (in[in_pos-1] != ':') && (in[in_pos-1] != ';')) {
+ /* valid separator, so terminate current command word string */
+
+ if (space_found) {
+ /* Just end things if it is a semicolon */
+ if (in[in_pos]!=';') {
+ g_string_append_c (current_word, in[in_pos]);
+ }
+
+ ++parameter_found;
+
+ // the parameter may have multiple words,
+ // so this branch may be called repeatedly
+ g_free (parameter);
+ parameter = g_strdup (current_word->str);
+
+ } else if (!space_found) {
+ /* end of a regular command word - use it */
+
+ commands[command_depth]=Parser_id_word( current_word->str,
+ &channel,
+ &with_id_code);
+
+ /* get ready for the next token */
+ g_string_free (current_word, 1);
+ current_word = g_string_new ("");
+
+ if ( commands[command_depth]<13
+ || commands[command_depth]==63
+ || commands[command_depth]==64) {
+ dont_use_this_header=YES;
+ commands[0]=commands[command_depth];
+ command_depth=0;
+ }
+
+ ++command_depth; /* indicate that a new command word is ready */
+
+ /* indicate if the separator was a space - next bit parameter then */
+ if (in[in_pos]==' ') {
+ ++space_found;
+ }
}
+ } /* non-repeated separator */
+ else if (compound_message && in[in_pos-1]==';' && in[in_pos]==':') {
+ dont_use_this_header=YES;
+ command_depth=0;
}
- } /* non-repeated separator */
- else if (compound_message && in[in_pos-1]==';' && in[in_pos]==':') {
- dont_use_this_header=YES;
- command_depth=0;
- }
- } /* a separator */
- else if (in[in_pos]!='?') {
- /* if not white space or separator, add character to current command word */
- g_string_append_c (current_word, in[in_pos]);
- } /* not a separator */
- else {
- ++is_query;
- /* question mark found */
- }
+ } /* a separator */
+ else if (in[in_pos]!='?') {
+ /* if not white space or separator, add character to current command word */
+ g_string_append_c (current_word, in[in_pos]);
+ } /* not a separator */
+ else {
+ ++is_query;
+ /* question mark found */
+ }
- ++in_pos; /* move pointer to next letter */
+ ++in_pos; /* move pointer to next letter */
- } /* not a semi-colon */
+ } /* not a semi-colon */
- commands[command_depth]=0;
- ++command_depth;
- /* add end of tokens marker (0) */
+ commands[command_depth]=0;
+ ++command_depth;
+ /* add end of tokens marker (0) */
- int error_num=OK;
+ int error_num=OK;
- units_found = Parser_get_unit(&parameter,&units);
+ units_found = Parser_get_unit(&parameter,&units);
- if (!globals.Sys.startup_complete) {
- error_num=Startup_Not_Finished;
- }
+ if (!globals.Sys.startup_complete) {
+ error_num=Startup_Not_Finished;
+ }
- if (!error_num) {
- command_type=(is_query<<2) | (parameter_found?2:0) | units_found;
+ if (!error_num) {
+ command_type=(is_query<<2) | (parameter_found?2:0) | units_found;
- if (commands[0]!=0) {
- routine_num = Parser_find_commands(commands,command_depth);
+ if (commands[0]!=0) {
+ routine_num = Parser_find_commands(commands,command_depth);
- /* check for valid channel number, based on position in command */
- if ( (error_num=Parser_channel(&channel,with_id_code,routine_num)) )
- /* not a valid command due to improper channel suffix */
- {
+ /* check for valid channel number, based on position in command */
+ if ( (error_num=Parser_channel(&channel,with_id_code,routine_num)) )
+ /* not a valid command due to improper channel suffix */
+ {
+ routine_num=9999;
+ }
+ } else {
routine_num=9999;
+ /* ignore empty commands lists, generated by a white space string */
}
- } else {
- routine_num=9999;
- /* ignore empty commands lists, generated by a white space string */
- }
- switch (routine_num) {
- case 0:
- error_num=Unrecognized;
- break;
-
- case 1:
- error_num=Go_cls_1(&response,channel,parameter,units,command_type);
- break;
- case 2:
- error_num=Go_ese_2(&response,channel,parameter,units,command_type);
- break;
- case 3:
- error_num=Go_esr_3(&response,channel,parameter,units,command_type);
- break;
- case 4:
- error_num=Go_idn_5(&response,channel,parameter,units,command_type);
- break;
- case 5:
- error_num=Go_opc_5(&response,channel,parameter,units,command_type);
- break;
- case 6:
- error_num=Go_rst_6(&response,channel,parameter,units,command_type);
- break;
- case 7:
- error_num=Go_sre_7(&response,channel,parameter,units,command_type);
- break;
- case 8:
- error_num=Go_stb_8(&response,channel,parameter,units,command_type);
- break;
- case 9:
- error_num=Go_tst_9(&response,channel,parameter,units,command_type);
- break;
- case 10:
- error_num=Go_wai_10(&response,channel,parameter,units,command_type);
- break;
- case 11:
- error_num=Go_syst_err_11(&response,channel,parameter,units,command_type);
- break;
- case 12:
- error_num=Go_syst_ver_12(&response,channel,parameter,units,command_type);
- break;
- case 13:
- case 14:
- case 16:
- case 17:
- error_num=Go_event_13(&response,channel,parameter,units,command_type);
- break;
- case 15:
- error_num=Go_oper_enable15(&response,channel,parameter,units,command_type);
- break;
- case 18:
- error_num=Go_ques_enable18(&response,channel,parameter,units,command_type);
- break;
- case 19:
- error_num=Go_preset_19(&response,channel,parameter,units,command_type);
- break;
- case 20:
- error_num=Go_zout_20(&response,channel,parameter,units,command_type);
- break;
- case 21:
- case 30:
- case 31:
- error_num=Go_prot_trip_21(&response,channel,parameter,units,command_type);
- break;
- case 22:
- error_num=Go_ampl_26(&response,channel,parameter,units,command_type,"a");
- break;
- case 25:
- error_num=Go_offset_29(&response,channel,parameter,units,command_type,"a");
- break;
- case 26:
- error_num=Go_ampl_26(&response,channel,parameter,units,command_type,"v");
- break;
- case 29:
- error_num=Go_offset_29(&response,channel,parameter,units,command_type,"v");
- break;
- case 32:
- case 33:
- error_num=Go_freq_32_33(&response,channel,parameter,units,command_type);
- break;
- case 34:
- error_num=Go_func_34(&response,channel,parameter,units,command_type);
- break;
- case 35:
- error_num=Go_period_35(&response,channel,parameter,units,command_type);
- break;
- case 36:
- error_num=Go_pw_36(&response,channel,parameter,units,command_type);
- break;
- case 37:
- error_num=Go_duty_37(&response,channel,parameter,units,command_type);
- break;
- case 38:
- error_num=Go_hold_38(&response,channel,parameter,units,command_type);
- break;
- case 39:
- case 41:
- error_num=Go_delay_39(&response,channel,parameter,units,command_type);
- break;
- case 40:
- error_num=Go_dbl_pulse_40(&response,channel,parameter,units,command_type);
- break;
- case 42:
- error_num=Go_polarity_42(&response,channel,parameter,units,command_type);
- break;
- case 46:
- error_num=Go_trig_source46(&response,channel,parameter,units,command_type);
- break;
- case 47:
- error_num=Go_Str_eprom_47(&response,channel,parameter,units,command_type);
- break;
- case 48:
- error_num=Go_int_eprom_48(&response,channel,parameter,units,command_type);
- break;
- case 51:
- error_num=Go_Float_eprom51(&response,channel,parameter,units,command_type);
- break;
- case 53:
- error_num=Go_rcl_53(&response,channel,parameter,units,command_type);
- break;
- case 54:
- error_num=Go_sav_54(&response,channel,parameter,units,command_type);
- break;
- case 55:
- error_num=Go_output_55(&response,channel,parameter,units,command_type);
- break;
- case 56:
- error_num=Go_gate_type_56(&response,channel,parameter,units,command_type);
- break;
- case 58:
- error_num=Go_delay_test58(&response,channel,parameter,units,command_type);
- break;
- case 59:
- error_num=Go_gpib_addr_59(&response,channel,parameter,units,command_type);
- break;
- case 60:
- error_num=Go_ser_baud_60(&response,channel,parameter,units,command_type);
- break;
- case 64:
- error_num=Go_ser_rts_64(&response,channel,parameter,units,command_type);
- break;
- case 66:
- error_num=Go_syst_errcnt66(&response,channel,parameter,units,command_type);
- break;
- case 67:
- error_num=Go_gate_level_67(&response,channel,parameter,units,command_type);
- break;
- case 68:
- error_num=Go_load_68(&response,channel,parameter,units,command_type);
- break;
- case 69:
- error_num=Go_meas_ampl_69(&response,channel,parameter,units,command_type);
- break;
- case 70:
- error_num=Go_char_eprom_70(&response,channel,parameter,units,command_type);
- break;
- case 72:
- error_num=Go_calib_amp_72(&response,channel,parameter,units,command_type);
- break;
- case 73:
- error_num=Go_calib_mon_73(&response,channel,parameter,units,command_type);
- break;
- case 74:
- error_num=Go_mon_step_74(&response,channel,parameter,units,command_type);
- break;
- case 75:
- error_num=Go_outputtype_75(&response,channel,parameter,units,command_type);
- break;
- case 76:
- error_num=Go_calib_os_76(&response,channel,parameter,units,command_type);
- break;
- case 77:
- error_num=Go_calib_pw_77(&response,channel,parameter,units,command_type);
- break;
- case 78:
- error_num=Go_routeclose_78(&response,channel,parameter,units,command_type);
- break;
- case 79:
- error_num=Go_amp_pnt_83(&response,channel,parameter,units,command_type,pwl_pw_values);
- break;
- case 80:
- error_num=Go_amp_pnt_83(&response,channel,parameter,units,command_type,pwl_delay_values);
- break;
- case 81:
- error_num=Go_amp_pnt_83(&response,channel,parameter,units,command_type,pwl_period_values);
- break;
- case 82:
- error_num=Go_dly_shift_82(&response,channel,parameter,units,command_type);
- break;
- case 83:
- error_num=Go_amp_pnt_83(&response,channel,parameter,units,command_type,pwl_ampl_values);
- break;
- case 84:
- error_num=Go_amp_pnt_83(&response,channel,parameter,units,command_type,pwl_os_values);
- break;
- case 86:
- error_num=Go_eprom_siz_86(&response,channel,command_type);
- break;
- case 88:
- error_num=Go_puls_count_88(&response,channel,parameter,units,command_type);
- break;
- case 89:
- error_num=Go_puls_sep_89(&response,channel,parameter,units,command_type);
- break;
- case 90:
- error_num=Go_amp_pnt_83(&response,channel,parameter,units,command_type,pwl_burst_values);
- break;
- case 91:
- error_num=Go_sys_net_91(&response,channel,parameter,units,command_type);
- break;
- case 92:
- error_num=Go_sys_pwd_92(&response,channel,parameter,command_type);
- break;
- case 93:
- error_num=Go_eprom_sus_93(&response,channel,parameter,command_type);
- break;
- case 94:
- error_num=Go_rise_time_94(&response,channel,parameter,units,command_type);
- break;
- case 95:
- error_num=Go_amp_pnt_83(&response,channel,parameter,units,command_type,pwl_rise_time_values);
- break;
- case 96:
- error_num=Go_soft_current_limit_96(&response,channel,parameter,units,command_type);
- break;
- case 98:
- error_num=Go_curr_slew_98(&response,channel,parameter,units,command_type);
- break;
- case 99:
- error_num=Go_amp_pnt_83(&response,channel,parameter,units,command_type,pwl_slew_values);
- break;
- case 100:
- error_num=Go_cal_100(&response,channel,parameter,units,command_type);
- break;
- case 101:
- error_num=Go_cal_interval_101(&response,channel,parameter,units,command_type);
- break;
- case 102:
- error_num=Go_eprom_reset_102(&response,channel,parameter,units,command_type);
- break;
- case 103:
- error_num=Go_atten_103(&response,channel,parameter,units,command_type);
- break;
- case 104:
- error_num=Go_amp_pnt_83(&response,channel,parameter,units,command_type,pwl_distort_values);
- break;
- 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
- break;
-
- default:
- error_num=Unrecognized;
- break;
+ switch (routine_num) {
+ case 0:
+ error_num=Unrecognized;
+ break;
+
+ case 1:
+ error_num=Go_cls_1(&response,channel,parameter,units,command_type);
+ break;
+ case 2:
+ error_num=Go_ese_2(&response,channel,parameter,units,command_type);
+ break;
+ case 3:
+ error_num=Go_esr_3(&response,channel,parameter,units,command_type);
+ break;
+ case 4:
+ error_num=Go_idn_5(&response,channel,parameter,units,command_type);
+ break;
+ case 5:
+ error_num=Go_opc_5(&response,channel,parameter,units,command_type);
+ break;
+ case 6:
+ error_num=Go_rst_6(&response,channel,parameter,units,command_type);
+ break;
+ case 7:
+ error_num=Go_sre_7(&response,channel,parameter,units,command_type);
+ break;
+ case 8:
+ error_num=Go_stb_8(&response,channel,parameter,units,command_type);
+ break;
+ case 9:
+ error_num=Go_tst_9(&response,channel,parameter,units,command_type);
+ break;
+ case 10:
+ error_num=Go_wai_10(&response,channel,parameter,units,command_type);
+ break;
+ case 11:
+ error_num=Go_syst_err_11(&response,channel,parameter,units,command_type);
+ break;
+ case 12:
+ error_num=Go_syst_ver_12(&response,channel,parameter,units,command_type);
+ break;
+ case 13:
+ case 14:
+ case 16:
+ case 17:
+ error_num=Go_event_13(&response,channel,parameter,units,command_type);
+ break;
+ case 15:
+ error_num=Go_oper_enable15(&response,channel,parameter,units,command_type);
+ break;
+ case 18:
+ error_num=Go_ques_enable18(&response,channel,parameter,units,command_type);
+ break;
+ case 19:
+ error_num=Go_preset_19(&response,channel,parameter,units,command_type);
+ break;
+ case 20:
+ error_num=Go_zout_20(&response,channel,parameter,units,command_type);
+ break;
+ case 21:
+ case 30:
+ case 31:
+ error_num=Go_prot_trip_21(&response,channel,parameter,units,command_type);
+ break;
+ case 22:
+ error_num=Go_ampl_26(&response,channel,parameter,units,command_type,"a");
+ break;
+ case 25:
+ error_num=Go_offset_29(&response,channel,parameter,units,command_type,"a");
+ break;
+ case 26:
+ error_num=Go_ampl_26(&response,channel,parameter,units,command_type,"v");
+ break;
+ case 29:
+ error_num=Go_offset_29(&response,channel,parameter,units,command_type,"v");
+ break;
+ case 32:
+ case 33:
+ error_num=Go_freq_32_33(&response,channel,parameter,units,command_type);
+ break;
+ case 34:
+ error_num=Go_func_34(&response,channel,parameter,units,command_type);
+ break;
+ case 35:
+ error_num=Go_period_35(&response,channel,parameter,units,command_type);
+ break;
+ case 36:
+ error_num=Go_pw_36(&response,channel,parameter,units,command_type);
+ break;
+ case 37:
+ error_num=Go_duty_37(&response,channel,parameter,units,command_type);
+ break;
+ case 38:
+ error_num=Go_hold_38(&response,channel,parameter,units,command_type);
+ break;
+ case 39:
+ case 41:
+ error_num=Go_delay_39(&response,channel,parameter,units,command_type);
+ break;
+ case 40:
+ error_num=Go_dbl_pulse_40(&response,channel,parameter,units,command_type);
+ break;
+ case 42:
+ error_num=Go_polarity_42(&response,channel,parameter,units,command_type);
+ break;
+ case 46:
+ error_num=Go_trig_source46(&response,channel,parameter,units,command_type);
+ break;
+ case 47:
+ error_num=Go_Str_eprom_47(&response,channel,parameter,units,command_type);
+ break;
+ case 48:
+ error_num=Go_int_eprom_48(&response,channel,parameter,units,command_type);
+ break;
+ case 51:
+ error_num=Go_Float_eprom51(&response,channel,parameter,units,command_type);
+ break;
+ case 53:
+ error_num=Go_rcl_53(&response,channel,parameter,units,command_type);
+ break;
+ case 54:
+ error_num=Go_sav_54(&response,channel,parameter,units,command_type);
+ break;
+ case 55:
+ error_num=Go_output_55(&response,channel,parameter,units,command_type);
+ break;
+ case 56:
+ error_num=Go_gate_type_56(&response,channel,parameter,units,command_type);
+ break;
+ case 58:
+ error_num=Go_delay_test58(&response,channel,parameter,units,command_type);
+ break;
+ case 59:
+ error_num=Go_gpib_addr_59(&response,channel,parameter,units,command_type);
+ break;
+ case 60:
+ error_num=Go_ser_baud_60(&response,channel,parameter,units,command_type);
+ break;
+ case 64:
+ error_num=Go_ser_rts_64(&response,channel,parameter,units,command_type);
+ break;
+ case 66:
+ error_num=Go_syst_errcnt66(&response,channel,parameter,units,command_type);
+ break;
+ case 67:
+ error_num=Go_gate_level_67(&response,channel,parameter,units,command_type);
+ break;
+ case 68:
+ error_num=Go_load_68(&response,channel,parameter,units,command_type);
+ break;
+ case 69:
+ error_num=Go_meas_ampl_69(&response,channel,parameter,units,command_type);
+ break;
+ case 70:
+ error_num=Go_char_eprom_70(&response,channel,parameter,units,command_type);
+ break;
+ case 72:
+ error_num=Go_calib_amp_72(&response,channel,parameter,units,command_type);
+ break;
+ case 73:
+ error_num=Go_calib_mon_73(&response,channel,parameter,units,command_type);
+ break;
+ case 74:
+ error_num=Go_mon_step_74(&response,channel,parameter,units,command_type);
+ break;
+ case 75:
+ error_num=Go_outputtype_75(&response,channel,parameter,units,command_type);
+ break;
+ case 76:
+ error_num=Go_calib_os_76(&response,channel,parameter,units,command_type);
+ break;
+ case 77:
+ error_num=Go_calib_pw_77(&response,channel,parameter,units,command_type);
+ break;
+ case 78:
+ error_num=Go_routeclose_78(&response,channel,parameter,units,command_type);
+ break;
+ case 79:
+ error_num=Go_amp_pnt_83(&response,channel,parameter,units,command_type,pwl_pw_values);
+ break;
+ case 80:
+ error_num=Go_amp_pnt_83(&response,channel,parameter,units,command_type,pwl_delay_values);
+ break;
+ case 81:
+ error_num=Go_amp_pnt_83(&response,channel,parameter,units,command_type,pwl_period_values);
+ break;
+ case 82:
+ error_num=Go_dly_shift_82(&response,channel,parameter,units,command_type);
+ break;
+ case 83:
+ error_num=Go_amp_pnt_83(&response,channel,parameter,units,command_type,pwl_ampl_values);
+ break;
+ case 84:
+ error_num=Go_amp_pnt_83(&response,channel,parameter,units,command_type,pwl_os_values);
+ break;
+ case 86:
+ error_num=Go_eprom_siz_86(&response,channel,command_type);
+ break;
+ case 88:
+ error_num=Go_puls_count_88(&response,channel,parameter,units,command_type);
+ break;
+ case 89:
+ error_num=Go_puls_sep_89(&response,channel,parameter,units,command_type);
+ break;
+ case 90:
+ error_num=Go_amp_pnt_83(&response,channel,parameter,units,command_type,pwl_burst_values);
+ break;
+ case 91:
+ error_num=Go_sys_net_91(&response,channel,parameter,units,command_type);
+ break;
+ case 92:
+ error_num=Go_sys_pwd_92(&response,channel,parameter,command_type);
+ break;
+ case 93:
+ error_num=Go_eprom_sus_93(&response,channel,parameter,command_type);
+ break;
+ case 94:
+ error_num=Go_rise_time_94(&response,channel,parameter,units,command_type);
+ break;
+ case 95:
+ error_num=Go_amp_pnt_83(&response,channel,parameter,units,command_type,pwl_rise_time_values);
+ break;
+ case 96:
+ error_num=Go_soft_current_limit_96(&response,channel,parameter,units,command_type);
+ break;
+ case 98:
+ error_num=Go_curr_slew_98(&response,channel,parameter,units,command_type);
+ break;
+ case 99:
+ error_num=Go_amp_pnt_83(&response,channel,parameter,units,command_type,pwl_slew_values);
+ break;
+ case 100:
+ error_num=Go_cal_100(&response,channel,parameter,units,command_type);
+ break;
+ case 101:
+ error_num=Go_cal_interval_101(&response,channel,parameter,units,command_type);
+ break;
+ case 102:
+ error_num=Go_eprom_reset_102(&response,channel,parameter,units,command_type);
+ break;
+ case 103:
+ error_num=Go_atten_103(&response,channel,parameter,units,command_type);
+ break;
+ case 104:
+ error_num=Go_amp_pnt_83(&response,channel,parameter,units,command_type,pwl_distort_values);
+ break;
+ 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
+ break;
+
+ default:
+ error_num=Unrecognized;
+ break;
+ }
}
- }
- if (error_num) {
- queue_error_from_parser(&error_response, error_num);
- if (interactive_terminal) {
- (*cbfunc)(user_data, error_response);
+ if (error_num) {
+ queue_error_from_parser(&error_response, error_num);
+ if (interactive_terminal) {
+ (*cbfunc)(user_data, error_response);
+ }
+ } else if (response != NULL) {
+ (*cbfunc)(user_data, response);
}
- } else if (response != NULL) {
- (*cbfunc)(user_data, response);
- }
- g_free (units);
- g_free (response);
- g_free (error_response);
- g_free (parameter);
- g_string_free (current_word, 1);
+ g_free (units);
+ g_free (response);
+ g_free (error_response);
+ g_free (parameter);
+ g_string_free (current_word, 1);
- if (!is_query) {
- Main_update_shift_registers(); /* update values in pulse generator circuit */
- }
+ if (!is_query) {
+ Main_update_shift_registers(); /* update values in pulse generator circuit */
+ }
- } /* not EOS */
+ } /* not EOS */
- /* update display if it wasn't a query, and if the control menu isn't on (this gives the user
- a chance to press "Go To Local" to override control */
- if (!is_query && !(globals.MenuStatus.Selected_Submenu==Submenu1_rem_loc && globals.MenuStatus.Type_Of_Menu==Submenu_On)) {
- Show_Main_Menu();
- }
+ /* update display if it wasn't a query, and if the control menu isn't on (this gives the user
+ a chance to press "Go To Local" to override control */
+ if (!is_query && !(globals.MenuStatus.Selected_Submenu==Submenu1_rem_loc && globals.MenuStatus.Type_Of_Menu==Submenu_On)) {
+ Show_Main_Menu();
+ }
- /* re-run error_check to update min/max values based on actual settings, not proposed settings */
- Error_check(globals.ChannelState);
+ /* re-run error_check to update min/max values based on actual settings, not proposed settings */
+ Error_check(globals.ChannelState);
- // trigger a prompt
- if (interactive_terminal) {
- (*cbfunc)(user_data, "");
- }
+ // trigger a prompt
+ if (interactive_terminal) {
+ (*cbfunc)(user_data, "");
+ }
- g_free (in);
+ g_free (in);
}
g_strfreev (v);