;+ ; NAME: ; qnagoya ; PURPOSE: ; Widget for looking at Nagoya IPS data ; CATEGORY: ; Widgets ; CALLING SEQUENCE: ; qnagoya, group=group, img_offset=img_offset, wid_base=wid_base ; INPUTS: ; OPTIONAL INPUT PARAMETERS: ; group=group scalar; type: long integer ; group leader passed to XMANAGER ; OUTPUTS: ; (to widget) ; CALLS: ; TimeGet, TimeUnit, TimeSystem, qnagoya_info, qnagoya_plot, qnagoya_pointsources, qnagoya_skymap ; EXTERNAL: ; vu_point_source__define ; PROCEDURE: ; The state structure is as follows: ; ; state = {STATE_QNAGOYA, $ ; wid_send : 0L, $ Row base widget ; user value: widget ID of widget to receive QIMAGE_SEND ; events (set by qImage_SendDestination) ; wid_exit : 0L, $ 'Done' button ; user value: none ; wid_pick : 0L, $ 'Image' button for selection of image file ; user value: none ; wid_filter : 0L, $ cw_field for entering file filter for image file selection ; user value: none ; wid_qimage_cw : 0L, $ compound widget qimage_cw ; user value: none ; wid_info : 0L, $ 'Info' button to display information about the current image ; user value: string array containing informatin ; foreign : 0 $ set by pImage_SendDestination using keyword 'foreign'; controls how ; qImage reacts to QIMAGE_CW_UPDATE events from the ; qImage_cw compound widget. ; foreign=0: ignore events ; foreign=1,2: call qImage_TrackPeak (used by the 'Track' option in qView). ; } ;- PRO qnagoya_event, event @compile_opt.pro ; On error, return to caller ; event.top should be ID of the qImage top level widget ; qImage_cw should make sure to set the proper ID before passing an event on. ; Get the state structure from the top level widget widget_control, event.top, get_uvalue=state, /no_copy CASE event.id OF ; ID of widget that generated the message ; Intercepts WIDGET_KILL_REQUEST from top level widget event.top : widget_control, event.top, /destroy state.wid_exit : widget_control, event.top, /destroy state.wid_info : qnagoya_info, state state.wid_tsun : qnagoya_skymap, state state.wid_tbeg : qnagoya_pointsources, state state.wid_tend : qnagoya_pointsources, state state.wid_name : qnagoya_plot, state state.wid_draw : IF event.release EQ 1 then qnagoya_plot, state, event ELSE: BEGIN print, 'qnagoya: unexpected event' print, tag_names(event, /structure_name) print, event END ENDCASE ; Put the state structure back where it belongs ; (the widget may have been destroyed already, so we check for event.top for validity.) IF widget_info(event.top,/valid_id) THEN $ widget_control, event.top, set_uvalue=state, /no_copy RETURN & END PRO qnagoya, trange, subdir=subdir, group=group, wid_base=wid_base, retain=retain @compile_opt.pro ; On error, return to caller IF n_elements(subdir) EQ 0 THEN subdir = 'daily' InitVar, retain, 2 tags = tag_names( {vu_point_source} ) state = {STATE_QNAGOYA, $ wid_exit : 0L, $ wid_info : 0L, $ wid_name : 0L, $ wid_tsun : 0L, $ wid_tbeg : 0L, $ wid_tend : 0L, $ wid_draw : 0L $ ; Use for Hammer-Aitoff map with source positions } wid_base = widget_base(title='qnagoya', /column, /tlb_kill_request_events) wid_row = widget_base(wid_base,/row) sys = filepath(root=getenv('SSW_SMEI_UCSD'),'image') state.wid_exit = widget_button(wid_row, value=filepath(root=sys,'done.ico'), /bitmap) state.wid_info = widget_button(wid_row, value=filepath(root=sys,'info.ico'), /bitmap, uvalue=subdir) state.wid_tsun = cw_field(wid_row, /string, title=' Sun' , /row, xsize=10, /return_events, $ value=TimeGet(TimeSystem(/silent), upto=TimeUnit(/day), /ymd)) state.wid_tbeg = cw_field(wid_row, /string, title=' Start', /row, xsize=10, /return_events) state.wid_tend = cw_field(wid_row, /string, title=' End' , /row, xsize=10, /return_events) state.wid_name = widget_droplist(title='Source', wid_row) ;type = vu_sky_type('skymap_snap') wid_row = widget_base(wid_base, /row) state.wid_draw = widget_draw(wid_row, xsize=400, ysize=240, /button_events, retain=retain) widget_control, wid_base, set_uvalue=state ; No /no_copy here ! widget_control, wid_base, /realize xmanager, 'qnagoya', wid_base, event_handler='qnagoya_event', group=Group, /no_block qnagoya_pointsources, state RETURN & END