|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287 |
- module CTongNotification
- use COperationScenariosVariables
- implicit none
- contains
-
- subroutine Evaluate_TongNotification()
- implicit none
-
-
-
-
-
- if (Hoisting%DriveType == TopDrive_DriveType) then
- #ifdef OST
- print*, 'Evaluate_TongNotification=TopDrive'
- #endif
-
-
-
-
- !TOPDRIVE-CODE=50
- if (((Get_HookHeight() >= (TL() + PL - ECG + NFC() - RE) .and. Get_HookHeight() <= (TL() + NFC() + PL - ECG + TG)) .or.&
- (Get_HookHeight() >= (TL() + SL - ECG + NFC() - RE) .and. Get_HookHeight() <= (TL() + NFC() + SL - ECG + TG))).and.&
- GetRotaryRpm() == 0.0d0 .and.&
- Get_NearFloorConnection() >= 3.0 .and. Get_NearFloorConnection() <= 6.0 .and.&
- ((Get_Tong() /= TONG_BREAKOUT_BEGIN .and.&
- Get_Tong() /= TONG_MAKEUP_BEGIN) .or.&
- Get_Tong() == TONG_NEUTRAL ) .and.&
- (Get_TdsElevatorModes() == TDS_ELEVATOR_LATCH_STRING .or. Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_STRING) .and.&
- Get_TdsSwing() == TDS_SWING_OFF_END .and.&
- Get_Slips() == SLIPS_SET_END) then
-
- call Set_TongNotification(.true.)
- return
- end if
-
-
-
-
-
- !TOPDRIVE-CODE=51
- if (GetRotaryRpm() == 0.0d0 .and.&
- Get_JointConnectionPossible() .and.&
- (Get_Tong() /= TONG_BREAKOUT_BEGIN .and.&
- Get_Tong() /= TONG_MAKEUP_BEGIN) .and.&
- (Get_TdsElevatorModes() == TDS_ELEVATOR_LATCH_SINGLE .or. Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_SINGLE) .and.&
- Get_TdsSwing() == TDS_SWING_OFF_END .and.&
- Get_Slips() == SLIPS_SET_END) then
-
- call Set_TongNotification(.true.)
- return
- end if
-
-
-
-
-
-
-
-
- !TOPDRIVE-CODE=52
- if (GetRotaryRpm() == 0.0d0 .and.&
- Get_JointConnectionPossible() .and.&
- (Get_Tong() /= TONG_BREAKOUT_BEGIN .and.&
- Get_Tong() /= TONG_MAKEUP_BEGIN) .and.&
- (Get_TdsElevatorModes() == TDS_ELEVATOR_LATCH_STAND .or. Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_STAND) .and.&
- Get_TdsSwing() == TDS_SWING_OFF_END .and.&
- Get_Slips() == SLIPS_SET_END) then
-
- call Set_TongNotification(.true.)
- return
- end if
-
-
-
-
-
- endif
-
-
-
-
-
-
-
-
-
-
- if (Hoisting%DriveType == Kelly_DriveType) then
- #ifdef OST
- print*, 'Evaluate_TongNotification=Kelly'
- #endif
-
- !OPERATION-CODE=44
- if (Get_OperationCondition() == OPERATION_DRILL .and.&
- !((Get_HookHeight() >= 65.0 .and. Get_HookHeight() <= 70.0) .or.&
- ! (Get_HookHeight() >= 96.0 .and. Get_HookHeight() <= 101.0)).and.&
- ((Get_HookHeight() >= (HKL + Get_NearFloorConnection() - RE) .and. Get_HookHeight() <= (HKL + Get_NearFloorConnection() + TG)) .or.&
- (Get_HookHeight() >= (HKL + Get_NearFloorConnection() + PL -RE) .and. Get_HookHeight() <= (HKL + Get_NearFloorConnection() + TG + PL))).and.&
- GetRotaryRpm() == 0.0d0 .and.&
- Get_KellyConnection() == KELLY_CONNECTION_STRING .and.&
- Get_NearFloorConnection() >= 3.0 .and. Get_NearFloorConnection() <= 6.0 .and.&
- Get_Swing() == SWING_WELL_END .and.&
- (Get_Tong() /= TONG_BREAKOUT_BEGIN .and.&
- Get_Tong() /= TONG_MAKEUP_BEGIN) .and.&
- Get_Slips() == SLIPS_SET_END) then
-
- call Set_TongNotification(.true.)
- return
- end if
-
-
-
-
- !OPERATION-CODE=45
- if (Get_OperationCondition() == OPERATION_DRILL .and.&
- Get_HookHeight() >= 66 .and. Get_HookHeight() <= 69 .and.&
- Get_KellyConnection() == KELLY_CONNECTION_SINGLE .and.&
- (Get_Tong() /= TONG_BREAKOUT_BEGIN .and.&
- Get_Tong() /= TONG_MAKEUP_BEGIN) .and.&
- Get_Swing() == SWING_MOUSE_HOLE_END) then
-
- call Set_TongNotification(.true.)
- return
- end if
-
-
-
- !OPERATION-CODE=46
- if (Get_OperationCondition() == OPERATION_DRILL .and.&
- Get_JointConnectionPossible() .and.&
- Get_KellyConnection() == KELLY_CONNECTION_NOTHING .and.&
- (Get_Tong() /= TONG_BREAKOUT_BEGIN .and.&
- Get_Tong() /= TONG_MAKEUP_BEGIN) .and.&
- Get_Swing() == SWING_MOUSE_HOLE_END) then
-
- call Set_TongNotification(.true.)
- return
- end if
-
-
-
-
- !OPERATION-CODE=47
- if (Get_OperationCondition() == OPERATION_DRILL .and.&
- GetRotaryRpm() == 0.0d0 .and.&
- Get_JointConnectionPossible() .and.&
- Get_KellyConnection() == KELLY_CONNECTION_NOTHING .and.&
- (Get_Tong() /= TONG_BREAKOUT_BEGIN .and.&
- Get_Tong() /= TONG_MAKEUP_BEGIN) .and.&
- Get_Swing() == SWING_WELL_END .and.&
- Get_Slips() == SLIPS_SET_END) then
-
- call Set_TongNotification(.true.)
- return
- end if
-
-
-
-
-
- !OPERATION-CODE=48
- if (Get_OperationCondition() == OPERATION_DRILL .and.&
- GetRotaryRpm() == 0.0d0 .and.&
- Get_JointConnectionPossible() .and.&
- Get_KellyConnection() == KELLY_CONNECTION_SINGLE .and.&
- (Get_Tong() /= TONG_BREAKOUT_BEGIN .and.&
- Get_Tong() /= TONG_MAKEUP_BEGIN) .and.&
- Get_Swing() == SWING_WELL_END .and.&
- Get_Slips() == SLIPS_SET_END) then
-
- call Set_TongNotification(.true.)
- return
- end if
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- !OPERATION-CODE=50
- if (Get_OperationCondition() == OPERATION_TRIP .and.&
- ((Get_HookHeight() >= (HL + PL - ECG + Get_NearFloorConnection() - RE) .and. Get_HookHeight() <= (HL + Get_NearFloorConnection() + PL - ECG + TG)) .or.&
- (Get_HookHeight() >= (HL + SL - ECG + Get_NearFloorConnection() - RE) .and. Get_HookHeight() <= (HL + Get_NearFloorConnection() + TG - ECG + SL))).and.&
- Get_NearFloorConnection() >= 3.0 .and. Get_NearFloorConnection() <= 6.0 .and.&
- GetRotaryRpm() == 0.0d0 .and.&
- Get_ElevatorConnection() == ELEVATOR_CONNECTION_STRING .and.&
- (Get_Tong() /= TONG_BREAKOUT_BEGIN .and.&
- Get_Tong() /= TONG_MAKEUP_BEGIN) .and.&
- Get_Swing() == SWING_WELL_END .and.&
- Get_Slips() == SLIPS_SET_END) then
-
- call Set_TongNotification(.true.)
- return
- end if
-
-
-
-
-
- !OPERATION-CODE=51
- if (Get_OperationCondition() == OPERATION_TRIP .and.&
- GetRotaryRpm() == 0.0d0 .and.&
- Get_JointConnectionPossible() .and.&
- Get_ElevatorConnection() == ELEVATOR_CONNECTION_SINGLE .and.&
- (Get_Tong() /= TONG_BREAKOUT_BEGIN .and.&
- Get_Tong() /= TONG_MAKEUP_BEGIN) .and.&
- Get_Swing() == SWING_WELL_END .and.&
- Get_Slips() == SLIPS_SET_END) then
-
- call Set_TongNotification(.true.)
- return
- end if
-
-
-
-
-
- !OPERATION-CODE=52
- if (Get_OperationCondition() == OPERATION_TRIP .and.&
- GetRotaryRpm() == 0.0d0 .and.&
- Get_JointConnectionPossible() .and.&
- Get_ElevatorConnection() == ELEVATOR_CONNECTION_STAND .and.&
- (Get_Tong() /= TONG_BREAKOUT_BEGIN .and.&
- Get_Tong() /= TONG_MAKEUP_BEGIN) .and.&
- Get_Swing() == SWING_WELL_END .and.&
- Get_Slips() == SLIPS_SET_END) then
-
- call Set_TongNotification(.true.)
- return
- end if
-
-
-
-
- !if (Get_OperationCondition() == OPERATION_DRILL .and.&
- ! Get_KellyConnection() == KELLY_CONNECTION_STRING .and.&
- ! Get_Swing() == SWING_WELL_END .and.&
- ! Get_Slips() == SLIPS_SET_END) then
- !
- ! call Set_TongNotification(.true.)
- ! return
- !end if
- !
-
-
- call Set_TongNotification(.false.)
-
- endif
-
-
-
-
-
-
-
-
-
-
- end subroutine
-
- subroutine Subscribe_TongNotification()
- implicit none
-
- call OnOperationConditionChange%Add(Evaluate_TongNotification)
- call OnHookHeightChange%Add(Evaluate_TongNotification)
- call OnJointConnectionPossibleChange%Add(Evaluate_TongNotification)
- call OnSingleSetInMouseHoleChange%Add(Evaluate_TongNotification)
- call OnElevatorConnectionChange%Add(Evaluate_TongNotification)
- call OnKellyConnectionChange%Add(Evaluate_TongNotification)
- call OnSwingChange%Add(Evaluate_TongNotification)
- call OnSlipsChange%Add(Evaluate_TongNotification)
-
- end subroutine
-
-
-
- end module CTongNotification
|