|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478 |
- module UnitySignalVariables
- use CVoidEventHandlerCollection
- use CIntegerEventHandlerCollection
-
- type:: UnitySignalsType
- integer :: MudBucket = 0
- type(VoidEventHandlerCollection) :: OnMudBucketChange
- integer :: Elevator = 0
- type(VoidEventHandlerCollection) :: OnElevatorChange
- integer :: FillupHead = 0
- type(VoidEventHandlerCollection) :: OnFillupHeadChange
- integer :: Ibop = 0
- type(VoidEventHandlerCollection) :: OnIbopChange
- integer :: Kelly = 0
- type(VoidEventHandlerCollection) :: OnKellyChange
- integer :: MouseHole = 0
- type(VoidEventHandlerCollection) :: OnMouseHoleChange
- integer :: OperationCondition = 0
- type(VoidEventHandlerCollection) :: OnOperationConditionChange
- type(IntegerEventHandlerCollection) :: OnOperationConditionChangeInt
- integer :: SafetyValve = 0
- type(VoidEventHandlerCollection) :: OnSafetyValveChange
- integer :: operation = 0
- integer :: Slips = 0
- integer :: Slips_S = 0
- type(VoidEventHandlerCollection) :: OnSlipsChange
- integer :: Swing = 0
- integer :: Swing_S = 0
- type(VoidEventHandlerCollection) :: OnSwingChange
- integer :: TdsBackupClamp = 0
- type(VoidEventHandlerCollection) :: OnTdsBackupClampChange
- integer :: TdsSpine = 0
- type(VoidEventHandlerCollection) :: OnTdsSpineChange
- integer :: TdsSwing = 0
- type(VoidEventHandlerCollection) :: OnTdsSwingChange
- integer :: TdsTong = 0
- type(VoidEventHandlerCollection) :: OnTdsTongChange
- integer :: Tong = 0
- integer :: Tong_S = 0
- type(VoidEventHandlerCollection) :: OnTongChange
- end type UnitySignalsType
- type(UnitySignalsType):: unitySignals
-
- enum, bind(c)
- enumerator TONG_NEUTRAL
- enumerator TONG_BREAKOUT_BEGIN
- enumerator TONG_BREAKOUT_END
- enumerator TONG_MAKEUP_BEGIN
- enumerator TONG_MAKEUP_END
-
- enumerator TDS_SWING_NEUTRAL
- enumerator TDS_SWING_OFF_BEGIN
- enumerator TDS_SWING_OFF_END
- enumerator TDS_SWING_DRILL_BEGIN
- enumerator TDS_SWING_DRILL_END
- enumerator TDS_SWING_TILT_BEGIN
- enumerator TDS_SWING_TILT_END
-
- enumerator TDS_SPINE_NEUTRAL
- enumerator TDS_SPINE_CONNECT_BEGIN
- enumerator TDS_SPINE_CONNECT_END
- enumerator TDS_SPINE_DISCONNECT_BEGIN
- enumerator TDS_SPINE_DISCONNECT_END
-
- enumerator BACKUP_CLAMP_OFF_END
- enumerator BACKUP_CLAMP_OFF_BEGIN
- enumerator BACKUP_CLAMP_FW_BEGIN
- enumerator BACKUP_CLAMP_FW_END
-
- enumerator SWING_NEUTRAL
- enumerator SWING_MOUSE_HOLE_BEGIN
- enumerator SWING_MOUSE_HOLE_END
- enumerator SWING_RAT_HOLE_BEGIN
- enumerator SWING_RAT_HOLE_END
- enumerator SWING_WELL_BEGIN
- enumerator SWING_WELL_END
- end enum
- enum, bind(c)
- enumerator TDS_TONG_BREAKOUT_END
- enumerator TDS_TONG_BREAKOUT_BEGIN
- enumerator TDS_TONG_MAKEUP_BEGIN
- enumerator TDS_TONG_MAKEUP_END
-
- enumerator SAFETY_VALVE_NEUTRAL
- enumerator SAFETY_VALVE_REMOVE
- enumerator SAFETY_VALVE_INSTALL
-
- end enum
- enum, bind(c)
- enumerator OPERATION_DRILL
- enumerator OPERATION_TRIP
- end enum
- enum, bind(c)
- enumerator SLIPS_NEUTRAL
- enumerator SLIPS_SET_BEGIN
- enumerator SLIPS_SET_END
- enumerator SLIPS_UNSET_BEGIN
- enumerator SLIPS_UNSET_END
-
- enumerator MOUSE_HOLE_NEUTRAL
- enumerator MOUSE_HOLE_FILL
- enumerator MOUSE_HOLE_EMPTY
-
- enumerator KELLY_NEUTRAL
- enumerator KELLY_INSTALL
- enumerator KELLY_REMOVE
-
- !enumerator FILLUP_HEAD_NEUTRAL
- enumerator FILLUP_HEAD_REMOVE
- enumerator FILLUP_HEAD_INSTALL
-
- enumerator ELEVATOR_NEUTRAL
-
- enumerator ELEVATOR_LATCH_STRING_BEGIN
- enumerator ELEVATOR_LATCH_STRING_END
-
- enumerator ELEVATOR_UNLATCH_STRING_BEGIN
- enumerator ELEVATOR_UNLATCH_STRING_END
-
- enumerator ELEVATOR_LATCH_STAND_BEGIN
- enumerator ELEVATOR_LATCH_STAND_END
-
- enumerator ELEVATOR_UNLATCH_STAND_BEGIN
- enumerator ELEVATOR_UNLATCH_STAND_END
-
- enumerator ELEVATOR_LATCH_SINGLE_BEGIN
- enumerator ELEVATOR_LATCH_SINGLE_END
-
- enumerator ELEVATOR_UNLATCH_SINGLE_BEGIN
- enumerator ELEVATOR_UNLATCH_SINGLE_END
-
- !enumerator MUD_BUCKET_NEUTRAL
- enumerator MUD_BUCKET_REMOVE
- enumerator MUD_BUCKET_INSTALL
-
- !enumerator IBOP_NEUTRAL
- enumerator IBOP_REMOVE
- enumerator IBOP_INSTALL
- end enum
-
- contains
-
- subroutine Set_Ibop_Install()
- implicit none
- call Set_Ibop(IBOP_INSTALL)
- end subroutine
-
- subroutine Set_Ibop_Remove()
- implicit none
- call Set_Ibop(IBOP_REMOVE)
- end subroutine
-
- subroutine Set_Tong(v)
- implicit none
- integer , intent(in) :: v
- #ifdef ExcludeExtraChanges
- if(UnitySignals%Tong == v) return
- #endif
- UnitySignals%Tong = v
- #ifdef deb
- print*, 'Tong=', UnitySignals%Tong
- #endif
- call UnitySignals%OnTongChange%RunAll()
- end subroutine
-
- integer function Get_Tong()
- implicit none
- Get_Tong = UnitySignals%Tong
- end function
-
-
- subroutine Set_TdsTong(v)
- implicit none
- integer , intent(in) :: v
- #ifdef ExcludeExtraChanges
- if(UnitySignals%TdsTong == v) return
- #endif
- UnitySignals%TdsTong = v
- #ifdef deb
- print*, 'TdsTong=', UnitySignals%TdsTong
- #endif
- call UnitySignals%OnTdsTongChange%RunAll()
- end subroutine
-
- integer function Get_TdsTong()
- implicit none
- Get_TdsTong = UnitySignals%TdsTong
- end function
-
-
- subroutine Set_TdsSwing(v)
- implicit none
- integer , intent(in) :: v
- #ifdef ExcludeExtraChanges
- if(UnitySignals%TdsSwing == v) return
- #endif
- UnitySignals%TdsSwing = v
- #ifdef deb
- print*, 'TdsSwing=', UnitySignals%TdsSwing
- #endif
- call UnitySignals%OnTdsSwingChange%RunAll()
- end subroutine
-
- integer function Get_TdsSwing()
- implicit none
- Get_TdsSwing = UnitySignals%TdsSwing
- end function
-
-
- subroutine Set_TdsSpine(v)
- implicit none
- integer , intent(in) :: v
- #ifdef ExcludeExtraChanges
- if(UnitySignals%TdsSpine == v) return
- #endif
- UnitySignals%TdsSpine = v
- #ifdef deb
- print*, 'TdsSpine=', UnitySignals%TdsSpine
- #endif
- call UnitySignals%OnTdsSpineChange%RunAll()
- end subroutine
-
- integer function Get_TdsSpine()
- implicit none
- Get_TdsSpine = UnitySignals%TdsSpine
- end function
-
-
- subroutine Set_TdsBackupClamp(v)
- implicit none
- integer , intent(in) :: v
- #ifdef ExcludeExtraChanges
- if(UnitySignals%TdsBackupClamp == v) return
- #endif
- UnitySignals%TdsBackupClamp = v
- #ifdef deb
- print*, 'TdsBackupClamp=', UnitySignals%TdsBackupClamp
- #endif
- call UnitySignals%OnTdsBackupClampChange%RunAll()
- end subroutine
-
- integer function Get_TdsBackupClamp()
- implicit none
- Get_TdsBackupClamp = UnitySignals%TdsBackupClamp
- end function
-
-
- subroutine Set_Swing(v)
- implicit none
- integer , intent(in) :: v
- #ifdef ExcludeExtraChanges
- if(UnitySignals%Swing == v) return
- #endif
- UnitySignals%Swing = v
- #ifdef deb
- print*, 'Swing=', UnitySignals%Swing
- #endif
- call UnitySignals%OnSwingChange%RunAll()
- end subroutine
-
- integer function Get_Swing()
- implicit none
- Get_Swing = UnitySignals%Swing
- end function
-
-
- subroutine Set_Slips(v)
- implicit none
- integer , intent(in) :: v
- #ifdef ExcludeExtraChanges
- if(UnitySignals%Slips == v) return
- #endif
- UnitySignals%Slips = v
- #ifdef deb
- print*, 'Slips=', UnitySignals%Slips
- #endif
- call UnitySignals%OnSlipsChange%RunAll()
- end subroutine
-
- integer function Get_Slips()
- implicit none
- Get_Slips = UnitySignals%Slips
- end function
-
- subroutine Set_Operation(i)
- implicit none
- integer, intent (in) :: i
- UnitySignals%operation = i
- end subroutine
-
- subroutine Set_SafetyValve(v)
- implicit none
- integer , intent(in) :: v
- #ifdef ExcludeExtraChanges
- if(UnitySignals%SafetyValve == v) return
- #endif
- UnitySignals%SafetyValve = v
- #ifdef deb
- if(UnitySignals%SafetyValve == SAFETY_VALVE_NEUTRAL) then
- print*, 'SafetyValve=SAFETY_VALVE_NEUTRAL'
- else if (UnitySignals%SafetyValve == SAFETY_VALVE_INSTALL) then
- print*, 'SafetyValve=SAFETY_VALVE_INSTALL'
- else if (UnitySignals%SafetyValve == SAFETY_VALVE_INSTALL) then
- print*, 'SafetyValve=SAFETY_VALVE_REMOVE'
- endif
- #endif
- call UnitySignals%OnSafetyValveChange%RunAll()
- end subroutine
-
- integer function Get_SafetyValve()
- implicit none
- Get_SafetyValve = UnitySignals%SafetyValve
- end function
-
- subroutine Set_SafetyValve_Install()
- implicit none
- call Set_SafetyValve(SAFETY_VALVE_INSTALL)
- end subroutine
-
- subroutine Set_SafetyValve_Remove()
- implicit none
- call Set_SafetyValve(SAFETY_VALVE_REMOVE)
- end subroutine
-
-
- subroutine Set_OperationCondition(v)
- ! use CKellyEnumVariables
- implicit none
- integer , intent(in) :: v
- #ifdef ExcludeExtraChanges
- if(UnitySignals%OperationCondition == v) return
- #endif
- UnitySignals%OperationCondition = v
- #ifdef deb
- print*, 'OperationCondition=', UnitySignals%OperationCondition
- #endif
- call UnitySignals%OnOperationConditionChange%RunAll()
- call UnitySignals%OnOperationConditionChangeInt%RunAll(UnitySignals%OperationCondition)
- end subroutine
-
- integer function Get_OperationCondition()
- implicit none
- Get_OperationCondition = UnitySignals%OperationCondition
- end function
-
-
- subroutine Set_MouseHole(v)
- implicit none
- integer , intent(in) :: v
- #ifdef ExcludeExtraChanges
- if(UnitySignals%MouseHole == v) return
- #endif
- !call sleep(2)
- UnitySignals%MouseHole = v
- #ifdef deb
- print*, 'MouseHole=', UnitySignals%MouseHole
- #endif
- call UnitySignals%OnMouseHoleChange%RunAll()
- end subroutine
-
- integer function Get_MouseHole()
- implicit none
- Get_MouseHole = UnitySignals%MouseHole
- end function
-
-
-
- subroutine Set_Kelly(v)
- implicit none
- integer , intent(in) :: v
- #ifdef ExcludeExtraChanges
- if(UnitySignals%Kelly == v) return
- #endif
- UnitySignals%Kelly = v
- #ifdef deb
- print*, 'Kelly=', UnitySignals%Kelly
- #endif
- call UnitySignals%OnKellyChange%RunAll()
- end subroutine
-
- integer function Get_Kelly()
- implicit none
- Get_Kelly = UnitySignals%Kelly
- end function
-
-
- subroutine Set_Ibop(v)
- implicit none
- integer , intent(in) :: v
- #ifdef ExcludeExtraChanges
- if(UnitySignals%Ibop == v) return
- #endif
- UnitySignals%Ibop = v
- #ifdef deb
- print*, 'Ibop=', UnitySignals%Ibop
- #endif
- call UnitySignals%OnIbopChange%RunAll()
- end subroutine
-
- integer function Get_Ibop()
- implicit none
- Get_Ibop = UnitySignals%Ibop
- end function
-
-
- subroutine Set_FillupHead(v)
- use CManifolds, only: ToggleFillupHead
- implicit none
- integer , intent(in) :: v
- #ifdef ExcludeExtraChanges
- if(UnitySignals%FillupHead == v) return
- #endif
- UnitySignals%FillupHead = v
-
- if (UnitySignals%FillupHead == FILLUP_HEAD_INSTALL) then
- call ToggleFillupHead(.true.)
- else if (UnitySignals%FillupHead == FILLUP_HEAD_REMOVE) then
- call ToggleFillupHead(.false.)
- endif
-
- #ifdef deb
- print*, 'FillupHead=', UnitySignals%FillupHead
- #endif
- call UnitySignals%OnFillupHeadChange%RunAll()
- end subroutine
-
- integer function Get_FillupHead()
- implicit none
- Get_FillupHead = UnitySignals%FillupHead
- end function
-
-
- subroutine Set_Elevator(v)
- implicit none
- integer , intent(in) :: v
- #ifdef ExcludeExtraChanges
- if(UnitySignals%Elevator == v) return
- #endif
- UnitySignals%Elevator = v
- #ifdef deb
- print*, 'Elevator=', UnitySignals%Elevator
- #endif
- call UnitySignals%OnElevatorChange%RunAll()
- end subroutine
-
- integer function Get_Elevator()
- implicit none
- Get_Elevator = UnitySignals%Elevator
- end function
-
-
-
- subroutine Set_MudBucket(v)
- use CManifolds, only: ToggleMudBox
- implicit none
- integer , intent(in) :: v
- #ifdef ExcludeExtraChanges
- if(UnitySignals%MudBucket == v) return
- #endif
- UnitySignals%MudBucket = v
- if (UnitySignals%MudBucket == MUD_BUCKET_INSTALL) then
- call ToggleMudBox(.true.)
- else if (UnitySignals%MudBucket == MUD_BUCKET_REMOVE) then
- call ToggleMudBox(.false.)
- endif
- #ifdef deb
- print*, 'MudBucket=', UnitySignals%MudBucket
- #endif
- call UnitySignals%OnMudBucketChange%RunAll()
- end subroutine
-
- integer function Get_MudBucket()
- implicit none
- Get_MudBucket = UnitySignals%MudBucket
- end function
-
-
- end module UnitySignalVariables
|