------------------------------------------------------------------ -- -- NAME: WSR_EVENT_OPERATIONS - BODY -- DISCREPANCY REPORTS: -- ------------------------------------------------------------------ -- file: wsr_event_ops_1c_b.ada -- level: 1c, 2c with GKS_ERRORS; package body WSR_EVENT_OPERATIONS is procedure FLUSH_DEVICE_EVENTS (WS_SL : in WS_STATE_LIST_TYPES.WS_STATE_LIST_PTR; DEVICE : in EVENT_OVERFLOW_DEVICE_NUMBER; CLASS : in INPUT_QUEUE_CLASS; ERROR_INDICATOR : out ERROR_NUMBER) is -- This procedure checks that the current workstation is of the -- correct category. It also checks for a valid input device. -- -- WS_SL - Pointer to the workstation state list. -- DEVICE - Logical input device to flush event queue. -- CLASS - Input class of device being flushed. -- ERROR_INDICATOR - Error indicator. begin -- Assume no error, is changed if error found. ERROR_INDICATOR := GKS_ERRORS.SUCCESSFUL; -- Check if the current workstation is of the correct category if WS_SL.WORKSTATION_CATEGORY /= INPUT and WS_SL.WORKSTATION_CATEGORY /= OUTIN then ERROR_INDICATOR := GKS_ERRORS.WS_NOT_INPUT_OUTIN; -- Check if the requested device is on the specified workstation. else -- Depending upon the class, check if ws supports device case CLASS is when LOCATOR_INPUT => if NATURAL(DEVICE.LOCATOR_EVENT_DEVICE) not in WS_SL.LIST_OF_LOCATOR_DEVICES'RANGE then ERROR_INDICATOR := GKS_ERRORS.INPUT_DEVICE_NOT_ON_WS; end if; when STROKE_INPUT => if NATURAL(DEVICE.STROKE_EVENT_DEVICE) not in WS_SL.LIST_OF_STROKE_DEVICES'RANGE then ERROR_INDICATOR := GKS_ERRORS.INPUT_DEVICE_NOT_ON_WS; end if; when VALUATOR_INPUT => if NATURAL(DEVICE.VALUATOR_EVENT_DEVICE) not in WS_SL.LIST_OF_VALUATOR_DEVICES'RANGE then ERROR_INDICATOR := GKS_ERRORS.INPUT_DEVICE_NOT_ON_WS; end if; when CHOICE_INPUT => if NATURAL(DEVICE.CHOICE_EVENT_DEVICE) not in WS_SL.LIST_OF_CHOICE_DEVICES'RANGE then ERROR_INDICATOR := GKS_ERRORS.INPUT_DEVICE_NOT_ON_WS; end if; when STRING_INPUT => if NATURAL(DEVICE.STRING_EVENT_DEVICE) not in WS_SL.LIST_OF_STRING_DEVICES'RANGE then ERROR_INDICATOR := GKS_ERRORS.INPUT_DEVICE_NOT_ON_WS; end if; when PICK_INPUT => if NATURAL(DEVICE.PICK_EVENT_DEVICE) not in WS_SL.LIST_OF_PICK_DEVICES'RANGE then ERROR_INDICATOR := GKS_ERRORS.INPUT_DEVICE_NOT_ON_WS; end if; end case; end if; end FLUSH_DEVICE_EVENTS; end WSR_EVENT_OPERATIONS;