SUBROUTINE REACT_MODE_CONV(ConvType, DataIo, SubrLabel, ReturnedValue)
*

$insert logical

equ valid$         to 0    ;* successful
equ invalid_msg$   to 1    ;* bad data       -   print error message window
equ invalid_conv$  to 2    ;* bad conversion -          "         "
equ invalid_nomsg$ to 3    ;* bad but do not print the error message window

status() = Valid$
begin case
    case DataIo = 'IDLE'
        ReturnedValue = DataIo
	case DataIo = 'INITIATE_IDLE'
        ReturnedValue = DataIo
	case DataIo = 'IDLE_STARTUP'
        ReturnedValue = DataIo
    Case DataIo = 'SHUTDOWN'
    	ReturnedValue = DataIo
    case DataIo = 'RESPONSE_TIME_MAINTENANCE_UNSCHEDULED'
        ReturnedValue = DataIo
    case DataIo = 'RESPONSE_TIME_ENGINEER_UNSCHEDULED'
        ReturnedValue = DataIo
    case DataIo = 'RESPONSE_TIME_ENGTECH_UNSCHEDULED'
        ReturnedValue = DataIo
    case DataIo = 'RESPONSE_TIME_MAINTENANCE_SCHEDULED'
        ReturnedValue = DataIo
    case DataIo = 'RESPONSE_TIME_ENGINEER_SCHEDULED'
        ReturnedValue = DataIo
    case DataIo = 'RESPONSE_TIME_ENGTECH_SCHEDULED'
        ReturnedValue = DataIo
    case DataIo = 'WAITING_FOR_MAINTENANCE_UNSCHEDULED'
        ReturnedValue = DataIo
    case DataIo = 'WAITING_FOR_ENGINEER_UNSCHEDULED'
        ReturnedValue = DataIo
    case DataIo = 'WAITING_FOR_ENGTECH_UNSCHEDULED'
        ReturnedValue = DataIo
    case DataIo = 'WAITING_FOR_MAINTENANCE_SCHEDULED'
        ReturnedValue = DataIo
    case DataIo = 'WAITING_FOR_ENGINEER_SCHEDULED'
        ReturnedValue = DataIo
    case DataIo = 'WAITING_FOR_ENGTECH_SCHEDULED'
        ReturnedValue = DataIo
    case DataIo = 'WAITING_FOR_OPERATOR'
        ReturnedValue = DataIo
    case DataIo = 'ENGINEERING_DEVELOPMENT'
        ReturnedValue = DataIo
    case DataIo = 'ENGINEERING_INVESTIGATION'
        ReturnedValue = DataIo
    case DataIo = 'TEST_SCHEDULED'
        ReturnedValue = DataIo
    case DataIo = 'TEST_UNSCHEDULED'
        ReturnedValue = DataIo
    case DataIo = 'TEST_PM'
        ReturnedValue = DataIo
    case DataIo = 'MAINTENANCE_UNSCHEDULED'
        ReturnedValue = DataIo
    case DataIo = 'MAINTENANCE_DEVELOPMENT'
        ReturnedValue = DataIo
    case DataIo = 'MAINTENANCE_SCHEDULED'
        ReturnedValue = DataIo
    case DataIo = 'MAINTENANCE_WAITING_FOR_PARTS'
        ReturnedValue = DataIo
    case DataIo = 'UP_WITH_RESTRICTIONS'
        ReturnedValue = DataIo
    case DataIo = 'UP'
        ReturnedValue = DataIo
    case DataIo = 'UP_WITH_INCREASED_SAMPLING'
        ReturnedValue = DataIo
	case DataIo = 'UP_WITH_INCREASED_SAMPLING_SURFACE'
        ReturnedValue = DataIo
	case DataIo = 'UP_WITH_INCREASED_SAMPLING_METROLOGY'
        ReturnedValue = DataIo
    case DataIo = 'UP_NOT_RUNNING'
        ReturnedValue = DataIo
    case DataIo = 'TROUBLESHOOT_ENGTECH'
        ReturnedValue = DataIo
    case DataIo = 'TROUBLESHOOT_OPERATOR'
        ReturnedValue = DataIo
    case DataIo = 'CHANGEOVER_SCHEDULED'
        ReturnedValue = DataIo
    case DataIo = 'CHANGEOVER_UNSCHEDULED'
        ReturnedValue = DataIo
    case DataIo = 'FACILITIES_UNSCHEDULED'
        ReturnedValue = DataIo
    case DataIo = 'FACILITIES_SHEDULED'
        ReturnedValue = DataIo
    case DataIo = 'FACILITIES_WAITING_FOR_PARTS'
        ReturnedValue = DataIo
    case DataIo = 'CLEANUP'
        ReturnedValue = DataIo
    case ConvType = 'ICONV'
        ReturnedValue = DataIo
    case ConvType = 'OCONV'
        * WHEN THE BELOW CASES CHANGE OR ARE ADDED TO YOU NEED TO MAKE THE
        * SAME CHANGE ON THE CLICK EVENT FOR THE "APPLY" BUTTON ON "REACT_MODE_CHG"
        
        PopupData = XLATE('SYSREPOSPOPUPS','LSL2**REACTOR_MODE',8,'X')
        Code = ''
        FOR I = 1 TO COUNT(PopupData,@VM) + (@VM NE '')
            Code = PopupData<1,I,1>
        UNTIL Code = DataIO
        NEXT I
        IF Code NE '' THEN
            ReturnedValue = PopupData<1,I,2>
        END
        
    case otherwise$
        status() = invalid_msg$
end case
return





