Simulation Core
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

135 lines
3.3 KiB

  1. module CSwingEnumVariables
  2. use CVoidEventHandlerCollection
  3. use CLog4
  4. implicit none
  5. integer :: Swing = 0
  6. integer :: Swing_S = 0
  7. public
  8. type(VoidEventHandlerCollection) :: OnSwingChange
  9. enum, bind(c)
  10. enumerator SWING_NEUTRAL
  11. enumerator SWING_MOUSE_HOLE_BEGIN
  12. enumerator SWING_MOUSE_HOLE_END
  13. enumerator SWING_RAT_HOLE_BEGIN
  14. enumerator SWING_RAT_HOLE_END
  15. enumerator SWING_WELL_BEGIN
  16. enumerator SWING_WELL_END
  17. end enum
  18. private :: Swing
  19. contains
  20. subroutine Set_Swing(v)
  21. implicit none
  22. integer , intent(in) :: v
  23. #ifdef ExcludeExtraChanges
  24. if(Swing == v) return
  25. #endif
  26. Swing = v
  27. #ifdef deb
  28. print*, 'Swing=', Swing
  29. #endif
  30. call OnSwingChange%RunAll()
  31. end subroutine
  32. integer function Get_Swing()
  33. implicit none
  34. Get_Swing = Swing
  35. end function
  36. subroutine Set_Swing_WN(v)
  37. !DEC$ ATTRIBUTES DLLEXPORT :: Set_Swing_WN
  38. !DEC$ ATTRIBUTES ALIAS: 'Set_Swing_WN' :: Set_Swing_WN
  39. implicit none
  40. integer , intent(in) :: v
  41. !call Set_Swing(v)
  42. Swing_S = v
  43. end subroutine
  44. integer function Get_Swing_WN()
  45. !DEC$ ATTRIBUTES DLLEXPORT :: Get_Swing_WN
  46. !DEC$ ATTRIBUTES ALIAS: 'Get_Swing_WN' :: Get_Swing_WN
  47. implicit none
  48. Get_Swing_WN = Swing
  49. end function
  50. subroutine SwingMouseHoleEnd()
  51. !DEC$ ATTRIBUTES DLLEXPORT :: SwingMouseHoleEnd
  52. !DEC$ ATTRIBUTES ALIAS: 'SwingMouseHoleEnd' :: SwingMouseHoleEnd
  53. implicit none
  54. !if(Swing /= SWING_MOUSE_HOLE_END) Swing = SWING_MOUSE_HOLE_END
  55. call Set_Swing(SWING_MOUSE_HOLE_END)
  56. #ifdef deb
  57. print*, 'SWING_MOUSE_HOLE_END'
  58. #endif
  59. end subroutine
  60. subroutine SwingRatHoleEnd()
  61. !DEC$ ATTRIBUTES DLLEXPORT :: SwingRatHoleEnd
  62. !DEC$ ATTRIBUTES ALIAS: 'SwingRatHoleEnd' :: SwingRatHoleEnd
  63. implicit none
  64. !if(Swing /= SWING_RAT_HOLE_END) Swing = SWING_RAT_HOLE_END
  65. call Set_Swing(SWING_RAT_HOLE_END)
  66. #ifdef deb
  67. print*, 'SWING_RAT_HOLE_END'
  68. #endif
  69. end subroutine
  70. subroutine SwingWellEnd()
  71. !DEC$ ATTRIBUTES DLLEXPORT :: SwingWellEnd
  72. !DEC$ ATTRIBUTES ALIAS: 'SwingWellEnd' :: SwingWellEnd
  73. implicit none
  74. !if(Swing /= SWING_WELL_END) Swing = SWING_WELL_END
  75. call Set_Swing(SWING_WELL_END)
  76. #ifdef deb
  77. print*, 'SWING_WELL_END'
  78. #endif
  79. end subroutine
  80. logical function Get_SwingMouseHole()
  81. !DEC$ ATTRIBUTES DLLEXPORT :: Get_SwingMouseHole
  82. !DEC$ ATTRIBUTES ALIAS: 'Get_SwingMouseHole' :: Get_SwingMouseHole
  83. implicit none
  84. Get_SwingMouseHole = .false. ! Swing == SWING_MOUSE_HOLE
  85. end function
  86. logical function Get_SwingRatHole()
  87. !DEC$ ATTRIBUTES DLLEXPORT :: Get_SwingRatHole
  88. !DEC$ ATTRIBUTES ALIAS: 'Get_SwingRatHole' :: Get_SwingRatHole
  89. implicit none
  90. Get_SwingRatHole = .false. ! Swing == SWING_RAT_HOLE
  91. end function
  92. logical function Get_SwingWell()
  93. !DEC$ ATTRIBUTES DLLEXPORT :: Get_SwingWell
  94. !DEC$ ATTRIBUTES ALIAS: 'Get_SwingWell' :: Get_SwingWell
  95. implicit none
  96. Get_SwingWell = .false. ! Swing == SWING_WELL
  97. end function
  98. end module CSwingEnumVariables