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
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488
  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 COperationConditionEnum
  15. ! use CMouseHoleEnum
  16. ! use CKellyEnum
  17. ! use CKellyConnectionEnum
  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 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. use COperationScenariosVariables
  155. use CHoistingVariables, only: DriveType, TopDrive_DriveType
  156. use CManifolds, only: RemoveSafetyValve_TripMode, RemoveSafetyValve_KellyMode
  157. implicit none
  158. call Set_KellyConnection(KELLY_CONNECTION_NOTHING)
  159. !Get_KellyConnection()
  160. !KELLY_CONNECTION_NOTHING
  161. !KELLY_CONNECTION_STRING
  162. !KELLY_CONNECTION_SINGLE
  163. call Set_ElevatorConnection(ELEVATOR_CONNECTION_NOTHING)
  164. !Get_ElevatorConnection()
  165. !ELEVATOR_CONNECTION_NOTHING
  166. !ELEVATOR_CONNECTION_STRING
  167. !ELEVATOR_CONNECTION_STAND
  168. !ELEVATOR_CONNECTION_SINGLE
  169. !ELEVATOR_LATCH_STRING
  170. !ELEVATOR_LATCH_SINGLE
  171. !ELEVATOR_LATCH_STAND
  172. call Set_CloseKellyCockLed(.false.) !Get_CloseKellyCockLed()
  173. call Set_CloseSafetyValveLed(.false.) !Get_CloseSafetyValveLed()
  174. call Set_FillMouseHoleLed(.true.) !Get_FillMouseHoleLed()
  175. call Set_IrIBopLed(.false.) !Get_IrIBopLed()
  176. !call Set_IrSafetyValveLed(.true.) !Get_IrSafetyValveLed()
  177. if(DriveType == TopDrive_DriveType) then
  178. call RemoveSafetyValve_TripMode()
  179. call RemoveSafetyValve_KellyMode()
  180. call Set_IrSafetyValveLed(.false.)
  181. else
  182. call Set_IrSafetyValveLed(.true.)
  183. endif
  184. call Set_LatchLed(.false.) !Get_LatchLed()
  185. call Set_OpenKellyCockLed(.true.) !Get_OpenKellyCockLed()
  186. call Set_OpenSafetyValveLed(.true.) !Get_OpenSafetyValveLed()
  187. call Set_SlipsNotification(.false.) !Get_SlipsNotification()
  188. call Set_SwingLed(.false.) !Get_SwingLed()
  189. call Set_TongNotification(.false.) !Get_TongNotification()
  190. call Set_UnlatchLed(.false.) !Get_UnlatchLed()
  191. call Set_InstallFillupHeadPermission(.false.) !Get_InstallFillupHeadPermission()
  192. call Set_InstallMudBucketPermission(.false.) !Get_InstallMudBucketPermission()
  193. call Set_IrIbopPermission(.false.) !Get_IrIbopPermission()
  194. call Set_IrSafetyValvePermission(.false.) !Get_IrSafetyValvePermission()
  195. call Set_RemoveFillupHeadPermission(.false.) !Get_RemoveFillupHeadPermission()
  196. call Set_RemoveMudBucketPermission(.false.) !Get_RemoveMudBucketPermission()
  197. !call Set_HookHeight(REAL(70.0, 8)) !Get_HookHeight()
  198. call Set_IbopHeight(3.0) !Get_IbopHeight()
  199. !call Set_NearFloorConnection(3.0) !Get_NearFloorConnection()
  200. call Set_SafetyValveHeight(3.0) !Get_SafetyValveHeight()
  201. call Set_SlackOff(.true.) !Get_SlackOff()
  202. !call Set_StandRack(0.0) !Get_StandRack()
  203. !call Set_StringPressure(0.0) !Get_StringPressure()
  204. !call Set_ZeroStringSpeed(.true.) !Get_ZeroStringSpeed()
  205. !Get_ElevatorConnected()
  206. !Get_JointConnection()
  207. !Get_NearMonkeyBoardPosition()
  208. !Get_NearFloorPosition()
  209. !Get_SingleSetInMouseHole()
  210. !Get_SwingCenter()
  211. call Set_MudBucket(MUD_BUCKET_REMOVE)
  212. !Get_MudBucket()
  213. !MUD_BUCKET_INSTALL
  214. !MUD_BUCKET_REMOVE
  215. call Set_Elevator(ELEVATOR_NEUTRAL)
  216. ! Get_Elevator()
  217. !ELEVATOR_NEUTRAL
  218. !ELEVATOR_LATCH_STRING_BEGIN
  219. !ELEVATOR_LATCH_STRING_END
  220. !ELEVATOR_UNLATCH_STRING_BEGIN
  221. !ELEVATOR_UNLATCH_STRING_END
  222. !ELEVATOR_LATCH_STAND_BEGIN
  223. !ELEVATOR_LATCH_STAND_END
  224. !ELEVATOR_UNLATCH_STAND_BEGIN
  225. !ELEVATOR_UNLATCH_STAND_END
  226. !ELEVATOR_LATCH_SINGLE_BEGIN
  227. !ELEVATOR_LATCH_SINGLE_END
  228. !ELEVATOR_UNLATCH_SINGLE_BEGIN
  229. !ELEVATOR_UNLATCH_SINGLE_END
  230. call Set_FillupHead(FILLUP_HEAD_REMOVE)
  231. !Get_FillupHead()
  232. !FILLUP_HEAD_INSTALL
  233. !FILLUP_HEAD_REMOVE
  234. call Set_Ibop(IBOP_REMOVE)
  235. !Get_Ibop()
  236. !IBOP_INSTALL
  237. !IBOP_REMOVE
  238. call Set_Kelly(KELLY_INSTALL)
  239. !Get_Kelly()
  240. !KELLY_NEUTRAL
  241. !KELLY_INSTALL
  242. !KELLY_REMOVE
  243. call Set_MouseHole(MOUSE_HOLE_FILL)
  244. !Get_MouseHole()
  245. !MOUSE_HOLE_NEUTRAL
  246. !MOUSE_HOLE_FILL
  247. !MOUSE_HOLE_EMPTY
  248. call Set_OperationCondition(OPERATION_DRILL)
  249. !Get_OperationCondition()
  250. !OPERATION_DRILL
  251. !OPERATION_TRIP
  252. call Set_SafetyValve(SAFETY_VALVE_INSTALL)
  253. !Get_SafetyValve()
  254. !SAFETY_VALVE_INSTALL
  255. !SAFETY_VALVE_REMOVE
  256. if(DriveType == TopDrive_DriveType) call Set_SafetyValve(SAFETY_VALVE_REMOVE)
  257. call Set_Slips(SLIPS_SET_BEGIN)
  258. !Get_Slips()
  259. !SLIPS_NEUTRAL
  260. !SLIPS_SET_BEGIN
  261. !SLIPS_SET_END
  262. !SLIPS_UNSET_BEGIN
  263. !SLIPS_UNSET_END
  264. call Set_Swing(SWING_WELL_BEGIN)
  265. !Get_Swing()
  266. !SWING_NEUTRAL
  267. !SWING_MOUSE_HOLE_BEGIN
  268. !SWING_MOUSE_HOLE_END
  269. !SWING_RAT_HOLE_BEGIN
  270. !SWING_RAT_HOLE_END
  271. !SWING_WELL_BEGIN
  272. !SWING_WELL_END
  273. call Set_Tong(TONG_NEUTRAL)
  274. !Get_Tong()
  275. !TONG_NEUTRAL
  276. !TONG_BREAKOUT_BEGIN
  277. !TONG_BREAKOUT_END
  278. !TONG_MAKEUP_BEGIN
  279. !TONG_MAKEUP_END
  280. call Set_StringUpdate(STRING_UPDATE_NEUTRAL)
  281. !Get_StringUpdate()
  282. !STRING_UPDATE_NEUTRAL
  283. !STRING_UPDATE_ADD_SINGLE
  284. !STRING_UPDATE_ADD_STAND
  285. !STRING_UPDATE_REMOVE_SINGLE
  286. !STRING_UPDATE_REMOVE_STAND
  287. call Set_TdsElevatorModes(TDS_ELEVATOR_CONNECTION_NOTHING)
  288. !Get_TdsElevatorModes()
  289. !TDS_ELEVATOR_CONNECTION_NOTHING
  290. !TDS_ELEVATOR_CONNECTION_STRING
  291. !TDS_ELEVATOR_CONNECTION_SINGLE
  292. !TDS_ELEVATOR_CONNECTION_STAND
  293. !TDS_ELEVATOR_LATCH_STRING
  294. !TDS_ELEVATOR_LATCH_SINGLE
  295. !TDS_ELEVATOR_LATCH_STAND
  296. call Set_TdsConnectionModes(TDS_CONNECTION_NOTHING)
  297. !Get_TdsConnectionModes()
  298. !TDS_CONNECTION_NOTHING
  299. !TDS_CONNECTION_STRING
  300. !TDS_CONNECTION_SPINE
  301. call Set_SwingTiltPermission(.false.) !Get_SwingTiltPermission()
  302. call Set_SwingOffPermission(.false.) !Get_SwingOffPermission()
  303. call Set_SwingDrillPermission(.false.) !Get_SwingDrillPermission()
  304. call Set_FillupHeadPermission(.false.) !Get_FillupHeadPermission()
  305. call Set_PowerLed(.false.)
  306. call Set_IbopLed(.false.)
  307. call Set_TorqueWrenchLed(0) !Get_TorqueWrenchLed()
  308. !TdsPower_REV = 1
  309. !TdsPower_OFF = 0
  310. !TdsPower_FWD = -1
  311. !
  312. !TdsMu_TORQ = 1
  313. !TdsMu_SPINE = 0
  314. !TdsMu_DRILL = -1
  315. !
  316. !TdsLinkTilt_TILT = 1
  317. !TdsLinkTilt_OFF = 0
  318. !TdsLinkTilt_DRILL = -1
  319. !TDS IBOP TopDriveIbop
  320. !TDS LinkTilt TopDriveLinkTiltState
  321. !TDS MU TopDriveDrillTorqueState
  322. !TDS Power TopDriveTdsPowerState
  323. !TopDriveTorqueWrench PRESSED=True or UNPRESSED=Falses
  324. !Get_TdsConnectionPossible()
  325. !Get_TdsStemIn()
  326. !call Set_TdsStemJointHeight(v) !Get_TdsStemJointHeight()
  327. !Get_SwingDrillPermission()
  328. !Get_SwingOffPermission()
  329. !Get_SwingTiltPermission()
  330. !Get_FillupHeadPermission()
  331. call Set_TdsTong(TDS_TONG_BREAKOUT_END)
  332. !Get_TdsTong()
  333. !TDS_TONG_BREAKOUT_BEGIN
  334. !TDS_TONG_BREAKOUT_END
  335. !TDS_TONG_MAKEUP_BEGIN
  336. !TDS_TONG_MAKEUP_END
  337. call Set_TdsBackupClamp(BACKUP_CLAMP_OFF_END)
  338. !Get_TdsBackupClamp()
  339. !BACKUP_CLAMP_OFF_END
  340. !BACKUP_CLAMP_OFF_BEGIN
  341. !BACKUP_CLAMP_FW_BEGIN
  342. !BACKUP_CLAMP_FW_END
  343. call Set_TdsSwing(TDS_SWING_OFF_END)
  344. !Get_TdsSwing()
  345. !TDS_SWING_NEUTRAL
  346. !TDS_SWING_OFF_BEGIN
  347. !TDS_SWING_OFF_END
  348. !TDS_SWING_DRILL_BEGIN
  349. !TDS_SWING_DRILL_END
  350. !TDS_SWING_TILT_BEGIN
  351. !TDS_SWING_TILT_END
  352. call Set_TdsSpine(TDS_SPINE_NEUTRAL) !TDS_SPINE_DISCONNECT_END
  353. !Get_TdsSpine()
  354. !TDS_SPINE_NEUTRAL
  355. !TDS_SPINE_CONNECT_BEGIN
  356. !TDS_SPINE_CONNECT_END
  357. !TDS_SPINE_DISCONNECT_BEGIN
  358. !TDS_SPINE_DISCONNECT_END
  359. end subroutine
  360. subroutine SetDefaults_WN()
  361. !DEC$ ATTRIBUTES DLLEXPORT :: SetDefaults_WN
  362. !DEC$ ATTRIBUTES ALIAS: 'SetDefaults_WN' :: SetDefaults_WN
  363. implicit none
  364. call SetDefaultValues()
  365. end subroutine
  366. end module COperationScenariosSettings