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.

CElevatorConnectionEnum.f90 23 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619
  1. module CElevatorConnectionEnum
  2. use COperationScenariosVariables
  3. use CLog3
  4. use CLog4
  5. implicit none
  6. contains
  7. subroutine Evaluate_ElevatorConnection()
  8. use CHoistingVariables
  9. use CCommon, only: SetStandRack
  10. implicit none
  11. if (Hoisting%DriveType == TopDrive_DriveType) then
  12. #ifdef OST
  13. print*, 'Evaluate_ElevatorConnection=TopDrive'
  14. #endif
  15. endif
  16. if (Hoisting%DriveType == Kelly_DriveType) then
  17. #ifdef OST
  18. print*, 'ElevatorConnection=Kelly'
  19. #endif
  20. !!OPERATION-CODE=83
  21. !if (Get_OperationCondition() == OPERATION_TRIP .and.&
  22. ! Get_ElevatorConnection() == ELEVATOR_LATCH_STRING .and.&
  23. ! Get_ElevatorPickup() .and.&
  24. ! Get_Slips() == SLIPS_SET_END) then
  25. ! !call Log_4('OPERATION-CODE=83')
  26. ! call Set_ElevatorConnection(ELEVATOR_CONNECTION_STRING)
  27. ! return
  28. !end if
  29. !OPERATION-CODE=78
  30. if (Get_ElevatorPickup() == .false. .and.&
  31. Get_Tong() == TONG_BREAKOUT_END .and.&
  32. Get_HookHeight() <= (OperationScenario%HL + Get_NearFloorConnection() + OperationScenario%PL) .and.&
  33. Get_ElevatorConnection() == ELEVATOR_LATCH_STRING) then
  34. call Set_ElevatorConnection(ELEVATOR_LATCH_SINGLE)
  35. return
  36. end if
  37. !OPERATION-CODE=79
  38. if (Get_ElevatorPickup() == .false. .and.&
  39. Get_Tong() == TONG_BREAKOUT_END .and.&
  40. Get_HookHeight() >= (OperationScenario%HL + Get_NearFloorConnection() + OperationScenario%SL - OperationScenario%LG) .and.&
  41. Get_ElevatorConnection() == ELEVATOR_LATCH_STRING) then
  42. call Set_ElevatorConnection(ELEVATOR_LATCH_STAND)
  43. return
  44. end if
  45. !OPERATION-CODE=83
  46. if (Get_ElevatorPickup().and.&
  47. Get_ElevatorConnection() == ELEVATOR_LATCH_SINGLE) then
  48. call Set_ElevatorConnection(ELEVATOR_CONNECTION_SINGLE)
  49. return
  50. end if
  51. !OPERATION-CODE=84
  52. if (Get_ElevatorPickup().and.&
  53. Get_ElevatorConnection() == ELEVATOR_LATCH_STAND) then
  54. call Set_ElevatorConnection(ELEVATOR_CONNECTION_STAND)
  55. return
  56. end if
  57. !OPERATION-CODE=7
  58. if (Get_OperationCondition() == OPERATION_TRIP .and.&
  59. !GetRotaryRpm() == 0.0d0 .and.&
  60. !Get_StandRack() > 0 .and.&
  61. Get_ElevatorConnection() == ELEVATOR_CONNECTION_NOTHING .and.&
  62. !Get_Swing() == SWING_WELL_END .and.&
  63. !Get_Slips() == SLIPS_SET_END .and.&
  64. !Get_LatchLed() .and.
  65. Get_Elevator() == ELEVATOR_LATCH_STAND_END) then
  66. !call Log_4('OPERATION-CODE=7')
  67. call Set_ElevatorConnection(ELEVATOR_CONNECTION_STAND)
  68. !call Set_UnlatchLed(.true.)
  69. !call Set_LatchLed(.false.)
  70. call SetStandRack(Get_StandRack() - 1)
  71. call Set_Elevator(ELEVATOR_NEUTRAL)
  72. return
  73. end if
  74. !OPERATION-CODE=8
  75. if (Get_OperationCondition() == OPERATION_TRIP .and.&
  76. !Get_HookHeight() >= (HL + Get_NearFloorConnection() + SL - RE) .and. Get_HookHeight() <= (HL + Get_NearFloorConnection() + SL + LG) .and.&
  77. !GetRotaryRpm() == 0.0d0 .and.&
  78. !Get_StandRack() < 80 .and.&
  79. !Get_ElevatorConnectionPossible() .and.&
  80. Get_ElevatorConnection() == ELEVATOR_CONNECTION_STAND .and.&
  81. !Get_Swing() == SWING_WELL_END .and.&
  82. !Get_Slips() == SLIPS_SET_END .and.&
  83. !Get_UnlatchLed() .and.&
  84. Get_Elevator() == ELEVATOR_UNLATCH_STAND_END) then
  85. call Set_ElevatorConnection(ELEVATOR_CONNECTION_NOTHING)
  86. !call Set_UnlatchLed(.false.)
  87. !call Set_LatchLed(.true.)
  88. call SetStandRack(Get_StandRack() + 1)
  89. call Set_Elevator(ELEVATOR_NEUTRAL)
  90. !call Set_Elevator(ELEVATOR_UNLATCH_STAND_BEGIN)
  91. call Log_3('OPERATION-CODE=8')
  92. return
  93. end if
  94. !OPERATION-CODE=9
  95. if (Get_OperationCondition() == OPERATION_TRIP .and.&
  96. !Get_HookHeight() >= 18.0 .and. Get_HookHeight() <= 22.0 .and.&
  97. Get_ElevatorConnection() == ELEVATOR_CONNECTION_NOTHING .and.&
  98. !Get_Swing() == SWING_WELL_END .and.&
  99. !Get_Slips() == SLIPS_SET_END .and.&
  100. !Get_LatchLed() .and.&
  101. !Get_ElevatorPickup() .and.&
  102. Get_Elevator() == ELEVATOR_LATCH_STRING_END) then
  103. !call Log_4('OPERATION-CODE=9')
  104. call Set_ElevatorConnection(ELEVATOR_LATCH_STRING)
  105. call Set_Elevator(ELEVATOR_NEUTRAL)
  106. !call Set_UnlatchLed(.true.)
  107. !call Set_LatchLed(.false.)
  108. !call Set_UnlatchLed(.false.)
  109. !call Set_Elevator(ELEVATOR_LATCH_STRING_BEGIN)
  110. return
  111. end if
  112. !OPERATION-CODE=60
  113. if (Get_OperationCondition() == OPERATION_TRIP .and.&
  114. !Get_HookHeight() <= (HL + Get_NearFloorConnection() - ECG) .and.&
  115. Get_ElevatorPickup() == .false. .and.&
  116. Get_Slips() == SLIPS_SET_END .and.&
  117. !Get_Tong() /= TONG_MAKEUP_END .and.&
  118. Get_ElevatorConnection() == ELEVATOR_CONNECTION_STRING) then
  119. call Set_ElevatorConnection(ELEVATOR_LATCH_STRING)
  120. !call Set_Elevator(ELEVATOR_NEUTRAL)
  121. return
  122. end if
  123. !OPERATION-CODE=49
  124. if (Get_OperationCondition() == OPERATION_TRIP .and.&
  125. Get_ElevatorPickup() .and.&
  126. Get_ElevatorConnection() == ELEVATOR_LATCH_STRING) then
  127. call Set_ElevatorConnection(ELEVATOR_CONNECTION_STRING)
  128. return
  129. end if
  130. !OPERATION-CODE=10
  131. if (Get_OperationCondition() == OPERATION_TRIP .and.&
  132. !GetRotaryRpm() == 0.0d0 .and.&
  133. (Get_ElevatorConnection() == ELEVATOR_CONNECTION_STRING .or. Get_ElevatorConnection() == ELEVATOR_LATCH_STRING) .and.&
  134. !Get_Swing() == SWING_WELL_END .and.&
  135. !Get_Slips() == SLIPS_SET_END .and.&
  136. !Get_UnlatchLed() .and.&
  137. Get_Elevator() == ELEVATOR_UNLATCH_STRING_END) then
  138. !call Log_4('OPERATION-CODE=10')
  139. call Set_ElevatorConnection(ELEVATOR_CONNECTION_NOTHING)
  140. call Set_Elevator(ELEVATOR_NEUTRAL)
  141. !call Set_UnlatchLed(.false.)
  142. !call Set_LatchLed(.true.)
  143. !call Set_Elevator(ELEVATOR_UNLATCH_STRING_BEGIN)
  144. return
  145. end if
  146. !OPERATION-CODE=11
  147. if (Get_OperationCondition() == OPERATION_TRIP .and.&
  148. !Get_ElevatorConnectionPossible() .and.&
  149. Get_ElevatorPickup().and.&
  150. Get_ElevatorConnection() == ELEVATOR_CONNECTION_NOTHING .and.&
  151. !Get_Swing() == SWING_MOUSE_HOLE_END .and.&
  152. !Get_LatchLed() .and.&
  153. !Get_FillMouseHoleLed() .and.&
  154. Get_Elevator() == ELEVATOR_LATCH_SINGLE_END) then
  155. call Set_ElevatorConnection(ELEVATOR_CONNECTION_SINGLE)
  156. !call Set_UnlatchLed(.true.)
  157. call Set_FillMouseHoleLed(.false.)
  158. call Set_MouseHole(MOUSE_HOLE_NEUTRAL)
  159. call Set_Elevator(ELEVATOR_NEUTRAL)
  160. !call Set_Elevator(ELEVATOR_LATCH_SINGLE_BEGIN)
  161. return
  162. end if
  163. !OPERATION-CODE=12
  164. if (Get_OperationCondition() == OPERATION_TRIP .and.&
  165. Get_ElevatorConnection() == ELEVATOR_CONNECTION_SINGLE .and.&
  166. !Get_Swing() == SWING_MOUSE_HOLE_END .and.&
  167. !Get_UnlatchLed() .and.&
  168. !Get_FillMouseHoleLed() == .false. .and.&
  169. Get_Elevator() == ELEVATOR_UNLATCH_SINGLE_END) then
  170. !call Log_4('OPERATION-CODE=12')
  171. call Set_ElevatorConnection(ELEVATOR_CONNECTION_NOTHING)
  172. !call Set_UnlatchLed(.false.)
  173. !call Set_LatchLed(.true.)
  174. call Set_FillMouseHoleLed(.true.)
  175. call Set_MouseHole(MOUSE_HOLE_NEUTRAL)
  176. call Set_Elevator(ELEVATOR_NEUTRAL)
  177. !call Set_Elevator(ELEVATOR_UNLATCH_SINGLE_BEGIN)
  178. return
  179. end if
  180. !OPERATION-CODE=13
  181. if (Get_OperationCondition() == OPERATION_TRIP .and.&
  182. Get_HookHeight() <= (OperationScenario%HL + Get_NearFloorConnection() + OperationScenario%PL) .and.&
  183. Get_ElevatorConnection() == ELEVATOR_CONNECTION_STRING .and.&
  184. !Get_Swing() == SWING_WELL_END .and.&
  185. !Get_TongNotification() .and.&
  186. Get_ElevatorPickup().and.&
  187. Get_Tong() == TONG_BREAKOUT_END) then
  188. !call Log_4('OPERATION-CODE=13')
  189. call Set_ElevatorConnection(ELEVATOR_CONNECTION_SINGLE)
  190. call Set_StringUpdate(STRING_UPDATE_REMOVE_SINGLE)
  191. !call Set_StringUpdate(STRING_UPDATE_ADD_SINGLE)
  192. call Set_Tong(TONG_NEUTRAL)
  193. return
  194. end if
  195. !OPERATION-CODE=14
  196. if (Get_OperationCondition() == OPERATION_TRIP .and.&
  197. Get_HookHeight() <= (OperationScenario%HL + Get_NearFloorConnection() + OperationScenario%PL) .and.&
  198. Get_ElevatorConnection() == ELEVATOR_CONNECTION_SINGLE .and.&
  199. !Get_Swing() == SWING_WELL_END .and.&
  200. !Get_TongNotification() .and.&
  201. Get_ElevatorPickup().and.&
  202. Get_Tong() == TONG_MAKEUP_END) then
  203. !call Log_4('OPERATION-CODE=14')
  204. call Set_Tong(TONG_NEUTRAL)
  205. call Set_ElevatorConnection(ELEVATOR_CONNECTION_STRING)
  206. call Set_StringUpdate(STRING_UPDATE_ADD_SINGLE)
  207. return
  208. end if
  209. !OPERATION-CODE=15
  210. if (Get_OperationCondition() == OPERATION_TRIP .and.&
  211. Get_HookHeight() >= (OperationScenario%HL + Get_NearFloorConnection() + OperationScenario%SL - OperationScenario%LG) .and.&
  212. !Get_HookHeight() >= (HL + Get_NearFloorConnection() + SL - RE) .and. Get_HookHeight() <= (HL + Get_NearFloorConnection() + SL + LG) .and.&
  213. Get_ElevatorConnection() == ELEVATOR_CONNECTION_STRING .and.&
  214. !Get_Swing() == SWING_WELL_END .and.&
  215. !Get_TongNotification() .and.&
  216. Get_ElevatorPickup().and.&
  217. Get_Tong() == TONG_BREAKOUT_END) then
  218. call Set_Tong(TONG_NEUTRAL)
  219. call Set_ElevatorConnection(ELEVATOR_CONNECTION_STAND)
  220. call Set_StringUpdate(STRING_UPDATE_REMOVE_STAND)
  221. return
  222. end if
  223. !OPERATION-CODE=16
  224. if (Get_OperationCondition() == OPERATION_TRIP .and.&
  225. !Get_HookHeight() >= (HL + Get_NearFloorConnection() + SL - RE) .and. Get_HookHeight() <= (HL + Get_NearFloorConnection() + SL + LG) .and.&
  226. !Get_JointConnectionPossible() .and.&
  227. Get_ElevatorConnection() == ELEVATOR_CONNECTION_STAND .and.&
  228. !Get_Swing() == SWING_WELL_END .and.&
  229. !Get_TongNotification() .and.&
  230. Get_ElevatorPickup().and.&
  231. Get_Tong() == TONG_MAKEUP_END) then
  232. !call Log_4('OPERATION-CODE=16')
  233. call Set_Tong(TONG_NEUTRAL)
  234. call Set_ElevatorConnection(ELEVATOR_CONNECTION_STRING)
  235. call Set_StringUpdate(STRING_UPDATE_ADD_STAND)
  236. return
  237. end if
  238. !OPERATION-CODE=75
  239. if (Get_ElevatorPickup() == .false. .and.&
  240. Get_ElevatorConnection() == ELEVATOR_CONNECTION_SINGLE) then
  241. call Set_ElevatorConnection(ELEVATOR_LATCH_SINGLE)
  242. return
  243. end if
  244. !OPERATION-CODE=76
  245. if (Get_ElevatorPickup() == .false. .and.&
  246. Get_ElevatorConnection() == ELEVATOR_CONNECTION_STAND) then
  247. call Set_ElevatorConnection(ELEVATOR_LATCH_STAND)
  248. return
  249. end if
  250. endif
  251. end subroutine
  252. ! subroutine Subscribe_ElevatorConnection()
  253. ! use CDrillingConsoleVariables
  254. ! implicit none
  255. ! call OnLatchPipePress%Add(ButtonPress_Latch_ElevatorConnection)
  256. ! call OnUnlatchPipePress%Add(ButtonPress_Unlatch_ElevatorConnection)
  257. ! call OnBreakoutLeverPress%Add(ButtonPress_Breakout_ElevatorConnection)
  258. ! call OnMakeupLeverPress%Add(ButtonPress_Makeup_ElevatorConnection)
  259. ! end subroutine
  260. subroutine ButtonPress_Latch_ElevatorConnection()
  261. use CCommon, only: SetStandRack
  262. implicit none
  263. if (Hoisting%DriveType == TopDrive_DriveType) then
  264. #ifdef OST
  265. print*, 'ButtonPress_Latch_ElevatorConnection=TopDrive'
  266. #endif
  267. !TOPDRIVE-CODE=73
  268. if ((Get_HookHeight() >= (TL() + OperationScenario%SL - OperationScenario%ECG + NFC()) .and. Get_HookHeight() <= (TL() + OperationScenario%SL - OperationScenario%ECG + NFC() + OperationScenario%TG)) .and.&
  269. Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_NOTHING .and.&
  270. Get_TdsSwing() == TDS_SWING_OFF_END .and.&
  271. Get_LatchLed()) then
  272. call Set_Elevator(ELEVATOR_LATCH_STAND_BEGIN)
  273. call Set_LatchLed(.false.)
  274. return
  275. end if
  276. !TOPDRIVE-CODE=74
  277. if (Get_HookHeight() <= (TL() + NFC() - OperationScenario%ECG) .and.&
  278. GetRotaryRpm() == 0.0d0 .and.&
  279. Get_ElevatorConnectionPossible() .and.&
  280. Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_NOTHING .and.&
  281. Get_TdsSwing() == TDS_SWING_OFF_END .and.&
  282. Get_LatchLed()) then
  283. call Set_Elevator(ELEVATOR_LATCH_STRING_BEGIN)
  284. call Set_LatchLed(.false.)
  285. return
  286. end if
  287. !TOPDRIVE-CODE=75
  288. if (Get_ElevatorConnectionPossible() .and.&
  289. Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_NOTHING .and.&
  290. Get_TdsSwing() == TDS_SWING_TILT_END .and.&
  291. Get_LatchLed() .and.&
  292. Get_FillMouseHoleLed()) then
  293. call Set_Elevator(ELEVATOR_LATCH_SINGLE_BEGIN)
  294. call Set_LatchLed(.false.)
  295. return
  296. end if
  297. endif
  298. if (Hoisting%DriveType == Kelly_DriveType) then
  299. #ifdef OST
  300. print*, 'ButtonPress_Latch_ElevatorConnection=Kelly'
  301. #endif
  302. !OPERATION-CODE=86
  303. if (Get_OperationCondition() == OPERATION_TRIP .and.&
  304. Get_HookHeight() <= (OperationScenario%HL + Get_NearFloorConnection() - OperationScenario%ECG) .and.&
  305. Get_ElevatorConnection() == ELEVATOR_CONNECTION_NOTHING .and.&
  306. Get_LatchLed() .and.&
  307. GetRotaryRpm() == 0.0d0 .and.&
  308. Get_Swing() == SWING_WELL_END .and.&
  309. Get_ElevatorConnectionPossible() .and.&
  310. Get_HookHeight() <= (OperationScenario%HL + Get_NearFloorConnection())) then
  311. !call Log_4("OPERATION-CODE=ELEVATOR_LATCH_STRING_BEGIN")
  312. call Set_Elevator(ELEVATOR_LATCH_STRING_BEGIN)
  313. call Set_LatchLed(.false.)
  314. return
  315. endif
  316. !OPERATION-CODE=85
  317. if (Get_OperationCondition() == OPERATION_TRIP .and.&
  318. Get_HookHeight() >= (OperationScenario%HL + OperationScenario%SL - OperationScenario%ECG + Get_NearFloorConnection()) .and. Get_HookHeight() <= (OperationScenario%HL + OperationScenario%SL - OperationScenario%ECG + Get_NearFloorConnection() + OperationScenario%LG) .and.&
  319. Get_ElevatorConnection() == ELEVATOR_CONNECTION_NOTHING .and.&
  320. Get_LatchLed() .and.&
  321. Get_Swing() == SWING_WELL_END) then
  322. !Get_HookHeight() >= (HL + Get_NearFloorConnection() + SL + RE) .and. Get_HookHeight() <= (HL + Get_NearFloorConnection() + SL + LG)
  323. call Set_Elevator(ELEVATOR_LATCH_STAND_BEGIN)
  324. call Set_LatchLed(.false.)
  325. return
  326. endif
  327. !OPERATION-CODE=87
  328. if (Get_OperationCondition() == OPERATION_TRIP .and.&
  329. Get_ElevatorConnection() == ELEVATOR_CONNECTION_NOTHING .and.&
  330. Get_LatchLed() .and.&
  331. Get_FillMouseHoleLed() .and.&
  332. Get_ElevatorConnectionPossible() .and.&
  333. Get_Swing() == SWING_MOUSE_HOLE_END) then
  334. call Set_Elevator(ELEVATOR_LATCH_SINGLE_BEGIN)
  335. call Set_LatchLed(.false.)
  336. return
  337. endif
  338. endif
  339. end subroutine
  340. subroutine ButtonPress_Unlatch_ElevatorConnection()
  341. use CCommon, only: SetStandRack
  342. implicit none
  343. if (Hoisting%DriveType == TopDrive_DriveType) then
  344. #ifdef OST
  345. print*, 'ButtonPress_Unlatch_ElevatorConnection=TopDrive'
  346. #endif
  347. !TOPDRIVE-CODE=76
  348. if ((Get_HookHeight() >= (TL() + OperationScenario%SL - OperationScenario%ECG + NFC()) .and. Get_HookHeight() <= (TL() + OperationScenario%SL - OperationScenario%ECG + NFC() + OperationScenario%TG)) .and.&
  349. Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_STAND .and.&
  350. Get_TdsSwing() == TDS_SWING_OFF_END .and.&
  351. Get_UnlatchLed()) then
  352. call Set_Elevator(ELEVATOR_UNLATCH_STAND_BEGIN)
  353. call Set_UnlatchLed(.false.)
  354. return
  355. end if
  356. !TOPDRIVE-CODE=77
  357. if (Get_HookHeight() <= (TL() + NFC() - OperationScenario%ECG) .and.&
  358. GetRotaryRpm() == 0.0d0 .and.&
  359. Get_NearFloorConnection() >= 3.0 .and. Get_NearFloorConnection() <= 6.0 .and.&
  360. (Get_TdsElevatorModes() == TDS_ELEVATOR_LATCH_STRING .or. Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_STRING) .and.&
  361. Get_TdsSwing() == TDS_SWING_OFF_END .and.&
  362. Get_UnlatchLed()) then
  363. call Set_Elevator(ELEVATOR_UNLATCH_STRING_BEGIN)
  364. call Set_UnlatchLed(.false.)
  365. return
  366. end if
  367. !TOPDRIVE-CODE=78
  368. if ((Get_HookHeight() > TL() .and. Get_HookHeight() < (TL() + NFC() + OperationScenario%SG)) .and.&
  369. Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_SINGLE .and.&
  370. Get_TdsSwing() == TDS_SWING_TILT_END .and.&
  371. Get_UnlatchLed() .and.&
  372. Get_FillMouseHoleLed() == .false.) then
  373. call Set_Elevator(ELEVATOR_UNLATCH_SINGLE_BEGIN)
  374. call Set_UnlatchLed(.false.)
  375. return
  376. end if
  377. endif
  378. if (Hoisting%DriveType == Kelly_DriveType) then
  379. #ifdef OST
  380. print*, 'ButtonPress_Unlatch_ElevatorConnection=Kelly'
  381. #endif
  382. !OPERATION-CODE=89
  383. if (Get_OperationCondition() == OPERATION_TRIP .and.&
  384. Get_HookHeight() <= (OperationScenario%HL + Get_NearFloorConnection() - OperationScenario%ECG) .and.&
  385. (Get_ElevatorConnection() == ELEVATOR_CONNECTION_STRING .or. Get_ElevatorConnection() == ELEVATOR_LATCH_STRING) .and.&
  386. Get_HookHeight() <= (OperationScenario%HL + Get_NearFloorConnection()) .and.&
  387. Get_UnlatchLed() .and.&
  388. GetRotaryRpm() == 0.0d0 .and.&
  389. Get_Swing() == SWING_WELL_END .and.&
  390. Get_NearFloorConnection() >= 3.0 .and. Get_NearFloorConnection() <= 6.0) then
  391. !Get_HookHeight() >= (HL + Get_NearFloorConnection() - 4.0) .and. Get_HookHeight() <= (HL + Get_NearFloorConnection() - 2.0)) then
  392. call Set_Elevator(ELEVATOR_UNLATCH_STRING_BEGIN)
  393. call Set_UnlatchLed(.false.)
  394. return
  395. endif
  396. !OPERATION-CODE=88
  397. if (Get_OperationCondition() == OPERATION_TRIP .and.&
  398. Get_HookHeight() >= (OperationScenario%HL + OperationScenario%SL - OperationScenario%ECG + Get_NearFloorConnection()) .and. Get_HookHeight() <= (OperationScenario%HL + OperationScenario%SL - OperationScenario%ECG + Get_NearFloorConnection() + OperationScenario%LG) .and.&
  399. !Get_HookHeight() >= (HL + Get_NearFloorConnection() + SL + RE) .and. Get_HookHeight() <= (HL + Get_NearFloorConnection() + SL + LG)
  400. Get_ElevatorConnection() == ELEVATOR_CONNECTION_STAND .and.&
  401. Get_UnlatchLed() .and.&
  402. Get_Swing() == SWING_WELL_END) then
  403. call Set_Elevator(ELEVATOR_UNLATCH_STAND_BEGIN)
  404. call Set_UnlatchLed(.false.)
  405. return
  406. endif
  407. !OPERATION-CODE=90
  408. if (Get_OperationCondition() == OPERATION_TRIP .and.&
  409. Get_ElevatorConnection() == ELEVATOR_CONNECTION_SINGLE .and.&
  410. Get_UnlatchLed() .and.&
  411. Get_HookHeight() >= OperationScenario%HL .and. Get_HookHeight() <= (OperationScenario%HL + Get_NearFloorConnection() + OperationScenario%SG) .and.&
  412. !Get_JointConnectionPossible() .and.&
  413. Get_Swing() == SWING_MOUSE_HOLE_END) then
  414. call Set_Elevator(ELEVATOR_UNLATCH_SINGLE_BEGIN)
  415. call Set_UnlatchLed(.false.)
  416. return
  417. endif
  418. endif
  419. end subroutine
  420. subroutine ButtonPress_Breakout_ElevatorConnection()
  421. implicit none
  422. end subroutine
  423. subroutine ButtonPress_Makeup_ElevatorConnection()
  424. implicit none
  425. end subroutine
  426. end module CElevatorConnectionEnum