|
- module CSlipsNotification
- use OperationScenariosModule
- implicit none
- contains
-
- !//TODO: must change code such that get new states of tong and slips from uie
- subroutine Evaluate_SlipsNotification()
- implicit none
-
- if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then
- ! if(print_log) print*, 'Evaluate_SlipsNotification=TopDrive'
- !TOPDRIVE-CODE=28
- if (Get_ZeroStringSpeed() .and.&
- GetRotaryRpm() == 0.0d0 .and.&
- Get_Slips() == SLIPS_UNSET_END .and.&
- Get_NearFloorConnection() >= 3.0 .and. Get_NearFloorConnection() <= 6.0) then
-
- call Set_SlipsNotification(.true.)
- return
- end if
-
- !TOPDRIVE-CODE=29
- if (Get_ZeroStringSpeed() .and.&
- GetRotaryRpm() == 0.0d0 .and.&
- (Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_STRING .or.&
- Get_TdsConnectionModes() == TDS_CONNECTION_STRING) .and.&
- Get_Slips() == SLIPS_SET_END .and.&
- Get_NearFloorConnection() >= 3.0 .and. Get_NearFloorConnection() <= 6.0) then
-
- call Set_SlipsNotification(.true.)
- return
- end if
-
- endif
- ! enumerator SLIPS_NEUTRAL
- ! enumerator SLIPS_SET_BEGIN
- ! enumerator SLIPS_SET_END
- ! enumerator SLIPS_UNSET_BEGIN
- ! enumerator SLIPS_UNSET_END
-
- if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then
- ! if(print_log) print*, 'Evaluate_SlipsNotification=Kelly'
-
- !OPERATION-CODE=53
- if (Get_ZeroStringSpeed() .and.&
- GetRotaryRpm() == 0.0d0 .and.&
- !Get_KellyConnection() == KELLY_CONNECTION_STRING
- Get_Slips() == SLIPS_UNSET_END .and.&
- Get_NearFloorConnection() >= 3.0 .and. Get_NearFloorConnection() <= 6.0) then
- call Set_SlipsNotification(.true.)
- return
- end if
-
- !OPERATION-CODE=77
- if (Get_ZeroStringSpeed() .and.&
- GetRotaryRpm() == 0.0d0 .and.&
- Get_Slips() == SLIPS_SET_END .and.&
- Get_IsKellyBushingSetInTable() == .false. .and.&
- Get_NearFloorConnection() >= 3.0 .and. Get_NearFloorConnection() <= 6.0 .and.&
- (Get_ElevatorConnection() == ELEVATOR_CONNECTION_STRING .or. Get_KellyConnection() == KELLY_CONNECTION_STRING)) then
- call Set_SlipsNotification(.true.)
- return
- end if
-
- call Set_SlipsNotification(.false.)
-
- endif
-
- end subroutine
-
- ! subroutine Subscribe_SlipsNotification()
- ! implicit none
-
- ! call OnOperationConditionChange%Add(Evaluate_SlipsNotification)
- ! call OnSlackOffChange%Add(Evaluate_SlipsNotification)
- ! call OnZeroStringSpeedChange%Add(Evaluate_SlipsNotification)
- ! call OnNearFloorConnectionChange%Add(Evaluate_SlipsNotification)
- ! call data%State%OperationScenario%OnElevatorConnectionChange%Add(Evaluate_SlipsNotification)
- ! call OnKellyConnectionChange%Add(Evaluate_SlipsNotification)
- ! call OnSlipsChange%Add(Evaluate_SlipsNotification)
-
- ! end subroutine
-
- end module CSlipsNotification
|