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.5 KiB

1 year ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. module COpenSafetyValveLedNotification
  2. use COperationScenariosVariables
  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. ! implicit none
  29. ! call OnOpenSafetyValvePress%Add(ButtonPress_OpenSafetyValve)
  30. ! call OnOperationConditionChangeInt%Add(Set_Operation_OpenSafetyValveLed)
  31. ! end subroutine
  32. subroutine Set_Operation_OpenSafetyValveLed(v)
  33. implicit none
  34. integer , intent(in) :: v
  35. #ifdef ExcludeExtraChanges
  36. if(operation_OpenSafetyValveLed == v) return
  37. #endif
  38. operation_OpenSafetyValveLed = v
  39. #ifdef deb
  40. print*, 'operation_OpenSafetyValveLed=', operation_OpenSafetyValveLed
  41. #endif
  42. end subroutine
  43. subroutine ButtonPress_OpenSafetyValve()
  44. implicit none
  45. if (DriveType == TopDrive_DriveType) then
  46. #ifdef OST
  47. print*, 'ButtonPress_OpenSafetyValve=TopDrive'
  48. #endif
  49. !TOPDRIVE-CODE=56
  50. if (Get_SafetyValveHeight() >= 3.0 .and. Get_SafetyValveHeight() <= 12.0 .and.&
  51. Get_OpenSafetyValveLed() == .false. .and.&
  52. Get_CloseSafetyValveLed()) then
  53. call Set_CloseSafetyValveLed(.false.)
  54. call Set_OpenSafetyValveLed(.true.)
  55. return
  56. end if
  57. endif
  58. if (DriveType == Kelly_DriveType) then
  59. #ifdef OST
  60. print*, 'ButtonPress_OpenSafetyValve=Kelly'
  61. #endif
  62. !OPERATION-CODE=58
  63. if (Get_SafetyValveHeight() >= 3.0 .and. Get_SafetyValveHeight() <= 12.0 .and.&
  64. Get_OpenSafetyValveLed() == .false. .and.&
  65. Get_CloseSafetyValveLed()) then
  66. call Set_OpenSafetyValveLed(.true.)
  67. call Set_CloseSafetyValveLed(.false.)
  68. return
  69. end if
  70. endif
  71. end subroutine
  72. end module COpenSafetyValveLedNotification