;+
; Project     :	SOLAR-B - EIS
;
; Name        :	EIS_CPT_CHECK_BAKEOUT_PARAMETERS
;
; Purpose     :	Checks the EIS bakeout parameters are valid.
;
; Explanation : Checks the EIS bakeout parameters are valid.
;
; Use         :	< result = eis_cpt_bakeout_parameters ( bakeout_parameters) >
;
; Inputs      : bakeout_parameters : STRUCTURE of type EIS_bakeout_parameters.
;
; Opt. Inputs : None.
;
; Outputs     : result   : status flag
;                       0 : if checks failed.
;                       1 : checks OK.
;
; Opt. Outputs:	None.
;
; Keywords    : None.
;
; Calls       : None.
;
; Common      :	None.
;
; Restrictions:	None.
;
; Side effects:	None.
;
; Category    :	EIS_CPT.
;
; Prev. Hist. :	None.
;
; Written     :	Martin Carter RAL 12/09/05
;
; Modified    :	Version 0.0, 12/09/05, MKC
;
; Version     :	Version 0.0, 12/09/05
;-
;**********************************************************

FUNCTION eis_cpt_check_bakeout_parameters, bakeout_parameters

  ; target_temperature              : UINT target temperature in ADC units (default 35 degC). Range 0-255.

  IF bakeout_parameters.target_temperature GT 255 THEN BEGIN

    eis_cpt_message, 'INVALID BAKEOUT PARAMETER : TARGET TEMPERATURE'

    GOTO, error

  ENDIF

  ; number_of_duty_cycle_increments : UINT number of 5% increments needed to reach the required final duty cycle. Range 0-19. NB initial duty cycle is 5%.

  IF bakeout_parameters.number_of_duty_cycle_increments GT 19 THEN BEGIN

    eis_cpt_message, 'INVALID BAKEOUT PARAMETER : NUMBER OF DUTY CYCLE INCREMENTS'

    GOTO, error

  ENDIF

  ; return OK flag

  RETURN, 1

error :

  ; issue routine name

  MESSAGE, 'ERROR', /INFORMATIONAL

  ; return error flag

  RETURN, 0

END





