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