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.
 
 
 
 
 
 

66 lines
1.7 KiB

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