Simulation Core
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

84 lines
3.5 KiB

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