pro init_qs, code, struct
;
;
;
struct = byte(0)
;---- Define qs structures and get the current version number
gen_struct, qs_general1=qs_general1
bcs_struct, bcs_qs_instr=bcs_qs_instr, bcs_qs_conv=bcs_qs_conv, bcs_qs_modeinit=bcs_qs_modeinit
sxt_struct, sxt_qs_instr=sxt_qs_instr, sxt_qs_conv=sxt_qs_conv 
hxt_struct, hxt_qs_instr=hxt_qs_instr, hxt_qs_conv=hxt_qs_conv 
wbs_struct, wbs_qs_instr=wbs_qs_instr, wbs_qs_conv1=wbs_qs_conv1 
;
case strupcase(code) of
    'B': begin
                struct = {bcs_qs_rec, $
                                general1: qs_general1, $
                                instr: bcs_qs_instr, $
                                conv: bcs_qs_conv}

                ;TODO - write ground derived info into the structures
          end
    'H': begin
                struct = {hxt_qs_rec, $
                                general1: qs_general1, $
                                instr: hxt_qs_instr, $
                                conv: hxt_qs_conv }

                ;TODO - write ground derived info into the structures
          end

    'S': begin
                struct = {sxt_qs_rec, $
                                general1: qs_general1, $
                                instr: sxt_qs_instr, $
                                conv: sxt_qs_conv }

                ;TODO - write ground derived info into the structures
		struct.instr.gain_const = 100*long(100)
          end
    'W': begin
                struct = {wbs_qs_rec, $
                                general1: qs_general1, $
                                instr: wbs_qs_instr, $
                                conv1: wbs_qs_conv1 }

                ;TODO - write ground derived info into the structures
          end
    'A': begin
		struct = {att_qs_rec, $
                                general1: qs_general1 }
	 end
    'C': begin
                struct = {cba_qs_rec, $
                                general1: qs_general1 }
         end


    else: ;;print, 'INIT_QS: Code not recognized.  Code = ', code
endcase
;
end
