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.
 
 
 
 
 
 

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