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.

CTdsElevatorModesEnum.i90 11 KiB

1 year ago
1 year ago
1 year ago
1 year ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319
  1. # 1 "/home/admin/SimulationCore2/CSharp/OperationScenarios/Enums/CTdsElevatorModesEnum.f90"
  2. module CTdsElevatorModesEnum
  3. use OperationScenariosModule
  4. use UnityModule
  5. implicit none
  6. contains
  7. subroutine Evaluate_TdsElevatorModes()
  8. use CCommon, only: SetStandRack
  9. implicit none
  10. if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then
  11. if(print_log) print*, 'Evaluate_TdsElevatorModes=TopDrive'
  12. !TOPDRIVE-CODE=7
  13. if (Get_Elevator() == ELEVATOR_LATCH_STRING_END .and.&
  14. Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_NOTHING .and.&
  15. Get_TdsSwing() == TDS_SWING_OFF_END ) then
  16. call Set_TdsElevatorModes(TDS_ELEVATOR_LATCH_STRING)
  17. call Set_Elevator(ELEVATOR_NEUTRAL)
  18. return
  19. end if
  20. !TOPDRIVE-CODE=8
  21. if (Get_HookHeight() <= (TL() + TJH() - data%State%OperationScenario%ECG) .and.&
  22. Get_ElevatorPickup() == .false. .and.&
  23. Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_STRING) then
  24. call Set_TdsElevatorModes(TDS_ELEVATOR_LATCH_STRING)
  25. return
  26. end if
  27. !TOPDRIVE-CODE=9
  28. if (Get_ElevatorPickup() .and.&
  29. Get_TdsElevatorModes() == TDS_ELEVATOR_LATCH_STRING) then
  30. call Set_TdsElevatorModes(TDS_ELEVATOR_CONNECTION_STRING)
  31. return
  32. end if
  33. !TOPDRIVE-CODE=10
  34. if (Get_Elevator() == ELEVATOR_UNLATCH_STRING_END .and.&
  35. Get_TdsElevatorModes() == TDS_ELEVATOR_LATCH_STRING) then
  36. call Set_TdsElevatorModes(TDS_ELEVATOR_CONNECTION_NOTHING)
  37. call Set_Elevator(ELEVATOR_NEUTRAL)
  38. return
  39. end if
  40. !TOPDRIVE-CODE=11
  41. if (Get_Elevator() == ELEVATOR_UNLATCH_STRING_END .and.&
  42. Get_TdsElevatorModes() == TDS_ELEVATOR_LATCH_STRING .and.&
  43. Get_TdsConnectionModes() == TDS_CONNECTION_STRING) then
  44. call Set_TdsElevatorModes(TDS_ELEVATOR_CONNECTION_NOTHING)
  45. call Set_Elevator(ELEVATOR_NEUTRAL)
  46. return
  47. end if
  48. !TOPDRIVE-CODE=12
  49. if (Get_Elevator() == ELEVATOR_LATCH_STAND_END .and.&
  50. Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_NOTHING) then
  51. call Set_TdsElevatorModes(TDS_ELEVATOR_CONNECTION_STAND)
  52. call Set_Elevator(ELEVATOR_NEUTRAL)
  53. call SetStandRack(Get_StandRack() - 1)
  54. return
  55. end if
  56. !TOPDRIVE-CODE=13
  57. if (Get_Elevator() == ELEVATOR_UNLATCH_STAND_END .and.&
  58. Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_STAND) then
  59. call Set_TdsElevatorModes(TDS_ELEVATOR_CONNECTION_NOTHING)
  60. call Set_Elevator(ELEVATOR_NEUTRAL)
  61. call SetStandRack(Get_StandRack() + 1)
  62. return
  63. end if
  64. !TOPDRIVE-CODE=14
  65. if (Get_Elevator() == ELEVATOR_LATCH_SINGLE_END .and.&
  66. Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_NOTHING .and.&
  67. Get_TdsSwing() == TDS_SWING_TILT_END .and.&
  68. Get_FillMouseHoleLed()) then
  69. call Set_TdsElevatorModes(TDS_ELEVATOR_CONNECTION_SINGLE)
  70. call Set_Elevator(ELEVATOR_NEUTRAL)
  71. call Set_UnlatchLed(.true.)
  72. call Set_FillMouseHoleLed(.false.)
  73. call Set_MouseHole(MOUSE_HOLE_NEUTRAL)
  74. return
  75. end if
  76. !TOPDRIVE-CODE=15
  77. if (Get_Elevator() == ELEVATOR_UNLATCH_SINGLE_END .and.&
  78. Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_SINGLE .and.&
  79. Get_TdsSwing() == TDS_SWING_TILT_END .and.&
  80. Get_FillMouseHoleLed() == .false.) then
  81. call Set_TdsElevatorModes(TDS_ELEVATOR_CONNECTION_NOTHING)
  82. call Set_Elevator(ELEVATOR_NEUTRAL)
  83. call Set_UnlatchLed(.false.)
  84. call Set_FillMouseHoleLed(.true.)
  85. call Set_MouseHole(MOUSE_HOLE_NEUTRAL)
  86. return
  87. end if
  88. !TOPDRIVE-CODE=16
  89. if (Get_HookHeight() <= (TL() + NFC() + data%State%OperationScenario%PL - data%State%OperationScenario%ECG) .and.&
  90. Get_Tong() == TONG_BREAKOUT_END .and.&
  91. Get_TdsElevatorModes() == TDS_ELEVATOR_LATCH_STRING .and.&
  92. Get_TdsConnectionModes() == TDS_CONNECTION_NOTHING) then
  93. call Set_TdsElevatorModes(TDS_ELEVATOR_LATCH_SINGLE)
  94. call Set_Tong(TONG_NEUTRAL)
  95. call Set_StringUpdate(STRING_UPDATE_REMOVE_SINGLE)
  96. return
  97. end if
  98. !TOPDRIVE-CODE=17
  99. if (Get_HookHeight() <= (TL() + NFC() + data%State%OperationScenario%PL - data%State%OperationScenario%ECG) .and.&
  100. Get_Tong() == TONG_BREAKOUT_END .and.&
  101. Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_STRING .and.&
  102. Get_TdsConnectionModes() == TDS_CONNECTION_NOTHING) then
  103. call Set_TdsElevatorModes(TDS_ELEVATOR_CONNECTION_SINGLE)
  104. call Set_Tong(TONG_NEUTRAL)
  105. call Set_StringUpdate(STRING_UPDATE_REMOVE_SINGLE)
  106. return
  107. end if
  108. !TOPDRIVE-CODE=18
  109. if (Get_ElevatorPickup() .and.&
  110. Get_TdsElevatorModes() == TDS_ELEVATOR_LATCH_SINGLE) then
  111. call Set_TdsElevatorModes(TDS_ELEVATOR_CONNECTION_SINGLE)
  112. return
  113. end if
  114. !TOPDRIVE-CODE=19
  115. if (Get_HookHeight() <= (TL() + NFC() + data%State%OperationScenario%PL - data%State%OperationScenario%ECG) .and.&
  116. Get_ElevatorPickup() == .false. .and.&
  117. Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_SINGLE) then
  118. call Set_TdsElevatorModes(TDS_ELEVATOR_LATCH_SINGLE)
  119. return
  120. end if
  121. !TOPDRIVE-CODE=20
  122. if (Get_Tong() == TONG_MAKEUP_END .and.&
  123. Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_SINGLE) then
  124. call Set_TdsElevatorModes(TDS_ELEVATOR_CONNECTION_STRING)
  125. call Set_Tong(TONG_NEUTRAL)
  126. call Set_StringUpdate(STRING_UPDATE_ADD_SINGLE)
  127. return
  128. end if
  129. !TOPDRIVE-CODE=21
  130. if (Get_Tong() == TONG_MAKEUP_END .and.&
  131. Get_TdsElevatorModes() == TDS_ELEVATOR_LATCH_SINGLE) then
  132. call Set_TdsElevatorModes(TDS_ELEVATOR_LATCH_STRING)
  133. call Set_Tong(TONG_NEUTRAL)
  134. call Set_StringUpdate(STRING_UPDATE_ADD_SINGLE)
  135. return
  136. end if
  137. !TOPDRIVE-CODE=22
  138. if (Get_HookHeight() <= (TL() + NFC() + data%State%OperationScenario%SL - data%State%OperationScenario%ECG) .and.&
  139. Get_Tong() == TONG_BREAKOUT_END .and.&
  140. Get_TdsElevatorModes() == TDS_ELEVATOR_LATCH_STRING .and.&
  141. Get_TdsConnectionModes() == TDS_CONNECTION_NOTHING) then
  142. call Set_TdsElevatorModes(TDS_ELEVATOR_LATCH_STAND)
  143. call Set_Tong(TONG_NEUTRAL)
  144. call Set_StringUpdate(STRING_UPDATE_REMOVE_STAND)
  145. return
  146. end if
  147. !TOPDRIVE-CODE=23
  148. if (Get_HookHeight() <= (TL() + NFC() + data%State%OperationScenario%SL - data%State%OperationScenario%ECG) .and.&
  149. Get_Tong() == TONG_BREAKOUT_END .and.&
  150. Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_STRING .and.&
  151. Get_TdsConnectionModes() == TDS_CONNECTION_NOTHING) then
  152. call Set_TdsElevatorModes(TDS_ELEVATOR_CONNECTION_STAND)
  153. call Set_Tong(TONG_NEUTRAL)
  154. call Set_StringUpdate(STRING_UPDATE_REMOVE_STAND)
  155. return
  156. end if
  157. !TOPDRIVE-CODE=24
  158. if (Get_ElevatorPickup() .and.&
  159. Get_TdsElevatorModes() == TDS_ELEVATOR_LATCH_STAND) then
  160. call Set_TdsElevatorModes(TDS_ELEVATOR_CONNECTION_STAND)
  161. return
  162. end if
  163. !TOPDRIVE-CODE=25
  164. if (Get_HookHeight() <= (TL() + NFC() + data%State%OperationScenario%SL - data%State%OperationScenario%ECG) .and.&
  165. Get_ElevatorPickup() == .false. .and.&
  166. Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_STAND) then
  167. call Set_TdsElevatorModes(TDS_ELEVATOR_LATCH_STAND)
  168. return
  169. end if
  170. !TOPDRIVE-CODE=26
  171. if (Get_Tong() == TONG_MAKEUP_END .and.&
  172. Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_STAND) then
  173. call Set_TdsElevatorModes(TDS_ELEVATOR_CONNECTION_STRING)
  174. call Set_Tong(TONG_NEUTRAL)
  175. call Set_StringUpdate(STRING_UPDATE_ADD_STAND)
  176. return
  177. end if
  178. !TOPDRIVE-CODE=27
  179. if (Get_Tong() == TONG_MAKEUP_END .and.&
  180. Get_TdsElevatorModes() == TDS_ELEVATOR_LATCH_STAND) then
  181. call Set_TdsElevatorModes(TDS_ELEVATOR_LATCH_STRING)
  182. call Set_Tong(TONG_NEUTRAL)
  183. call Set_StringUpdate(STRING_UPDATE_ADD_STAND)
  184. return
  185. end if
  186. endif
  187. ! if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then
  188. ! if(print_log) print*, 'Evaluate_TdsElevatorModes=Kelly'
  189. ! endif
  190. end subroutine
  191. subroutine Subscribe_TdsElevatorModes()
  192. use CDrillingConsoleVariables
  193. use SimulationVariables
  194. use SimulationVariables
  195. implicit none
  196. end subroutine
  197. end module CTdsElevatorModesEnum