------------------------------------------------------------------ -- -- NAME: WSD_INITIALISE_INPUT_1B - BODY -- DISCREPANCY REPORTS: -- ------------------------------------------------------------------ -- file : WSD_INIT_INPUT_1B_B.ADA -- level : 1B,1C,2B,2C with GKS_ERRORS; package body WSD_INITIALISE_INPUT_1B is -- This resource package initializes the workstation state list that -- it was passed with the values chosen by the application programmer. procedure INITIALISE_PICK (WS_SL : in out WS_STATE_LIST_TYPES.WS_STATE_LIST_PTR; WS_DT : in WS_DESCRIPTION_TABLE_TYPES .WS_DESCRIPTION_TBL; DEVICE : in PICK_DEVICE_NUMBER; STATUS : in PICK_STATUS; INITIAL_SEGMENT : in SEGMENT_NAME; INITIAL_PICK : in PICK_ID; ECHO_AREA : in DC.RECTANGLE_LIMITS; DATA_RECORD : in INTERNAL_DATA_RECORDS.PICK_DATA_RECORD; ERROR_INDICATOR : out ERROR_NUMBER) is -- This procedure sets the appropriate pick device from the -- list of pick devices in the workstation state list with the -- values passed in. -- -- The following parameters are used in this procedure: -- WS_SL - The workstation state list in which to change the values. -- WS_DT - The workstation description table for the specified -- workstation. Used for error checking. -- DEVICE - Used to determine which device to setfrom the list. -- STATUS - Used to indicate if a choice was made. -- INITIAL_SEGMENT - An initial segment. -- INITIAL_PICK - An initial pick. -- ECHO_AREA - The echo area in DC -- DATA_RECORD - The Data Record used to determine how the input -- prompt and echo appear. -- ERROR_INDICATOR - An error indicator used to log errors. begin -- Check that the specified device is on the workstation. if NATURAL(DEVICE) not in WS_SL.LIST_OF_PICK_DEVICES'range then ERROR_INDICATOR := GKS_ERRORS.INPUT_DEVICE_NOT_ON_WS; -- Check that the specified device is in the REQUEST MODE. elsif WS_SL.LIST_OF_PICK_DEVICES (NATURAL(DEVICE)) .OPERATING_MODE /= REQUEST_MODE then ERROR_INDICATOR := GKS_ERRORS.INPUT_DEVICE_NOT_REQUEST; -- Check that the requested ECHO AREA is on the display space. elsif ECHO_AREA.XMIN < 0.0 or else ECHO_AREA.YMIN < 0.0 or else ECHO_AREA.XMAX > DC_TYPE(WS_DT .MAX_DISPLAY_SURFACE_DC_UNITS.XAXIS) or else ECHO_AREA.YMAX > DC_TYPE(WS_DT .MAX_DISPLAY_SURFACE_DC_UNITS.YAXIS) then ERROR_INDICATOR := GKS_ERRORS.ECHO_AREA_OUT_OF_DISPLAY; -- Check that the requested prompt an echo type is supported on -- the specified workstation. elsif not PICK_PROMPT_ECHO_TYPES.IS_IN_LIST (DATA_RECORD.PROMPT_ECHO_TYPE, WS_DT.LIST_OF_PICK_DEVICES (NATURAL(DEVICE)) .LIST_AVAL_PROMPT_ECHO_TYPES) then ERROR_INDICATOR := GKS_ERRORS.NO_PROMPT_AND_ECHO_ON_WS; else ERROR_INDICATOR := GKS_ERRORS.SUCCESSFUL; WS_SL.LIST_OF_PICK_DEVICES (NATURAL(DEVICE)) := (OPERATING_MODE => WS_SL.LIST_OF_PICK_DEVICES (NATURAL(DEVICE)).OPERATING_MODE, ECHO_SWITCH => WS_SL.LIST_OF_PICK_DEVICES (NATURAL(DEVICE)).ECHO_SWITCH, INITIAL_STATUS => STATUS, INITIAL_SEGMENT => INITIAL_SEGMENT, INITIAL_PICK_ID => INITIAL_PICK, ECHO_AREA => ECHO_AREA, PICK_DATA_RECORD => DATA_RECORD); end if; end INITIALISE_PICK; end WSD_INITIALISE_INPUT_1B;