Simulation Core
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

86 lines
3.3 KiB

  1. # 1 "/home/admin/SimulationCore2/CSharp/OperationScenarios/Notifications/CSlipsNotification.f90"
  2. module CSlipsNotification
  3. use OperationScenariosModule
  4. implicit none
  5. contains
  6. !//TODO: must change code such that get new states of tong and slips from uie
  7. subroutine Evaluate_SlipsNotification()
  8. implicit none
  9. if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then
  10. ! if(print_log) print*, 'Evaluate_SlipsNotification=TopDrive'
  11. !TOPDRIVE-CODE=28
  12. if (Get_ZeroStringSpeed() .and.&
  13. GetRotaryRpm() == 0.0d0 .and.&
  14. Get_Slips() == SLIPS_UNSET_END .and.&
  15. Get_NearFloorConnection() >= 3.0 .and. Get_NearFloorConnection() <= 6.0) then
  16. call Set_SlipsNotification(.true.)
  17. return
  18. end if
  19. !TOPDRIVE-CODE=29
  20. if (Get_ZeroStringSpeed() .and.&
  21. GetRotaryRpm() == 0.0d0 .and.&
  22. (Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_STRING .or.&
  23. Get_TdsConnectionModes() == TDS_CONNECTION_STRING) .and.&
  24. Get_Slips() == SLIPS_SET_END .and.&
  25. Get_NearFloorConnection() >= 3.0 .and. Get_NearFloorConnection() <= 6.0) then
  26. call Set_SlipsNotification(.true.)
  27. return
  28. end if
  29. endif
  30. ! enumerator SLIPS_NEUTRAL
  31. ! enumerator SLIPS_SET_BEGIN
  32. ! enumerator SLIPS_SET_END
  33. ! enumerator SLIPS_UNSET_BEGIN
  34. ! enumerator SLIPS_UNSET_END
  35. if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then
  36. ! if(print_log) print*, 'Evaluate_SlipsNotification=Kelly'
  37. !OPERATION-CODE=53
  38. if (Get_ZeroStringSpeed() .and.&
  39. GetRotaryRpm() == 0.0d0 .and.&
  40. !Get_KellyConnection() == KELLY_CONNECTION_STRING
  41. Get_Slips() == SLIPS_UNSET_END .and.&
  42. Get_NearFloorConnection() >= 3.0 .and. Get_NearFloorConnection() <= 6.0) then
  43. call Set_SlipsNotification(.true.)
  44. return
  45. end if
  46. !OPERATION-CODE=77
  47. if (Get_ZeroStringSpeed() .and.&
  48. GetRotaryRpm() == 0.0d0 .and.&
  49. Get_Slips() == SLIPS_SET_END .and.&
  50. Get_IsKellyBushingSetInTable() == .false. .and.&
  51. Get_NearFloorConnection() >= 3.0 .and. Get_NearFloorConnection() <= 6.0 .and.&
  52. (Get_ElevatorConnection() == ELEVATOR_CONNECTION_STRING .or. Get_KellyConnection() == KELLY_CONNECTION_STRING)) then
  53. call Set_SlipsNotification(.true.)
  54. return
  55. end if
  56. call Set_SlipsNotification(.false.)
  57. endif
  58. end subroutine
  59. ! subroutine Subscribe_SlipsNotification()
  60. ! implicit none
  61. ! call OnOperationConditionChange%Add(Evaluate_SlipsNotification)
  62. ! call OnSlackOffChange%Add(Evaluate_SlipsNotification)
  63. ! call OnZeroStringSpeedChange%Add(Evaluate_SlipsNotification)
  64. ! call OnNearFloorConnectionChange%Add(Evaluate_SlipsNotification)
  65. ! call data%State%OperationScenario%OnElevatorConnectionChange%Add(Evaluate_SlipsNotification)
  66. ! call OnKellyConnectionChange%Add(Evaluate_SlipsNotification)
  67. ! call OnSlipsChange%Add(Evaluate_SlipsNotification)
  68. ! end subroutine
  69. end module CSlipsNotification