------------------------------------------------------------------ -- -- NAME: SET_BUNDLE_INDICES - BODY -- DISCREPANCY REPORTS: ------------------------------------------------------------------ -- file: set_bundle_idx_b.ada -- level: 0a, 1a, 2a, 0b, 1b, 2b, 0c, 1c, 2c with WSM; with CGI_SUBTYPES_A; with ERROR_HANDLING; with GKS_OPERATING_STATE_LIST; with GKS_ERRORS; with GKS_DESCRIPTION_TABLE; with GKS_STATE_LIST; with GKS_ERROR_STATE_LIST; use WSM; use CGI_SUBTYPES_A; use GKS_ERROR_STATE_LIST; use GKS_ERRORS; use GKS_OPERATING_STATE_LIST; package body SET_BUNDLE_INDICES is -- This is the package body for the procedures to call the work- -- station manager to set the values of the bundle table indices -- in the workstation state lists. -- -- Each procedure in this package inquires the GKS_OPERATING- -- STATE_LIST to check if GKS is in one of the states GKOP, -- WSOP, WSAC, or SGOP. If it is not, error 8 occurs and the -- procedure calls the procedure ERROR_HANDLING. -- -- If an error indicator above 0 occurs, these procedures call -- the ERROR_HANDLING procedure. procedure SET_POLYLINE_INDEX (INDEX : in POLYLINE_INDEX) is -- This procedure sets the value of the current polyline index -- in the GKS_STATE_LIST and then sends the value to the -- WS_MANAGER. This value is used when creating subsequent -- polyline output primitives. -- -- INDEX - Specifies the polyline index to be set. GKS_INSTR : CGI_SET_POLYLINE_INDEX; 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 before proceeding. if CURRENT_OPERATING_STATE = GKCL then GKS_ERROR_STATE_LIST.ERROR_STATE := ON; ERROR_HANDLING (NOT_GKOP_WSOP_WSAC_SGOP, "SET_POLYLINE_INDEX"); -- Error 8 GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; else -- Call to WS_MANAGER with the polyline index. GKS_INSTR.POLYLINE_INDEX_SET := INDEX; WS_MANAGER (GKS_INSTR); if GKS_INSTR.ERROR_INDICATOR = INVALID_POLYLINE_INDEX then -- Error 60 GKS_ERROR_STATE_LIST.ERROR_STATE := ON; ERROR_HANDLING (GKS_INSTR.ERROR_INDICATOR, "SET_POLYLINE_INDEX"); GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; end if; GKS_STATE_LIST.CURRENT_POLYLINE_INDEX := INDEX; 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_POLYLINE_INDEX"); -- Error 2501 GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; exception when OTHERS => GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; raise; end; end SET_POLYLINE_INDEX; procedure SET_POLYMARKER_INDEX (INDEX : in POLYMARKER_INDEX) is -- This procedure sets the value of the current polymarker index -- in the GKS_STATE_LIST and then sends the value to the -- WS_MANAGER. This value is used when creating subsequent -- polymarker output primitives. -- -- INDEX - Specifies the polymarker index to be set. GKS_INSTR : CGI_SET_POLYMARKER_INDEX; 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 before proceeding. if CURRENT_OPERATING_STATE = GKCL then GKS_ERROR_STATE_LIST.ERROR_STATE := ON; ERROR_HANDLING (NOT_GKOP_WSOP_WSAC_SGOP, "SET_POLYMARKER_INDEX"); -- Error 8 GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; else -- Call to WS_MANAGER with the new polymarker index. GKS_INSTR.POLYMARKER_INDEX_SET := INDEX; WS_MANAGER (GKS_INSTR); if GKS_INSTR.ERROR_INDICATOR = INVALID_POLYMARKER_INDEX then -- Error 66 GKS_ERROR_STATE_LIST.ERROR_STATE := ON; ERROR_HANDLING (GKS_INSTR.ERROR_INDICATOR,"SET_POLYMARKER_INDEX"); GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; end if; GKS_STATE_LIST.CURRENT_POLYMARKER_INDEX := INDEX; 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_POLYMARKER_INDEX"); -- Error 2501 GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; exception when OTHERS => GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; raise; end; end SET_POLYMARKER_INDEX; procedure SET_TEXT_INDEX (INDEX : in TEXT_INDEX) is -- This procedure sets the value of the current text index -- in the GKS_STATE_LIST and then sends the value to the -- WS_MANAGER. This value is used when creating subsequent -- text output primitives. -- -- INDEX - Specifies the text index to be set. GKS_INSTR : CGI_SET_TEXT_INDEX; 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 before proceeding. if CURRENT_OPERATING_STATE = GKCL then GKS_ERROR_STATE_LIST.ERROR_STATE := ON; ERROR_HANDLING (NOT_GKOP_WSOP_WSAC_SGOP, "SET_TEXT_INDEX"); -- Error 8 GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; else -- Call to WS_MANAGER with the new text index. GKS_INSTR.TEXT_INDEX_SET := INDEX; WS_MANAGER (GKS_INSTR); if GKS_INSTR.ERROR_INDICATOR = INVALID_TEXT_INDEX then -- Error 72 GKS_ERROR_STATE_LIST.ERROR_STATE := ON; ERROR_HANDLING (GKS_INSTR.ERROR_INDICATOR, "SET_TEXT_INDEX"); GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; end if; GKS_STATE_LIST.CURRENT_TEXT_INDEX := INDEX; 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_TEXT_INDEX"); -- Error 2501 GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; exception when OTHERS => GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; raise; end; end SET_TEXT_INDEX; procedure SET_FILL_AREA_INDEX (INDEX : in FILL_AREA_INDEX) is -- This procedure sets the value of the current fill area index -- in the GKS_STATE_LIST and then sends the value to the -- WS_MANAGER. This value is used when creating subsequent -- fill area output primitives. -- -- INDEX - Specifies the fill area index to be set. GKS_INSTR : CGI_SET_FILL_AREA_INDEX; 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 before proceeding. if CURRENT_OPERATING_STATE = GKCL then GKS_ERROR_STATE_LIST.ERROR_STATE := ON; ERROR_HANDLING (NOT_GKOP_WSOP_WSAC_SGOP, "SET_FILL_AREA_INDEX"); -- Error 8 GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; else -- Call to WS_MANAGER with the new fill area index. GKS_INSTR.FILL_AREA_INDEX_SET := INDEX; WS_MANAGER (GKS_INSTR); if GKS_INSTR.ERROR_INDICATOR = INVALID_FILL_AREA_INDEX then -- Error 80 GKS_ERROR_STATE_LIST.ERROR_STATE := ON; ERROR_HANDLING (GKS_INSTR.ERROR_INDICATOR,"SET_FILL_AREA_INDEX"); GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; end if; GKS_STATE_LIST.CURRENT_FILL_AREA_INDEX := INDEX; 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_FILL_AREA_INDEX"); GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; -- Error 2501 exception when OTHERS => GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; raise; end; end SET_FILL_AREA_INDEX; end SET_BUNDLE_INDICES;