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.

COpenSafetyValveLedNotification.f90 2.9 KiB

1 year ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. module COpenSafetyValveLedNotification
  2. use OperationScenariosModule
  3. implicit none
  4. contains
  5. subroutine Evaluate_OpenSafetyValveLed()
  6. implicit none
  7. ! if (DriveType == TopDrive_DriveType) then
  8. !#ifdef OST
  9. ! print*, 'Evaluate_OpenSafetyValveLed=TopDrive'
  10. !#endif
  11. ! endif
  12. !
  13. !
  14. !
  15. !
  16. !
  17. !
  18. !
  19. !
  20. ! if (DriveType == Kelly_DriveType) then
  21. !#ifdef OST
  22. ! print*, 'Evaluate_OpenSafetyValveLed=Kelly'
  23. !#endif
  24. ! endif
  25. end subroutine
  26. ! subroutine Subscribe_OpenSafetyValveLed()
  27. ! use CDrillingConsoleVariables
  28. ! use ConfigurationVariables
  29. ! use ConfigurationVariables
  30. ! implicit none
  31. ! call OnOpenSafetyValvePress%Add(ButtonPress_OpenSafetyValve)
  32. ! call OnOperationConditionChangeInt%Add(Set_Operation_OpenSafetyValveLed)
  33. ! end subroutine
  34. subroutine Set_Operation_OpenSafetyValveLed(v)
  35. implicit none
  36. integer , intent(in) :: v
  37. #ifdef ExcludeExtraChanges
  38. if(data%State%notifications%operation_OpenSafetyValveLed == v) return
  39. #endif
  40. data%State%notifications%operation_OpenSafetyValveLed = v
  41. #ifdef deb
  42. print*, 'data%State%notifications%operation_OpenSafetyValveLed=', data%State%notifications%operation_OpenSafetyValveLed
  43. #endif
  44. end subroutine
  45. subroutine ButtonPress_OpenSafetyValve()
  46. implicit none
  47. if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then
  48. #ifdef OST
  49. print*, 'ButtonPress_OpenSafetyValve=TopDrive'
  50. #endif
  51. !TOPDRIVE-CODE=56
  52. if (Get_SafetyValveHeight() >= 3.0 .and. Get_SafetyValveHeight() <= 12.0 .and.&
  53. Get_OpenSafetyValveLed() == .false. .and.&
  54. Get_CloseSafetyValveLed()) then
  55. call Set_CloseSafetyValveLed(.false.)
  56. call Set_OpenSafetyValveLed(.true.)
  57. return
  58. end if
  59. endif
  60. if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then
  61. #ifdef OST
  62. print*, 'ButtonPress_OpenSafetyValve=Kelly'
  63. #endif
  64. !OPERATION-CODE=58
  65. if (Get_SafetyValveHeight() >= 3.0 .and. Get_SafetyValveHeight() <= 12.0 .and.&
  66. Get_OpenSafetyValveLed() == .false. .and.&
  67. Get_CloseSafetyValveLed()) then
  68. call Set_OpenSafetyValveLed(.true.)
  69. call Set_CloseSafetyValveLed(.false.)
  70. return
  71. end if
  72. endif
  73. end subroutine
  74. end module COpenSafetyValveLedNotification