;+ ;NAME: ; thm_ui_summplot ;PURPOSE: ; This widget prompts the user for a choice of probe, and then Calls ; the thm_ui_temp_overplot routine, This should be superceded ;HISTORY: ; 21-jun-2007, jmm, jimm@ssl.berkeley.edu ;$LastChangedBy$ ;$LastChangedDate$ ;$LastChangedRevision$ ;$URL$ ;- Pro thm_ui_summplot_event, event @tplot_com err_xxx = 0 catch, err_xxx If(err_xxx Ne 0) Then Begin catch, /cancel help, /last_message, output = err_msg For j = 0, n_elements(err_msg)-1 Do print, err_msg[j] If(is_struct(state)) Then Begin cw = state.cw For j = 0, n_elements(state.button_arr)-1 Do widget_control, state.button_arr[j], sensitive = 1 widget_control, event.top, set_uval = state, /no_copy Endif Else Begin widget_control, event.top, get_uval = state, /no_copy If(is_struct(state)) Then Begin cw = state.cw For j = 0, n_elements(state.button_arr)-1 Do widget_control, state.button_arr[j], sensitive = 1 widget_control, event.top, set_uval = state, /no_copy Endif Else cw = -1 Endelse If(widget_valid(cw)) Then Begin If(is_struct(wstate)) Then widget_control, cw, set_uval = wstate thm_ui_update_history, cw, [';*** FYI', ';'+err_msg] thm_ui_update_progress, cw, 'Error--See history' Endif thm_ui_error Return Endif ;start here widget_control, event.id, get_uval = uval Case uval Of 'EXIT': widget_control, event.top, /destroy 'PRLIST':Begin widget_control, event.top, get_uval = state, /no_copy For j = 0, n_elements(state.button_arr)-1 Do widget_control, state.button_arr[j], sensitive = 0 pindex = widget_info(state.prlist, /list_select) state.this_probe = state.probes[pindex] history_ext = 'probe = '''+state.this_probe+'''' thm_ui_update_history, state.cw, history_ext For j = 0, n_elements(state.button_arr)-1 Do widget_control, state.button_arr[j], sensitive = 1 widget_control, event.top, set_uval = state, /no_copy End 'PLOT':Begin widget_control, event.top, get_uval = state, /no_copy For j = 0, n_elements(state.button_arr)-1 Do widget_control, state.button_arr[j], sensitive = 0 widget_control, state.cw, get_uval = wstate, /no_copy progobj = wstate.progobj t0 = wstate.st_time & t1 = wstate.en_time widget_control, state.cw, set_uval = wstate, /no_copy If(t0 Eq 0 Or t1 Eq 0) Then Begin thm_ui_update_progress, state.cw, 'Please Choose a Time Range' Endif Else Begin history_ext = 'thm_gen_overplot, sc='+''''+state.this_probe+''''+$ ', '+thm_ui_multichoice_history('trange = ', time_string([t0, t1]))+$ ', varnames_out=varnames' thm_ui_update_history, state.cw, history_ext ;You need a start time, and a duration in hours n_hours = ceil((t1-t0)/3600.0d0) thm_gen_overplot, sc = state.this_probe, date = t0, dur = n_hours, $ /hours ; thm_ui_temp_overplot, sc = state.this_probe, trange = [t0, t1], $ ; varnames_out = tvn, progobj = progobj tvn = tnames() thm_ui_update_data_all, state.cw, tvn Endelse For j = 0, n_elements(state.button_arr)-1 Do widget_control, state.button_arr[j], sensitive = 1 widget_control, event.top, set_uval = state, /no_copy End Endcase Return End Pro thm_ui_summplot, gui_id master = widget_base(title = 'THEMIS Science Software: Overview Plot', $ group_leader = gui_id, /row, scr_xsize = 360) probes = ['a', 'b', 'c', 'd', 'e'] probes_ext = ['A (P5)', 'B (P1)', 'C (P2)', 'D (P3)', 'E (P4)'] left = widget_base(master, /col, frame = 5, /align_center) label = widget_label(left, value = 'Choose One Probe') right = widget_base(master, /col, frame = 5, /align_center) prlist = widget_list(left, xsiz = 12, ysiz = 5, value = probes_ext, $ uval = 'PRLIST') ;plot button plbut = widget_button(right, val = ' Draw Overview Plot ', $ uval = 'PLOT', /align_center, scr_xsize = 200) ;exit button exbut = widget_button(right, val = ' Close ', uval = 'EXIT', $ /align_center, scr_xsize = 050) state = {cw:gui_id, prlist:prlist, probes:probes, this_probe:'', $ button_arr:[plbut, prlist]} widget_control, master, set_uval = state, /no_copy widget_control, master, /realize xmanager, 'thm_ui_summplot', master, /no_block Return End