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.

CSlipsNotification.i90 3.9 KiB

1 year ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. # 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/OperationScenarios/Notifications/CSlipsNotification.f90"
  2. module CSlipsNotification
  3. use OperationScenariosModule
  4. implicit none
  5. contains
  6. subroutine Evaluate_SlipsNotification()
  7. implicit none
  8. if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then
  9. # 15
  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. if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then
  30. # 58
  31. !OPERATION-CODE=53
  32. if (Get_ZeroStringSpeed() .and.&
  33. GetRotaryRpm() == 0.0d0 .and.&
  34. !Get_KellyConnection() == KELLY_CONNECTION_STRING
  35. Get_Slips() == SLIPS_UNSET_END .and.&
  36. Get_NearFloorConnection() >= 3.0 .and. Get_NearFloorConnection() <= 6.0) then
  37. call Set_SlipsNotification(.true.)
  38. return
  39. end if
  40. !OPERATION-CODE=77
  41. if (Get_ZeroStringSpeed() .and.&
  42. GetRotaryRpm() == 0.0d0 .and.&
  43. Get_Slips() == SLIPS_SET_END .and.&
  44. Get_IsKellyBushingSetInTable() == .false. .and.&
  45. Get_NearFloorConnection() >= 3.0 .and. Get_NearFloorConnection() <= 6.0 .and.&
  46. (Get_ElevatorConnection() == ELEVATOR_CONNECTION_STRING .or. Get_KellyConnection() == KELLY_CONNECTION_STRING)) then
  47. call Set_SlipsNotification(.true.)
  48. return
  49. end if
  50. !if (Get_OperationCondition() == OPERATION_DRILL .and.&
  51. ! Get_ZeroStringSpeed() .and.&
  52. ! Get_SlackOff() .and.&
  53. ! Get_KellyConnection() == KELLY_CONNECTION_STRING) then
  54. ! call Set_SlipsNotification(.true.)
  55. ! return
  56. !end if
  57. !
  58. !
  59. !if (Get_OperationCondition() == OPERATION_TRIP .and.&
  60. ! Get_ZeroStringSpeed() .and.&
  61. ! Get_NearFloorConnection() >= 21 .and. Get_NearFloorConnection() <= 25 .and.&
  62. ! Get_ElevatorConnection() == ELEVATOR_CONNECTION_STRING) then
  63. ! call Set_SlipsNotification(.true.)
  64. ! return
  65. !end if
  66. call Set_SlipsNotification(.false.)
  67. endif
  68. end subroutine
  69. ! subroutine Subscribe_SlipsNotification()
  70. ! implicit none
  71. ! call OnOperationConditionChange%Add(Evaluate_SlipsNotification)
  72. ! call OnSlackOffChange%Add(Evaluate_SlipsNotification)
  73. ! call OnZeroStringSpeedChange%Add(Evaluate_SlipsNotification)
  74. ! call OnNearFloorConnectionChange%Add(Evaluate_SlipsNotification)
  75. ! call data%State%OperationScenario%OnElevatorConnectionChange%Add(Evaluate_SlipsNotification)
  76. ! call OnKellyConnectionChange%Add(Evaluate_SlipsNotification)
  77. ! call OnSlipsChange%Add(Evaluate_SlipsNotification)
  78. ! end subroutine
  79. end module CSlipsNotification