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.
 
 
 
 
 
 

123 lines
4.5 KiB

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