module UnitySignalVariables
    ! use CVoidEventHandlerCollection
    ! use CIntegerEventHandlerCollection

    type:: UnitySignalsType
        integer :: MudBucket = 0
        integer :: Elevator = 0
        integer :: FillupHead = 0
        integer :: Ibop = 0
        integer :: Kelly = 0
        integer :: MouseHole = 0
        integer :: OperationCondition = 0
        integer :: SafetyValve = 0
        integer :: operation = 0
        integer :: Slips = 0
        integer :: Slips_S = 0
        integer :: Swing = 0
        integer :: Swing_S = 0
        integer :: TdsBackupClamp = 0
        integer :: TdsSpine = 0
        integer :: TdsSwing = 0
        integer :: TdsTong = 0
        integer :: Tong = 0
        integer :: Tong_S = 0
        integer :: TdsConnectionModes = 0
        integer :: TdsElevatorModes = 0

    end type UnitySignalsType

    enum, bind(c)
        enumerator TONG_NEUTRAL
        enumerator TONG_BREAKOUT_BEGIN
        enumerator TONG_BREAKOUT_END
        enumerator TONG_MAKEUP_BEGIN
        enumerator TONG_MAKEUP_END

        enumerator TDS_SWING_NEUTRAL
        enumerator TDS_SWING_OFF_BEGIN
        enumerator TDS_SWING_OFF_END
        enumerator TDS_SWING_DRILL_BEGIN
        enumerator TDS_SWING_DRILL_END
        enumerator TDS_SWING_TILT_BEGIN
        enumerator TDS_SWING_TILT_END

        enumerator TDS_SPINE_NEUTRAL
        enumerator TDS_SPINE_CONNECT_BEGIN
        enumerator TDS_SPINE_CONNECT_END
        enumerator TDS_SPINE_DISCONNECT_BEGIN
        enumerator TDS_SPINE_DISCONNECT_END

        enumerator BACKUP_CLAMP_OFF_END
        enumerator BACKUP_CLAMP_OFF_BEGIN
        enumerator BACKUP_CLAMP_FW_BEGIN
        enumerator BACKUP_CLAMP_FW_END

        enumerator SWING_NEUTRAL
        enumerator SWING_MOUSE_HOLE_BEGIN
        enumerator SWING_MOUSE_HOLE_END
        enumerator SWING_RAT_HOLE_BEGIN
        enumerator SWING_RAT_HOLE_END
        enumerator SWING_WELL_BEGIN
        enumerator SWING_WELL_END
    end enum
    enum, bind(c)
        enumerator TDS_TONG_BREAKOUT_END
        enumerator TDS_TONG_BREAKOUT_BEGIN
        enumerator TDS_TONG_MAKEUP_BEGIN
        enumerator TDS_TONG_MAKEUP_END

        enumerator SAFETY_VALVE_NEUTRAL
        enumerator SAFETY_VALVE_REMOVE
        enumerator SAFETY_VALVE_INSTALL

    end enum
    enum, bind(c)
        enumerator OPERATION_DRILL
        enumerator OPERATION_TRIP
    end enum
    enum, bind(c)
        enumerator SLIPS_NEUTRAL
        enumerator SLIPS_SET_BEGIN
        enumerator SLIPS_SET_END
        enumerator SLIPS_UNSET_BEGIN
        enumerator SLIPS_UNSET_END

        enumerator MOUSE_HOLE_NEUTRAL
        enumerator MOUSE_HOLE_FILL
        enumerator MOUSE_HOLE_EMPTY

        enumerator KELLY_NEUTRAL
        enumerator KELLY_INSTALL
        enumerator KELLY_REMOVE

        !enumerator FILLUP_HEAD_NEUTRAL
        enumerator FILLUP_HEAD_REMOVE
        enumerator FILLUP_HEAD_INSTALL

        enumerator ELEVATOR_NEUTRAL
        
        enumerator ELEVATOR_LATCH_STRING_BEGIN
        enumerator ELEVATOR_LATCH_STRING_END
        
        enumerator ELEVATOR_UNLATCH_STRING_BEGIN
        enumerator ELEVATOR_UNLATCH_STRING_END
        
        enumerator ELEVATOR_LATCH_STAND_BEGIN
        enumerator ELEVATOR_LATCH_STAND_END
        
        enumerator ELEVATOR_UNLATCH_STAND_BEGIN
        enumerator ELEVATOR_UNLATCH_STAND_END
        
        enumerator ELEVATOR_LATCH_SINGLE_BEGIN
        enumerator ELEVATOR_LATCH_SINGLE_END
        
        enumerator ELEVATOR_UNLATCH_SINGLE_BEGIN
        enumerator ELEVATOR_UNLATCH_SINGLE_END

        !enumerator MUD_BUCKET_NEUTRAL
        enumerator MUD_BUCKET_REMOVE
        enumerator MUD_BUCKET_INSTALL

        !enumerator IBOP_NEUTRAL
        enumerator IBOP_REMOVE
        enumerator IBOP_INSTALL

        enumerator TDS_CONNECTION_NOTHING
        enumerator TDS_CONNECTION_STRING
        enumerator TDS_CONNECTION_SPINE
    
        enumerator TDS_ELEVATOR_CONNECTION_NOTHING
        enumerator TDS_ELEVATOR_CONNECTION_STRING
        enumerator TDS_ELEVATOR_CONNECTION_SINGLE
        enumerator TDS_ELEVATOR_CONNECTION_STAND
        enumerator TDS_ELEVATOR_LATCH_STRING
        enumerator TDS_ELEVATOR_LATCH_SINGLE
        enumerator TDS_ELEVATOR_LATCH_STAND
    end enum

    contains

    
end module UnitySignalVariables