
;+ ***********************************************************************
; NAME:
;	CW_INFONRH
;
; PURPOSE:
;	Cette procedure affiche les caracteristiques principales du 
;fichier lu
;
; CATEGORY:
;	COMPOUND WIDGET
;
; CALLING SEQUENCE:
;	ID = CW_INFONRH, parent, Struc
;
; INPUTS:
;	PARENT	Identifieur du widget appelant
;	STRUC	Structure d'information de fichier (NRH_STR_INFIC)
; OPTIONAL INPUTS:
;	Parm2:	Describe optional inputs here. If you don't have any, just
;		delete this section.
;	
; KEYWORD PARAMETERS:
;	XSIZE	dimension du widget (voir WIDGET_TEXT)
;
;	YSIZE	dimension du widget (voir WIDGET_TEXT)
;
;	INFO	remise a jour de l'affichage 
;
;
; EXAMPLE:
;	ID = CW_INFONRH(parent, Str)
; Lecture d'un fichier au format NRH et affichage des caracteristiques
;
;	ID = CW_INFONRH( ID, Str, /INFO)
; Remet a jour l'affichage apres lecture d'un autre fichier
;
; MODIFICATION HISTORY:
;	Ecrit par: J Bonmartin le 03/11/97 (bonmartin@obspm.fr)
;-*******************************************************************

FUNCTION CW_INFONRH, parent, STR, XSIZE= xsize, YSIZE= ysize $
	, INFO=info

text= strarr(10)
text(0) = '   File description'
text(1) = 'Instrument: '+Str.instrume
IF Str.Instrume EQ 'NRH2' THEN BEGIN
	text(2) = 'Date: ' +Str.date
	text(3) = 'Freq: ' +STRING((Str.freq), FORMAT ='(f6.2)') + ' MHz'
	text(4) = 'Time-start: ' + Str.Hd
	text(5) = 'Time-end  : ' + Str.Hf

	IF Str.Physpar EQ 2 THEN $
		text(6) = 'Stokes I & V' $
	ELSE Text(6) =    'Stokes I    '
	text(7) = 'Time-exp(s): ' + STRING(Str.Tscan, FORMAT='(f8.2)')
	
	text(8) = STRCOMPRESS(STRING(Str.Nim),/REMOVE) + ' images' 
END
IF Str.Instrume EQ 'HSSI' THEN BEGIN
	text(2) = 'Date: ' +Str.date
	text(3) = 'Time-start: ' + Str.Hd
	text(4) = 'Time-end  : ' + Str.Hf
	text(5) = STRCOMPRESS(STRING(Str.Nim),/REMOVE) + ' images' 
END
IF Str.Content EQ 'STD' THEN BEGIN
	text(2) = 'Date: ' +Str.date
	text(3) = 'Time: ' + Str.Hd
	text(4) = 'Time-exp(s): ' + STRING(Str.Tscan, FORMAT='(f8.2)')
	text(5) = STRCOMPRESS(STRING(Str.Nim),/REMOVE) + ' images'
END 
	x= 25
	y= 10
if KEYWORD_SET(XSIZE) THEN x=xsize
if KEYWORD_SET(YSIZE) THEN y=ysize
if KEYWORD_SET(INFO) Then BEGIN
	widget_control,parent,set_value=text
	r=parent
endif else $
	r = widget_text(parent, value = text,Xsize=x,ysize=y)



return,r
end

