------------------------------------------------------------------ -- -- NAME: SEGMENT_ATTRIBUTES - BODY -- DISCREPANCY REPORTS: ------------------------------------------------------------------ -- file: SEG_ATTR_B.ADA -- level: 1a, 2a with CGI_SUBTYPES_A; with WSM; with GKS_OPERATING_STATE_LIST; with ERROR_HANDLING; with GKS_ERRORS; with GKS_ERROR_STATE_LIST; use CGI_SUBTYPES_A; use WSM; use GKS_OPERATING_STATE_LIST; use GKS_ERRORS; use GKS_ERROR_STATE_LIST; package body SEGMENT_ATTRIBUTES is -- The package SEGMENT_ATTRIBUTES contains procedures that set -- segment attributes. -- -- The procedures in the package SEGMENT_ATTRIBUTES check the -- operating state. If it is not WSOP, WSAC or SGOP, the procedure -- ERROR_HANDLING is called. Otherwise the WS_MANAGER is called. -- It can detect errors 122 causing and call ERROR_HANDLING. -- If no error conditions exist the appropriate attributes -- associated with the segment are set. procedure SET_SEGMENT_TRANSFORMATION (SEGMENT : in SEGMENT_NAME; TRANSFORMATION : in TRANSFORMATION_MATRIX) is -- The transformation matrix associated with the segment is updated. -- -- SEGMENT - This is the identifier of the segment on which -- the transformation is to be set. -- -- TRANSFORMATION - This is the transformation matrix. GKS_INSTR : CGI_SET_SEGMENT_TRANSFORMATION; ERROR_INDICATOR : ERROR_NUMBER; 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 inquires the GKS_OPERATING_STATE_LIST to see -- if GKS is in the proper state before proceeding. if (CURRENT_OPERATING_STATE = GKOP) or (CURRENT_OPERATING_STATE = GKCL) then -- The state must indicate there is an open workstation. -- Otherwise an error exists and must be logged. -- error 7 GKS_ERROR_STATE_LIST.ERROR_STATE := ON; ERROR_HANDLING(NOT_WSOP_WSAC_SGOP,"SET_SEGMENT_TRANSFORMATION"); GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; else -- Call to workstation manager with parameters. GKS_INSTR.SEGMENT_TO_SET_TRANSFORMATION := SEGMENT; GKS_INSTR.TRANSFORMATION_SET := TRANSFORMATION; WS_MANAGER(GKS_INSTR); -- Check for a successful call. 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_SEGMENT_TRANSFORMATION"); 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_SEGMENT_TRANSFORMATION"); GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; exception when OTHERS => GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; raise; end; end SET_SEGMENT_TRANSFORMATION; procedure SET_VISIBILITY (SEGMENT : in SEGMENT_NAME; VISIBILITY : in SEGMENT_VISIBILITY) is -- The visibility associated with the segment is updated. -- -- SEGMENT - This is the identifier of the segment on which -- the visibility is to be set. -- -- VISIBILITY - This is the visibility value in which to set the -- segment. GKS_INSTR : CGI_SET_VISIBILITY; -- The parameter to the WS_MANAGER call 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 inquires the GKS_OPERATING_STATE_LIST to see -- if GKS is in the proper state before proceeding. if (CURRENT_OPERATING_STATE = GKOP) or (CURRENT_OPERATING_STATE = GKCL) then -- The state must indicate there is an open workstation. -- Otherwise an error exists and must be logged. GKS_ERROR_STATE_LIST.ERROR_STATE := ON; ERROR_HANDLING(NOT_WSOP_WSAC_SGOP,"SET_VISIBILITY"); GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; else -- Call to workstation manager with parameters. GKS_INSTR.SEGMENT_TO_SET_VISIBILITY := SEGMENT; GKS_INSTR.VISIBILITY_SET := VISIBILITY; WS_MANAGER(GKS_INSTR); -- Check for a successful call. 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_VISIBILITY"); 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_VISIBILITY"); GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; exception when OTHERS => GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; raise; end; end SET_VISIBILITY; procedure SET_HIGHLIGHTING (SEGMENT : in SEGMENT_NAME; HIGHLIGHTING : in SEGMENT_HIGHLIGHTING) is -- The highlighting associated with the segment is updated. -- -- SEGMENT - This is the identifier of the segment on which -- the visibility is to be set. -- -- HIGHLIGHTING - This is the HIGHLIGHTING value in which to set the -- segment. GKS_INSTR : CGI_SET_HIGHLIGHTING; 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 case inquires the GKS_OPERATING_STATE_LIST to see -- if GKS is in the proper state before proceeding. if (CURRENT_OPERATING_STATE = GKOP) or (CURRENT_OPERATING_STATE = GKCL) then -- The state must indicate there is an open workstation. -- Otherwise an error exists and must be logged. GKS_ERROR_STATE_LIST.ERROR_STATE := ON; ERROR_HANDLING(NOT_WSOP_WSAC_SGOP,"SET_HIGHLIGHTING"); GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; else -- Call to workstation manager with parameters. GKS_INSTR.SEGMENT_TO_SET_HIGHLIGHTING := SEGMENT; GKS_INSTR.HIGHLIGHTING_SET := HIGHLIGHTING; WS_MANAGER(GKS_INSTR); -- Check for a successful call. 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_HIGHLIGHTING"); 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_HIGHLIGHTING"); GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; exception when OTHERS => GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; raise; end; end SET_HIGHLIGHTING; procedure SET_SEGMENT_PRIORITY (SEGMENT : in SEGMENT_NAME; PRIORITY : in SEGMENT_PRIORITY) is -- The priority associated with the segment is updated. -- -- SEGMENT - This is the identifier of the segment on which -- the visibility is to be set. -- -- PRIORITY - This is the PRIORITY value in which to set the -- segment. GKS_INSTR : CGI_SET_SEGMENT_PRIORITY; 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 inquires the GKS_OPERATING_STATE_LIST to see -- if GKS is in the proper state before proceeding. if (CURRENT_OPERATING_STATE = GKOP) or (CURRENT_OPERATING_STATE = GKCL) then -- The state must indicate there is an open workstation. -- Otherwise an error exists and must be logged. GKS_ERROR_STATE_LIST.ERROR_STATE := ON; ERROR_HANDLING(NOT_WSOP_WSAC_SGOP,"SET_SEGMENT_PRIORITY"); GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; else -- Call to workstation manager with parameters. GKS_INSTR.SEGMENT_TO_SET_PRIORITY := SEGMENT; GKS_INSTR.PRIORITY_SET := PRIORITY; WS_MANAGER(GKS_INSTR); -- Check for a successful call. 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_SEGMENT_PRIORITY"); 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_SEGMENT_PRIORITY"); GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; exception when OTHERS => GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; raise; end; end SET_SEGMENT_PRIORITY; end SEGMENT_ATTRIBUTES;