;+
; Project     :	SOHO - CDS
;
; Name        :	GET_VDSWIN_INFO
;
; Purpose     :	Gets version numbers and internal IDs for CDHS tables.
;
; Explanation : First checks the current software version number of the code which creates
;               the table and then searches the id database to determine whether this
;               precise table has been used before and if so gets the internal CDHS IDs.
;               It searches the commprep database to determine whether the table is
;               already loaded or gets CDS index for loading it.
;
; Use         : <get_vdswin_info, vdswin, cut_off_time>
;
; Inputs      : vdswin = structure array listing information on tables used 
;                        in science plan.
;                    vdswin.vs      = character string indicating the software version
;                                     of the code used to create the table.
;                    vdswin.id      = integer planning database ID for the table.
;                    vdswin.iefid   = an integer indicating the ID of a flag master scheme used.
;                    vdswin.version = integer giving VDS calibration version 
;                    vdswin.cdhsx   = the internal CDHS index where the table is loaded
;                    vdswin.cdhsid  = the internal CDHS ID used to reference the table
;               cut_off_time = DOUBLE TAI format time before which tables may be overwritten
;
; Opt. Inputs : None.
;
; Outputs     : Updates the entries in vdswin directly.
;                    vdswin.ok     = an integer flag indicating whether table is already 
;                                   loaded onto the CDS.
;
; Opt. Outputs:	None.
;
; Keywords    : None.
;
; Calls       :	get_version, get_cdhs_index.
;                
; Common      :	None.
;
; Restrictions:	None.
;
; Side effects:	None.
;
; Category    :	Command preparation.
;
; Prev. Hist. :	None.
;
; Written     :	Version 0.0, Martin Carter, RAL, 14/10/94
;
; Modified    :	Version 0.1, Martin Carter, RAL, 28/11/94
;                            Added proforma.
;               Version 0.2, MKC, RAL, 2/3/95
;                            Added repn and sft to table info.
;                            Removed some tags from dexwin and vdswin tables. 
;               Version 0.3, MKC, RAL, 6/3/95
;                            Modified printout.
;               Version 0.4, MKC, RAL, 21/3/95
;                            Modified printout.
;               version 0.5, MKC, RAL, 18/4/95
;                            Adapted from get_table_info.
;                            Modified call to get_version.
;                            Modified argument list.
;               Version 0.6, MKC, RAL, 24/4/95
;                            Modified printout.
;               Version 0.7, MKC, 7/11/95
;                            Modified to use get_vdswin_id.
;               Version 0.8, MKC, 19/2/96
;                            Changed vdswin parameters to use calibration version number.
;               Version 0.9, MKC, 3/10/96
;                            Added time to allow previous tables to be overwritten to argument list.
;
; Version     :	Version 0.9, 3/10/96
;-
;**********************************************************

PRO get_vdswin_info, vdswin, cut_off_time

  ; get table creation software version

  get_version, 'VDSWIN', vdswin

  ; check if table already defined and get CDHS ID

  vdswin = get_vdswin_id ( vdswin ) 

  ; check if table loaded onto CDHS and get CDHS index

  vdswin = get_cdhs_index( 'VDSWIN', vdswin, cut_off_time )

  ; display some info on tables

  PRINT, 'VDSWIN table',                           $
         ' LOADED=', STRTRIM ( vdswin.ok, 1 ),     $
         ' SW=', vdswin.vs,                        $
         ' CDHSID=', STRTRIM ( vdswin.cdhsid, 1 ), $
         ' CDHSX=', STRTRIM ( vdswin.cdhsx, 1 ),   $
         ' ID=', STRTRIM ( vdswin.id, 1 ),         $
         ' VERSION=', STRTRIM (vdswin.version, 1), $
         ' IEFID=', STRTRIM ( vdswin.iefid, 1)

END
