PRO qRemoteView_ChangeCoordinates, state, event ;+ ; NAME: ; qRemoteView_ChangeCoordinates ; PURPOSE: ; Controls the units of the location and viewing directions. ; Units are either ecliptic or heliographic ; CATEGORY: ; Widgets: qRemoteView ; CALLING SEQUENCE: ; qRemoteView_ChangeCoordinates, state, event ; INPUTS: ; state array[1]; type: structure ; qRemoteView state structure ; event array[1]; type: structure ; event structure with event.id=state.wid_ecliptic or ; state.wid_heliographic ; OUTPUTS: ; (updates values of state.wid_loc and state.wid_dir) ; INCLUDE: @compile_opt.pro ; On error, return to caller ; CALLS: ; Carrington, TimeSet, CvSky ; SIDE EFFECTS: ; RESTRICTIONS: ; PROCEDURE: ; The user value of state.wid_clabel stores the information about which coordinate system ; is currently in use: it stores the widget ID of state.wid_ecliptic of state.wid_heliographic ; If the event ID does not match this value and event.select=1 then the values ; of both time widgets are converted to the new units, and the user value of ; state.wid_clabel is updated accordingly. ; STATE INFO USED: ; widget_control, state.wid_clabel , get_uvalue=wid_unit ; widget_control, state.wid_loc[0] , get_value=loc_lng ; widget_control, state.wid_loc[1] , get_value=loc_lat ; widget_control, state.wid_dir[0] , get_value=dir_lng ; widget_control, state.wid_dir[1] , get_value=dir_lat ; widget_control, state.wid_earth[0] , get_value=earth_lng ; widget_control, state.wid_earth[1] , get_value=earth_lat ; widget_control, state.wid_tdisplay, get_value=tdisplay ; widget_control, state.wid_tlabel , get_uvalue=wid_tunit ; STATE INFO MODIFIED: ; widget_control, state.wid_loc[0] , set_value=loc[0,0] ; widget_control, state.wid_loc[1] , set_value=loc[1,0] ; widget_control, state.wid_dir[0] , set_value=loc[0,1] ; widget_control, state.wid_dir[1] , set_value=loc[1,1] ; widget_control, state.wid_clabel, set_uvalue=event.id ; widget_control, state.wid_earth[0] , set_value=loc[0,2] ; widget_control, state.wid_earth[1] , set_value=loc[0,2] ; MODIFICATION HISTORY: ; MAY-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu) ;- widget_control, event.id, set_button=event.select, set_uvalue=event.select IF event.select THEN BEGIN widget_control, state.wid_clabel , get_uvalue=wid_unit IF wid_unit NE event.id THEN BEGIN widget_control, state.wid_loc[0] , get_value=loc_lng widget_control, state.wid_loc[1] , get_value=loc_lat widget_control, state.wid_dir[0] , get_value=dir_lng widget_control, state.wid_dir[1] , get_value=dir_lat widget_control, state.wid_earth[0] , get_value=earth_lng widget_control, state.wid_earth[1] , get_value=earth_lat loc = [ [loc_lng, loc_lat], [dir_lng, dir_lat], [earth_lng, earth_lat] ] widget_control, state.wid_tdisplay, get_value=tdisplay widget_control, state.wid_tlabel , get_uvalue=wid_tunit CASE wid_tunit OF state.wid_uttime : TT = TimeSet(tdisplay) state.wid_rotation: TT = Carrington(double(tdisplay)) ENDCASE CASE event.id OF state.wid_ecliptic : loc = CvSky(TT, from_heliographic=loc, /to_ecliptic, /degrees) state.wid_heliographic: loc = CvSky(TT, from_ecliptic=loc, /to_heliographic, /degrees) ENDCASE widget_control, state.wid_loc[0] , set_value=loc[0,0] widget_control, state.wid_loc[1] , set_value=loc[1,0] widget_control, state.wid_dir[0] , set_value=loc[0,1] widget_control, state.wid_dir[1] , set_value=loc[1,1] widget_control, state.wid_earth[0] , set_value=loc[0,2] widget_control, state.wid_earth[1] , set_value=loc[1,2] widget_control, state.wid_clabel, set_uvalue=event.id ENDIF ENDIF RETURN & END