Simulation Core
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 
 
 
 

164 righe
3.7 KiB

  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. print*, 'Evaluate_IrSafetyValveLed=TopDrive'
  11. #endif
  12. endif
  13. if (data%Configuration%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. !@ 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. 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. 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. 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