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

1 year ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. module CIrSafetyValveLedNotification
  2. use OperationScenariosModule
  3. !use UnitySignalsModuleVariables
  4. implicit none
  5. contains
  6. subroutine Evaluate_IrSafetyValveLed()
  7. implicit none
  8. if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then
  9. #ifdef OST
  10. if(print_log) print*, 'Evaluate_IrSafetyValveLed=TopDrive'
  11. #endif
  12. endif
  13. if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then
  14. #ifdef OST
  15. if(print_log) 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. !@ use ConfigurationVariables
  28. !@ use ConfigurationVariables
  29. ! implicit none
  30. ! call OnIRSafetyValvePress%Add(ButtonPress_IrSafetyValve)
  31. ! call OnOperationConditionChangeInt%Add(Set_Operation_IrSafetyValveLed)
  32. ! end subroutine
  33. subroutine Set_Operation_IrSafetyValveLed(v)
  34. implicit none
  35. integer , intent(in) :: v
  36. #ifdef ExcludeExtraChanges
  37. if(data%State%notifications%operation_IrSafetyValveLed == v) return
  38. #endif
  39. data%State%notifications%operation_IrSafetyValveLed = v
  40. #ifdef deb
  41. if(print_log) print*, 'operation_IrSafetyValveLed=', data%State%notifications%operation_IrSafetyValveLed
  42. #endif
  43. end subroutine
  44. subroutine ButtonPress_IrSafetyValve()
  45. implicit none
  46. if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then
  47. #ifdef OST
  48. if(print_log) print*, 'Evaluate_IrSafetyValveLed=TopDrive'
  49. #endif
  50. !TOPDRIVE-CODE=53
  51. if (Get_IrSafetyValvePermission() .and.&
  52. Get_IrSafetyValveLed()) then
  53. call Set_IrSafetyValveLed(.false.)
  54. return
  55. end if
  56. !TOPDRIVE-CODE=54
  57. if (Get_IrSafetyValvePermission() .and.&
  58. Get_IrSafetyValveLed() == .false.) then
  59. call Set_IrSafetyValveLed(.true.)
  60. return
  61. end if
  62. endif
  63. if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then
  64. #ifdef OST
  65. if(print_log) print*, 'Evaluate_IrSafetyValveLed=Kelly'
  66. #endif
  67. !OPERATION-CODE=54
  68. if (Get_OperationCondition() == OPERATION_TRIP .and.&
  69. Get_IrSafetyValvePermission() .and.&
  70. Get_IrSafetyValveLed()) then
  71. call Set_IrSafetyValveLed(.false.)
  72. return
  73. end if
  74. !OPERATION-CODE=55
  75. if (Get_OperationCondition() == OPERATION_TRIP .and.&
  76. Get_IrSafetyValvePermission() .and.&
  77. Get_IrSafetyValveLed() == .false. ) then
  78. call Set_IrSafetyValveLed(.true.)
  79. return
  80. end if
  81. endif
  82. end subroutine
  83. end module CIrSafetyValveLedNotification