;---------------------------------------------------------------------------
; Document name: mk_plan_send.pro
; Created by:    Liyun Wang, GSFC/ARC, December 27, 1995
;
; Last Modified: Fri Jan  5 10:21:47 1996 (lwang@achilles.nascom.nasa.gov)
;---------------------------------------------------------------------------
;
PRO mk_plan_send, plan, messenger
;+
; PROJECT:
;       SOHO - CDS/SUMER
;
; NAME:
;       MK_PLAN_SEND
;
; PURPOSE:
;       Send a new pointing structure to and trigger an event in IMAGE_TOOL
;
; CATEGORY:
;       Planning
;
; SYNTAX:
;       mk_plan_send, plan, messenger
;
; INPUTS:
;       PLAN      - Structure representing a CDS/SUMER DET plan or SOHO
;                   SCI plan
;       MESSENGER - ID of the widget in planning tool through which
;                   the pointing structure is sent back to planning
;                   tool from IMAGE_TOOL; must be a widget that does
;                   not usually  generate any event 
;
; OPTIONAL INPUTS:
;       None.
;
; OUTPUTS:
;       None.
;
; OPTIONAL OUTPUTS:
;       None.
;
; KEYWORDS:
;       None.
;
; COMMON:
;       None.
;
; RESTRICTIONS:
;       The first child of widget program IMAGE_TOOL must be a widget
;       that does not usually generate events.
;
; SIDE EFFECTS:
;       A widget timer event is generated by the first widget child of
;       IMAGE_TOOL; the event handler of IAMGE_TOOL must process this
;       event accordingly
;
; HISTORY:
;       Version 1, December 27, 1995, Liyun Wang, GSFC/ARC. Written
;       Version 2, January 4, 1996, Liyun Wang, GSFC/ARC
;          Made it independent of common block used by IMAGE_TOOL
;       Version 3, 13-Feb-1996, Zarro GSFC/ARC
;          Added check for valid POINT_STC
;
; CONTACT:
;       Liyun Wang, GSFC/ARC (Liyun.Wang.1@gsfc.nasa.gov)
;-
;
   ON_ERROR, 2

   point_stc = mk_plan_point(plan)
   if datatype(point_stc) eq 'STC' then begin
    point_stc.messenger = messenger
    IF xvalid('image_tool', id=parent) THEN BEGIN
      child = WIDGET_INFO(parent, /child)
      WIDGET_CONTROL, child, timer=1.0, set_uvalue=point_stc
    ENDIF
   endif

END

;---------------------------------------------------------------------------
; End of 'mk_plan_send.pro'.
;---------------------------------------------------------------------------
