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.
 
 
 
 
 
 

274 lines
13 KiB

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