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.

CDataDisplayConsole.f90 14 KiB

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