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.

CHeadEnum.f90 4.4 KiB

1 year ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. module CHeadEnum
  2. use OperationScenariosModule
  3. implicit none
  4. ! enum, bind(c)
  5. ! enumerator FILLUP_HEAD_REMOVE
  6. ! enumerator FILLUP_HEAD_INSTALL
  7. ! end enum
  8. contains
  9. subroutine Set_FillupHead(v)
  10. use CManifolds, only: ToggleFillupHead
  11. implicit none
  12. integer , intent(in) :: v
  13. #ifdef ExcludeExtraChanges
  14. if(data%State%unitySignals%FillupHead == v) return
  15. #endif
  16. data%State%unitySignals%FillupHead = v
  17. if (data%State%unitySignals%FillupHead == FILLUP_HEAD_INSTALL) then
  18. call ToggleFillupHead(.true.)
  19. else if (data%State%unitySignals%FillupHead == FILLUP_HEAD_REMOVE) then
  20. call ToggleFillupHead(.false.)
  21. endif
  22. #ifdef deb
  23. print*, 'data%State%unitySignals%FillupHead=', data%State%unitySignals%FillupHead
  24. #endif
  25. call OnFillupHeadChange%RunAll()
  26. end subroutine
  27. integer function Get_FillupHead()
  28. implicit none
  29. Get_FillupHead = FillupHead
  30. end function
  31. subroutine Evaluate_FillupHead()
  32. use CStudentStationVariables!, only: data%State%StudentStation%FillupHeadInstallation
  33. implicit none
  34. if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then
  35. #ifdef OST
  36. print*, 'Evaluate_FillupHead=TopDrive'
  37. #endif
  38. endif
  39. if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then
  40. #ifdef OST
  41. print*, 'Evaluate_FillupHead=Kelly'
  42. #endif
  43. endif
  44. if (Get_FillupHead() == FILLUP_HEAD_INSTALL) then
  45. data%State%StudentStation%FillupHeadInstallation = .true.
  46. else if (Get_FillupHead() == FILLUP_HEAD_REMOVE) then
  47. data%State%StudentStation%FillupHeadInstallation = .false.
  48. endif
  49. end subroutine
  50. ! subroutine Subscribe_FillupHead()
  51. ! use CStudentStationVariables
  52. ! implicit none
  53. ! call OnState%StudentStation%FillupHeadInstallationPress%Add(ButtonPress_State%StudentStation%FillupHeadInstallation)
  54. ! call OnFillupHeadRemovePress%Add(ButtonPress_FillupHeadRemove)
  55. ! end subroutine
  56. subroutine ButtonPress_FillupHeadInstallation()
  57. implicit none
  58. if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then
  59. #ifdef OST
  60. print*, 'ButtonPress_State%StudentStation%FillupHeadInstallation=TopDrive'
  61. #endif
  62. !TOPDRIVE-CODE=67
  63. if (Get_FillupHeadPermission()) then
  64. call Set_FillupHead(FILLUP_HEAD_INSTALL)
  65. return
  66. end if
  67. endif
  68. if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then
  69. #ifdef OST
  70. print*, 'ButtonPress_State%StudentStation%FillupHeadInstallation=Kelly'
  71. #endif
  72. !OPERATION-CODE=71
  73. if (Get_InstallFillupHeadPermission()) then
  74. call Set_FillupHead(FILLUP_HEAD_INSTALL)
  75. return
  76. end if
  77. endif
  78. end subroutine
  79. subroutine ButtonPress_FillupHeadRemove()
  80. implicit none
  81. if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then
  82. #ifdef OST
  83. print*, 'ButtonPress_FillupHeadRemove=TopDrive'
  84. #endif
  85. !TOPDRIVE-CODE=68
  86. if (Get_FillupHeadPermission()) then
  87. call Set_FillupHead(FILLUP_HEAD_REMOVE)
  88. return
  89. end if
  90. endif
  91. if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then
  92. #ifdef OST
  93. print*, 'ButtonPress_FillupHeadRemove=Kelly'
  94. #endif
  95. !OPERATION-CODE=72
  96. if (Get_InstallFillupHeadPermission()) then
  97. call Set_FillupHead(FILLUP_HEAD_REMOVE)
  98. return
  99. end if
  100. endif
  101. end subroutine
  102. end module CHeadEnum