------------------------------------------------------------------ -- -- NAME: SEPERATES TO GKS PACKAGE FOR INQ_WS_STATE_LIST_1B - BODY -- DISCREPANCY REPORTS: -- ------------------------------------------------------------------ -- file: inq_ws_st_lst_1b_b.ada -- level: 1b, 2b -- This package body provides the procedure for inquiring the -- WS_STATE_LISTs at level 1b. separate (GKS) procedure INQ_PICK_DEVICE_STATE (WS : in WS_ID; DEVICE : in PICK_DEVICE_NUMBER; RETURNED_VALUES : in RETURN_VALUE_TYPE; ERROR_INDICATOR : out ERROR_NUMBER; MODE : out OPERATING_MODE; SWITCH : out ECHO_SWITCH; INITIAL_STATUS : out PICK_STATUS; INITIAL_SEGMENT : out SEGMENT_NAME; INITIAL_PICK : out PICK_ID; ECHO_AREA : out DC.RECTANGLE_LIMITS; DATA_RECORD : out PICK_DATA_RECORD) is -- This procedure calls the workstation manager to obtain -- current pick device data from the workstation state list -- for the specified workstation identifier. -- -- First, the procedure inquires the GKS_OPERATING_STATE_LIST -- to check if GKS is in one of the states WSOP, WSAC, or SGOP. -- If it is not, error indicator 7 occurs but no exception is -- raised. In addition, each of the procedures inquires the -- GKS_STATE_LIST to see if the requested WS is open. If it is -- not, error indicator 25 occurs but no exception is raised. -- If neither condition occurs, then a call is made to the -- WS_MANAGER to do the inquiry. If the information is -- available, the workstation manager returns the error indicator -- as 0 and the values requested. Otherwise, the workstation -- manager returns error 37 or 140 to indicate the reason for -- non-availability. -- -- WS - Numeric value representing the workstation identification. -- DEVICE - Numeric value used to reference the pick input device. -- RETURNED_VALUES - Enumerated type indicating whether the returned -- values should be as they were set by the program or as they -- were actually realized on the device. -- ERROR_INDICATOR - Numeric value used to represent the type of -- error, if any, that occurred. -- MODE - This enumerated type defines the operating mode of the -- pick input device. -- SWITCH - Indicates whether or not echoing of the prompt is -- performed. -- INITIAL_STATUS - This enumerated type defines the status of a pick input. -- INITIAL_SEGMENT - Numeric value indicating the segment name -- used as the initial segment for the pick operation. -- INITIAL_PICK - Numeric value identifying the pick device. -- ECHO_AREA - Indicates the echo area in device coordinates that may -- be used to control the location of the echo and prompting -- appearances on the device. -- DATA_RECORD - Defines the pick input data record. GKS_INSTR : CGI_INQ_PICK_DEVICE_STATE; INPUT_DATA_RECORD : PICK_DATA_RECORD; -- This is a default output record for the parameter DATA_RECORD. -- It is used only when an error condition is detected by the -- procedure (at the device independent level). begin -- Initialise the out parameters. ERROR_INDICATOR := SUCCESSFUL; MODE := OPERATING_MODE'FIRST; SWITCH := ECHO_SWITCH'FIRST; INITIAL_STATUS := PICK_STATUS'FIRST; INITIAL_SEGMENT := SEGMENT_NAME'FIRST; INITIAL_PICK := PICK_ID'FIRST; ECHO_AREA := (0.0, 0.0, 0.0, 0.0); DATA_RECORD := INPUT_DATA_RECORD; -- The following if structure inquires the GKS_OPERATING -- _STATE_LIST to see if GKS is in the proper state. Then -- it checks to see if the WS exists by checking if it is -- in the list of open workstations in the GKS_STATE_LIST. -- If both conditions are true, the WS_MANAGER is called -- for the inquiry. if CURRENT_OPERATING_STATE = GKCL or CURRENT_OPERATING_STATE = GKOP then ERROR_INDICATOR := NOT_WSOP_WSAC_SGOP; -- Error 7 elsif not WS_IDS.IS_IN_LIST(WS,GKS_STATE_LIST.LIST_OF_OPEN_WS) then ERROR_INDICATOR := WS_NOT_OPEN; -- Error 25; else GKS_INSTR.WS_TO_INQ_PICK_STATE := WS; GKS_INSTR.DEVICE_TO_INQ_PICK_STATE := DEVICE; GKS_INSTR.RETURN_VALUE_TO_INQ_PICK_STATE := RETURNED_VALUES; WS_MANAGER(GKS_INSTR); if GKS_INSTR.ERROR_INDICATOR /= SUCCESSFUL then -- Error 0 if GKS_INSTR.ERROR_INDICATOR = WS_CATEGORY_NOT_OUTIN or -- Error 37 GKS_INSTR.ERROR_INDICATOR = INPUT_DEVICE_NOT_ON_WS then -- Error 140 ERROR_INDICATOR := GKS_INSTR.ERROR_INDICATOR; else ERROR_INDICATOR := UNKNOWN; -- Error 2501 end if; end if; MODE := GKS_INSTR.PICK_MODE_INQ; SWITCH := GKS_INSTR.PICK_SWITCH_INQ; INITIAL_STATUS := GKS_INSTR.PICK_STATUS_INQ; INITIAL_SEGMENT := GKS_INSTR.PICK_INITIAL_SEGMENT_INQ; INITIAL_PICK := GKS_INSTR.PICK_INITIAL_PICK_ID_INQ; ECHO_AREA := GKS_INSTR.PICK_ECHO_AREA_INQ; if GKS_INSTR.PICK_DATA_RECORD_INQ.PROMPT_ECHO_TYPE in 1..3 then BUILD_PICK_DATA_RECORD(GKS_INSTR.PICK_DATA_RECORD_INQ. PROMPT_ECHO_TYPE, DATA_RECORD); end if; end if; end INQ_PICK_DEVICE_STATE;