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.
 
 
 
 
 
 

252 lines
8.0 KiB

  1. module CDataDisplayConsoleVariables
  2. use CIActionReference
  3. ! !**use CDoubleEventHandlerCollection
  4. implicit none
  5. public
  6. Type :: DataDisplayConsoleType
  7. !portable
  8. real(8) :: TripAlarmLow
  9. real(8) :: TripAlarmHigh
  10. real(8) :: RetFlowAlarmLow
  11. real(8) :: RetFlowAlarmHigh
  12. real(8) :: PitAlarmLow
  13. real(8) :: PitAlarmHigh
  14. real(8) :: PortWeightOnBit
  15. real(8) :: PortHookLoad
  16. real(8) :: PortCasingPressure
  17. real(8) :: PortPumpPressure
  18. ! Input vars
  19. real(8) :: TripTankSetAlarmLow
  20. real(8) :: TripTankSetAlarmHigh
  21. integer :: TripTankSetAlarmSwitch
  22. logical :: TripTankPowerSwitch
  23. logical :: TripTankPumpSwitch
  24. logical :: TripTankHornSwitch
  25. logical :: AcidGasDetectionHornSwitch
  26. logical :: TotalStrokeCounterResetSwitch
  27. logical :: DrillingTrippingSelectorSwitch
  28. real(8) :: MVTSetAlarmLowKnob
  29. real(8) :: MVTSetAlarmHighKnob
  30. integer :: MVTSetAlarmSwitch
  31. logical :: MudTank1Switch
  32. logical :: MudTank2Switch
  33. logical :: MudTank3Switch
  34. logical :: MudTank4Switch
  35. real(8) :: MVTFineKnob
  36. real(8) :: MVTCoarseKnob
  37. logical :: MVTHornSwitch
  38. logical :: MVTDeviationTripSelectionSwitch
  39. logical :: MVTPowerSwitch
  40. logical :: MFFIResetTotalStrokes
  41. logical :: MFFIResetFillCounter
  42. integer :: MFFIPumpSelectorSwitch
  43. logical :: MFFIFillSPMSelectorSwitch
  44. real(8) :: MFFISetAlarmLowKnob
  45. real(8) :: MFFISetAlarmHighKnob
  46. integer :: MFFISetAlarmSwitch
  47. logical :: MFFIPowerSwitch
  48. logical :: MFFIHornSwitch
  49. logical :: ResetWob
  50. logical :: Clutch
  51. ! Output vars
  52. real(8) :: WOBPointer
  53. real(8) :: HookLoadPointer
  54. real(8) :: TripTankGauge
  55. integer :: TripTankAlarmLED
  56. integer :: TripTankPumpLED
  57. real(8) :: StandPipePressureGauge
  58. real(8) :: CasingPressureGauge
  59. real(8) :: MP1SPMGauge
  60. real(8) :: MP2SPMGauge
  61. real(8) :: ReturnLineTempGauge
  62. real(8) :: RotaryTorqueGauge
  63. real(8) :: RotaryRPMGauge
  64. ! !**type(DoubleEventHandlerCollection) :: OnRotaryRpmChange
  65. integer :: AcidGasDetectionLED
  66. real(8) :: TotalStrokeCounter
  67. !real(8) :: TotalStrokeCounter_temp
  68. real(8) :: PitGainLossGauge
  69. real(8) :: MudTanksVolumeGauge
  70. integer :: MVTAlarmLED
  71. real(8) :: ReturnMudFlowGauge
  72. real(8) :: FillStrokeCounter
  73. real(8) :: MFFITotalStrokeCounter
  74. integer :: MFFIAlarmLED
  75. integer :: MFFIPumpLED
  76. real(8) :: TotalWellDepth
  77. real(8) :: BitDepth
  78. real(8) :: HookLoad
  79. real(8) :: StandPipePressure
  80. real(8) :: CasingPressure
  81. real(8) :: MP1SPM
  82. real(8) :: MP2SPM
  83. real(8) :: RTTorque
  84. real(8) :: RTRPM
  85. real(8) :: WOP
  86. real(8) :: ROP
  87. real(8) :: MudWeightIn
  88. real(8) :: MudWeightOut
  89. logical :: Buzzer1
  90. logical :: Buzzer2
  91. logical :: Buzzer3
  92. logical :: Buzzer4
  93. End Type DataDisplayConsoleType
  94. Type(DataDisplayConsoleType) :: DataDisplayConsole
  95. ! events
  96. procedure (ActionDualDouble), pointer :: PumpsSpmChanges => null()
  97. contains
  98. subroutine Set_TotalDepth(v)
  99. use CDrillWatchVariables!!, only: DrillingWatch%Depth
  100. ! use CSimulationVariables, only: SetDistanceDrilled
  101. implicit none
  102. real(8), intent(in) :: v
  103. DataDisplayConsole%TotalWellDepth = v
  104. DrillingWatch%Depth = v
  105. ! call SetDistanceDrilled(v)
  106. end subroutine
  107. subroutine Set_BitPosition(v)
  108. use CDrillWatchVariables!!, only: DrillingWatch%BitPosition
  109. implicit none
  110. real(8), intent(in) :: v
  111. DataDisplayConsole%BitDepth = v
  112. DrillingWatch%BitPosition = v
  113. end subroutine
  114. subroutine Set_RotaryTorque(v)
  115. use CDrillWatchVariables!!, only: DrillingWatch%Torque
  116. implicit none
  117. real(8), intent(in) :: v
  118. DataDisplayConsole%RotaryTorqueGauge = v
  119. DrillingWatch%Torque = v
  120. DataDisplayConsole%RTTorque = v
  121. end subroutine
  122. subroutine Set_MudWeightIn(v)
  123. use CDrillWatchVariables!, only: MudWeightInDw => DataDisplayConsole%MudWeightIn
  124. implicit none
  125. real(8), intent(in) :: v
  126. DataDisplayConsole%MudWeightIn = v
  127. DrillingWatch%MudWeightIn = v
  128. end subroutine
  129. subroutine Set_MudWeightOut(v)
  130. use CDrillWatchVariables!, only: MudWeightOutDw => DataDisplayConsole%MudWeightOut
  131. implicit none
  132. real(8), intent(in) :: v
  133. DataDisplayConsole%MudWeightOut = v
  134. DrillingWatch%MudWeightOut = v
  135. end subroutine
  136. subroutine Set_TripTankVolume(v)
  137. use CDrillWatchVariables!, only: DrillingWatch%TripTankVolume
  138. implicit none
  139. real(8), intent(in) :: v
  140. DrillingWatch%TripTankVolume = v
  141. end subroutine
  142. subroutine Set_FillVolume(v)
  143. use CDrillWatchVariables!, only: DrillingWatch%FillVolume
  144. implicit none
  145. real(8), intent(in) :: v
  146. DrillingWatch%FillVolume = v
  147. end subroutine
  148. subroutine Set_HookLoad(v)
  149. use CDrillWatchVariables!, only: HookLoadDw => DataDisplayConsole%HookLoad
  150. implicit none
  151. real(8), intent(in) :: v
  152. DataDisplayConsole%HookLoadPointer = v
  153. DrillingWatch%HookLoad = v * 1000
  154. DataDisplayConsole%HookLoad = v
  155. end subroutine
  156. subroutine Set_WeightOnBit(v)
  157. use CDrillWatchVariables!, only: DrillingWatch%WeightOnBit
  158. implicit none
  159. real(8), intent(in) :: v
  160. DataDisplayConsole%WOBPointer = v
  161. DrillingWatch%WeightOnBit = v
  162. DataDisplayConsole%WOP = v
  163. end subroutine
  164. subroutine Set_ROP(v)
  165. use CDrillWatchVariables!, only: ROPDw => DataDisplayConsole%ROP
  166. implicit none
  167. real(8), intent(in) :: v
  168. DataDisplayConsole%ROP = v
  169. DrillingWatch%ROP = v
  170. end subroutine
  171. subroutine Set_CasingPressure(v)
  172. use CDrillWatchVariables!, only: CasingPressureDw => CasingPressure
  173. use CChokeControlPanelVariables!, only: CasingPressureChoke => CasingPressure
  174. implicit none
  175. real(8), intent(in) :: v
  176. DataDisplayConsole%CasingPressureGauge = v
  177. DrillingWatch%CasingPressure = v
  178. ChokeControlPanel%CasingPressure = v
  179. DataDisplayConsole%CasingPressure = v
  180. end subroutine
  181. subroutine Set_StandPipePressure(v)
  182. use CDrillWatchVariables!, only: DrillingWatch%PumpPressure
  183. use CChokeControlPanelVariables!, only: StandPipePressureChoke => DataDisplayConsole%StandPipePressure
  184. implicit none
  185. real(8), intent(in) :: v
  186. DataDisplayConsole%StandPipePressureGauge = v
  187. DrillingWatch%PumpPressure = v
  188. ChokeControlPanel%StandPipePressure = v
  189. DataDisplayConsole%StandPipePressure = v
  190. end subroutine
  191. subroutine Set_RotaryRPMGauge(v)
  192. use CDrillWatchVariables!, only: DrillingWatch%RPM
  193. implicit none
  194. real(8), intent(in) :: v
  195. DataDisplayConsole%RotaryRPMGauge = v
  196. DrillingWatch%RPM = v
  197. DataDisplayConsole%RTRPM = v
  198. ! call DataDisplayConsole%OnRotaryRpmChange%RunAll(v)
  199. end subroutine
  200. subroutine Set_MP1SPMGauge(v)
  201. implicit none
  202. real(8), intent(in) :: v
  203. DataDisplayConsole%MP1SPMGauge = v
  204. DataDisplayConsole%MP1SPM = v
  205. if(associated(PumpsSpmChanges)) call PumpsSpmChanges(DataDisplayConsole%MP1SPMGauge, DataDisplayConsole%MP2SPMGauge)
  206. #ifdef deb
  207. print*, 'MP1SPMGauge=', DataDisplayConsole%MP1SPMGauge
  208. #endif
  209. end subroutine
  210. subroutine Set_MP2SPMGauge(v)
  211. implicit none
  212. real(8), intent(in) :: v
  213. DataDisplayConsole%MP2SPMGauge = v
  214. DataDisplayConsole%MP2SPM = v
  215. if(associated(PumpsSpmChanges)) call PumpsSpmChanges(DataDisplayConsole%MP1SPMGauge, DataDisplayConsole%MP2SPMGauge)
  216. #ifdef deb
  217. print*, 'MP2SPMGauge=', DataDisplayConsole%MP2SPMGauge
  218. #endif
  219. end subroutine
  220. end module CDataDisplayConsoleVariables