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.

CSlipsEnumVariables.f90 2.5 KiB

1 year ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. module CSlipsEnumVariables
  2. use CVoidEventHandlerCollection
  3. implicit none
  4. integer :: Slips = 0
  5. integer :: Slips_S = 0
  6. public
  7. type(VoidEventHandlerCollection) :: OnSlipsChange
  8. enum, bind(c)
  9. enumerator SLIPS_NEUTRAL
  10. enumerator SLIPS_SET_BEGIN
  11. enumerator SLIPS_SET_END
  12. enumerator SLIPS_UNSET_BEGIN
  13. enumerator SLIPS_UNSET_END
  14. end enum
  15. private :: Slips
  16. contains
  17. subroutine Set_Slips(v)
  18. implicit none
  19. integer , intent(in) :: v
  20. #ifdef ExcludeExtraChanges
  21. if(Slips == v) return
  22. #endif
  23. Slips = v
  24. #ifdef deb
  25. print*, 'Slips=', Slips
  26. #endif
  27. call OnSlipsChange%RunAll()
  28. end subroutine
  29. integer function Get_Slips()
  30. implicit none
  31. Get_Slips = Slips
  32. end function
  33. subroutine Set_Slips_WN(v)
  34. !DEC$ ATTRIBUTES DLLEXPORT :: Set_Slips_WN
  35. !DEC$ ATTRIBUTES ALIAS: 'Set_Slips_WN' :: Set_Slips_WN
  36. implicit none
  37. integer , intent(in) :: v
  38. !call Set_Slips(v)
  39. Slips_S = v
  40. end subroutine
  41. integer function Get_Slips_WN()
  42. !DEC$ ATTRIBUTES DLLEXPORT :: Get_Slips_WN
  43. !DEC$ ATTRIBUTES ALIAS: 'Get_Slips_WN' :: Get_Slips_WN
  44. implicit none
  45. Get_Slips_WN = Slips
  46. end function
  47. subroutine SlipsSetEnd()
  48. !DEC$ ATTRIBUTES DLLEXPORT :: SlipsSetEnd
  49. !DEC$ ATTRIBUTES ALIAS: 'SlipsSetEnd' :: SlipsSetEnd
  50. implicit none
  51. !if(Slips /= SLIPS_SET_END) Slips = SLIPS_SET_END
  52. call Set_Slips(SLIPS_SET_END)
  53. #ifdef deb
  54. print*, 'SlipsSetEnd'
  55. #endif
  56. end subroutine
  57. subroutine SlipsUnsetEnd()
  58. !DEC$ ATTRIBUTES DLLEXPORT :: SlipsUnsetEnd
  59. !DEC$ ATTRIBUTES ALIAS: 'SlipsUnsetEnd' :: SlipsUnsetEnd
  60. implicit none
  61. !if(Slips /= SLIPS_UNSET_END) Slips = SLIPS_UNSET_END
  62. call Set_Slips(SLIPS_UNSET_END)
  63. #ifdef deb
  64. print*, 'SlipsUnsetEnd'
  65. #endif
  66. end subroutine
  67. logical function Get_SlipsUnset()
  68. !DEC$ ATTRIBUTES DLLEXPORT :: Get_SlipsUnset
  69. !DEC$ ATTRIBUTES ALIAS: 'Get_SlipsUnset' :: Get_SlipsUnset
  70. implicit none
  71. Get_SlipsUnset = .false. ! Slips == SLIPS_UNSET
  72. end function
  73. logical function Get_SlipsSet()
  74. !DEC$ ATTRIBUTES DLLEXPORT :: Get_SlipsSet
  75. !DEC$ ATTRIBUTES ALIAS: 'Get_SlipsSet' :: Get_SlipsSet
  76. implicit none
  77. Get_SlipsSet = .false. ! Slips == SLIPS_SET
  78. end function
  79. end module CSlipsEnumVariables