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.
 
 
 
 
 
 

162 lines
3.3 KiB

  1. module CIrSafetyValveLedNotification
  2. use COperationScenariosVariables
  3. !use COperationConditionEnumVariables
  4. implicit none
  5. contains
  6. subroutine Evaluate_IrSafetyValveLed()
  7. implicit none
  8. if (Hoisting%DriveType == TopDrive_DriveType) then
  9. #ifdef OST
  10. print*, 'Evaluate_IrSafetyValveLed=TopDrive'
  11. #endif
  12. endif
  13. if (Hoisting%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(Notifications%operation_IrSafetyValveLed == v) return
  36. #endif
  37. Notifications%operation_IrSafetyValveLed = v
  38. #ifdef deb
  39. print*, 'operation_IrSafetyValveLed=', Notifications%operation_IrSafetyValveLed
  40. #endif
  41. end subroutine
  42. subroutine ButtonPress_IrSafetyValve()
  43. implicit none
  44. if (Hoisting%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 (Hoisting%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