" ."Error: invalid analogue cable end specification" ." $cable. Example of a correct spec: 8032C" .""; } else { $ans = array( $regs[1], 11 + ord($regs[2]) - ord(A) ); } } return $ans; } ################################################################ # Returns array with 'error' and 'data' keys. # The 'data' field contains a structure to be passed # to postamp_mainpage() function postamp_query_db($item_id, $item_type, $sernum) { $pa_dat = array( 'error' => '', 'data' => array( 'item_id' => $item_id, 'item_type' => $item_type ) ); ## ================================================================ ## Prepare status info $res = edit_get_status($item_id, $item_type); if($res['error']) { $pa_dat['error'] .= $res['error']; } else { $pa_dat['data']['status'] = $res['status']; $pa_dat['data']['status_date'] = $res['date']; $pa_dat['data']['status_set'] = $res['isset']; $pa_dat['data']['status_options'] = $res['options']; } ## ================================================================ ## Where is the item installed? $res = edit_get_base($sernum); if($res['error']) { $pa_dat['error'] .= $res['error']; } else { $pa_dat['data']['base_sernum'] = $res['base_sernum']; $pa_dat['data']['base_point'] = $res['point']; $pa_dat['data']['base_id'] = $res['base_sernum']? format_default_id( $res['base_sernum']) : ""; $pa_dat['data']['base_description'] = $res['description']; } ## ---------------------------------------------------------------- ## Parameters $res = edit_get_value( $sernum, 'postamp_pars', array('a','b') ); if($res['error']) { $pa_dat['error'] .= $res['error']; } else { $pa_dat['data']['fit_date'] = $res['date']; $pa_dat['data']['a'] = $res['a']; $pa_dat['data']['b'] = $res['b']; } ## ---------------------------------------------------------------- ## Cables $res = edit_get_parts( array($sernum), array(10,20,30) ); if($res['error']) { $pa_dat['error'] .= $res['error']; } else { $pa_dat['data']['cable_date'] = $res['last_date']; $dd = $res['data']; $pa_dat['data']['analogAsernum'] = $dd[$sernum][10]['part']['part_id']; $pa_dat['data']['analogA'] = format_default_id($dd[$sernum][10]['part']['part_id']) . postamp_analogue_letter($dd[$sernum][10]['part']['part_point']) ; $pa_dat['data']['analogBsernum'] = $dd[$sernum][10]['part']['part_id']; $pa_dat['data']['analogB'] = format_default_id($dd[$sernum][20]['part']['part_id']) . postamp_analogue_letter($dd[$sernum][20]['part']['part_point']) ; $pa_dat['data']['ecl'] = $dd[$sernum][30]['part']['part_id']; } ## ---------------------------------------------------------------- $pa_dat['data']['comments'] = get_comments($sernum); return $pa_dat; } #================================================================ # Returns HTML text to be used in between
function postamp_mainpage($data) { # ---------------------------------------------------------------- return "Connected cables | |
---|---|
".href2($data['ecl'],"Output ch 1-16 (ECL)")." | |
".href2($data[analogBsernum],"Input ch 9-16 (Analog)")." | |
".href2($data[analogAsernum],"Input ch 1-8 (Analog)")." |
Date of the last cabling change: $data[cable_date]\n" : "" ) ."
PostAmp parameters:
Comment to add
A = $vars[old_a] |
B = $vars[old_b] |
A = $a_str |
B = $b_str |