module CSwingEnumVariables use CVoidEventHandlerCollection use CLog4 implicit none integer :: Swing = 0 integer :: Swing_S = 0 public type(VoidEventHandlerCollection) :: OnSwingChange enum, bind(c) 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 private :: Swing contains subroutine Set_Swing(v) implicit none integer , intent(in) :: v #ifdef ExcludeExtraChanges if(Swing == v) return #endif Swing = v #ifdef deb print*, 'Swing=', Swing #endif call OnSwingChange%RunAll() end subroutine integer function Get_Swing() implicit none Get_Swing = Swing end function subroutine Set_Swing_WN(v) !DEC$ ATTRIBUTES DLLEXPORT :: Set_Swing_WN !DEC$ ATTRIBUTES ALIAS: 'Set_Swing_WN' :: Set_Swing_WN implicit none integer , intent(in) :: v !call Set_Swing(v) Swing_S = v end subroutine integer function Get_Swing_WN() !DEC$ ATTRIBUTES DLLEXPORT :: Get_Swing_WN !DEC$ ATTRIBUTES ALIAS: 'Get_Swing_WN' :: Get_Swing_WN implicit none Get_Swing_WN = Swing end function subroutine SwingMouseHoleEnd() !DEC$ ATTRIBUTES DLLEXPORT :: SwingMouseHoleEnd !DEC$ ATTRIBUTES ALIAS: 'SwingMouseHoleEnd' :: SwingMouseHoleEnd implicit none !if(Swing /= SWING_MOUSE_HOLE_END) Swing = SWING_MOUSE_HOLE_END call Set_Swing(SWING_MOUSE_HOLE_END) #ifdef deb print*, 'SWING_MOUSE_HOLE_END' #endif end subroutine subroutine SwingRatHoleEnd() !DEC$ ATTRIBUTES DLLEXPORT :: SwingRatHoleEnd !DEC$ ATTRIBUTES ALIAS: 'SwingRatHoleEnd' :: SwingRatHoleEnd implicit none !if(Swing /= SWING_RAT_HOLE_END) Swing = SWING_RAT_HOLE_END call Set_Swing(SWING_RAT_HOLE_END) #ifdef deb print*, 'SWING_RAT_HOLE_END' #endif end subroutine subroutine SwingWellEnd() !DEC$ ATTRIBUTES DLLEXPORT :: SwingWellEnd !DEC$ ATTRIBUTES ALIAS: 'SwingWellEnd' :: SwingWellEnd implicit none !if(Swing /= SWING_WELL_END) Swing = SWING_WELL_END call Set_Swing(SWING_WELL_END) #ifdef deb print*, 'SWING_WELL_END' #endif end subroutine logical function Get_SwingMouseHole() !DEC$ ATTRIBUTES DLLEXPORT :: Get_SwingMouseHole !DEC$ ATTRIBUTES ALIAS: 'Get_SwingMouseHole' :: Get_SwingMouseHole implicit none Get_SwingMouseHole = .false. ! Swing == SWING_MOUSE_HOLE end function logical function Get_SwingRatHole() !DEC$ ATTRIBUTES DLLEXPORT :: Get_SwingRatHole !DEC$ ATTRIBUTES ALIAS: 'Get_SwingRatHole' :: Get_SwingRatHole implicit none Get_SwingRatHole = .false. ! Swing == SWING_RAT_HOLE end function logical function Get_SwingWell() !DEC$ ATTRIBUTES DLLEXPORT :: Get_SwingWell !DEC$ ATTRIBUTES ALIAS: 'Get_SwingWell' :: Get_SwingWell implicit none Get_SwingWell = .false. ! Swing == SWING_WELL end function end module CSwingEnumVariables