;+ ;NAME: ; thm_ui_set_state_ptrs ;PURPOSE: ; This program sets the values of the pointers in the themis_w state ; structure to their counterparts in the tplot common block: ;INPUT: ; state = themis_w state structure: See the doc_header for ; themis_w.pro ;HISTORY: ; 13-nov-2006, jmm, jimm@ssl.berkeley.edu ; 14-dec-2006, jmm, deals with no data ; ;$LastChangedBy: kenb-mac $ ;$LastChangedDate: 2007-01-26 15:52:34 -0800 (Fri, 26 Jan 2007) $ ;$LastChangedRevision: 241 $ ;$URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/thmsoc/trunk/idl/themis/common/thm_ui_set_state_ptrs.pro $ ; ;- Pro thm_ui_set_state_ptrs, state @tplot_com If(is_struct(state)) Then Begin If(is_struct(data_quants) And n_elements(data_quants) Gt 1) Then Begin If(ptr_valid(state.data)) Then ptr_free, state.data state.data = ptr_new(data_quants) tx = time_string(data_quants.trange) didx=data_quants.name+':'+tx[0,*]+' To '+tx[1,*] If(ptr_valid(state.data_id)) Then ptr_free, state.data_id state.data_id = ptr_new(didx) Endif Else Begin If(ptr_valid(state.data)) Then ptr_free, state.data state.data_id = ptr_new('None') Endelse If(is_struct(tplot_vars)) Then Begin If(ptr_valid(state.tplot_vars)) Then ptr_free, state.tplot_vars state.tplot_vars = ptr_new(tplot_vars) Endif Else If(ptr_valid(state.tplot_vars)) Then ptr_free, state.tplot_vars If(is_struct(plot_configs)) Then Begin If(ptr_valid(state.plot_configs)) Then ptr_free, state.plot_configs state.plot_configs = ptr_new(plot_configs) Endif Else If(ptr_valid(state.plot_configs)) Then ptr_free, state.plot_configs If(is_struct(current_config)) Then Begin If(ptr_valid(state.current_config)) Then ptr_free, state.current_config state.current_config = ptr_new(current_config) Endif Else If(ptr_valid(state.current_config)) Then ptr_free, state.current_config Endif Else message, /info, 'State is not a structure' Return End