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.6 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 = DrillingConsole%AssignmentSwitch
  14. ! end if
  15. if (DrillingConsole%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. (DrillingConsole%RTSwitch == -1) ) then !.and. (IsStopped == .false.) ) then
  19. RTable%SoundBlower = .true.
  20. Call SetSoundBlowerRT(RTable%SoundBlower)
  21. DrillingConsole%RTBLWR = 1
  22. IF ( DrillingConsole%RTTransmissionLever /=0 .and. RotaryGearsAbuse==0 ) THEN !be in clutch mode ??????
  23. RTable%N_new = DrillingConsole%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 = DataDisplayConsole%RotaryRPMGauge
  36. RTable%N_old = RTable%N_ref
  37. Else IF ( DrillingConsole%RTTransmissionLever==0) THEN !be in brake mode ??????
  38. Call RTable_OffMode
  39. RT_RPMUnityOutput = DataDisplayConsole%RotaryRPMGauge
  40. End IF
  41. RT_OldTransMode = DrillingConsole%RTTransmissionLever
  42. else if ( (any(RTable%AssignmentSwitch==(/1,2,3,4,5,8,9,10,11/))) .and. (DrillingConsole%RTSwitch == 1) .and. (RTable%K_throttle==1) ) then !.and. (IsStopped == .false.) ) then
  43. RTable%SoundBlower = .true.
  44. Call SetSoundBlowerRT(RTable%SoundBlower)
  45. DrillingConsole%RTBLWR = 1
  46. IF ( DrillingConsole%RTTransmissionLever /=0 .and. RotaryGearsAbuse==0 ) THEN !be in clutch mode ??????
  47. RTable%N_new = DrillingConsole%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 = -DataDisplayConsole%RotaryRPMGauge
  60. RTable%N_old = RTable%N_ref
  61. Else IF ( DrillingConsole%RTTransmissionLever==0) THEN !be in brake mode ??????
  62. Call RTable_OffMode
  63. RT_RPMUnityOutput = -DataDisplayConsole%RotaryRPMGauge
  64. End IF
  65. RT_OldTransMode = DrillingConsole%RTTransmissionLever
  66. else
  67. if((any(RTable%AssignmentSwitch==(/1,2,3,4,5,8,9,10,11/))) .and. (DrillingConsole%RTSwitch /= 0) ) then !.and. (IsStopped == .false.) ) then
  68. RTable%SoundBlower = .true.
  69. Call SetSoundBlowerRT(RTable%SoundBlower)
  70. DrillingConsole%RTBLWR = 1
  71. else
  72. RTable%SoundBlower = .false.
  73. Call SetSoundBlowerRT(RTable%SoundBlower)
  74. DrillingConsole%RTBLWR = 0
  75. end if
  76. Call RTable_OffMode
  77. RT_RPMUnityOutput = DataDisplayConsole%RotaryRPMGauge
  78. RT_OldTransMode = DrillingConsole%RTTransmissionLever
  79. RTable%K_throttle = 0
  80. end if
  81. END subroutine Rtable_MainSolver