Simulation Core
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 
 
 
 
 

235 líneas
7.9 KiB

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