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.
 
 
 
 
 
 

258 lines
6.7 KiB

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