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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. # 1 "/home/admin/SimulationCore2/CSharp/OperationScenarios/Notifications/CIrSafetyValveLedNotification.f90"
  2. module CIrSafetyValveLedNotification
  3. use OperationScenariosModule
  4. !use UnitySignalsModuleVariables
  5. implicit none
  6. contains
  7. subroutine Evaluate_IrSafetyValveLed()
  8. implicit none
  9. if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then
  10. # 17
  11. endif
  12. if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then
  13. # 37
  14. !OPERATION-CODE=56
  15. if (Get_OperationCondition() == OPERATION_DRILL) then
  16. call Set_IrSafetyValveLed(.true.)
  17. return
  18. end if
  19. !call Set_IrSafetyValveLed(.false.)
  20. endif
  21. end subroutine
  22. ! subroutine Subscribe_IrSafetyValveLed()
  23. ! use CDrillingConsoleVariables
  24. !@ use ConfigurationVariables
  25. !@ use ConfigurationVariables
  26. ! implicit none
  27. ! call OnIRSafetyValvePress%Add(ButtonPress_IrSafetyValve)
  28. ! call OnOperationConditionChangeInt%Add(Set_Operation_IrSafetyValveLed)
  29. ! end subroutine
  30. subroutine Set_Operation_IrSafetyValveLed(v)
  31. implicit none
  32. integer , intent(in) :: v
  33. # 79
  34. data%State%notifications%operation_IrSafetyValveLed = v
  35. # 83
  36. end subroutine
  37. subroutine ButtonPress_IrSafetyValve()
  38. implicit none
  39. if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then
  40. # 95
  41. !TOPDRIVE-CODE=53
  42. if (Get_IrSafetyValvePermission() .and.&
  43. Get_IrSafetyValveLed()) then
  44. call Set_IrSafetyValveLed(.false.)
  45. return
  46. end if
  47. !TOPDRIVE-CODE=54
  48. if (Get_IrSafetyValvePermission() .and.&
  49. Get_IrSafetyValveLed() == .false.) then
  50. call Set_IrSafetyValveLed(.true.)
  51. return
  52. end if
  53. endif
  54. if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then
  55. # 134
  56. !OPERATION-CODE=54
  57. if (Get_OperationCondition() == OPERATION_TRIP .and.&
  58. Get_IrSafetyValvePermission() .and.&
  59. Get_IrSafetyValveLed()) then
  60. call Set_IrSafetyValveLed(.false.)
  61. return
  62. end if
  63. !OPERATION-CODE=55
  64. if (Get_OperationCondition() == OPERATION_TRIP .and.&
  65. Get_IrSafetyValvePermission() .and.&
  66. Get_IrSafetyValveLed() == .false. ) then
  67. call Set_IrSafetyValveLed(.true.)
  68. return
  69. end if
  70. endif
  71. end subroutine
  72. end module CIrSafetyValveLedNotification