Simulation Core
Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 
 
 

197 linhas
8.5 KiB

  1. module CBopControlPanel
  2. ! use CBopControlPanel
  3. use SimulationVariables
  4. implicit none
  5. public
  6. contains
  7. subroutine BopControlPanelFromJson(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,'BopControl',p)
  13. call json%get(p,'AirMasterValve',pval)
  14. call json%get(pval,data%Equipments%BopControlPanel%AirMasterValve)
  15. call json%get(p,'ByePassValve',pval)
  16. call json%get(pval,data%Equipments%BopControlPanel%ByePassValve)
  17. call json%get(p,'AnnularValve',pval)
  18. call json%get(pval,data%Equipments%BopControlPanel%AnnularValve)
  19. call json%get(p,'UpperRamsValve',pval)
  20. call json%get(pval,data%Equipments%BopControlPanel%UpperRamsValve)
  21. call json%get(p,'MiddleRamsValve',pval)
  22. call json%get(pval,data%Equipments%BopControlPanel%MiddleRamsValve)
  23. call json%get(p,'KillLineValve',pval)
  24. call json%get(pval,data%Equipments%BopControlPanel%KillLineValve)
  25. call json%get(p,'ChokeLineValve',pval)
  26. call json%get(pval,data%Equipments%BopControlPanel%ChokeLineValve)
  27. call json%get(p,'LowerRamsValve',pval)
  28. call json%get(pval,data%Equipments%BopControlPanel%LowerRamsValve)
  29. ! call json%get(p,'ManifoldPressureGauge',pval)
  30. ! call json%get(pval,data%Equipments%BopControlPanel%ManifoldPressureGauge)
  31. ! call json%get(p,'AirSupplyPressureGauge',pval)
  32. ! call json%get(pval,data%Equipments%BopControlPanel%AirSupplyPressureGauge)
  33. ! call json%get(p,'AccumulatorPressureGauge',pval)
  34. ! call json%get(pval,data%Equipments%BopControlPanel%AccumulatorPressureGauge)
  35. ! call json%get(p,'AnnularPressureGauge',pval)
  36. ! call json%get(pval,data%Equipments%BopControlPanel%AnnularPressureGauge)
  37. ! call json%get(p,'AnnularOpenLED',pval)
  38. ! call json%get(pval,data%Equipments%BopControlPanel%AnnularOpenLED)
  39. ! call json%get(p,'AnnularCloseLED',pval)
  40. ! call json%get(pval,data%Equipments%BopControlPanel%AnnularCloseLED)
  41. ! call json%get(p,'UpperRamsOpenLED',pval)
  42. ! call json%get(pval,data%Equipments%BopControlPanel%UpperRamsOpenLED)
  43. ! call json%get(p,'UpperRamsCloseLED',pval)
  44. ! call json%get(pval,data%Equipments%BopControlPanel%UpperRamsCloseLED)
  45. ! call json%get(p,'MiddleRamsOpenLED',pval)
  46. ! call json%get(pval,data%Equipments%BopControlPanel%MiddleRamsOpenLED)
  47. ! call json%get(p,'MiddleRamsCloseLED',pval)
  48. ! call json%get(pval,data%Equipments%BopControlPanel%MiddleRamsCloseLED)
  49. ! call json%get(p,'KillLineOpenLED',pval)
  50. ! call json%get(pval,data%Equipments%BopControlPanel%KillLineOpenLED)
  51. ! call json%get(p,'KillLineCloseLED',pval)
  52. ! call json%get(pval,data%Equipments%BopControlPanel%KillLineCloseLED)
  53. ! call json%get(p,'ChokeLineOpenLED',pval)
  54. ! call json%get(pval,data%Equipments%BopControlPanel%ChokeLineOpenLED)
  55. ! call json%get(p,'ChokeLineCloseLED',pval)
  56. ! call json%get(pval,data%Equipments%BopControlPanel%ChokeLineCloseLED)
  57. ! call json%get(p,'LowerRamsOpenLED',pval)
  58. ! call json%get(pval,data%Equipments%BopControlPanel%LowerRamsOpenLED)
  59. ! call json%get(p,'LowerRamsCloseLED',pval)
  60. ! call json%get(pval,data%Equipments%BopControlPanel%LowerRamsCloseLED)
  61. ! call json%get(p,'AnnularStatus',pval)
  62. ! call json%get(pval,data%Equipments%BopControlPanel%AnnularStatus)
  63. ! call json%get(p,'UpperRamsStatus',pval)
  64. ! call json%get(pval,data%Equipments%BopControlPanel%UpperRamsStatus)
  65. ! call json%get(p,'MiddleRamsStatus',pval)
  66. ! call json%get(pval,data%Equipments%BopControlPanel%MiddleRamsStatus)
  67. ! call json%get(p,'LowerRamsStatus',pval)
  68. ! call json%get(pval,data%Equipments%BopControlPanel%LowerRamsStatus)
  69. call json%get(p,'AnnularRegulatorSetControl',pval)
  70. call json%get(pval,data%Equipments%BopControlPanel%AnnularRegulatorSetControl)
  71. ! 2. get member of data type from node
  72. end subroutine
  73. subroutine BopControlPanelToJson(parent)
  74. type(json_value),pointer :: parent
  75. type(json_core) :: json
  76. type(json_value),pointer :: p
  77. ! 1. create new node
  78. call json%create_object(p,'BopControl')
  79. ! call json%add(p,"AnnularRegulatorSetControl",data%Equipments%BopControlPanel%AnnularRegulatorSetControl)
  80. call json%add(p,"AirMasterValve",data%Equipments%BopControlPanel%AirMasterValve)
  81. call json%add(p,"ByePassValve",data%Equipments%BopControlPanel%ByePassValve)
  82. ! call json%add(p,"AnnularValve",data%Equipments%BopControlPanel%AnnularValve)
  83. ! call json%add(p,"UpperRamsValve",data%Equipments%BopControlPanel%UpperRamsValve)
  84. ! call json%add(p,"MiddleRamsValve",data%Equipments%BopControlPanel%MiddleRamsValve)
  85. ! call json%add(p,"KillLineValve",data%Equipments%BopControlPanel%KillLineValve)
  86. ! call json%add(p,"ChokeLineValve",data%Equipments%BopControlPanel%ChokeLineValve)
  87. ! call json%add(p,"LowerRamsValve",data%Equipments%BopControlPanel%LowerRamsValve)
  88. call json%add(p,"ManifoldPressureGauge",data%Equipments%BopControlPanel%ManifoldPressureGauge)
  89. call json%add(p,"AirSupplyPressureGauge",data%Equipments%BopControlPanel%AirSupplyPressureGauge)
  90. call json%add(p,"AccumulatorPressureGauge",data%Equipments%BopControlPanel%AccumulatorPressureGauge)
  91. call json%add(p,"AnnularPressureGauge",data%Equipments%BopControlPanel%AnnularPressureGauge)
  92. call json%add(p,"AnnularOpenLED",data%Equipments%BopControlPanel%AnnularOpenLED)
  93. call json%add(p,"AnnularCloseLED",data%Equipments%BopControlPanel%AnnularCloseLED)
  94. call json%add(p,"UpperRamsOpenLED",data%Equipments%BopControlPanel%UpperRamsOpenLED)
  95. call json%add(p,"UpperRamsCloseLED",data%Equipments%BopControlPanel%UpperRamsCloseLED)
  96. call json%add(p,"MiddleRamsOpenLED",data%Equipments%BopControlPanel%MiddleRamsOpenLED)
  97. call json%add(p,"MiddleRamsCloseLED",data%Equipments%BopControlPanel%MiddleRamsCloseLED)
  98. call json%add(p,"KillLineOpenLED",data%Equipments%BopControlPanel%KillLineOpenLED)
  99. call json%add(p,"KillLineCloseLED",data%Equipments%BopControlPanel%KillLineCloseLED)
  100. call json%add(p,"ChokeLineOpenLED",data%Equipments%BopControlPanel%ChokeLineOpenLED)
  101. call json%add(p,"ChokeLineCloseLED",data%Equipments%BopControlPanel%ChokeLineCloseLED)
  102. call json%add(p,"LowerRamsOpenLED",data%Equipments%BopControlPanel%LowerRamsOpenLED)
  103. call json%add(p,"LowerRamsCloseLED",data%Equipments%BopControlPanel%LowerRamsCloseLED)
  104. call json%add(p,"AnnularStatus",data%Equipments%BopControlPanel%AnnularStatus)
  105. call json%add(p,"UpperRamsStatus",data%Equipments%BopControlPanel%UpperRamsStatus)
  106. call json%add(p,"MiddleRamsStatus",data%Equipments%BopControlPanel%MiddleRamsStatus)
  107. call json%add(p,"LowerRamsStatus",data%Equipments%BopControlPanel%LowerRamsStatus)
  108. call json%add(parent,p)
  109. end subroutine
  110. subroutine OpenAnnular()
  111. use CManifolds
  112. implicit none
  113. call ChangeValve(52, .true.)
  114. end subroutine
  115. subroutine CloseAnnular()
  116. use CManifolds
  117. implicit none
  118. call ChangeValve(52, .false.)
  119. end subroutine
  120. subroutine OpenUpperRams()
  121. use CManifolds
  122. implicit none
  123. call ChangeValve(51, .true.)
  124. end subroutine
  125. subroutine CloseUpperRams()
  126. use CManifolds
  127. implicit none
  128. call ChangeValve(51, .false.)
  129. end subroutine
  130. subroutine OpenMiddleRams()
  131. use CManifolds
  132. implicit none
  133. call ToggleMiddleRams(.true.)
  134. end subroutine
  135. subroutine CloseMiddleRams()
  136. use CManifolds
  137. implicit none
  138. call ToggleMiddleRams(.false.)
  139. end subroutine
  140. subroutine OpenKillLine()
  141. use CManifolds
  142. implicit none
  143. call ChangeValve(46, .true.)
  144. end subroutine
  145. subroutine CloseKillLine()
  146. use CManifolds
  147. implicit none
  148. call ChangeValve(46, .false.)
  149. end subroutine
  150. subroutine OpenChokeLine()
  151. use CManifolds
  152. implicit none
  153. call ChangeValve(47, .true.)
  154. !WRITE (*,*) ' valve 47 true '
  155. end subroutine
  156. subroutine CloseChokeLine()
  157. use CManifolds
  158. implicit none
  159. call ChangeValve(47, .false.)
  160. !WRITE (*,*) ' valve 47 false '
  161. end subroutine
  162. subroutine OpenLowerRams()
  163. use CManifolds
  164. implicit none
  165. call ChangeValve(49, .true.)
  166. !WRITE (*,*) ' valve 49 true '
  167. end subroutine
  168. subroutine CloseLowerRams()
  169. use CManifolds
  170. implicit none
  171. call ChangeValve(49, .false.)
  172. !WRITE (*,*) ' valve 49 false '
  173. end subroutine
  174. end module CBopControlPanel