;+ ; NAME: ; qRemoteView_Time ; PURPOSE: ; Get times from widgets for matrix and display time in qRemoteView widget ; CATEGORY: ; Widgets: qRemoteView ; CALLING SEQUENCE: FUNCTION qRemoteView_Time, state, time=time, matrix=matrix, display=display, $ uttime=uttime, rotation=rotation, set=set ; INPUTS: ; state array[1]; type: structure ; qRemoteView state structure ; OPTIONAL INPUT PARAMETERS: ; /matrix if set, then the start time for the matrix is returned ; (this is the default) ; /display if set, then the display time is returned ; /uttime if set, then the time is returned as a time structure ; (this is the default) ; /rotation if set, then the time is returned as a Carrington variable ; OUTPUTS: ; OK 0: if time was not retrieved successfully ; 1: if time was retrieved successfully ; OPTIONAL OUTPUT PARAMETERS: ; time=time scalar or structure[1]; double or time structure ; the requested time, either as a time structure of ; as a Carrington variable ; (will only be defined if OK = 1 is returned ; INCLUDE: @compile_opt.pro ; On error, return to caller ; CALLS: ; TimeSet, IsTime, flt_string, IsType, Carrington ; SIDE EFFECTS: ; Keywords /display and /rotation take precedence over keywords ; /matrix and /rotation, respectively. ; RESTRICTIONS: ; PROCEDURE: ; The main purpose of this procedure is to guard against the possibility the ; the values stored in the widget fields are not valid times. Always check the ; return status before using the return value of 'time'. ; MODIFICATION HISTORY: ; MAY-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu) ;- InitVar, display , /key InitVar, rotation, /key InitVar, set , /key wid_time = ([state.wid_tmatrix, state.wid_tdisplay])[display ] wid_type = ([state.wid_uttime , state.wid_rotation])[rotation] widget_control, state.wid_tlabel , get_uvalue=wid_unit widget_control, wid_time, get_value=tt tt = tt[0] CASE wid_unit OF state.wid_uttime : BEGIN tt = TimeSet(tt) ok = IsTime(tt) END state.wid_rotation: BEGIN tt = flt_string(tt, /double) ok = IsType(tt, /double) END ENDCASE IF ok AND wid_type NE wid_unit THEN BEGIN CASE wid_type OF state.wid_uttime : tt = Carrington(tt) ; Rotation -> UT time state.wid_rotation: tt = Carrington(tt) ; UT time -> Rotation ENDCASE ENDIF IF ok THEN time = tt RETURN, ok & END