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.

CCloseSafetyValveLedNotification.f90 2.6 KiB

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