;+
; Project     : SOHO - CDS     
;                   
; Name        : TP_DISPLAY_VP
;               
; Purpose     : Defines the window to display VDS parameters.
;               
; Explanation : Creates the widgets which form the window within which
;               the VDS detector parameters are displayed.
;               
; Use         : tp_display_vp
;    
; Inputs      : None
;               
; Opt. Inputs : None
;               
; Outputs     : None
;               
; Opt. Outputs: None
;               
; Keywords    : None
;
; Calls       : None
;               
; Restrictions: For use with TPLAN
;               
; Side effects: None
;               
; Category    : Planning, technical
;               
; Prev. Hist. : None
;
; Written     : C D Pike, RAL, 12-Jul-94
;               
; Modified    : Make display only, no settable values.  CDP, 4-Apr-95
;               Cut out display of readout mode and MCP voltage. CDP, 29-Jul-96
;
; Version     : Version 3, 29-Jul-96
;-            

pro tp_d_vp_event, ev

;
;  common for data and widgets ids
;
@tplan_com

widget_control, ev.id, get_uval=val

if val eq 'Done' then begin
   widget_control, vp_base, /destroy
endif

   
end


PRO tp_display_vp

;
;  common for data and widgets ids
;                       
@tplan_com

;
;  guard against trigger happy users
;
if xregistered('tp_display_vp') then begin
  widget_control,info_line,set_val='Current values already on display',/append
  widget_control,vp_base,map=1
  return
endif

;
;  create main base
;
vp_base = WIDGET_BASE(title='VDS detector parameters',  /FRAME, /COLUMN,$
                       group_leader = base, xoffset=400, yoffset=400, xsize=300)

vp_widg = lonarr(5)

;
;  'Done' button to exit
;
doneid = widget_button(vp_base, value='Done', uvalue='Done')

              
;
;  widgets for display of detector details
;
;dummy = WIDGET_LABEL(vp_base, VALUE='')
;dummy = WIDGET_LABEL(vp_base, VALUE='VDS setup parameters: ',frame=9)


a1  = WIDGET_BASE(vp_base, /ROW)
a11 = WIDGET_LABEL(a1, VALUE='Orientation........')
words = ['Row','Column']
vp_widg(0) = WIDGET_TEXT(a1,XSIZE=12,YSIZE=1,$
                         value=words(tp_obs.raster_v.vds_orient)) 


a2  = WIDGET_BASE(vp_base, /ROW)
a21 = WIDGET_LABEL(a2, VALUE='Data mapping mode..')
words = [' ',' ','Normal','Accumulate']
vp_widg(1) = WIDGET_TEXT(a2,XSIZE=12,YSIZE=1,$
                         value=words(tp_obs.raster_v.vds_map)) 

a5  = WIDGET_BASE(vp_base, /ROW)
a51 = WIDGET_LABEL(a5, VALUE='Background windows: ')
words = ['No','Yes']
s = tp_obs.vds_backwin(0).win_def(3)
text =  words(tp_obs.data_win.vds_back)
if text eq 'Yes' then begin
   text = text + ' - ' + fmt_vect([s,s])
endif
vp_widg(4) = WIDGET_TEXT(a5,XSIZE=15,YSIZE=1,value=text) 

;
;  make it all appear
;
WIDGET_CONTROL, vp_base, /realize

end
