|
- 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() + OperationScenario%PL - OperationScenario%ECG + NFC() - OperationScenario%RE) .and. Get_HookHeight() <= (TL() + NFC() + OperationScenario%PL - OperationScenario%ECG + OperationScenario%TG)) .or.&
- (Get_HookHeight() >= (TL() + OperationScenario%SL - OperationScenario%ECG + NFC() - OperationScenario%RE) .and. Get_HookHeight() <= (TL() + NFC() + OperationScenario%SL - OperationScenario%ECG + OperationScenario%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() >= (OperationScenario%HKL + Get_NearFloorConnection() - OperationScenario%RE) .and. Get_HookHeight() <= (OperationScenario%HKL + Get_NearFloorConnection() + OperationScenario%TG)) .or.&
- (Get_HookHeight() >= (OperationScenario%HKL + Get_NearFloorConnection() + OperationScenario%PL -OperationScenario%RE) .and. Get_HookHeight() <= (OperationScenario%HKL + Get_NearFloorConnection() + OperationScenario%TG + OperationScenario%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() >= (OperationScenario%HL + OperationScenario%PL - OperationScenario%ECG + Get_NearFloorConnection() - OperationScenario%RE) .and. Get_HookHeight() <= (OperationScenario%HL + Get_NearFloorConnection() + OperationScenario%PL - OperationScenario%ECG + OperationScenario%TG)) .or.&
- (Get_HookHeight() >= (OperationScenario%HL + OperationScenario%SL - OperationScenario%ECG + Get_NearFloorConnection() - OperationScenario%RE) .and. Get_HookHeight() <= (OperationScenario%HL + Get_NearFloorConnection() + OperationScenario%TG - OperationScenario%ECG + OperationScenario%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 UnitySignals%OnOperationConditionChange%Add(Evaluate_TongNotification)
- call SoftwareInputs%OnHookHeightChange%Add(Evaluate_TongNotification)
- call UnityInputs%OnJointConnectionPossibleChange%Add(Evaluate_TongNotification)
- call UnityInputs%OnSingleSetInMouseHoleChange%Add(Evaluate_TongNotification)
- call OperationScenario%OnElevatorConnectionChange%Add(Evaluate_TongNotification)
- call KellyConnectionEnum%OnKellyConnectionChange%Add(Evaluate_TongNotification)
- call UnitySignals%OnSwingChange%Add(Evaluate_TongNotification)
- call UnitySignals%OnSlipsChange%Add(Evaluate_TongNotification)
-
- end subroutine
-
-
-
- end module CTongNotification
|