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.
 
 
 
 
 
 

134 lines
4.1 KiB

  1. module CSlipsNotification
  2. use COperationScenariosVariables
  3. implicit none
  4. contains
  5. subroutine Evaluate_SlipsNotification()
  6. implicit none
  7. if (DriveType == TopDrive_DriveType) then
  8. #ifdef OST
  9. print*, 'Evaluate_SlipsNotification=TopDrive'
  10. #endif
  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. if (DriveType == Kelly_DriveType) then
  31. #ifdef OST
  32. print*, 'Evaluate_SlipsNotification=Kelly'
  33. #endif
  34. !OPERATION-CODE=53
  35. if (Get_ZeroStringSpeed() .and.&
  36. GetRotaryRpm() == 0.0d0 .and.&
  37. !Get_KellyConnection() == KELLY_CONNECTION_STRING
  38. Get_Slips() == SLIPS_UNSET_END .and.&
  39. Get_NearFloorConnection() >= 3.0 .and. Get_NearFloorConnection() <= 6.0) then
  40. call Set_SlipsNotification(.true.)
  41. return
  42. end if
  43. !OPERATION-CODE=77
  44. if (Get_ZeroStringSpeed() .and.&
  45. GetRotaryRpm() == 0.0d0 .and.&
  46. Get_Slips() == SLIPS_SET_END .and.&
  47. Get_IsKellyBushingSetInTable() == .false. .and.&
  48. Get_NearFloorConnection() >= 3.0 .and. Get_NearFloorConnection() <= 6.0 .and.&
  49. (Get_ElevatorConnection() == ELEVATOR_CONNECTION_STRING .or. Get_KellyConnection() == KELLY_CONNECTION_STRING)) then
  50. call Set_SlipsNotification(.true.)
  51. return
  52. end if
  53. !if (Get_OperationCondition() == OPERATION_DRILL .and.&
  54. ! Get_ZeroStringSpeed() .and.&
  55. ! Get_SlackOff() .and.&
  56. ! Get_KellyConnection() == KELLY_CONNECTION_STRING) then
  57. ! call Set_SlipsNotification(.true.)
  58. ! return
  59. !end if
  60. !
  61. !
  62. !if (Get_OperationCondition() == OPERATION_TRIP .and.&
  63. ! Get_ZeroStringSpeed() .and.&
  64. ! Get_NearFloorConnection() >= 21 .and. Get_NearFloorConnection() <= 25 .and.&
  65. ! Get_ElevatorConnection() == ELEVATOR_CONNECTION_STRING) then
  66. ! call Set_SlipsNotification(.true.)
  67. ! return
  68. !end if
  69. call Set_SlipsNotification(.false.)
  70. endif
  71. end subroutine
  72. ! subroutine Subscribe_SlipsNotification()
  73. ! implicit none
  74. ! call OnOperationConditionChange%Add(Evaluate_SlipsNotification)
  75. ! call OnSlackOffChange%Add(Evaluate_SlipsNotification)
  76. ! call OnZeroStringSpeedChange%Add(Evaluate_SlipsNotification)
  77. ! call OnNearFloorConnectionChange%Add(Evaluate_SlipsNotification)
  78. ! call OnElevatorConnectionChange%Add(Evaluate_SlipsNotification)
  79. ! call OnKellyConnectionChange%Add(Evaluate_SlipsNotification)
  80. ! call OnSlipsChange%Add(Evaluate_SlipsNotification)
  81. ! end subroutine
  82. end module CSlipsNotification