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.

CIrSafetyValveLedNotification.f90 3.3 KiB

1 year ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. module CIrSafetyValveLedNotification
  2. use COperationScenariosVariables
  3. !use COperationConditionEnumVariables
  4. implicit none
  5. contains
  6. subroutine Evaluate_IrSafetyValveLed()
  7. implicit none
  8. if (DriveType == TopDrive_DriveType) then
  9. #ifdef OST
  10. print*, 'Evaluate_IrSafetyValveLed=TopDrive'
  11. #endif
  12. endif
  13. if (DriveType == Kelly_DriveType) then
  14. #ifdef OST
  15. print*, 'Evaluate_IrSafetyValveLed=Kelly'
  16. #endif
  17. !OPERATION-CODE=56
  18. if (Get_OperationCondition() == OPERATION_DRILL) then
  19. call Set_IrSafetyValveLed(.true.)
  20. return
  21. end if
  22. !call Set_IrSafetyValveLed(.false.)
  23. endif
  24. end subroutine
  25. ! subroutine Subscribe_IrSafetyValveLed()
  26. ! use CDrillingConsoleVariables
  27. ! implicit none
  28. ! call OnIRSafetyValvePress%Add(ButtonPress_IrSafetyValve)
  29. ! call OnOperationConditionChangeInt%Add(Set_Operation_IrSafetyValveLed)
  30. ! end subroutine
  31. subroutine Set_Operation_IrSafetyValveLed(v)
  32. implicit none
  33. integer , intent(in) :: v
  34. #ifdef ExcludeExtraChanges
  35. if(operation_IrSafetyValveLed == v) return
  36. #endif
  37. operation_IrSafetyValveLed = v
  38. #ifdef deb
  39. print*, 'operation_IrSafetyValveLed=', operation_IrSafetyValveLed
  40. #endif
  41. end subroutine
  42. subroutine ButtonPress_IrSafetyValve()
  43. implicit none
  44. if (DriveType == TopDrive_DriveType) then
  45. #ifdef OST
  46. print*, 'Evaluate_IrSafetyValveLed=TopDrive'
  47. #endif
  48. !TOPDRIVE-CODE=53
  49. if (Get_IrSafetyValvePermission() .and.&
  50. Get_IrSafetyValveLed()) then
  51. call Set_IrSafetyValveLed(.false.)
  52. return
  53. end if
  54. !TOPDRIVE-CODE=54
  55. if (Get_IrSafetyValvePermission() .and.&
  56. Get_IrSafetyValveLed() == .false.) then
  57. call Set_IrSafetyValveLed(.true.)
  58. return
  59. end if
  60. endif
  61. if (DriveType == Kelly_DriveType) then
  62. #ifdef OST
  63. print*, 'Evaluate_IrSafetyValveLed=Kelly'
  64. #endif
  65. !OPERATION-CODE=54
  66. if (Get_OperationCondition() == OPERATION_TRIP .and.&
  67. Get_IrSafetyValvePermission() .and.&
  68. Get_IrSafetyValveLed()) then
  69. call Set_IrSafetyValveLed(.false.)
  70. return
  71. end if
  72. !OPERATION-CODE=55
  73. if (Get_OperationCondition() == OPERATION_TRIP .and.&
  74. Get_IrSafetyValvePermission() .and.&
  75. Get_IrSafetyValveLed() == .false. ) then
  76. call Set_IrSafetyValveLed(.true.)
  77. return
  78. end if
  79. endif
  80. end subroutine
  81. end module CIrSafetyValveLedNotification