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.

CSwingLedNotification.f90 4.1 KiB

1 year ago
1 year ago
1 year ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. module CSwingLedNotification
  2. use COperationScenariosVariables
  3. implicit none
  4. contains
  5. subroutine Evaluate_SwingLed()
  6. implicit none
  7. if (Hoisting%DriveType == TopDrive_DriveType) then
  8. #ifdef OST
  9. print*, 'Evaluate_SwingLed=TopDrive'
  10. #endif
  11. endif
  12. if (Hoisting%DriveType == Kelly_DriveType) then
  13. #ifdef OST
  14. print*, 'Evaluate_SwingLed=Kelly'
  15. #endif
  16. !OPERATION-CODE=22
  17. if (Get_OperationCondition() == OPERATION_TRIP .and.&
  18. Get_HookHeight() >= (HL + Get_NearFloorConnection()) .and. Get_HookHeight() <= (HL + Get_NearFloorConnection() + LG) .and.&
  19. Get_ElevatorConnection() == ELEVATOR_CONNECTION_NOTHING .and.&
  20. Get_JointConnectionPossible() == .false. .and.&
  21. (Get_Swing() /= SWING_WELL_BEGIN .and.&
  22. Get_Swing() /= SWING_MOUSE_HOLE_BEGIN .and.&
  23. Get_Swing() /= SWING_RAT_HOLE_BEGIN) .and.&
  24. Get_Slips() == SLIPS_SET_END) then
  25. call Set_SwingLed(.true.)
  26. return
  27. end if
  28. !OPERATION-CODE=23
  29. if (Get_OperationCondition() == OPERATION_TRIP .and.&
  30. Get_HookHeight() >= (HL + Get_NearFloorConnection() + PL) .and. Get_HookHeight() <= (HL + Get_NearFloorConnection() + LG + PL) .and.&
  31. Get_ElevatorConnection() == ELEVATOR_CONNECTION_SINGLE .and.&
  32. Get_JointConnectionPossible() == .false. .and.&
  33. (Get_Swing() /= SWING_WELL_BEGIN .and.&
  34. Get_Swing() /= SWING_MOUSE_HOLE_BEGIN .and.&
  35. Get_Swing() /= SWING_RAT_HOLE_BEGIN) .and.&
  36. Get_Slips() == SLIPS_SET_END) then
  37. call Set_SwingLed(.true.)
  38. return
  39. end if
  40. !OPERATION-CODE=24
  41. if (Get_OperationCondition() == OPERATION_DRILL .and.&
  42. Get_HookHeight() >= (HKL + Get_NearFloorConnection()) .and. Get_HookHeight() <= (HKL + Get_NearFloorConnection() + LG) .and.&
  43. Get_JointConnectionPossible() == .false. .and.&
  44. Get_KellyConnection() == KELLY_CONNECTION_NOTHING .and.&
  45. (Get_Swing() /= SWING_WELL_BEGIN .and.&
  46. Get_Swing() /= SWING_MOUSE_HOLE_BEGIN .and.&
  47. Get_Swing() /= SWING_RAT_HOLE_BEGIN) .and.&
  48. Get_Slips() == SLIPS_SET_END) then
  49. call Set_SwingLed(.true.)
  50. return
  51. end if
  52. !OPERATION-CODE=25
  53. if (Get_OperationCondition() == OPERATION_DRILL .and.&
  54. Get_HookHeight() >= (HKL + Get_NearFloorConnection() + PL) .and. Get_HookHeight() <= (HKL + Get_NearFloorConnection() + LG + PL) .and.&
  55. Get_KellyConnection() == KELLY_CONNECTION_SINGLE .and.&
  56. Get_JointConnectionPossible() == .false. .and.&
  57. (Get_Swing() /= SWING_WELL_BEGIN .and.&
  58. Get_Swing() /= SWING_MOUSE_HOLE_BEGIN .and.&
  59. Get_Swing() /= SWING_RAT_HOLE_BEGIN) .and.&
  60. Get_Slips() == SLIPS_SET_END) then
  61. call Set_SwingLed(.true.)
  62. return
  63. end if
  64. call Set_SwingLed(.false.)
  65. endif
  66. end subroutine
  67. ! subroutine Subscribe_SwingLed()
  68. ! implicit none
  69. ! call OnOperationConditionChange%Add(Evaluate_SwingLed)
  70. ! call OnHookHeightChange%Add(Evaluate_SwingLed)
  71. ! call OnElevatorConnectionChange%Add(Evaluate_SwingLed)
  72. ! call OnKellyConnectionChange%Add(Evaluate_SwingLed)
  73. ! call OnSwingChange%Add(Evaluate_SwingLed)
  74. ! call OnSlipsChange%Add(Evaluate_SwingLed)
  75. ! call OnFillMouseHoleLedChange%Add(Evaluate_SwingLed)
  76. ! end subroutine
  77. end module CSwingLedNotification