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.

COperationScenariosMain.f90 22 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
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
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722
  1. module COperationScenariosMain
  2. use CIActionReference
  3. implicit none
  4. public
  5. procedure (ActionVoid), pointer :: UpdateUnityPtr
  6. contains
  7. ! subroutine OperationScenarios_Setup()
  8. ! ! use CSimulationVariables
  9. ! implicit none
  10. ! call OnSimulationInitialization%Add(OperationScenarios_Init)
  11. ! call OnSimulationStop%Add(OperationScenarios_Init)
  12. ! !call OnOperationScenariosStep%Add(OperationScenarios_Step)
  13. ! !call OnOperationScenariosOutput%Add(OperationScenarios_Output)
  14. ! call OnOperationScenariosMain%Add(OperationScenariosMainBody)
  15. ! end subroutine
  16. ! subroutine OperationScenarios_Init
  17. ! use COperationScenariosSettings, OperationScenariosInitialization => Initialization
  18. ! implicit none
  19. ! call OperationScenariosInitialization()
  20. ! end subroutine OperationScenarios_Init
  21. subroutine OperationScenarios_Step
  22. ! use CSimulationVariables
  23. use CKellyConnectionEnum
  24. use CElevatorConnectionEnum
  25. use CCloseKellyCockLedNotification
  26. use CCloseSafetyValveLedNotification
  27. use CFillMouseHoleLedNotification
  28. use CIrIBopLedNotification
  29. use CIrSafetyValveLedNotification
  30. use CLatchLedNotification
  31. use COpenKellyCockLedNotification
  32. use COpenSafetyValveLedNotification
  33. use CSlipsNotification
  34. use CSwingLedNotification
  35. use CTongNotification
  36. use CUnlatchLedNotification
  37. use CInstallFillupHeadPermission
  38. use CInstallMudBucketPermission
  39. use CIrIbopPermission
  40. use CIrSafetyValvePermission
  41. use CRemoveFillupHeadPermission
  42. use CRemoveMudBucketPermission
  43. use SoftwareInputsVariables
  44. ! use CHookHeight
  45. ! use CIbopHeight
  46. ! use CNearFloorConnection
  47. ! use CSafetyValveHeight
  48. ! use CSlackOff
  49. ! use CStandRack
  50. ! use CStringPressure
  51. ! use CZeroStringSpeed
  52. use CUnityInputs, only: &
  53. Get_ElevatorConnectionPossible, &
  54. Get_JointConnectionPossible, &
  55. Get_ElevatorPickup, &
  56. Get_NearFloorPosition, &
  57. Get_SingleSetInMouseHole
  58. use CBucketEnum
  59. use CElevatorEnum
  60. use CHeadEnum
  61. use CIbopEnum
  62. use CKellyEnum
  63. use CMouseHoleEnum
  64. use COperationConditionEnum
  65. use CSafetyValveEnum
  66. use CSlipsEnum
  67. use CSwingEnum
  68. use CTongEnum
  69. ! use CStringUpdate
  70. use CFlowPipeDisconnectEnum
  71. use CFlowKellyDisconnectEnum
  72. use CFillupHeadPermission
  73. use CSwingDrillPermission
  74. use CSwingOffPermission
  75. use CSwingTiltPermission
  76. ! use CTdsStemJointHeight
  77. use CTdsConnectionModesEnum
  78. use CTdsElevatorModesEnum
  79. use CTdsSpineEnum
  80. use CTdsSwingEnum
  81. use CTdsTongEnum
  82. use CTdsBackupClamp
  83. use CTdsIbopLedNotification
  84. use CTdsPowerLedNotification
  85. use CTdsTorqueWrenchLedNotification
  86. implicit none
  87. call Evaluate_KellyConnection()
  88. call Evaluate_ElevatorConnection()
  89. call Evaluate_CloseKellyCockLed()
  90. call Evaluate_CloseSafetyValveLed()
  91. call Evaluate_FillMouseHoleLed()
  92. call Evaluate_IrIBopLed()
  93. call Evaluate_IrSafetyValveLed()
  94. call Evaluate_LatchLed()
  95. call Evaluate_OpenKellyCockLed()
  96. call Evaluate_OpenSafetyValveLed()
  97. call Evaluate_SlipsNotification()
  98. call Evaluate_SwingLed()
  99. call Evaluate_TongNotification()
  100. call Evaluate_UnlatchLed()
  101. call Evaluate_InstallFillupHeadPermission()
  102. call Evaluate_InstallMudBucketPermission()
  103. call Evaluate_IrIbopPermission()
  104. call Evaluate_IrSafetyValvePermission()
  105. call Evaluate_RemoveFillupHeadPermission()
  106. call Evaluate_RemoveMudBucketPermission()
  107. call Evaluate_MudBucket()
  108. call Evaluate_Elevator()
  109. call Evaluate_FillupHead()
  110. call Evaluate_Ibop()
  111. call Evaluate_Kelly()
  112. call Evaluate_MouseHole()
  113. call Evaluate_MouseHole()
  114. call Evaluate_OperationCondition()
  115. call Evaluate_SafetyValve()
  116. call Evaluate_Slips()
  117. call Evaluate_Swing()
  118. call Evaluate_Tong()
  119. ! call Evaluate_StringUpdate()
  120. call Evaluate_FlowKellyDisconnect()
  121. call Evaluate_FlowPipeDisconnect()
  122. !if(Get_FillMouseHoleLed()) then
  123. ! call Set_MouseHole(MOUSE_HOLE_FILL)
  124. !else
  125. ! if((Get_KellyConnection() == KELLY_CONNECTION_SINGLE .or.&
  126. ! Get_ElevatorConnection() == ELEVATOR_CONNECTION_SINGLE) .and.&
  127. ! Get_HookHeight() >= 95.0 ) then
  128. ! call Set_MouseHole(MOUSE_HOLE_NEUTRAL)
  129. ! else
  130. ! call Set_MouseHole(MOUSE_HOLE_EMPTY)
  131. ! endif
  132. !endif
  133. !topdrive
  134. call Evaluate_TdsElevatorModes()
  135. call Evaluate_TdsConnectionModes()
  136. call Evaluate_SwingTiltPermission()
  137. call Evaluate_SwingOffPermission()
  138. call Evaluate_SwingDrillPermission()
  139. call Evaluate_FillupHeadPermission()
  140. call Evaluate_TdsTong()
  141. call Evaluate_TdsBackupClamp()
  142. call Evaluate_TdsSwing()
  143. call Evaluate_TdsSpine()
  144. call Evaluate_PowerLed()
  145. call Evaluate_IbopLed()
  146. call Evaluate_TorqueWrenchLed()
  147. end subroutine OperationScenarios_Step
  148. subroutine OperationScenarios_Output
  149. implicit none
  150. end subroutine OperationScenarios_Output
  151. ! subroutine OperationScenariosMainBody
  152. ! ! use CSimulationVariables
  153. ! use CKellyConnectionEnum
  154. ! use CElevatorConnectionEnum
  155. ! use CCloseKellyCockLedNotification
  156. ! use CCloseSafetyValveLedNotification
  157. ! use CFillMouseHoleLedNotification
  158. ! use CIrIBopLedNotification
  159. ! use CIrSafetyValveLedNotification
  160. ! use CLatchLedNotification
  161. ! use COpenKellyCockLedNotification
  162. ! use COpenSafetyValveLedNotification
  163. ! use CSlipsNotification
  164. ! use CSwingLedNotification
  165. ! use CTongNotification
  166. ! use CUnlatchLedNotification
  167. ! use CInstallFillupHeadPermission
  168. ! use CInstallMudBucketPermission
  169. ! use CIrIbopPermission
  170. ! use CIrSafetyValvePermission
  171. ! use CRemoveFillupHeadPermission
  172. ! use CRemoveMudBucketPermission
  173. ! ! use CHookHeight
  174. ! ! use CIbopHeight
  175. ! ! use CNearFloorConnection
  176. ! ! use CSafetyValveHeight
  177. ! ! use CSlackOff
  178. ! ! use CStandRack
  179. ! ! use CStringPressure
  180. ! ! use CZeroStringSpeed
  181. ! use CUnityInputs, only: &
  182. ! Get_ElevatorConnectionPossible, &
  183. ! Get_JointConnectionPossible, &
  184. ! Get_ElevatorPickup, &
  185. ! Get_NearFloorPosition, &
  186. ! Get_SingleSetInMouseHole
  187. ! use CBucketEnum
  188. ! use CElevatorEnum
  189. ! use CHeadEnum
  190. ! use CIbopEnum
  191. ! use CKellyEnum
  192. ! use CMouseHoleEnum
  193. ! use COperationConditionEnum
  194. ! use CSafetyValveEnum
  195. ! use CSlipsEnum
  196. ! use CSwingEnum
  197. ! use CTongEnum
  198. ! ! use CStringUpdate
  199. ! use CFlowPipeDisconnectEnum
  200. ! use CFlowKellyDisconnectEnum
  201. ! use CFillupHeadPermission
  202. ! use CSwingDrillPermission
  203. ! use CSwingOffPermission
  204. ! use CSwingTiltPermission
  205. ! ! use CTdsStemJointHeight
  206. ! use CTdsConnectionModesEnum
  207. ! use CTdsElevatorModesEnum
  208. ! use CTdsSpineEnum
  209. ! use CTdsSwingEnum
  210. ! use CTdsTongEnum
  211. ! use CTdsBackupClamp
  212. ! use CTdsIbopLedNotification
  213. ! use CTdsPowerLedNotification
  214. ! use CTdsTorqueWrenchLedNotification
  215. ! implicit none
  216. ! loop1: do
  217. ! call Evaluate_KellyConnection()
  218. ! call Evaluate_ElevatorConnection()
  219. ! call Evaluate_CloseKellyCockLed()
  220. ! call Evaluate_CloseSafetyValveLed()
  221. ! call Evaluate_FillMouseHoleLed()
  222. ! call Evaluate_IrIBopLed()
  223. ! call Evaluate_IrSafetyValveLed()
  224. ! call Evaluate_LatchLed()
  225. ! call Evaluate_OpenKellyCockLed()
  226. ! call Evaluate_OpenSafetyValveLed()
  227. ! call Evaluate_SlipsNotification()
  228. ! call Evaluate_SwingLed()
  229. ! call Evaluate_TongNotification()
  230. ! call Evaluate_UnlatchLed()
  231. ! call Evaluate_InstallFillupHeadPermission()
  232. ! call Evaluate_InstallMudBucketPermission()
  233. ! call Evaluate_IrIbopPermission()
  234. ! call Evaluate_IrSafetyValvePermission()
  235. ! call Evaluate_RemoveFillupHeadPermission()
  236. ! call Evaluate_RemoveMudBucketPermission()
  237. ! call Evaluate_MudBucket()
  238. ! call Evaluate_Elevator()
  239. ! call Evaluate_FillupHead()
  240. ! call Evaluate_Ibop()
  241. ! call Evaluate_Kelly()
  242. ! call Evaluate_MouseHole()
  243. ! call Evaluate_MouseHole()
  244. ! call Evaluate_OperationCondition()
  245. ! call Evaluate_SafetyValve()
  246. ! call Evaluate_Slips()
  247. ! call Evaluate_Swing()
  248. ! call Evaluate_Tong()
  249. ! ! call Evaluate_StringUpdate()
  250. ! call Evaluate_FlowKellyDisconnect()
  251. ! call Evaluate_FlowPipeDisconnect()
  252. ! !if(Get_FillMouseHoleLed()) then
  253. ! ! call Set_MouseHole(MOUSE_HOLE_FILL)
  254. ! !else
  255. ! ! if((Get_KellyConnection() == KELLY_CONNECTION_SINGLE .or.&
  256. ! ! Get_ElevatorConnection() == ELEVATOR_CONNECTION_SINGLE) .and.&
  257. ! ! Get_HookHeight() >= 95.0 ) then
  258. ! ! call Set_MouseHole(MOUSE_HOLE_NEUTRAL)
  259. ! ! else
  260. ! ! call Set_MouseHole(MOUSE_HOLE_EMPTY)
  261. ! ! endif
  262. ! !endif
  263. ! !topdrive
  264. ! call Evaluate_TdsElevatorModes()
  265. ! call Evaluate_TdsConnectionModes()
  266. ! call Evaluate_SwingTiltPermission()
  267. ! call Evaluate_SwingOffPermission()
  268. ! call Evaluate_SwingDrillPermission()
  269. ! call Evaluate_FillupHeadPermission()
  270. ! call Evaluate_TdsTong()
  271. ! call Evaluate_TdsBackupClamp()
  272. ! call Evaluate_TdsSwing()
  273. ! call Evaluate_TdsSpine()
  274. ! call Evaluate_PowerLed()
  275. ! call Evaluate_IbopLed()
  276. ! call Evaluate_TorqueWrenchLed()
  277. ! !if (IsStopped==.true.) exit loop1
  278. ! if(IsStopped) call Quit()
  279. ! call sleepqq(100)
  280. ! enddo loop1
  281. ! end subroutine OperationScenariosMainBody
  282. ! subroutine SubscribeUpdateUnity(a)
  283. ! !DEC$ ATTRIBUTES DLLEXPORT :: SubscribeUpdateUnity
  284. ! !DEC$ ATTRIBUTES ALIAS: 'SubscribeUpdateUnity' :: SubscribeUpdateUnity
  285. ! implicit none
  286. ! procedure (ActionVoid) :: a
  287. ! UpdateUnityPtr => a
  288. ! end subroutine
  289. subroutine UpdateUnity()
  290. implicit none
  291. if(associated(UpdateUnityPtr)) call UpdateUnityPtr()
  292. end subroutine
  293. ! subroutine PreProcessingSnapshot
  294. ! !DEC$ ATTRIBUTES DLLEXPORT :: PreProcessingSnapshot
  295. ! !DEC$ ATTRIBUTES ALIAS: 'PreProcessingSnapshot' :: PreProcessingSnapshot
  296. ! use CSwingEnumVariables
  297. ! use CSlipsEnumVariables
  298. ! use CHookVariables
  299. ! use CTongEnumVariables
  300. ! use CHoistingVariables
  301. ! use CKellyConnectionEnumVariables
  302. ! use COperationScenariosVariables
  303. ! ! use CElevatorConnectionEnumVariables
  304. ! use COperationConditionEnumVariables
  305. ! use CMouseHoleEnumVariables
  306. ! implicit none
  307. ! if(Hoisting%DriveType == Kelly_DriveType) then ! kelly mode
  308. ! if(Get_OperationCondition() == OPERATION_DRILL) then
  309. ! if(Get_KellyConnection() == KELLY_CONNECTION_NOTHING) then
  310. ! call Kelly_ConnectionNothing()
  311. ! elseif (Get_KellyConnection() == KELLY_CONNECTION_STRING) then
  312. ! call Kelly_ConnectionString()
  313. ! elseif (Get_KellyConnection() == KELLY_CONNECTION_SINGLE) then
  314. ! call Kelly_ConnectionSingle()
  315. ! endif
  316. ! elseif (Get_OperationCondition() == OPERATION_TRIP) then
  317. ! if(Get_ElevatorConnection() == ELEVATOR_CONNECTION_NOTHING) then
  318. ! call Elevator_ConnectionNothing()
  319. ! elseif (Get_ElevatorConnection() == ELEVATOR_CONNECTION_STRING) then
  320. ! call Elevator_ConnectionString()
  321. ! elseif (Get_ElevatorConnection() == ELEVATOR_CONNECTION_STAND) then
  322. ! call Elevator_ConnectionStand()
  323. ! elseif (Get_ElevatorConnection() == ELEVATOR_CONNECTION_SINGLE) then
  324. ! call Elevator_ConnectionSingle()
  325. ! endif
  326. ! endif
  327. ! else ! Topdrive mode
  328. ! !
  329. ! endif
  330. ! ! final adjustments
  331. ! call Update_MouseHole_From_Snapshot()
  332. ! end subroutine PreProcessingSnapshot
  333. subroutine Kelly_ConnectionNothing
  334. ! use CSwingEnumVariables
  335. ! use CSlipsEnumVariables
  336. use UnitySignalVariables
  337. use CHookVariables
  338. implicit none
  339. call Set_HookHeight(75.0)
  340. call sleep(1)
  341. ! first wait for unity to get to starting point
  342. loop1: do
  343. if(Get_Swing() == SWING_WELL_END .and. Get_Slips() == SLIPS_SET_END) exit loop1
  344. call sleepqq(100)
  345. enddo loop1
  346. call sleep(1)
  347. !TODO: possibly goto a position to activate swing
  348. ! goto preferred swing position
  349. if(UnitySignals%Swing_S == SWING_MOUSE_HOLE_END) then
  350. call Set_Swing(SWING_MOUSE_HOLE_BEGIN)
  351. call UpdateUnity()
  352. loop2: do
  353. if(Get_Swing() == SWING_MOUSE_HOLE_END) exit loop2
  354. call sleepqq(100)
  355. enddo loop2
  356. elseif (UnitySignals%Swing_S == SWING_RAT_HOLE_END) then
  357. call Set_Swing(SWING_RAT_HOLE_BEGIN)
  358. call UpdateUnity()
  359. loop3: do
  360. if(Get_Swing() == SWING_RAT_HOLE_END) exit loop3
  361. call sleepqq(100)
  362. enddo loop3
  363. !elseif (Swing_S == SWING_WELL_END) then
  364. ! call Set_Swing(SWING_WELL_BEGIN)
  365. ! call UpdateUnity()
  366. ! loop4: do
  367. ! if(Get_Swing() == SWING_WELL_END) exit loop4
  368. ! call sleepqq(100)
  369. ! enddo loop4
  370. endif
  371. call sleep(3)
  372. ! move to final hook height
  373. call Update_HookHeight_From_Snapshot()
  374. call sleep(3)
  375. end subroutine Kelly_ConnectionNothing
  376. subroutine Kelly_ConnectionString
  377. ! use CSwingEnumVariables
  378. ! use CSlipsEnumVariables
  379. use UnitySignalVariables
  380. use CHookVariables
  381. ! use CTongEnumVariables
  382. implicit none
  383. call Set_HookHeight(75.0)
  384. call sleep(1)
  385. ! first wait for unity to get to starting point
  386. loop1: do
  387. if(Get_Swing() == SWING_WELL_END .and. Get_Slips() == SLIPS_SET_END) exit loop1
  388. call sleepqq(100)
  389. enddo loop1
  390. call sleep(1)
  391. ! goto connection to string position
  392. call Set_HookHeight_S(66.7)
  393. call sleep(1)
  394. ! start tong makeup
  395. call Set_Tong(TONG_MAKEUP_BEGIN)
  396. call UpdateUnity()
  397. loop2: do
  398. if(Get_Tong() == TONG_MAKEUP_END) exit loop2
  399. call sleepqq(100)
  400. enddo loop2
  401. call sleepqq(100)
  402. ! release slips
  403. call Set_Slips(SLIPS_UNSET_BEGIN)
  404. call UpdateUnity()
  405. loop3: do
  406. if(Get_Slips() == SLIPS_UNSET_END) exit loop3
  407. call sleepqq(100)
  408. enddo loop3
  409. call sleepqq(100)
  410. ! move to final hook height
  411. call Update_HookHeight_From_Snapshot()
  412. call sleep(3)
  413. ! put slips to saved position
  414. if(UnitySignals%Slips_S == SLIPS_SET_END) then
  415. call Set_Slips(SLIPS_SET_BEGIN)
  416. call UpdateUnity()
  417. loop4: do
  418. if(Get_Slips() == SLIPS_SET_END) exit loop4
  419. call sleepqq(100)
  420. enddo loop4
  421. call sleep(1)
  422. endif
  423. end subroutine Kelly_ConnectionString
  424. subroutine Kelly_ConnectionSingle
  425. ! use CSwingEnumVariables
  426. ! use CSlipsEnumVariables
  427. ! use CTongEnumVariables
  428. use UnitySignalVariables
  429. use CHookVariables
  430. implicit none
  431. call Set_HookHeight(75.0)
  432. call sleep(1)
  433. ! first wait for unity to get to starting point
  434. loop1: do
  435. if(Get_Swing() == SWING_WELL_END .and. Get_Slips() == SLIPS_SET_END) exit loop1
  436. call sleepqq(100)
  437. enddo loop1
  438. call sleep(1)
  439. ! goto swing mouse hole position
  440. call Set_HookHeight_S(70.0)
  441. call sleep(1)
  442. ! swing mouse hole
  443. call Set_Swing(SWING_MOUSE_HOLE_BEGIN)
  444. call UpdateUnity()
  445. loop2: do
  446. if(Get_Swing() == SWING_MOUSE_HOLE_END) exit loop2
  447. call sleepqq(100)
  448. enddo loop2
  449. call sleepqq(100)
  450. ! goto makeup pipe location
  451. call Set_HookHeight_S(65.0)
  452. call sleep(1)
  453. ! start tong makeup
  454. call Set_Tong(TONG_MAKEUP_BEGIN)
  455. call UpdateUnity()
  456. loop3: do
  457. if(Get_Tong() == TONG_MAKEUP_END) exit loop3
  458. call sleepqq(100)
  459. enddo loop3
  460. call sleepqq(100)
  461. if (UnitySignals%Swing_S == SWING_WELL_END) then ! already in mouse hole
  462. ! goto swing location
  463. call Set_HookHeight_S(98.0)
  464. call sleep(1)
  465. ! goto preferred swing position
  466. call Set_Swing(SWING_WELL_BEGIN)
  467. call UpdateUnity()
  468. loop4: do
  469. if(Get_Swing() == SWING_WELL_END) exit loop4
  470. call sleepqq(100)
  471. enddo loop4
  472. call sleep(2)
  473. endif
  474. ! move to final hook height
  475. call Update_HookHeight_From_Snapshot()
  476. call sleep(3)
  477. end subroutine Kelly_ConnectionSingle
  478. subroutine Elevator_ConnectionNothing
  479. ! use CSwingEnumVariables
  480. ! use CSlipsEnumVariables
  481. use UnitySignalVariables
  482. use CHookVariables
  483. ! use CKellyEnumVariables
  484. implicit none
  485. call Set_HookHeight(75.0)
  486. call sleep(1)
  487. ! first wait for unity to get to starting point
  488. loop1: do
  489. if(Get_Swing() == SWING_WELL_END .and. Get_Slips() == SLIPS_SET_END) exit loop1
  490. call sleepqq(100)
  491. enddo loop1
  492. call sleep(1)
  493. !TODO: possibly goto a position to activate swing
  494. !! first goto mouse hole
  495. !call Set_Swing(SWING_MOUSE_HOLE_BEGIN)
  496. !call UpdateUnity()
  497. !loop2: do
  498. ! if(Get_Swing() == SWING_MOUSE_HOLE_END) exit loop2
  499. ! call sleepqq(100)
  500. !enddo loop2
  501. !call sleep(1)
  502. !
  503. !! then goto rat hole
  504. !call Set_Swing(SWING_RAT_HOLE_BEGIN)
  505. !call UpdateUnity()
  506. !loop3: do
  507. ! if(Get_Swing() == SWING_RAT_HOLE_END) exit loop3
  508. ! call sleepqq(100)
  509. !enddo loop3
  510. !call sleep(1)
  511. ! kelly back
  512. call Set_Kelly(KELLY_REMOVE)
  513. call sleepqq(100)
  514. ! goto preferred swing position
  515. if(UnitySignals%Swing_S == SWING_MOUSE_HOLE_END) then
  516. call Set_Swing(SWING_MOUSE_HOLE_BEGIN)
  517. call UpdateUnity()
  518. loop4: do
  519. if(Get_Swing() == SWING_MOUSE_HOLE_END) exit loop4
  520. call sleepqq(100)
  521. enddo loop4
  522. elseif (UnitySignals%Swing_S == SWING_RAT_HOLE_END) then
  523. call Set_Swing(SWING_RAT_HOLE_BEGIN)
  524. call UpdateUnity()
  525. loop5: do
  526. if(Get_Swing() == SWING_RAT_HOLE_END) exit loop5
  527. call sleepqq(100)
  528. enddo loop5
  529. elseif (UnitySignals%Swing_S == SWING_WELL_END) then
  530. call Set_Swing(SWING_WELL_BEGIN)
  531. call UpdateUnity()
  532. loop6: do
  533. if(Get_Swing() == SWING_WELL_END) exit loop6
  534. call sleepqq(100)
  535. enddo loop6
  536. endif
  537. call sleepqq(100)
  538. ! move to final hook height
  539. call Update_HookHeight_From_Snapshot()
  540. call sleep(3)
  541. end subroutine Elevator_ConnectionNothing
  542. subroutine Elevator_ConnectionString
  543. implicit none
  544. end subroutine Elevator_ConnectionString
  545. subroutine Elevator_ConnectionStand
  546. implicit none
  547. end subroutine Elevator_ConnectionStand
  548. subroutine Elevator_ConnectionSingle
  549. implicit none
  550. end subroutine Elevator_ConnectionSingle
  551. end module COperationScenariosMain