;+
; PROJECT
;          SolarB EIS
;
; NAME
;          EIS_XRTF_PROPS_TO_CONTROL
;
; PURPOSE
;          Procedure to convert EIS Event (EEBP) props from TL entry type
;          to CPT-type control structures
;
; CATEGORY
;          EIS Timeline Planning
;          Trigger/Response Studies
;
; INPUTS
;          sty_props    - tl.sc.eis_event_response
;          sra_props    - tl.sc.studyRasters[index].eis_event_props, where
;                         index is the index of the selected raster
;          eise_control - is a CPT defined structure; {eis_event_control}
;
; KEYWORDS
;          None
;
; WRITTEN
;          John Rainnie, RAL, Dec-2005
;
; HISTORY
;          v0.1 JAR 27-Jan-2010
;               Added comments.
;
;-
;______________________________________________________________________________
FUNCTION eis_eise_props_to_control , sty_props , sra_props , eise_control

; Which response line has been selected
line_index_list = WHERE(sra_props.event_flag EQ 1 , count)
eise_control.line_index          = line_index_list[0]

eise_control.response_identifier = sty_props.response_study_id
eise_control.raster_identifier   = sty_props.repoint_raster_index
eise_control.adjust_x            = sty_props.x_repoint
eise_control.adjust_y            = sty_props.y_repoint
eise_control.x_threshold         = sra_props.x_pixel_threshold
eise_control.y_threshold         = sra_props.y_pixel_threshold
eise_control.x_min_limit         = sra_props.x_min_limit
eise_control.y_min_limit         = sra_props.y_min_limit

RETURN , eise_control

END
