Simulation Core
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
 
 
 
 
 
 

489 рядки
15 KiB

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