module CFillMouseHoleLedNotification
    use OperationScenariosModule
    use NotificationModule
    implicit none
    contains
    
    subroutine Evaluate_FillMouseHoleLed()
        implicit none    
        
    end subroutine
        
    subroutine ButtonPress_FillMouseHole()
        ! use OperationScenariosModule
        use UnitySignalsModule
        implicit none
        
        if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then

            !TOPDRIVE-CODE=71
            if (Get_FillMouseHoleLed()) then
                
                call Set_FillMouseHoleLed(.false.)
                call Set_MouseHole(MOUSE_HOLE_NEUTRAL)
                return
            end if
            
            
            !TOPDRIVE-CODE=72
            if (Get_TdsElevatorModes() /= TDS_ELEVATOR_CONNECTION_STRING .and.&
                Get_FillMouseHoleLed() == .false.) then
                
                call Set_FillMouseHoleLed(.true.)
                return
            end if

        endif        
        
        if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then


            !OPERATION-CODE=81
            if (Get_FillMouseHoleLed()) then
                call Set_FillMouseHoleLed(.false.)
                call Set_MouseHole(MOUSE_HOLE_EMPTY)
                return
            end if
        
            !OPERATION-CODE=82
            if (Get_KellyConnection() /= KELLY_CONNECTION_SINGLE .and.&
                Get_ElevatorConnection() /= ELEVATOR_CONNECTION_SINGLE .and.&
                Get_FillMouseHoleLed() == .false.) then
                call Set_FillMouseHoleLed(.true.)
                call Set_MouseHole(MOUSE_HOLE_FILL)
                return
            end if     
                
        endif
        
    end subroutine
    
end module CFillMouseHoleLedNotification