;+
; Project     : SOHO - CDS     
;                   
; Name        : CHECK_WINDOWS
;               
; Purpose     : Check the line_window structure to ensure completeness.
;               
; Explanation : When new lines and/or windows are added to the lists, not
;               all the parameters need be specified by the user.  This 
;               routines checks for missing parameters and adds the current
;               defaults where necessary.  It is only appropriate for use with
;               the technical planning procedure tp_page1
;               
; Use         : IDL> check_windows
;    
; Inputs      : None, done via private common blocks
;               
; Opt. Inputs : None
;               
; Outputs     : None, common variables are updated.
;               
; Opt. Outputs: None
;               
; Keywords    : None
;
; Calls       : None
;               
; Restrictions: Needs technical planning common blocks
;               
; Side effects: None
;               
; Category    : Technical planning
;               
; Prev. Hist. : None
;
; Written     :  C D Pike, RAL, 28-May-93
;               
; Modified    :  Take account of order for calculation of y_pos, CDP 6/12/93
;                Change to tplan.  CDP, 8-Jul-94
;
; Version     :  Version 3, 8-Jul-94
;-            

pro check_windows

;
;  include common blocks
;
@tplan_com.pro

;
;  check the necessary parameters and supply defaults
;
for i=0,num_windows-1 do begin
   x = line_window(i).x_pos
   if line_window(i).order eq 0 then line_window(i).order = 1
   if line_window(i).left  le 0 then line_window(i).left  = x - (curr_lwidth/2)
   if line_window(i).right eq 0 then begin
      line_window(i).right = line_window(i).left + curr_lwidth - 1
   endif
   if line_window(i).height eq 0 then line_window(i).height = curr_lheight
   if line_window(i).id eq '' then line_window(i).id = 'No ID'  
   obs_lam = line_window(i).lam * line_window(i).order         
   line_window(i).y_pos = ( obs_lam lt 400.) * 128
endfor

end
