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.
 
 
 
 
 
 

144 line
5.0 KiB

  1. module CTdsSwingEnum
  2. use OperationScenariosModule
  3. use SimulationVariables
  4. use UnitySignalsModule
  5. implicit none
  6. contains
  7. subroutine Evaluate_TdsSwing()
  8. implicit none
  9. if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then
  10. #ifdef OST
  11. print*, 'Evaluate_TdsSwing=TopDrive'
  12. #endif
  13. !TOPDRIVE-CODE=37
  14. if (Get_SwingDrillPermission() .and.&
  15. Get_TdsSwing() == TDS_SWING_OFF_END .and.&
  16. Get_FillMouseHoleLed() == .false. .and.&
  17. data%Equipments%TopDrivePanel%TopDriveLinkTiltState == TdsLinkTilt_DRILL) then
  18. call Set_TdsSwing(TDS_SWING_DRILL_BEGIN)
  19. data%Equipments%TopDrivePanel%TopDriveLinkTiltLed = LED_ON
  20. return
  21. end if
  22. !TOPDRIVE-CODE=38
  23. if (Get_SwingTiltPermission() .and.&
  24. Get_TdsSwing() == TDS_SWING_TILT_END .and.&
  25. data%Equipments%TopDrivePanel%TopDriveLinkTiltState == TdsLinkTilt_TILT) then
  26. call Set_TdsSwing(TDS_SWING_TILT_BEGIN)
  27. data%Equipments%TopDrivePanel%TopDriveLinkTiltLed = LED_ON
  28. return
  29. end if
  30. !TOPDRIVE-CODE=39
  31. if (Get_SwingOffPermission() .and.&
  32. Get_TdsConnectionModes() == TDS_CONNECTION_NOTHING .and.&
  33. Get_TdsSwing() == TDS_SWING_OFF_END .and.&
  34. data%Equipments%TopDrivePanel%TopDriveLinkTiltState == TdsLinkTilt_OFF) then
  35. call Set_TdsSwing(TDS_SWING_OFF_BEGIN)
  36. data%Equipments%TopDrivePanel%TopDriveLinkTiltLed = LED_ON
  37. return
  38. end if
  39. !TOPDRIVE-CODE=40
  40. if (Get_SwingTiltPermission() .and.&
  41. Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_NOTHING .and.&
  42. Get_TdsSwing() == TDS_SWING_OFF_END .and.&
  43. data%Equipments%TopDrivePanel%TopDriveLinkTiltState == TdsLinkTilt_TILT) then
  44. call Set_TdsSwing(TDS_SWING_TILT_BEGIN)
  45. data%Equipments%TopDrivePanel%TopDriveLinkTiltLed = LED_ON
  46. return
  47. end if
  48. !TOPDRIVE-CODE=41
  49. if (Get_SwingOffPermission() .and.&
  50. Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_NOTHING .and.&
  51. Get_TdsSwing() == TDS_SWING_TILT_END .and.&
  52. data%Equipments%TopDrivePanel%TopDriveLinkTiltState == TdsLinkTilt_OFF) then
  53. call Set_TdsSwing(TDS_SWING_OFF_BEGIN)
  54. data%Equipments%TopDrivePanel%TopDriveLinkTiltLed = LED_ON
  55. return
  56. end if
  57. !TOPDRIVE-CODE=42
  58. if (Get_HookHeight() > (TL() + NFC() + data%State%OperationScenario%PL - data%State%OperationScenario%ECG) .and.&
  59. Get_SwingTiltPermission() .and.&
  60. Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_SINGLE .and.&
  61. Get_TdsSwing() == TDS_SWING_OFF_END .and.&
  62. data%Equipments%TopDrivePanel%TopDriveLinkTiltState == TdsLinkTilt_TILT) then
  63. call Set_TdsSwing(TDS_SWING_TILT_BEGIN)
  64. data%Equipments%TopDrivePanel%TopDriveLinkTiltLed = LED_ON
  65. return
  66. end if
  67. !TOPDRIVE-CODE=43
  68. if (Get_HookHeight() > (TL() + NFC() + data%State%OperationScenario%PL - data%State%OperationScenario%ECG) .and.&
  69. Get_SwingOffPermission() .and.&
  70. Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_SINGLE .and.&
  71. Get_TdsSwing() == TDS_SWING_TILT_END .and.&
  72. data%Equipments%TopDrivePanel%TopDriveLinkTiltState == TdsLinkTilt_OFF) then
  73. call Set_TdsSwing(TDS_SWING_OFF_BEGIN)
  74. data%Equipments%TopDrivePanel%TopDriveLinkTiltLed = LED_ON
  75. return
  76. end if
  77. endif
  78. ! if (DriveType == Kelly_DriveType) then
  79. !#ifdef OST
  80. ! print*, 'Evaluate_TdsSwing=Kelly'
  81. !#endif
  82. ! endif
  83. end subroutine
  84. subroutine Subscribe_TdsSwing()
  85. use CDrillingConsoleVariables
  86. use SimulationVariables
  87. use SimulationVariables
  88. implicit none
  89. end subroutine
  90. end module CTdsSwingEnum