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.
 
 
 
 
 
 

310 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. call json%add(p,"StandPipePressure",data%Equipments%DataDisplayConsole%StandPipePressure)
  122. call json%add(p,"CasingPressure",data%Equipments%DataDisplayConsole%CasingPressure)
  123. call json%add(p,"MP1SPM",data%Equipments%DataDisplayConsole%MP1SPM)
  124. call json%add(p,"MP2SPM",data%Equipments%DataDisplayConsole%MP2SPM)
  125. call json%add(p,"RTTorque",data%Equipments%DataDisplayConsole%RTTorque)
  126. call json%add(p,"RTRPM",data%Equipments%DataDisplayConsole%RTRPM)
  127. call json%add(p,"WOP",data%Equipments%DataDisplayConsole%WOP)
  128. call json%add(p,"ROP",data%Equipments%DataDisplayConsole%ROP)
  129. call json%add(p,"MudWeightIn",data%Equipments%DataDisplayConsole%MudWeightIn)
  130. call json%add(p,"MudWeightOut",data%Equipments%DataDisplayConsole%MudWeightOut)
  131. call json%add(p,"Buzzer1",data%Equipments%DataDisplayConsole%Buzzer1)
  132. call json%add(p,"Buzzer2",data%Equipments%DataDisplayConsole%Buzzer2)
  133. call json%add(p,"Buzzer3",data%Equipments%DataDisplayConsole%Buzzer3)
  134. call json%add(p,"Buzzer4",data%Equipments%DataDisplayConsole%Buzzer4)
  135. call json%add(p,"MFFIAlarmLow",data%Equipments%DataDisplayConsole%MFFIAlarmLow)
  136. call json%add(p,"MFFIAlarmHigh",data%Equipments%DataDisplayConsole%MFFIAlarmHigh)
  137. call json%add(p,"MVTAlarmLow",data%Equipments%DataDisplayConsole%MVTAlarmLow)
  138. call json%add(p,"MVTAlarmHigh",data%Equipments%DataDisplayConsole%MVTAlarmHigh)
  139. call json%add(p,"MFFISetAlarmSwitch",data%Equipments%DataDisplayConsole%MFFISetAlarmSwitch)
  140. call json%add(p,"MVTSetAlarmSwitch",data%Equipments%DataDisplayConsole%MVTSetAlarmSwitch)
  141. call json%add(parent,p)
  142. end subroutine
  143. subroutine Set_TotalDepth(v)
  144. implicit none
  145. real(8), intent(in) :: v
  146. ! print *,"total depth = ",v
  147. data%Equipments%DataDisplayConsole%TotalWellDepth = v
  148. data%Equipments%DrillingWatch%Depth = v
  149. ! call SetDistanceDrilled(v)
  150. end subroutine
  151. subroutine Set_BitPosition(v)
  152. implicit none
  153. real(8), intent(in) :: v
  154. data%Equipments%DataDisplayConsole%BitDepth = v
  155. data%Equipments%DrillingWatch%BitPosition = v
  156. end subroutine
  157. subroutine Set_RotaryTorque(v)
  158. implicit none
  159. real(8), intent(in) :: v
  160. data%Equipments%DataDisplayConsole%RotaryTorqueGauge = v
  161. data%Equipments%DrillingWatch%Torque = v
  162. data%Equipments%DataDisplayConsole%RTTorque = v
  163. end subroutine
  164. subroutine Set_MudWeightIn(v)
  165. use SimulationVariables
  166. implicit none
  167. real(8), intent(in) :: v
  168. data%Equipments%DataDisplayConsole%MudWeightIn = v
  169. data%Equipments%DrillingWatch%MudWeightIn = v
  170. end subroutine
  171. subroutine Set_MudWeightOut(v)
  172. use SimulationVariables !@!, only: MudWeightOutDw => data%Equipments%DataDisplayConsole%MudWeightOut
  173. implicit none
  174. real(8), intent(in) :: v
  175. data%Equipments%DataDisplayConsole%MudWeightOut = v
  176. data%Equipments%DrillingWatch%MudWeightOut = v
  177. end subroutine
  178. subroutine Set_TripTankVolume(v)
  179. use SimulationVariables !@!, only: data%Equipments%DrillingWatch%TripTankVolume
  180. implicit none
  181. real(8), intent(in) :: v
  182. data%Equipments%DrillingWatch%TripTankVolume = v
  183. end subroutine
  184. subroutine Set_FillVolume(v)
  185. use SimulationVariables !@!, only: data%Equipments%DrillingWatch%FillVolume
  186. implicit none
  187. real(8), intent(in) :: v
  188. data%Equipments%DrillingWatch%FillVolume = v
  189. end subroutine
  190. subroutine Set_HookLoad(v)
  191. use SimulationVariables !@!, only: HookLoadDw => data%Equipments%DataDisplayConsole%HookLoad
  192. implicit none
  193. real(8), intent(in) :: v
  194. data%Equipments%DataDisplayConsole%HookLoadPointer = v
  195. data%Equipments%DrillingWatch%HookLoad = v * 1000
  196. data%Equipments%DataDisplayConsole%HookLoad = v
  197. end subroutine
  198. subroutine Set_WeightOnBit(v)
  199. use SimulationVariables !@!, only: data%Equipments%DrillingWatch%WeightOnBit
  200. implicit none
  201. real(8), intent(in) :: v
  202. data%Equipments%DataDisplayConsole%WOBPointer = v
  203. data%Equipments%DrillingWatch%WeightOnBit = v
  204. data%Equipments%DataDisplayConsole%WOP = v
  205. end subroutine
  206. subroutine Set_ROP(v)
  207. implicit none
  208. real(8), intent(in) :: v
  209. data%Equipments%DataDisplayConsole%ROP = v
  210. data%Equipments%DrillingWatch%ROP = v
  211. end subroutine
  212. subroutine Set_CasingPressure(v)
  213. ! use CChokeControlPanelVariables
  214. implicit none
  215. real(8), intent(in) :: v
  216. data%Equipments%DataDisplayConsole%CasingPressureGauge = v
  217. data%Equipments%DrillingWatch%CasingPressure = v
  218. data%Equipments%ChokeControlPanel%CasingPressure = v
  219. data%Equipments%DataDisplayConsole%CasingPressure = v
  220. end subroutine
  221. subroutine Set_StandPipePressure(v)
  222. implicit none
  223. real(8), intent(in) :: v
  224. data%Equipments%DataDisplayConsole%StandPipePressureGauge = v
  225. data%Equipments%DrillingWatch%PumpPressure = v
  226. data%Equipments%ChokeControlPanel%StandPipePressure = v
  227. data%Equipments%DataDisplayConsole%StandPipePressure = v
  228. end subroutine
  229. subroutine Set_RotaryRPMGauge(v)
  230. implicit none
  231. real(8), intent(in) :: v
  232. data%Equipments%DataDisplayConsole%RotaryRPMGauge = v
  233. data%Equipments%DrillingWatch%RPM = v
  234. data%Equipments%DataDisplayConsole%RTRPM = v
  235. ! call data%Equipments%DataDisplayConsole%OnRotaryRpmChange%RunAll(v)
  236. end subroutine
  237. subroutine Set_MP1SPMGauge(v)
  238. implicit none
  239. real(8), intent(in) :: v
  240. data%Equipments%DataDisplayConsole%MP1SPMGauge = v
  241. data%Equipments%DataDisplayConsole%MP1SPM = v
  242. !@data%State%unitySignals%(PumpsSpmChanges)) call PumpsSpmChanges(data%Equipments%DataDisplayConsole%MP1SPMGauge, data%Equipments%DataDisplayConsole%MP2SPMGauge)
  243. #ifdef deb
  244. print*, 'MP1SPMGauge=', data%Equipments%DataDisplayConsole%MP1SPMGauge
  245. #endif
  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. #ifdef deb
  254. print*, 'MP2SPMGauge=', data%Equipments%DataDisplayConsole%MP2SPMGauge
  255. #endif
  256. end subroutine
  257. end module CDataDisplayConsole