function qSkyImage_Time, state, time=time, matrix=matrix, display=display, $ uttime=uttime, rotation=rotation, set=set ;+ ; NAME: ; qSkyImage_Time ; PURPOSE: ; Get times from widgets for matrix and display time in qSkyImage widget ; CATEGORY: ; Widgets: qSkyImage ; CALLING SEQUENCE: ; OK = qSkyImage_Time(state, time=time, matrix=matrix, display=display, $ ; uttime=uttime, rotation=rotation, set=set) ; INPUTS: ; state array[1]; type: structure ; qSkyImage 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 ; CALLS: ; TimeSet, IsTime, sfloat, IsType, CarringtonT, CarringtonVar ; 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) ;- on_error, 2 ; On error, return to caller COMPILE_OPT hidden display = keyword_set(display) rotation= keyword_set(rotation) set = keyword_set(set) 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 = sfloat(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