pro qSkyImage_AddData, state, f0, f1, f2, add_list=add_list ;+ ; NAME: ; qSkyImage_AddData ; PURPOSE: ; Adds 3D data cubes to the available data ; CATEGORY: ; Widgets: qSkyImage ; CALLING SEQUENCE: ; qSkyImage_AddData, state, f0, f1, f2, add_list=add_list ; INPUTS: ; state array[1]; type: structure ; qSkyImage state structure ; f0, f1, f2 array[n,m,l]; type: any ; 3D data matrices ; OPTIONAL INPUT PARAMETERS: ; add_list array[*]; type: string ; array with identifying string for f0, f1, f2 ; OUTPUTS: ; OPTIONAL OUTPUT PARAMETERS: ; CALLS: ; COMMON BLOCKS: ; SIDE EFFECTS: ; RESTRICTIONS: ; The max number of array processed is set to three. Hence the number ; of elements in add_list can be at most three. ; PROCEDURE: ; MODIFICATION HISTORY: ; MAY-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu) ;- on_error, 2 ; On error, return to caller COMPILE_OPT hidden n = n_elements(add_list) if n ne 0 then begin add_mptrs = ptrarr(n, /allocate_heap) ; Matrix pointers add_vptrs = ptrarr(n, /allocate_heap) ; View cube pointers for i=0,n-1 do begin if i eq 0 then *add_mptrs[i] = f0 if i eq 1 then *add_mptrs[i] = f1 if i eq 2 then *add_mptrs[i] = f2 endfor widget_control, state.wid_list , get_uvalue=list , /no_copy widget_control, state.wid_matrix, get_uvalue=mptrs, /no_copy widget_control, state.wid_calc , get_uvalue=vptrs, /no_copy if n_elements(list) eq 0 then begin list = add_list mptrs = add_mptrs vptrs = add_vptrs endif else begin list = [list, add_list] mptrs = [mptrs, add_mptrs] vptrs = [vptrs, add_vptrs] endelse ; Can't use /no_copy here: apparently the uvalue is set first. If /no_copy is used ; 'list' doesn't exist anymore when the value is set. widget_control, state.wid_list , set_uvalue=list, set_value=list, /sensitive widget_control, state.wid_matrix, set_uvalue=mptrs, /no_copy widget_control, state.wid_calc , set_uvalue=vptrs, /no_copy widget_control, state.wid_mhisto , /sensitive endif return & end