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.
 
 
 
 
 
 

175 lines
5.8 KiB

  1. module CKellyConnectionEnum
  2. use COperationScenariosVariables
  3. use CLog4
  4. implicit none
  5. contains
  6. subroutine Evaluate_KellyConnection()
  7. implicit none
  8. if (Hoisting%DriveType == TopDrive_DriveType) then
  9. #ifdef OST
  10. print*, 'Evaluate_KellyConnection=TopDrive'
  11. #endif
  12. endif
  13. if (Hoisting%DriveType == Kelly_DriveType) then
  14. #ifdef OST
  15. print*, 'Evaluate_KellyConnection=Kelly'
  16. #endif
  17. !!OPERATION-CODE=4
  18. !if (Get_OperationCondition() == OPERATION_DRILL .and.&
  19. ! Get_KellyConnection() == KELLY_CONNECTION_SINGLE .and.&
  20. ! Get_Swing() == SWING_MOUSE_HOLE_END .and.&
  21. ! Get_TongNotification() .and.&
  22. ! Get_FillMouseHoleLed() == .false. .and.&
  23. ! Get_Tong() == TONG_BREAKOUT_END) then
  24. !
  25. ! call Set_FillMouseHoleLed(.true.)
  26. ! return
  27. !end if
  28. !OPERATION-CODE=1
  29. if (Get_OperationCondition() == OPERATION_DRILL .and.&
  30. !Get_JointConnectionPossible() .and.&
  31. Get_KellyConnection() == KELLY_CONNECTION_NOTHING .and.&
  32. Get_Swing() == SWING_WELL_END .and.&
  33. !Get_TongNotification() .and.&
  34. Get_Tong() == TONG_MAKEUP_END) then
  35. !call Log_4('KELLY_CONNECTION_STRING')
  36. call Set_Tong(TONG_NEUTRAL)
  37. call Set_KellyConnection(KELLY_CONNECTION_STRING)
  38. return
  39. end if
  40. !OPERATION-CODE=2
  41. if (Get_OperationCondition() == OPERATION_DRILL .and.&
  42. Get_StringPressure() == 0 .and.&
  43. Get_HookHeight() <= (HKL + Get_NearFloorConnection()) .and.&
  44. Get_KellyConnection() == KELLY_CONNECTION_STRING .and.&
  45. Get_Swing() == SWING_WELL_END .and.&
  46. !Get_TongNotification() .and.&
  47. Get_Tong() == TONG_BREAKOUT_END) then
  48. call Set_Tong(TONG_NEUTRAL)
  49. call Set_KellyConnection(KELLY_CONNECTION_NOTHING)
  50. call Set_SwingLed(.true.)
  51. return
  52. end if
  53. !OPERATION-CODE=3
  54. if (Get_OperationCondition() == OPERATION_DRILL .and.&
  55. !Get_JointConnectionPossible() .and.&
  56. Get_KellyConnection() == KELLY_CONNECTION_NOTHING .and.&
  57. Get_Swing() == SWING_MOUSE_HOLE_END .and.&
  58. !Get_TongNotification() .and.&
  59. Get_FillMouseHoleLed() .and.&
  60. Get_Tong() == TONG_MAKEUP_END) then
  61. call Set_Tong(TONG_NEUTRAL)
  62. call Set_KellyConnection(KELLY_CONNECTION_SINGLE)
  63. call Set_SwingLed(.false.)
  64. call Set_FillMouseHoleLed(.false.)
  65. call Set_MouseHole(MOUSE_HOLE_NEUTRAL)
  66. return
  67. end if
  68. !OPERATION-CODE=4
  69. if (Get_OperationCondition() == OPERATION_DRILL .and.&
  70. Get_KellyConnection() == KELLY_CONNECTION_SINGLE .and.&
  71. Get_Swing() == SWING_MOUSE_HOLE_END .and.&
  72. !Get_TongNotification() .and.&
  73. Get_FillMouseHoleLed() == .false. .and.&
  74. Get_Tong() == TONG_BREAKOUT_END) then
  75. call Set_Tong(TONG_NEUTRAL)
  76. call Set_KellyConnection(KELLY_CONNECTION_NOTHING)
  77. call Set_FillMouseHoleLed(.true.)
  78. call Set_MouseHole(MOUSE_HOLE_NEUTRAL)
  79. return
  80. end if
  81. !OPERATION-CODE=5
  82. if (Get_OperationCondition() == OPERATION_DRILL .and.&
  83. !Get_JointConnectionPossible() .and.&
  84. Get_KellyConnection() == KELLY_CONNECTION_SINGLE .and.&
  85. Get_Swing() == SWING_WELL_END .and.&
  86. !Get_TongNotification() .and.&
  87. Get_Tong() == TONG_MAKEUP_END) then
  88. call Set_Tong(TONG_NEUTRAL)
  89. call Set_KellyConnection(KELLY_CONNECTION_STRING)
  90. call Set_StringUpdate(STRING_UPDATE_ADD_SINGLE)
  91. call Set_SwingLed(.false.)
  92. return
  93. end if
  94. !OPERATION-CODE=6
  95. if (Get_OperationCondition() == OPERATION_DRILL .and.&
  96. Get_StringPressure() == 0 .and.&
  97. Get_HookHeight() > 70.0 .and.&
  98. Get_KellyConnection() == KELLY_CONNECTION_STRING .and.&
  99. !Get_TongNotification() .and.&
  100. Get_Swing() == SWING_WELL_END .and.&
  101. Get_Tong() == TONG_BREAKOUT_END) then
  102. call Set_Tong(TONG_NEUTRAL)
  103. call Set_KellyConnection(KELLY_CONNECTION_SINGLE)
  104. call Set_StringUpdate(STRING_UPDATE_REMOVE_SINGLE)
  105. return
  106. end if
  107. endif
  108. end subroutine
  109. ! subroutine Subscribe_KellyConnection()
  110. ! use CDrillingConsoleVariables
  111. ! implicit none
  112. ! call OnBreakoutLeverPress%Add(ButtonPress_Breakout)
  113. ! call OnMakeupLeverPress%Add(ButtonPress_Makeup)
  114. ! end subroutine
  115. subroutine ButtonPress_Breakout()
  116. implicit none
  117. #ifdef deb
  118. print*, 'ButtonPress_Breakout on ======> CKellyConnectionEnum'
  119. #endif
  120. end subroutine
  121. subroutine ButtonPress_Makeup()
  122. implicit none
  123. #ifdef deb
  124. print*, 'ButtonPress_Makeup on ======> CKellyConnectionEnum'
  125. #endif
  126. end subroutine
  127. end module CKellyConnectionEnum