pro set_list_widget_values @common_blocks.inc oldweight = (['none', list_str])[weight_index] if N_elements(*parti.names) gt 1 and ptr_valid(parti.names) then oldparti = (*parti.names)[min([parti.index,N_elements(*parti.names)-1])] else oldparti='' if (var_index lt N_elements(list_str)) then oldvariable = list_str[var_index] else oldvariable=list_str[0] list_str = get_variable_names(grid_info, particle_names=pnames) parti.names = PTR_NEW(pnames) ; histograms is all plus some more histnames = ['none', list_str, ['dx']] if N_elements(*parti.names) gt 0 then if ((*parti.names)[0] ne '') then begin histnames = [histnames, *parti.names] endif if N_elements(grid_info) gt 0 then begin file_name = grid_info[0].baryon_file slashparts = StrSplit(grid_info[0].baryon_file, '/',/extract) nume = N_elements(slashparts) fnamerest= StrJoin('/'+slashparts[nume-3:*]) if nume gt 3 then fnamerest = '...'+fnamerest ; don't show the entire path grpos = strpos(fnamerest, '.grid') ; remove the .grid#### if there if grpos[0] ge 1 then fnamerest = strmid(fnamerest, 0, grpos) endif else fnamerest = '' timestr = 'Time:'+strcompress(string(times)) timestr[time_index] += ' '+fnamerest widget_control, TIME_LIST_WIDGET, set_value=timestr widget_control, TIME_LIST_WIDGET, set_combobox_select=N_elements(times)-1 widget_control, TIME_LIST_WIDGET, set_combobox_select=time_index ind = where(list_str eq '', count) if count ne 0 then list_str=list_str[where(list_str ne '')] widget_control, variable_list_widget, SET_VALUE=list_str ; widget_control, weight_list_widget, SET_VALUE=['none',list_str[*]] widget_control, weight_list_widget, SET_VALUE=histnames var_index = (where(oldvariable eq list_str))[0] > 0 widget_control, variable_list_widget, SET_COMBOBOX_SELECT=var_index weight_index = (where(list_str eq oldweight) + 1)[0] widget_control, weight_list_widget, SET_COMBOBOX_SELECT=weight_index if ptr_valid(parti.names) then if N_elements(*parti.names) gt 0 and strlen((*parti.names)[0]) gt 0 then begin widget_control, parti_listid, SET_value=(*parti.names) parti.index = (where(*parti.names eq oldparti))[0] > 0 widget_control, parti_listid, SET_COMBOBOX_SELECT=parti.index widget_control, parti_baseid, sensitive=1 endif else begin widget_control, parti_listid, SET_value='no particles' widget_control, parti_baseid, sensitive=0 endelse ; histogram lists ind = where(histnames eq '', count) if count ne 0 then histnames=histnames[where(histnames ne '')] widget_control, hi.listid1, SET_value=histnames widget_control, hi.listid2, SET_value=histnames widget_control, hi.weightlistid, SET_value=histnames hi1 = where(histnames eq hi.field1) > 0 hi2 = where(histnames eq hi.field2) > 0 hi3 = where(histnames eq hi.weight) > 0 widget_control, hi.listid1, set_combobox_select=hi1[0] widget_control, hi.listid2, set_combobox_select=hi2[0] widget_control, hi.weightlistid, set_combobox_select=hi3[0] data_format = determine_data_format_from_file_name(file_name) if data_format gt 2 then begin ; for partiview and gadget data its already read parti.read[*] = 0 vel.read = 0 hi.read[*] = 0 endif if N_elements(oj) gt 0 then obj_destroy, oj oj = OBJ_NEW('OJ', grid_info) return end