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.

CTongEnumVariables.f90 2.9 KiB

1 year ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. module CTongEnumVariables
  2. use CVoidEventHandlerCollection
  3. use CLog4
  4. implicit none
  5. integer :: Tong = 0
  6. integer :: Tong_S = 0
  7. public
  8. type(VoidEventHandlerCollection) :: OnTongChange
  9. enum, bind(c)
  10. enumerator TONG_NEUTRAL
  11. enumerator TONG_BREAKOUT_BEGIN
  12. enumerator TONG_BREAKOUT_END
  13. enumerator TONG_MAKEUP_BEGIN
  14. enumerator TONG_MAKEUP_END
  15. end enum
  16. private :: Tong
  17. contains
  18. subroutine Set_Tong(v)
  19. implicit none
  20. integer , intent(in) :: v
  21. #ifdef ExcludeExtraChanges
  22. if(Tong == v) return
  23. #endif
  24. Tong = v
  25. #ifdef deb
  26. !if(Tong==TONG_NEUTRAL) then
  27. ! print*, 'Tong=TONG_NEUTRAL'
  28. !else if(Tong==TONG_BREAKOUT) then
  29. ! print*, 'Tong=TONG_BREAKOUT'
  30. !else if(Tong==TONG_MAKEUP) then
  31. ! print*, 'Tong=TONG_MAKEUP'
  32. !endif
  33. print*, 'Tong=', Tong
  34. #endif
  35. call OnTongChange%RunAll()
  36. end subroutine
  37. integer function Get_Tong()
  38. implicit none
  39. Get_Tong = Tong
  40. end function
  41. subroutine Set_Tong_WN(v)
  42. !DEC$ ATTRIBUTES DLLEXPORT :: Set_Tong_WN
  43. !DEC$ ATTRIBUTES ALIAS: 'Set_Tong_WN' :: Set_Tong_WN
  44. implicit none
  45. integer , intent(in) :: v
  46. !call Set_Tong(v)
  47. Tong_S = v
  48. end subroutine
  49. integer function Get_Tong_WN()
  50. !DEC$ ATTRIBUTES DLLEXPORT :: Get_Tong_WN
  51. !DEC$ ATTRIBUTES ALIAS: 'Get_Tong_WN' :: Get_Tong_WN
  52. implicit none
  53. Get_Tong_WN = Tong
  54. end function
  55. subroutine TongBreakoutEnd()
  56. !DEC$ ATTRIBUTES DLLEXPORT :: TongBreakoutEnd
  57. !DEC$ ATTRIBUTES ALIAS: 'TongBreakoutEnd' :: TongBreakoutEnd
  58. implicit none
  59. !if(Tong /= TONG_BREAKOUT_END) then
  60. ! Tong = TONG_BREAKOUT_END
  61. !endif
  62. call Set_Tong(TONG_BREAKOUT_END)
  63. #ifdef deb
  64. print*, 'TONG_BREAKOUT_END'
  65. #endif
  66. end subroutine
  67. subroutine TongMakeupEnd()
  68. !DEC$ ATTRIBUTES DLLEXPORT :: TongMakeupEnd
  69. !DEC$ ATTRIBUTES ALIAS: 'TongMakeupEnd' :: TongMakeupEnd
  70. implicit none
  71. !if(Tong /= TONG_MAKEUP_END) then
  72. ! Tong = TONG_MAKEUP_END
  73. !
  74. !endif
  75. call Set_Tong(TONG_MAKEUP_END)
  76. #ifdef deb
  77. print*, 'TONG_MAKEUP_END'
  78. #endif
  79. end subroutine
  80. logical function Get_TongBreakout()
  81. !DEC$ ATTRIBUTES DLLEXPORT :: Get_TongBreakout
  82. !DEC$ ATTRIBUTES ALIAS: 'Get_TongBreakout' :: Get_TongBreakout
  83. implicit none
  84. Get_TongBreakout = .false. ! Tong == TONG_BREAKOUT
  85. end function
  86. logical function Get_TongMakeup()
  87. !DEC$ ATTRIBUTES DLLEXPORT :: Get_TongMakeup
  88. !DEC$ ATTRIBUTES ALIAS: 'Get_TongMakeup' :: Get_TongMakeup
  89. implicit none
  90. Get_TongMakeup = .false. ! Tong == TONG_MAKEUP
  91. end function
  92. end module CTongEnumVariables