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.

CKellyConnectionEnumVariables.f90 2.1 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. module CKellyConnectionEnumVariables
  2. use CVoidEventHandlerCollection
  3. implicit none
  4. type::KellyConnectionEnumType
  5. integer :: KellyConnection = 0
  6. type(VoidEventHandlerCollection) :: OnKellyConnectionChange
  7. end type KellyConnectionEnumType
  8. type(KellyConnectionEnumType)::KellyConnectionEnum
  9. ! public
  10. enum, bind(c)
  11. enumerator KELLY_CONNECTION_NOTHING
  12. enumerator KELLY_CONNECTION_STRING
  13. enumerator KELLY_CONNECTION_SINGLE
  14. end enum
  15. ! private :: OperationScenario%KellyConnection
  16. contains
  17. subroutine Set_KellyConnection(v)
  18. use CManifolds, Only: KellyConnected, KellyDisconnected
  19. implicit none
  20. integer , intent(in) :: v
  21. #ifdef ExcludeExtraChanges
  22. if(KellyConnectionEnum%KellyConnection == v) return
  23. #endif
  24. KellyConnectionEnum%KellyConnection = v
  25. if(KellyConnectionEnum%KellyConnection /= KELLY_CONNECTION_STRING) then
  26. call KellyDisconnected()
  27. else
  28. call KellyConnected()
  29. endif
  30. #ifdef deb
  31. print*, 'KellyConnectionEnum%KellyConnection=', KellyConnectionEnum%KellyConnection
  32. #endif
  33. call KellyConnectionEnum%OnKellyConnectionChange%RunAll()
  34. end subroutine
  35. integer function Get_KellyConnection()
  36. implicit none
  37. Get_KellyConnection = KellyConnectionEnum%KellyConnection
  38. end function
  39. ! subroutine Set_KellyConnection_WN(v)
  40. ! !DEC$ ATTRIBUTES DLLEXPORT :: Set_KellyConnection_WN
  41. ! !DEC$ ATTRIBUTES ALIAS: 'Set_KellyConnection_WN' :: Set_KellyConnection_WN
  42. ! implicit none
  43. ! integer , intent(in) :: v
  44. ! call Set_KellyConnection(v)
  45. ! end subroutine
  46. ! integer function Get_KellyConnection_WN()
  47. ! !DEC$ ATTRIBUTES DLLEXPORT :: Get_KellyConnection_WN
  48. ! !DEC$ ATTRIBUTES ALIAS: 'Get_KellyConnection_WN' :: Get_KellyConnection_WN
  49. ! implicit none
  50. ! Get_KellyConnection_WN = OperationScenario%KellyConnection
  51. ! end function
  52. end module CKellyConnectionEnumVariables