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.
 
 
 
 
 
 

107 lines
4.2 KiB

  1. subroutine Rtable_MainSolver
  2. use CDataDisplayConsoleVariables
  3. use CDrillingConsoleVariables
  4. use CSimulationVariables
  5. use RTable_VARIABLES
  6. use CDrillWatchVariables
  7. use CWarningsVariables
  8. use CSounds
  9. IMPLICIT NONE
  10. if (IsPortable) then
  11. RTable%AssignmentSwitch = 1
  12. else
  13. RTable%AssignmentSwitch = AssignmentSwitch
  14. end if
  15. if (RTThrottle<=0.e0) then
  16. RTable%K_throttle = 1
  17. end if
  18. if ( (any(RTable%AssignmentSwitch==(/1,2,3,4,5,8,9,10,11/))) .and. (RTSwitch == -1) .and. (IsStopped == .false.) ) then
  19. RTable%SoundBlower = .true.
  20. Call SetSoundBlowerRT(RTable%SoundBlower)
  21. RTBLWR = 1
  22. IF ( RTTransmissionLever /=0 .and. RotaryGearsAbuse==0 ) THEN !be in clutch mode ??????
  23. RTable%N_new = RTThrottle
  24. !===> Rotary Table Malfunction ----> Drive Motor Failure
  25. call RTMalfunction_MotorFailure
  26. if (((RTable%N_new-RTable%N_old)/RTable%time_step)>193.) then
  27. RTable%N_ref = (193.*RTable%time_step)+RTable%N_old
  28. else if (((RTable%N_old-RTable%N_new)/RTable%time_step)>193.) then
  29. RTable%N_ref = (-193.*RTable%time_step)+RTable%N_old
  30. else
  31. RTable%N_ref = RTable%N_new
  32. end if
  33. CALL RTable_INPUTS
  34. CALL RTable_Solver
  35. RT_RPMUnityOutput = RotaryRPMGauge
  36. RTable%N_old = RTable%N_ref
  37. Else IF ( RTTransmissionLever==0) THEN !be in brake mode ??????
  38. Call RTable_OffMode
  39. RT_RPMUnityOutput = RotaryRPMGauge
  40. End IF
  41. RT_OldTransMode = RTTransmissionLever
  42. else if ( (any(RTable%AssignmentSwitch==(/1,2,3,4,5,8,9,10,11/))) .and. (RTSwitch == 1) .and. (RTable%K_throttle==1) .and. (IsStopped == .false.) ) then
  43. RTable%SoundBlower = .true.
  44. Call SetSoundBlowerRT(RTable%SoundBlower)
  45. RTBLWR = 1
  46. IF ( RTTransmissionLever /=0 .and. RotaryGearsAbuse==0 ) THEN !be in clutch mode ??????
  47. RTable%N_new = RTThrottle
  48. !===> Rotary Table Malfunction ----> Drive Motor Failure
  49. call RTMalfunction_MotorFailure
  50. if (((RTable%N_new-RTable%N_old)/RTable%time_step)>193.) then
  51. RTable%N_ref = (193.*RTable%time_step)+RTable%N_old
  52. else if (((RTable%N_old-RTable%N_new)/RTable%time_step)>193.) then
  53. RTable%N_ref = (-193.*RTable%time_step)+RTable%N_old
  54. else
  55. RTable%N_ref = RTable%N_new
  56. end if
  57. CALL RTable_INPUTS
  58. CALL RTable_Solver
  59. RT_RPMUnityOutput = -RotaryRPMGauge
  60. RTable%N_old = RTable%N_ref
  61. Else IF ( RTTransmissionLever==0) THEN !be in brake mode ??????
  62. Call RTable_OffMode
  63. RT_RPMUnityOutput = -RotaryRPMGauge
  64. End IF
  65. RT_OldTransMode = RTTransmissionLever
  66. else
  67. if((any(RTable%AssignmentSwitch==(/1,2,3,4,5,8,9,10,11/))) .and. (RTSwitch /= 0) .and. (IsStopped == .false.) ) then
  68. RTable%SoundBlower = .true.
  69. Call SetSoundBlowerRT(RTable%SoundBlower)
  70. RTBLWR = 1
  71. else
  72. RTable%SoundBlower = .false.
  73. Call SetSoundBlowerRT(RTable%SoundBlower)
  74. RTBLWR = 0
  75. end if
  76. Call RTable_OffMode
  77. RT_RPMUnityOutput = RotaryRPMGauge
  78. RT_OldTransMode = RTTransmissionLever
  79. RTable%K_throttle = 0
  80. end if
  81. END subroutine Rtable_MainSolver