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.i90 12 KiB

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