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.
 
 
 
 
 
 

233 lines
7.0 KiB

  1. module CSwingEnum
  2. use COperationScenariosVariables
  3. implicit none
  4. contains
  5. subroutine Evaluate_Swing()
  6. implicit none
  7. ! if (DriveType == TopDrive_DriveType) then
  8. !#ifdef OST
  9. ! print*, 'Evaluate_Swing=TopDrive'
  10. !#endif
  11. ! endif
  12. !
  13. !
  14. !
  15. !
  16. !
  17. !
  18. !
  19. !
  20. !
  21. ! if (DriveType == Kelly_DriveType) then
  22. !#ifdef OST
  23. ! print*, 'Evaluate_Swing=Kelly'
  24. !#endif
  25. ! endif
  26. end subroutine
  27. ! subroutine Subscribe_Swing()
  28. ! use CDrillingConsoleVariables
  29. ! implicit none
  30. ! call OnSwingPress%Add(ButtonPress_Swing)
  31. ! end subroutine
  32. subroutine ButtonPress_Swing()
  33. implicit none
  34. if (Hoisting%DriveType == TopDrive_DriveType) then
  35. #ifdef OST
  36. print*, 'ButtonPress_Swing=TopDrive'
  37. #endif
  38. endif
  39. if (Hoisting%DriveType == Kelly_DriveType) then
  40. #ifdef OST
  41. print*, 'ButtonPress_Swing=Kelly'
  42. #endif
  43. !!OPERATION-CODE=84
  44. !if (Get_OperationCondition() == OPERATION_DRILL .and.&
  45. ! Get_HookHeight() >= (HKL + Get_NearFloorConnection() + RE) .and.&
  46. ! Get_Swing() == SWING_RAT_HOLE_END) then
  47. ! call Set_Swing(SWING_WELL_BEGIN)
  48. ! return
  49. !endif
  50. !OPERATION-CODE=26
  51. if (Get_OperationCondition() == OPERATION_DRILL .and.&
  52. Get_HookHeight() >= (HKL + Get_NearFloorConnection() + PL) .and.&
  53. Get_KellyConnection() == KELLY_CONNECTION_SINGLE .and.&
  54. Get_Swing() == SWING_WELL_END .and.&
  55. Get_SwingLed() .and.&
  56. Get_FillMouseHoleLed() == .false.) then
  57. call Set_Swing(SWING_MOUSE_HOLE_BEGIN)
  58. return
  59. endif
  60. !OPERATION-CODE=27
  61. if (Get_OperationCondition() == OPERATION_DRILL .and.&
  62. Get_HookHeight() >= (HKL + Get_NearFloorConnection() + PL) .and.&
  63. Get_KellyConnection() == KELLY_CONNECTION_SINGLE .and.&
  64. Get_Swing() == SWING_MOUSE_HOLE_END .and.&
  65. Get_SwingLed()) then
  66. call Set_Swing(SWING_WELL_BEGIN)
  67. return
  68. endif
  69. !OPERATION-CODE=28
  70. if (Get_OperationCondition() == OPERATION_DRILL .and.&
  71. Get_HookHeight() >= (HKL + Get_NearFloorConnection()) .and.&
  72. Get_KellyConnection() == KELLY_CONNECTION_NOTHING .and.&
  73. Get_Swing() == SWING_WELL_END .and.&
  74. Get_SwingLed()) then
  75. call Set_Swing(SWING_MOUSE_HOLE_BEGIN)
  76. return
  77. endif
  78. !OPERATION-CODE=29
  79. if (Get_OperationCondition() == OPERATION_DRILL .and.&
  80. Get_HookHeight() >= (HKL + SG) .and.&
  81. Get_KellyConnection() == KELLY_CONNECTION_NOTHING .and.&
  82. Get_Swing() == SWING_MOUSE_HOLE_END .and.&
  83. Get_SwingLed()) then
  84. call Set_Swing(SWING_RAT_HOLE_BEGIN)
  85. return
  86. endif
  87. !OPERATION-CODE=30
  88. if (Get_OperationCondition() == OPERATION_DRILL .and.&
  89. Get_HookHeight() >= (HKL + Get_NearFloorConnection()) .and.&
  90. Get_Swing() == SWING_RAT_HOLE_END .and.&
  91. Get_SwingLed()) then
  92. call Set_Swing(SWING_WELL_BEGIN)
  93. return
  94. endif
  95. !OPERATION-CODE=31
  96. if (Get_OperationCondition() == OPERATION_TRIP .and.&
  97. Get_HookHeight() >= (HL + Get_NearFloorConnection()) .and.&
  98. Get_ElevatorConnection() == ELEVATOR_CONNECTION_NOTHING .and.&
  99. Get_Swing() == SWING_WELL_END .and.&
  100. Get_SwingLed()) then
  101. call Set_Swing(SWING_MOUSE_HOLE_BEGIN)
  102. return
  103. endif
  104. !OPERATION-CODE=32
  105. if (Get_OperationCondition() == OPERATION_TRIP .and.&
  106. Get_HookHeight() >= 27.41 .and.&
  107. Get_ElevatorConnection() == ELEVATOR_CONNECTION_NOTHING .and.&
  108. !Get_Swing() == SWING_WELL_END .and.&
  109. Get_Swing() == SWING_MOUSE_HOLE_END .and.&
  110. Get_SwingLed()) then
  111. call Set_Swing(SWING_RAT_HOLE_BEGIN)
  112. return
  113. endif
  114. !OPERATION-CODE=33
  115. if (Get_OperationCondition() == OPERATION_TRIP .and.&
  116. (Get_HookHeight() >= (HL + Get_NearFloorConnection()) .and. Get_HookHeight() <= 27.41) .and.&
  117. Get_ElevatorConnection() == ELEVATOR_CONNECTION_NOTHING .and.&
  118. Get_Swing() == SWING_MOUSE_HOLE_END .and.&!Get_Swing() == SWING_MOUSE_HOLE_END .and.&!Get_Swing() /= SWING_WELL_END
  119. Get_SwingLed()) then
  120. call Set_Swing(SWING_WELL_BEGIN)
  121. return
  122. endif
  123. !OPERATION-CODE=34
  124. if (Get_OperationCondition() == OPERATION_TRIP .and.&
  125. Get_HookHeight() >= (HL + Get_NearFloorConnection() + PL - ECG) .and.&
  126. Get_ElevatorConnection() == ELEVATOR_CONNECTION_SINGLE .and.&
  127. Get_Swing() == SWING_WELL_END .and.&
  128. Get_SwingLed()) then
  129. call Set_Swing(SWING_MOUSE_HOLE_BEGIN)
  130. return
  131. endif
  132. !OPERATION-CODE=35
  133. if (Get_OperationCondition() == OPERATION_TRIP .and.&
  134. Get_HookHeight() >= (HL + Get_NearFloorConnection() + PL - ECG + RE) .and.&
  135. Get_ElevatorConnection() == ELEVATOR_CONNECTION_SINGLE .and.&
  136. Get_Swing() == SWING_MOUSE_HOLE_END .and.&
  137. Get_SwingLed()) then
  138. call Set_Swing(SWING_WELL_BEGIN)
  139. return
  140. endif
  141. !OPERATION-CODE=80
  142. if (Get_OperationCondition() == OPERATION_TRIP .and.&
  143. Get_HookHeight() >= 27.41 .and. Get_HookHeight() <= (27.41 + 10) .and.&
  144. Get_ElevatorConnection() == ELEVATOR_CONNECTION_NOTHING .and.&
  145. Get_Swing() == SWING_RAT_HOLE_END .and.&
  146. Get_SwingLed()) then
  147. call Set_Swing(SWING_WELL_BEGIN)
  148. return
  149. end if
  150. endif
  151. end subroutine
  152. end module CSwingEnum