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.
 
 
 
 
 
 

199 lines
8.4 KiB

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