|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488 |
- module COperationScenariosSettings
- implicit none
- public
- contains
-
- !subroutine Initialization()
- ! use CSimulationVariables
- ! use CUnityOutputs, only: SetupUnityOutputs => Setup
- !
- ! use CBucketEnum
- ! use CTongEnum
- ! use CSwingEnum
- ! use CSlipsEnum
- ! use CSafetyValveEnum
- ! use COperationConditionEnum
- ! use CMouseHoleEnum
- ! use CKellyEnum
- ! use CKellyConnectionEnum
- ! use CIbopEnum
- ! use CHeadEnum
- ! use CElevatorEnum
- ! use CElevatorConnectionEnum
- !
- ! use CInstallFillupHeadPermission
- ! use CInstallMudBucketPermission
- ! use CIrIbopPermission
- ! use CIrSafetyValvePermission
- ! use CRemoveFillupHeadPermission
- ! use CRemoveMudBucketPermission
- !
- ! use CCloseKellyCockLedNotification
- ! use CCloseSafetyValveLedNotification
- ! use CFillMouseHoleLedNotification
- ! use CIrIBopLedNotification
- ! use CIrSafetyValveLedNotification
- ! use CLatchLedNotification
- ! use COpenKellyCockLedNotification
- ! use COpenSafetyValveLedNotification
- ! use CSlipsNotification
- ! use CSwingLedNotification
- ! use CTongNotification
- ! use CUnlatchLedNotification
- !
- ! use CHookHeight
- ! use CIbopHeight
- ! use CNearFloorConnection
- ! use CSafetyValveHeight
- ! use CSlackOff
- ! use CStandRack
- ! use CStringPressure
- ! use CZeroStringSpeed
- !
- ! use CStringUpdate
- !
- ! use CFlowPipeDisconnectEnum
- ! use CFlowKellyDisconnectEnum
- !
- ! use CFillupHeadPermission
- ! use CSwingDrillPermission
- ! use CSwingOffPermission
- ! use CSwingTiltPermission
- ! use CTdsStemJointHeight
- ! use CTdsConnectionModesEnum
- ! use CTdsElevatorModesEnum
- ! use CTdsSpineEnum
- ! use CTdsSwingEnum
- ! use CTdsTongEnum
- ! use CTdsBackupClamp
- !
- ! use CTdsIbopLedNotification
- ! use CTdsPowerLedNotification
- !
- ! use CTdsTorqueWrenchLedNotification
- !
- ! implicit none
- !
- ! call SetupUnityOutputs()
- !
- ! call Subscribe_Tong()
- ! call Subscribe_MudBucket()
- ! call Subscribe_ElevatorConnection()
- ! call Subscribe_Elevator()
- ! call Subscribe_FillupHead()
- ! call Subscribe_Ibop()
- ! call Subscribe_KellyConnection()
- ! call Subscribe_Kelly()
- ! call Subscribe_MouseHole()
- ! call Subscribe_OperationCondition()
- ! call Subscribe_SafetyValve()
- ! call Subscribe_Slips()
- ! call Subscribe_Swing()
- !
- !
- ! call Subscribe_InstallFillupHeadPermission()
- ! call Subscribe_InstallMudBucketPermission()
- ! call Subscribe_IrIbopPermission()
- ! call Subscribe_IrSafetyValvePermission()
- ! call Subscribe_RemoveFillupHeadPermission()
- ! call Subscribe_RemoveMudBucketPermission()
- !
- ! call Subscribe_CloseKellyCockLed()
- ! call Subscribe_CloseSafetyValveLed()
- ! call Subscribe_FillMouseHoleLed()
- ! call Subscribe_IrIBopLed()
- ! call Subscribe_IrSafetyValveLed()
- ! call Subscribe_LatchLed()
- ! call Subscribe_OpenKellyCockLed()
- ! call Subscribe_OpenSafetyValveLed()
- ! call Subscribe_SlipsNotification()
- ! call Subscribe_SwingLed()
- ! call Subscribe_UnlatchLed()
- !
- ! call Subscribe_HookHeight()
- ! call Subscribe_IbopHeight()
- ! call Subscribe_NearFloorConnection()
- ! call Subscribe_SafetyValveHeight()
- ! call Subscribe_SlackOff()
- ! call Subscribe_StringPressure()
- ! call Subscribe_ZeroStringSpeed()
- ! call Subscribe_StandRack()
- !
- ! call Subscribe_StringUpdate()
- !
- ! call Subscribe_TongNotification()
- !
- ! call Subscribe_FlowKellyDisconnect()
- ! call Subscribe_FlowPipeDisconnect()
- !
- !
- !
- !
- !
- ! !top drive
- ! call Subscribe_TdsConnectionModes()
- ! call Subscribe_TdsElevatorModes()
- ! call Subscribe_FillupHeadPermission()
- ! call Subscribe_SwingDrillPermission()
- ! call Subscribe_SwingOffPermission()
- ! call Subscribe_SwingTiltPermission()
- ! call Subscribe_TdsStemJointHeight()
- ! call Subscribe_TdsTong()
- ! call Subscribe_TdsBackupClamp()
- ! call Subscribe_TdsSwing()
- ! call Subscribe_TdsSpine()
- ! call Subscribe_PowerLed()
- ! call Subscribe_IbopLed()
- !
- ! call Subscribe_TorqueWrenchLed()
- !
- !
- ! call OnSimulationStart%Add(SetDefaultValues)
- !
- !end subroutine
-
- subroutine SetDefaultValues()
- use COperationScenariosVariables
- use CHoistingVariables, only: DriveType, TopDrive_DriveType
- use CManifolds, only: RemoveSafetyValve_TripMode, RemoveSafetyValve_KellyMode
- implicit none
-
- call Set_KellyConnection(KELLY_CONNECTION_NOTHING)
- !Get_KellyConnection()
- !KELLY_CONNECTION_NOTHING
- !KELLY_CONNECTION_STRING
- !KELLY_CONNECTION_SINGLE
- call Set_ElevatorConnection(ELEVATOR_CONNECTION_NOTHING)
- !Get_ElevatorConnection()
- !ELEVATOR_CONNECTION_NOTHING
- !ELEVATOR_CONNECTION_STRING
- !ELEVATOR_CONNECTION_STAND
- !ELEVATOR_CONNECTION_SINGLE
- !ELEVATOR_LATCH_STRING
- !ELEVATOR_LATCH_SINGLE
- !ELEVATOR_LATCH_STAND
-
-
-
-
-
-
-
-
- call Set_CloseKellyCockLed(.false.) !Get_CloseKellyCockLed()
- call Set_CloseSafetyValveLed(.false.) !Get_CloseSafetyValveLed()
- call Set_FillMouseHoleLed(.true.) !Get_FillMouseHoleLed()
- call Set_IrIBopLed(.false.) !Get_IrIBopLed()
- !call Set_IrSafetyValveLed(.true.) !Get_IrSafetyValveLed()
- if(DriveType == TopDrive_DriveType) then
- call RemoveSafetyValve_TripMode()
- call RemoveSafetyValve_KellyMode()
- call Set_IrSafetyValveLed(.false.)
- else
- call Set_IrSafetyValveLed(.true.)
- endif
- call Set_LatchLed(.false.) !Get_LatchLed()
- call Set_OpenKellyCockLed(.true.) !Get_OpenKellyCockLed()
- call Set_OpenSafetyValveLed(.true.) !Get_OpenSafetyValveLed()
- call Set_SlipsNotification(.false.) !Get_SlipsNotification()
- call Set_SwingLed(.false.) !Get_SwingLed()
- call Set_TongNotification(.false.) !Get_TongNotification()
- call Set_UnlatchLed(.false.) !Get_UnlatchLed()
-
-
-
-
-
-
-
- call Set_InstallFillupHeadPermission(.false.) !Get_InstallFillupHeadPermission()
- call Set_InstallMudBucketPermission(.false.) !Get_InstallMudBucketPermission()
- call Set_IrIbopPermission(.false.) !Get_IrIbopPermission()
- call Set_IrSafetyValvePermission(.false.) !Get_IrSafetyValvePermission()
- call Set_RemoveFillupHeadPermission(.false.) !Get_RemoveFillupHeadPermission()
- call Set_RemoveMudBucketPermission(.false.) !Get_RemoveMudBucketPermission()
-
-
-
-
-
-
-
-
-
- !call Set_HookHeight(REAL(70.0, 8)) !Get_HookHeight()
- call Set_IbopHeight(3.0) !Get_IbopHeight()
- !call Set_NearFloorConnection(3.0) !Get_NearFloorConnection()
- call Set_SafetyValveHeight(3.0) !Get_SafetyValveHeight()
- call Set_SlackOff(.true.) !Get_SlackOff()
- !call Set_StandRack(0.0) !Get_StandRack()
- !call Set_StringPressure(0.0) !Get_StringPressure()
- !call Set_ZeroStringSpeed(.true.) !Get_ZeroStringSpeed()
-
-
-
-
-
-
-
-
- !Get_ElevatorConnected()
- !Get_JointConnection()
- !Get_NearMonkeyBoardPosition()
- !Get_NearFloorPosition()
- !Get_SingleSetInMouseHole()
- !Get_SwingCenter()
-
-
-
-
-
-
- call Set_MudBucket(MUD_BUCKET_REMOVE)
- !Get_MudBucket()
- !MUD_BUCKET_INSTALL
- !MUD_BUCKET_REMOVE
-
- call Set_Elevator(ELEVATOR_NEUTRAL)
- ! Get_Elevator()
- !ELEVATOR_NEUTRAL
- !ELEVATOR_LATCH_STRING_BEGIN
- !ELEVATOR_LATCH_STRING_END
- !ELEVATOR_UNLATCH_STRING_BEGIN
- !ELEVATOR_UNLATCH_STRING_END
- !ELEVATOR_LATCH_STAND_BEGIN
- !ELEVATOR_LATCH_STAND_END
- !ELEVATOR_UNLATCH_STAND_BEGIN
- !ELEVATOR_UNLATCH_STAND_END
- !ELEVATOR_LATCH_SINGLE_BEGIN
- !ELEVATOR_LATCH_SINGLE_END
- !ELEVATOR_UNLATCH_SINGLE_BEGIN
- !ELEVATOR_UNLATCH_SINGLE_END
-
- call Set_FillupHead(FILLUP_HEAD_REMOVE)
- !Get_FillupHead()
- !FILLUP_HEAD_INSTALL
- !FILLUP_HEAD_REMOVE
-
- call Set_Ibop(IBOP_REMOVE)
- !Get_Ibop()
- !IBOP_INSTALL
- !IBOP_REMOVE
-
- call Set_Kelly(KELLY_INSTALL)
- !Get_Kelly()
- !KELLY_NEUTRAL
- !KELLY_INSTALL
- !KELLY_REMOVE
-
- call Set_MouseHole(MOUSE_HOLE_FILL)
- !Get_MouseHole()
- !MOUSE_HOLE_NEUTRAL
- !MOUSE_HOLE_FILL
- !MOUSE_HOLE_EMPTY
-
- call Set_OperationCondition(OPERATION_DRILL)
- !Get_OperationCondition()
- !OPERATION_DRILL
- !OPERATION_TRIP
-
-
- call Set_SafetyValve(SAFETY_VALVE_INSTALL)
- !Get_SafetyValve()
- !SAFETY_VALVE_INSTALL
- !SAFETY_VALVE_REMOVE
- if(DriveType == TopDrive_DriveType) call Set_SafetyValve(SAFETY_VALVE_REMOVE)
-
- call Set_Slips(SLIPS_SET_BEGIN)
- !Get_Slips()
- !SLIPS_NEUTRAL
- !SLIPS_SET_BEGIN
- !SLIPS_SET_END
- !SLIPS_UNSET_BEGIN
- !SLIPS_UNSET_END
-
- call Set_Swing(SWING_WELL_BEGIN)
- !Get_Swing()
- !SWING_NEUTRAL
- !SWING_MOUSE_HOLE_BEGIN
- !SWING_MOUSE_HOLE_END
- !SWING_RAT_HOLE_BEGIN
- !SWING_RAT_HOLE_END
- !SWING_WELL_BEGIN
- !SWING_WELL_END
-
- call Set_Tong(TONG_NEUTRAL)
- !Get_Tong()
- !TONG_NEUTRAL
- !TONG_BREAKOUT_BEGIN
- !TONG_BREAKOUT_END
- !TONG_MAKEUP_BEGIN
- !TONG_MAKEUP_END
-
-
- call Set_StringUpdate(STRING_UPDATE_NEUTRAL)
- !Get_StringUpdate()
- !STRING_UPDATE_NEUTRAL
- !STRING_UPDATE_ADD_SINGLE
- !STRING_UPDATE_ADD_STAND
- !STRING_UPDATE_REMOVE_SINGLE
- !STRING_UPDATE_REMOVE_STAND
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- call Set_TdsElevatorModes(TDS_ELEVATOR_CONNECTION_NOTHING)
- !Get_TdsElevatorModes()
- !TDS_ELEVATOR_CONNECTION_NOTHING
- !TDS_ELEVATOR_CONNECTION_STRING
- !TDS_ELEVATOR_CONNECTION_SINGLE
- !TDS_ELEVATOR_CONNECTION_STAND
- !TDS_ELEVATOR_LATCH_STRING
- !TDS_ELEVATOR_LATCH_SINGLE
- !TDS_ELEVATOR_LATCH_STAND
-
-
-
-
-
- call Set_TdsConnectionModes(TDS_CONNECTION_NOTHING)
- !Get_TdsConnectionModes()
- !TDS_CONNECTION_NOTHING
- !TDS_CONNECTION_STRING
- !TDS_CONNECTION_SPINE
-
-
-
-
- call Set_SwingTiltPermission(.false.) !Get_SwingTiltPermission()
- call Set_SwingOffPermission(.false.) !Get_SwingOffPermission()
- call Set_SwingDrillPermission(.false.) !Get_SwingDrillPermission()
- call Set_FillupHeadPermission(.false.) !Get_FillupHeadPermission()
-
- call Set_PowerLed(.false.)
- call Set_IbopLed(.false.)
-
- call Set_TorqueWrenchLed(0) !Get_TorqueWrenchLed()
-
-
- !TdsPower_REV = 1
- !TdsPower_OFF = 0
- !TdsPower_FWD = -1
- !
- !TdsMu_TORQ = 1
- !TdsMu_SPINE = 0
- !TdsMu_DRILL = -1
- !
- !TdsLinkTilt_TILT = 1
- !TdsLinkTilt_OFF = 0
- !TdsLinkTilt_DRILL = -1
-
- !TDS IBOP TopDriveIbop
- !TDS LinkTilt TopDriveLinkTiltState
- !TDS MU TopDriveDrillTorqueState
- !TDS Power TopDriveTdsPowerState
-
- !TopDriveTorqueWrench PRESSED=True or UNPRESSED=Falses
-
- !Get_TdsConnectionPossible()
- !Get_TdsStemIn()
-
- !call Set_TdsStemJointHeight(v) !Get_TdsStemJointHeight()
-
-
- !Get_SwingDrillPermission()
- !Get_SwingOffPermission()
- !Get_SwingTiltPermission()
- !Get_FillupHeadPermission()
-
- call Set_TdsTong(TDS_TONG_BREAKOUT_END)
- !Get_TdsTong()
- !TDS_TONG_BREAKOUT_BEGIN
- !TDS_TONG_BREAKOUT_END
- !TDS_TONG_MAKEUP_BEGIN
- !TDS_TONG_MAKEUP_END
-
-
- call Set_TdsBackupClamp(BACKUP_CLAMP_OFF_END)
- !Get_TdsBackupClamp()
- !BACKUP_CLAMP_OFF_END
- !BACKUP_CLAMP_OFF_BEGIN
- !BACKUP_CLAMP_FW_BEGIN
- !BACKUP_CLAMP_FW_END
-
-
- call Set_TdsSwing(TDS_SWING_OFF_END)
- !Get_TdsSwing()
- !TDS_SWING_NEUTRAL
- !TDS_SWING_OFF_BEGIN
- !TDS_SWING_OFF_END
- !TDS_SWING_DRILL_BEGIN
- !TDS_SWING_DRILL_END
- !TDS_SWING_TILT_BEGIN
- !TDS_SWING_TILT_END
-
-
-
-
-
- call Set_TdsSpine(TDS_SPINE_NEUTRAL) !TDS_SPINE_DISCONNECT_END
- !Get_TdsSpine()
- !TDS_SPINE_NEUTRAL
- !TDS_SPINE_CONNECT_BEGIN
- !TDS_SPINE_CONNECT_END
- !TDS_SPINE_DISCONNECT_BEGIN
- !TDS_SPINE_DISCONNECT_END
-
-
-
-
-
-
-
-
-
-
-
- end subroutine
-
- subroutine SetDefaults_WN()
- !DEC$ ATTRIBUTES DLLEXPORT :: SetDefaults_WN
- !DEC$ ATTRIBUTES ALIAS: 'SetDefaults_WN' :: SetDefaults_WN
- implicit none
- call SetDefaultValues()
- end subroutine
-
- end module COperationScenariosSettings
|