|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318 |
- module CTdsElevatorModesEnum
- use OperationScenariosModule
- use UnityModule
- implicit none
- contains
-
- subroutine Evaluate_TdsElevatorModes()
- use CCommon, only: SetStandRack
- implicit none
-
- if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then
- if(print_log) print*, 'Evaluate_TdsElevatorModes=TopDrive'
-
- !TOPDRIVE-CODE=7
- if (Get_Elevator() == ELEVATOR_LATCH_STRING_END .and.&
- Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_NOTHING .and.&
- Get_TdsSwing() == TDS_SWING_OFF_END ) then
-
- call Set_TdsElevatorModes(TDS_ELEVATOR_LATCH_STRING)
- call Set_Elevator(ELEVATOR_NEUTRAL)
- return
- end if
-
- !TOPDRIVE-CODE=8
- if (Get_HookHeight() <= (TL() + TJH() - data%State%OperationScenario%ECG) .and.&
- Get_ElevatorPickup() == .false. .and.&
- Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_STRING) then
-
- call Set_TdsElevatorModes(TDS_ELEVATOR_LATCH_STRING)
- return
- end if
-
-
-
- !TOPDRIVE-CODE=9
- if (Get_ElevatorPickup() .and.&
- Get_TdsElevatorModes() == TDS_ELEVATOR_LATCH_STRING) then
-
- call Set_TdsElevatorModes(TDS_ELEVATOR_CONNECTION_STRING)
- return
- end if
-
-
- !TOPDRIVE-CODE=10
- if (Get_Elevator() == ELEVATOR_UNLATCH_STRING_END .and.&
- Get_TdsElevatorModes() == TDS_ELEVATOR_LATCH_STRING) then
-
- call Set_TdsElevatorModes(TDS_ELEVATOR_CONNECTION_NOTHING)
- call Set_Elevator(ELEVATOR_NEUTRAL)
- return
- end if
-
-
-
-
- !TOPDRIVE-CODE=11
- if (Get_Elevator() == ELEVATOR_UNLATCH_STRING_END .and.&
- Get_TdsElevatorModes() == TDS_ELEVATOR_LATCH_STRING .and.&
- Get_TdsConnectionModes() == TDS_CONNECTION_STRING) then
-
- call Set_TdsElevatorModes(TDS_ELEVATOR_CONNECTION_NOTHING)
- call Set_Elevator(ELEVATOR_NEUTRAL)
- return
- end if
-
-
-
-
-
- !TOPDRIVE-CODE=12
- if (Get_Elevator() == ELEVATOR_LATCH_STAND_END .and.&
- Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_NOTHING) then
-
- call Set_TdsElevatorModes(TDS_ELEVATOR_CONNECTION_STAND)
- call Set_Elevator(ELEVATOR_NEUTRAL)
- call SetStandRack(Get_StandRack() - 1)
- return
- end if
-
-
-
-
- !TOPDRIVE-CODE=13
- if (Get_Elevator() == ELEVATOR_UNLATCH_STAND_END .and.&
- Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_STAND) then
-
- call Set_TdsElevatorModes(TDS_ELEVATOR_CONNECTION_NOTHING)
- call Set_Elevator(ELEVATOR_NEUTRAL)
- call SetStandRack(Get_StandRack() + 1)
- return
- end if
-
-
-
-
- !TOPDRIVE-CODE=14
- if (Get_Elevator() == ELEVATOR_LATCH_SINGLE_END .and.&
- Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_NOTHING .and.&
- Get_TdsSwing() == TDS_SWING_TILT_END .and.&
- Get_FillMouseHoleLed()) then
-
- call Set_TdsElevatorModes(TDS_ELEVATOR_CONNECTION_SINGLE)
- call Set_Elevator(ELEVATOR_NEUTRAL)
- call Set_UnlatchLed(.true.)
- call Set_FillMouseHoleLed(.false.)
- call Set_MouseHole(MOUSE_HOLE_NEUTRAL)
- return
- end if
-
-
-
-
-
- !TOPDRIVE-CODE=15
- if (Get_Elevator() == ELEVATOR_UNLATCH_SINGLE_END .and.&
- Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_SINGLE .and.&
- Get_TdsSwing() == TDS_SWING_TILT_END .and.&
- Get_FillMouseHoleLed() == .false.) then
-
- call Set_TdsElevatorModes(TDS_ELEVATOR_CONNECTION_NOTHING)
- call Set_Elevator(ELEVATOR_NEUTRAL)
- call Set_UnlatchLed(.false.)
- call Set_FillMouseHoleLed(.true.)
- call Set_MouseHole(MOUSE_HOLE_NEUTRAL)
- return
- end if
-
-
-
- !TOPDRIVE-CODE=16
- if (Get_HookHeight() <= (TL() + NFC() + data%State%OperationScenario%PL - data%State%OperationScenario%ECG) .and.&
- Get_Tong() == TONG_BREAKOUT_END .and.&
- Get_TdsElevatorModes() == TDS_ELEVATOR_LATCH_STRING .and.&
- Get_TdsConnectionModes() == TDS_CONNECTION_NOTHING) then
-
- call Set_TdsElevatorModes(TDS_ELEVATOR_LATCH_SINGLE)
- call Set_Tong(TONG_NEUTRAL)
- call Set_StringUpdate(STRING_UPDATE_REMOVE_SINGLE)
- return
- end if
-
-
-
-
- !TOPDRIVE-CODE=17
- if (Get_HookHeight() <= (TL() + NFC() + data%State%OperationScenario%PL - data%State%OperationScenario%ECG) .and.&
- Get_Tong() == TONG_BREAKOUT_END .and.&
- Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_STRING .and.&
- Get_TdsConnectionModes() == TDS_CONNECTION_NOTHING) then
-
- call Set_TdsElevatorModes(TDS_ELEVATOR_CONNECTION_SINGLE)
- call Set_Tong(TONG_NEUTRAL)
- call Set_StringUpdate(STRING_UPDATE_REMOVE_SINGLE)
- return
- end if
-
-
-
- !TOPDRIVE-CODE=18
- if (Get_ElevatorPickup() .and.&
- Get_TdsElevatorModes() == TDS_ELEVATOR_LATCH_SINGLE) then
-
- call Set_TdsElevatorModes(TDS_ELEVATOR_CONNECTION_SINGLE)
- return
- end if
-
-
-
-
- !TOPDRIVE-CODE=19
- if (Get_HookHeight() <= (TL() + NFC() + data%State%OperationScenario%PL - data%State%OperationScenario%ECG) .and.&
- Get_ElevatorPickup() == .false. .and.&
- Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_SINGLE) then
-
- call Set_TdsElevatorModes(TDS_ELEVATOR_LATCH_SINGLE)
-
- return
- end if
-
-
-
-
-
-
- !TOPDRIVE-CODE=20
- if (Get_Tong() == TONG_MAKEUP_END .and.&
- Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_SINGLE) then
-
- call Set_TdsElevatorModes(TDS_ELEVATOR_CONNECTION_STRING)
- call Set_Tong(TONG_NEUTRAL)
- call Set_StringUpdate(STRING_UPDATE_ADD_SINGLE)
- return
- end if
-
-
-
-
- !TOPDRIVE-CODE=21
- if (Get_Tong() == TONG_MAKEUP_END .and.&
- Get_TdsElevatorModes() == TDS_ELEVATOR_LATCH_SINGLE) then
-
- call Set_TdsElevatorModes(TDS_ELEVATOR_LATCH_STRING)
- call Set_Tong(TONG_NEUTRAL)
- call Set_StringUpdate(STRING_UPDATE_ADD_SINGLE)
- return
- end if
-
-
-
- !TOPDRIVE-CODE=22
- if (Get_HookHeight() <= (TL() + NFC() + data%State%OperationScenario%SL - data%State%OperationScenario%ECG) .and.&
- Get_Tong() == TONG_BREAKOUT_END .and.&
- Get_TdsElevatorModes() == TDS_ELEVATOR_LATCH_STRING .and.&
- Get_TdsConnectionModes() == TDS_CONNECTION_NOTHING) then
-
- call Set_TdsElevatorModes(TDS_ELEVATOR_LATCH_STAND)
- call Set_Tong(TONG_NEUTRAL)
- call Set_StringUpdate(STRING_UPDATE_REMOVE_STAND)
- return
- end if
-
-
-
- !TOPDRIVE-CODE=23
- if (Get_HookHeight() <= (TL() + NFC() + data%State%OperationScenario%SL - data%State%OperationScenario%ECG) .and.&
- Get_Tong() == TONG_BREAKOUT_END .and.&
- Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_STRING .and.&
- Get_TdsConnectionModes() == TDS_CONNECTION_NOTHING) then
-
- call Set_TdsElevatorModes(TDS_ELEVATOR_CONNECTION_STAND)
- call Set_Tong(TONG_NEUTRAL)
- call Set_StringUpdate(STRING_UPDATE_REMOVE_STAND)
- return
- end if
-
-
-
- !TOPDRIVE-CODE=24
- if (Get_ElevatorPickup() .and.&
- Get_TdsElevatorModes() == TDS_ELEVATOR_LATCH_STAND) then
-
- call Set_TdsElevatorModes(TDS_ELEVATOR_CONNECTION_STAND)
- return
- end if
-
-
-
-
-
- !TOPDRIVE-CODE=25
- if (Get_HookHeight() <= (TL() + NFC() + data%State%OperationScenario%SL - data%State%OperationScenario%ECG) .and.&
- Get_ElevatorPickup() == .false. .and.&
- Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_STAND) then
-
- call Set_TdsElevatorModes(TDS_ELEVATOR_LATCH_STAND)
- return
- end if
-
-
-
-
- !TOPDRIVE-CODE=26
- if (Get_Tong() == TONG_MAKEUP_END .and.&
- Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_STAND) then
-
- call Set_TdsElevatorModes(TDS_ELEVATOR_CONNECTION_STRING)
- call Set_Tong(TONG_NEUTRAL)
- call Set_StringUpdate(STRING_UPDATE_ADD_STAND)
- return
- end if
-
-
-
-
-
-
-
-
-
- !TOPDRIVE-CODE=27
- if (Get_Tong() == TONG_MAKEUP_END .and.&
- Get_TdsElevatorModes() == TDS_ELEVATOR_LATCH_STAND) then
-
- call Set_TdsElevatorModes(TDS_ELEVATOR_LATCH_STRING)
- call Set_Tong(TONG_NEUTRAL)
- call Set_StringUpdate(STRING_UPDATE_ADD_STAND)
- return
- end if
-
-
-
-
-
-
-
-
-
-
-
- endif
-
- ! if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then
- ! if(print_log) print*, 'Evaluate_TdsElevatorModes=Kelly'
- ! endif
-
-
-
-
- end subroutine
-
- subroutine Subscribe_TdsElevatorModes()
- use CDrillingConsoleVariables
- use SimulationVariables
- use SimulationVariables
- implicit none
- end subroutine
-
- end module CTdsElevatorModesEnum
|