------------------------------------------------------------------ -- -- NAME: SEGMENT_ATTRIBUTES_1B - BODY -- DISCREPANCY REPORTS: -- ------------------------------------------------------------------ -- file: seg_attr_1b_b.ada -- level: 1b, 2b with WSM; with CGI_SUBTYPES_B_C; with GKS_OPERATING_STATE_LIST; with GKS_STATE_LIST; with GKS_ERRORS; with ERROR_HANDLING; with GKS_ERROR_STATE_LIST; use WSM; use CGI_SUBTYPES_B_C; use GKS_OPERATING_STATE_LIST; use GKS_ERRORS; use GKS_ERROR_STATE_LIST; package body SEGMENT_ATTRIBUTES_1B is -- This package body contains the procedures for setting the attributes -- for segments and the pick operation. -- -- Each of the procedures in this package inquires the GKS_OPERATING_ -- STATE_LIST to check if GKS is in the correct state. If it is not, -- the procedure calls the ERROR_HANDLING procedure. procedure SET_PICK_ID (PICK : in PICK_ID) is -- This procedure sets the value of the current pick identifier -- in the GKS_STATE_LIST to the value specified. -- -- PICK - Numeric value indentifying the pick. GKS_INSTR : CGI_SET_PICK_IDENTIFIER; begin -- Check the GKS_ERROR_STATE_LIST to see that the ERROR_STATE -- is not ON before continuing. if GKS_ERROR_STATE_LIST.ERROR_STATE = ON then return; end if; -- The following if structure inquires the GKS_OPERATING -- _STATE_LIST to see if GKS is in the proper state. If so, -- it sets the value of the current pick identifier in the -- GKS_STATE_LIST. if CURRENT_OPERATING_STATE = GKCL then GKS_ERROR_STATE_LIST.ERROR_STATE := ON; ERROR_HANDLING (NOT_GKOP_WSOP_WSAC_SGOP,"SET_PICK_IDENTIFIER"); GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; else GKS_STATE_LIST.CURRENT_PICK_IDENTIFIER := PICK; -- Set up the instruction and call the workstation manager -- with the new pick identifier. GKS_INSTR.PICK_ID_SET := PICK; WS_MANAGER (GKS_INSTR); end if; exception when GKS_ERROR => GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; raise; when OTHERS => begin GKS_ERROR_STATE_LIST.ERROR_STATE := ON; ERROR_HANDLING (UNKNOWN, "SET_PICK_IDENTIFIER"); GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; exception when OTHERS => GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; raise; end; end SET_PICK_ID; procedure SET_DETECTABILITY (SEGMENT : in SEGMENT_NAME; DETECTABILITY : in SEGMENT_DETECTABILITY) is -- This procedure calls the workstation manager to set the -- detectability entry in the segment state list of the -- specified segment to the value indicated by the parameter -- DETECTABILITY. If the workstation manager returns error -- 122, this procedure calls the ERROR_HANDLING procedure. -- -- SEGMENT - Numeric value identifying the segment. -- DETECTABILITY - Indicates if the segment is detectable -- or not. GKS_INSTR : CGI_SET_DETECTABILITY; begin -- Check the GKS_ERROR_STATE_LIST to see that the ERROR_STATE -- is not ON before continuing. if GKS_ERROR_STATE_LIST.ERROR_STATE = ON then return; end if; -- The following if structure inquires the GKS_OPERATING -- _STATE_LIST to see if GKS is in the proper state. -- If the condition is true, the WS_MANAGER is called -- for the set operation. if CURRENT_OPERATING_STATE = GKCL or CURRENT_OPERATING_STATE = GKOP then GKS_ERROR_STATE_LIST.ERROR_STATE := ON; ERROR_HANDLING (NOT_WSOP_WSAC_SGOP,"SET_DETECTABLILITY"); GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; else GKS_INSTR.SEGMENT_TO_SET_DETECTABILITY := SEGMENT; GKS_INSTR.DETECTABILITY_SET := DETECTABILITY; WS_MANAGER (GKS_INSTR); if GKS_INSTR.ERROR_INDICATOR = SEGMENT_DOES_NOT_EXIST then -- Error 122 GKS_ERROR_STATE_LIST.ERROR_STATE := ON; ERROR_HANDLING(GKS_INSTR.ERROR_INDICATOR,"SET_DETECTABLILITY"); GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; end if; end if; exception when GKS_ERROR => GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; raise; when OTHERS => begin GKS_ERROR_STATE_LIST.ERROR_STATE := ON; ERROR_HANDLING(UNKNOWN,"SET_DETECTABLILITY");-- Error 2501 GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; exception when OTHERS => GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; raise; end; end SET_DETECTABILITY; end SEGMENT_ATTRIBUTES_1B;