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.

COperationScenariosSettings.f90 14 KiB

1 year ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475
  1. module COperationScenariosSettings
  2. implicit none
  3. public
  4. contains
  5. !subroutine Initialization()
  6. ! ! use CSimulationVariables
  7. ! use CUnityOutputs, only: SetupUnityOutputs => Setup
  8. !
  9. ! use CBucketEnum
  10. ! use CTongEnum
  11. ! use CSwingEnum
  12. ! use CSlipsEnum
  13. ! use CSafetyValveEnum
  14. ! use UnitySignalsModule
  15. ! use CMouseHoleEnum
  16. ! use CKellyEnum
  17. ! use OperationScenariosModule
  18. ! use CIbopEnum
  19. ! use CHeadEnum
  20. ! use CElevatorEnum
  21. ! use CElevatorConnectionEnum
  22. !
  23. ! use CInstallFillupHeadPermission
  24. ! use CInstallMudBucketPermission
  25. ! use CIrIbopPermission
  26. ! use CIrSafetyValvePermission
  27. ! use CRemoveFillupHeadPermission
  28. ! use CRemoveMudBucketPermission
  29. !
  30. ! use CCloseKellyCockLedNotification
  31. ! use CCloseSafetyValveLedNotification
  32. ! use CFillMouseHoleLedNotification
  33. ! use CIrIBopLedNotification
  34. ! use CIrSafetyValveLedNotification
  35. ! use CLatchLedNotification
  36. ! use COpenKellyCockLedNotification
  37. ! use COpenSafetyValveLedNotification
  38. ! use CSlipsNotification
  39. ! use CSwingLedNotification
  40. ! use CTongNotification
  41. ! use CUnlatchLedNotification
  42. !
  43. ! use CHookHeight
  44. ! use CIbopHeight
  45. ! use CNearFloorConnection
  46. ! use CSafetyValveHeight
  47. ! use CSlackOff
  48. ! use CStandRack
  49. ! use CStringPressure
  50. ! use CZeroStringSpeed
  51. !
  52. ! use CStringUpdate
  53. !
  54. ! use CFlowPipeDisconnectEnum
  55. ! use CFlowKellyDisconnectEnum
  56. !
  57. ! use CFillupHeadPermission
  58. ! use CSwingDrillPermission
  59. ! use CSwingOffPermission
  60. ! use CSwingTiltPermission
  61. ! use CTdsStemJointHeight
  62. ! use UnitySignalsModule !for CTdsConnectionModesEnum
  63. ! use CTdsElevatorModesEnum
  64. ! use CTdsSpineEnum
  65. ! use CTdsSwingEnum
  66. ! use CTdsTongEnum
  67. ! use CTdsBackupClamp
  68. !
  69. ! use CTdsIbopLedNotification
  70. ! use CTdsPowerLedNotification
  71. !
  72. ! use CTdsTorqueWrenchLedNotification
  73. !
  74. ! implicit none
  75. !
  76. ! call SetupUnityOutputs()
  77. !
  78. ! call Subscribe_Tong()
  79. ! call Subscribe_MudBucket()
  80. ! call Subscribe_ElevatorConnection()
  81. ! call Subscribe_Elevator()
  82. ! call Subscribe_FillupHead()
  83. ! call Subscribe_Ibop()
  84. ! call Subscribe_KellyConnection()
  85. ! call Subscribe_Kelly()
  86. ! call Subscribe_MouseHole()
  87. ! call Subscribe_OperationCondition()
  88. ! call Subscribe_SafetyValve()
  89. ! call Subscribe_Slips()
  90. ! call Subscribe_Swing()
  91. !
  92. !
  93. ! call Subscribe_InstallFillupHeadPermission()
  94. ! call Subscribe_InstallMudBucketPermission()
  95. ! call Subscribe_IrIbopPermission()
  96. ! call Subscribe_IrSafetyValvePermission()
  97. ! call Subscribe_RemoveFillupHeadPermission()
  98. ! call Subscribe_RemoveMudBucketPermission()
  99. !
  100. ! call Subscribe_CloseKellyCockLed()
  101. ! call Subscribe_CloseSafetyValveLed()
  102. ! call Subscribe_FillMouseHoleLed()
  103. ! call Subscribe_IrIBopLed()
  104. ! call Subscribe_IrSafetyValveLed()
  105. ! call Subscribe_LatchLed()
  106. ! call Subscribe_OpenKellyCockLed()
  107. ! call Subscribe_OpenSafetyValveLed()
  108. ! call Subscribe_SlipsNotification()
  109. ! call Subscribe_SwingLed()
  110. ! call Subscribe_UnlatchLed()
  111. !
  112. ! call Subscribe_HookHeight()
  113. ! call Subscribe_IbopHeight()
  114. ! call Subscribe_NearFloorConnection()
  115. ! call Subscribe_SafetyValveHeight()
  116. ! call Subscribe_SlackOff()
  117. ! call Subscribe_StringPressure()
  118. ! call Subscribe_ZeroStringSpeed()
  119. ! call Subscribe_StandRack()
  120. !
  121. ! call Subscribe_StringUpdate()
  122. !
  123. ! call Subscribe_TongNotification()
  124. !
  125. ! call Subscribe_FlowKellyDisconnect()
  126. ! call Subscribe_FlowPipeDisconnect()
  127. !
  128. !
  129. !
  130. !
  131. !
  132. ! !top drive
  133. ! call Subscribe_TdsConnectionModes()
  134. ! call Subscribe_TdsElevatorModes()
  135. ! call Subscribe_FillupHeadPermission()
  136. ! call Subscribe_SwingDrillPermission()
  137. ! call Subscribe_SwingOffPermission()
  138. ! call Subscribe_SwingTiltPermission()
  139. ! call Subscribe_TdsStemJointHeight()
  140. ! call Subscribe_TdsTong()
  141. ! call Subscribe_TdsBackupClamp()
  142. ! call Subscribe_TdsSwing()
  143. ! call Subscribe_TdsSpine()
  144. ! call Subscribe_PowerLed()
  145. ! call Subscribe_IbopLed()
  146. !
  147. ! call Subscribe_TorqueWrenchLed()
  148. !
  149. !
  150. ! call OnSimulationStart%Add(SetDefaultValues)
  151. !
  152. !end subroutine
  153. ! subroutine SetDefaultValues()
  154. subroutine OperationScenarios_Init()
  155. use OperationScenariosModule
  156. use CHoistingVariables
  157. use SimulationVariables
  158. use CManifolds, only: RemoveSafetyValve_TripMode, RemoveSafetyValve_KellyMode
  159. implicit none
  160. call Set_KellyConnection(KELLY_CONNECTION_NOTHING)
  161. !Get_KellyConnection()
  162. !KELLY_CONNECTION_NOTHING
  163. !KELLY_CONNECTION_STRING
  164. !KELLY_CONNECTION_SINGLE
  165. call Set_ElevatorConnection(ELEVATOR_CONNECTION_NOTHING)
  166. !Get_ElevatorConnection()
  167. !ELEVATOR_CONNECTION_NOTHING
  168. !ELEVATOR_CONNECTION_STRING
  169. !ELEVATOR_CONNECTION_STAND
  170. !ELEVATOR_CONNECTION_SINGLE
  171. !ELEVATOR_LATCH_STRING
  172. !ELEVATOR_LATCH_SINGLE
  173. !ELEVATOR_LATCH_STAND
  174. call Set_CloseKellyCockLed(.false.) !Get_CloseKellyCockLed()
  175. call Set_CloseSafetyValveLed(.false.) !Get_CloseSafetyValveLed()
  176. call Set_FillMouseHoleLed(.true.) !Get_FillMouseHoleLed()
  177. call Set_IrIBopLed(.false.) !Get_IrIBopLed()
  178. !call Set_IrSafetyValveLed(.true.) !Get_IrSafetyValveLed()
  179. if(data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then
  180. call RemoveSafetyValve_TripMode()
  181. call RemoveSafetyValve_KellyMode()
  182. call Set_IrSafetyValveLed(.false.)
  183. else
  184. call Set_IrSafetyValveLed(.true.)
  185. endif
  186. call Set_LatchLed(.false.) !Get_LatchLed()
  187. call Set_OpenKellyCockLed(.true.) !Get_OpenKellyCockLed()
  188. call Set_OpenSafetyValveLed(.true.) !Get_OpenSafetyValveLed()
  189. call Set_SlipsNotification(.false.) !Get_SlipsNotification()
  190. call Set_SwingLed(.false.) !Get_SwingLed()
  191. call Set_TongNotification(.false.) !Get_TongNotification()
  192. call Set_UnlatchLed(.false.) !Get_UnlatchLed()
  193. call Set_InstallFillupHeadPermission(.false.) !Get_InstallFillupHeadPermission()
  194. call Set_InstallMudBucketPermission(.false.) !Get_InstallMudBucketPermission()
  195. call Set_IrIbopPermission(.false.) !Get_IrIbopPermission()
  196. call Set_IrSafetyValvePermission(.false.) !Get_IrSafetyValvePermission()
  197. call Set_RemoveFillupHeadPermission(.false.) !Get_RemoveFillupHeadPermission()
  198. call Set_RemoveMudBucketPermission(.false.) !Get_RemoveMudBucketPermission()
  199. !call Set_HookHeight(REAL(70.0, 8)) !Get_HookHeight()
  200. call Set_IbopHeight(3.0) !Get_IbopHeight()
  201. !call Set_NearFloorConnection(3.0) !Get_NearFloorConnection()
  202. call Set_SafetyValveHeight(3.0) !Get_SafetyValveHeight()
  203. call Set_SlackOff(.true.) !Get_SlackOff()
  204. !call Set_StandRack(0.0) !Get_StandRack()
  205. !call Set_StringPressure(0.0) !Get_StringPressure()
  206. !call Set_ZeroStringSpeed(.true.) !Get_ZeroStringSpeed()
  207. !Get_ElevatorConnected()
  208. !Get_JointConnection()
  209. !Get_NearMonkeyBoardPosition()
  210. !Get_NearFloorPosition()
  211. !Get_SingleSetInMouseHole()
  212. !Get_SwingCenter()
  213. call Set_MudBucket(MUD_BUCKET_REMOVE)
  214. !Get_MudBucket()
  215. !MUD_BUCKET_INSTALL
  216. !MUD_BUCKET_REMOVE
  217. call Set_Elevator(ELEVATOR_NEUTRAL)
  218. ! Get_Elevator()
  219. !ELEVATOR_NEUTRAL
  220. !ELEVATOR_LATCH_STRING_BEGIN
  221. !ELEVATOR_LATCH_STRING_END
  222. !ELEVATOR_UNLATCH_STRING_BEGIN
  223. !ELEVATOR_UNLATCH_STRING_END
  224. !ELEVATOR_LATCH_STAND_BEGIN
  225. !ELEVATOR_LATCH_STAND_END
  226. !ELEVATOR_UNLATCH_STAND_BEGIN
  227. !ELEVATOR_UNLATCH_STAND_END
  228. !ELEVATOR_LATCH_SINGLE_BEGIN
  229. !ELEVATOR_LATCH_SINGLE_END
  230. !ELEVATOR_UNLATCH_SINGLE_BEGIN
  231. !ELEVATOR_UNLATCH_SINGLE_END
  232. call Set_FillupHead(FILLUP_HEAD_REMOVE)
  233. !Get_FillupHead()
  234. !FILLUP_HEAD_INSTALL
  235. !FILLUP_HEAD_REMOVE
  236. call Set_Ibop(IBOP_REMOVE)
  237. !Get_Ibop()
  238. !IBOP_INSTALL
  239. !IBOP_REMOVE
  240. call Set_Kelly(KELLY_INSTALL)
  241. !Get_Kelly()
  242. !KELLY_NEUTRAL
  243. !KELLY_INSTALL
  244. !KELLY_REMOVE
  245. call Set_MouseHole(MOUSE_HOLE_FILL)
  246. !Get_MouseHole()
  247. !MOUSE_HOLE_NEUTRAL
  248. !MOUSE_HOLE_FILL
  249. !MOUSE_HOLE_EMPTY
  250. call Set_OperationCondition(OPERATION_DRILL)
  251. !Get_OperationCondition()
  252. !OPERATION_DRILL
  253. !OPERATION_TRIP
  254. call Set_SafetyValve(SAFETY_VALVE_INSTALL)
  255. !Get_SafetyValve()
  256. !SAFETY_VALVE_INSTALL
  257. !SAFETY_VALVE_REMOVE
  258. if(data%Configuration%Hoisting%DriveType == TopDrive_DriveType) call Set_SafetyValve(SAFETY_VALVE_REMOVE)
  259. call Set_Slips(SLIPS_SET_END)
  260. !Get_Slips()
  261. call Set_Swing(SWING_WELL_BEGIN)
  262. !Get_Swing()
  263. !SWING_NEUTRAL
  264. !SWING_MOUSE_HOLE_BEGIN
  265. !SWING_MOUSE_HOLE_END
  266. !SWING_RAT_HOLE_BEGIN
  267. !SWING_RAT_HOLE_END
  268. !SWING_WELL_BEGIN
  269. !SWING_WELL_END
  270. call Set_Tong(TONG_NEUTRAL)
  271. !Get_Tong()
  272. !TONG_NEUTRAL
  273. !TONG_BREAKOUT_BEGIN
  274. !TONG_BREAKOUT_END
  275. !TONG_MAKEUP_BEGIN
  276. !TONG_MAKEUP_END
  277. call Set_StringUpdate(STRING_UPDATE_NEUTRAL)
  278. !Get_StringUpdate()
  279. !STRING_UPDATE_NEUTRAL
  280. !STRING_UPDATE_ADD_SINGLE
  281. !STRING_UPDATE_ADD_STAND
  282. !STRING_UPDATE_REMOVE_SINGLE
  283. !STRING_UPDATE_REMOVE_STAND
  284. call Set_TdsElevatorModes(TDS_ELEVATOR_CONNECTION_NOTHING)
  285. !Get_TdsElevatorModes()
  286. !TDS_ELEVATOR_CONNECTION_NOTHING
  287. !TDS_ELEVATOR_CONNECTION_STRING
  288. !TDS_ELEVATOR_CONNECTION_SINGLE
  289. !TDS_ELEVATOR_CONNECTION_STAND
  290. !TDS_ELEVATOR_LATCH_STRING
  291. !TDS_ELEVATOR_LATCH_SINGLE
  292. !TDS_ELEVATOR_LATCH_STAND
  293. call Set_TdsConnectionModes(TDS_CONNECTION_NOTHING)
  294. !Get_TdsConnectionModes()
  295. !TDS_CONNECTION_NOTHING
  296. !TDS_CONNECTION_STRING
  297. !TDS_CONNECTION_SPINE
  298. call Set_SwingTiltPermission(.false.) !Get_SwingTiltPermission()
  299. call Set_SwingOffPermission(.false.) !Get_SwingOffPermission()
  300. call Set_SwingDrillPermission(.false.) !Get_SwingDrillPermission()
  301. call Set_FillupHeadPermission(.false.) !Get_FillupHeadPermission()
  302. call Set_PowerLed(.false.)
  303. call Set_IbopLed(.false.)
  304. call Set_TorqueWrenchLed(0) !Get_TorqueWrenchLed()
  305. !TdsPower_REV = 1
  306. !TdsPower_OFF = 0
  307. !TdsPower_FWD = -1
  308. !
  309. !TdsMu_TORQ = 1
  310. !TdsMu_SPINE = 0
  311. !TdsMu_DRILL = -1
  312. !
  313. !TdsLinkTilt_TILT = 1
  314. !TdsLinkTilt_OFF = 0
  315. !TdsLinkTilt_DRILL = -1
  316. !TDS IBOP TopDriveIbop
  317. !TDS LinkTilt TopDriveLinkTiltState
  318. !TDS MU TopDriveDrillTorqueState
  319. !TDS Power TopDriveTdsPowerState
  320. !TopDriveTorqueWrench PRESSED=True or UNPRESSED=Falses
  321. !Get_TdsConnectionPossible()
  322. !Get_TdsStemIn()
  323. !call Set_TdsStemJointHeight(v) !Get_TdsStemJointHeight()
  324. !Get_SwingDrillPermission()
  325. !Get_SwingOffPermission()
  326. !Get_SwingTiltPermission()
  327. !Get_FillupHeadPermission()
  328. call Set_TdsTong(TDS_TONG_BREAKOUT_END)
  329. !Get_TdsTong()
  330. !TDS_TONG_BREAKOUT_BEGIN
  331. !TDS_TONG_BREAKOUT_END
  332. !TDS_TONG_MAKEUP_BEGIN
  333. !TDS_TONG_MAKEUP_END
  334. call Set_TdsBackupClamp(BACKUP_CLAMP_OFF_END)
  335. !Get_TdsBackupClamp()
  336. !BACKUP_CLAMP_OFF_END
  337. !BACKUP_CLAMP_OFF_BEGIN
  338. !BACKUP_CLAMP_FW_BEGIN
  339. !BACKUP_CLAMP_FW_END
  340. call Set_TdsSwing(TDS_SWING_OFF_END)
  341. !Get_TdsSwing()
  342. !TDS_SWING_NEUTRAL
  343. !TDS_SWING_OFF_BEGIN
  344. !TDS_SWING_OFF_END
  345. !TDS_SWING_DRILL_BEGIN
  346. !TDS_SWING_DRILL_END
  347. !TDS_SWING_TILT_BEGIN
  348. !TDS_SWING_TILT_END
  349. call Set_TdsSpine(TDS_SPINE_NEUTRAL) !TDS_SPINE_DISCONNECT_END
  350. !Get_TdsSpine()
  351. !TDS_SPINE_NEUTRAL
  352. !TDS_SPINE_CONNECT_BEGIN
  353. !TDS_SPINE_CONNECT_END
  354. !TDS_SPINE_DISCONNECT_BEGIN
  355. !TDS_SPINE_DISCONNECT_END
  356. end subroutine
  357. ! subroutine SetDefaults_WN()
  358. ! !DEC$ ATTRIBUTES DLLEXPORT :: SetDefaults_WN
  359. ! !DEC$ ATTRIBUTES ALIAS: 'SetDefaults_WN' :: SetDefaults_WN
  360. ! implicit none
  361. ! call SetDefaultValues()
  362. ! end subroutine
  363. end module COperationScenariosSettings