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.

CBopControlPanel.f90 8.5 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  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,'AnnularRegulatorSetControl',pval)
  14. call json%get(pval,data%Equipments%BopControlPanel%AnnularRegulatorSetControl)
  15. call json%get(p,'AirMasterValve',pval)
  16. call json%get(pval,data%Equipments%BopControlPanel%AirMasterValve)
  17. call json%get(p,'ByePassValve',pval)
  18. call json%get(pval,data%Equipments%BopControlPanel%ByePassValve)
  19. call json%get(p,'AnnularValve',pval)
  20. call json%get(pval,data%Equipments%BopControlPanel%AnnularValve)
  21. call json%get(p,'UpperRamsValve',pval)
  22. call json%get(pval,data%Equipments%BopControlPanel%UpperRamsValve)
  23. call json%get(p,'MiddleRamsValve',pval)
  24. call json%get(pval,data%Equipments%BopControlPanel%MiddleRamsValve)
  25. call json%get(p,'KillLineValve',pval)
  26. call json%get(pval,data%Equipments%BopControlPanel%KillLineValve)
  27. call json%get(p,'ChokeLineValve',pval)
  28. call json%get(pval,data%Equipments%BopControlPanel%ChokeLineValve)
  29. call json%get(p,'LowerRamsValve',pval)
  30. call json%get(pval,data%Equipments%BopControlPanel%LowerRamsValve)
  31. ! call json%get(p,'ManifoldPressureGauge',pval)
  32. ! call json%get(pval,data%Equipments%BopControlPanel%ManifoldPressureGauge)
  33. ! call json%get(p,'AirSupplyPressureGauge',pval)
  34. ! call json%get(pval,data%Equipments%BopControlPanel%AirSupplyPressureGauge)
  35. ! call json%get(p,'AccumulatorPressureGauge',pval)
  36. ! call json%get(pval,data%Equipments%BopControlPanel%AccumulatorPressureGauge)
  37. ! call json%get(p,'AnnularPressureGauge',pval)
  38. ! call json%get(pval,data%Equipments%BopControlPanel%AnnularPressureGauge)
  39. ! call json%get(p,'AnnularOpenLED',pval)
  40. ! call json%get(pval,data%Equipments%BopControlPanel%AnnularOpenLED)
  41. ! call json%get(p,'AnnularCloseLED',pval)
  42. ! call json%get(pval,data%Equipments%BopControlPanel%AnnularCloseLED)
  43. ! call json%get(p,'UpperRamsOpenLED',pval)
  44. ! call json%get(pval,data%Equipments%BopControlPanel%UpperRamsOpenLED)
  45. ! call json%get(p,'UpperRamsCloseLED',pval)
  46. ! call json%get(pval,data%Equipments%BopControlPanel%UpperRamsCloseLED)
  47. ! call json%get(p,'MiddleRamsOpenLED',pval)
  48. ! call json%get(pval,data%Equipments%BopControlPanel%MiddleRamsOpenLED)
  49. ! call json%get(p,'MiddleRamsCloseLED',pval)
  50. ! call json%get(pval,data%Equipments%BopControlPanel%MiddleRamsCloseLED)
  51. ! call json%get(p,'KillLineOpenLED',pval)
  52. ! call json%get(pval,data%Equipments%BopControlPanel%KillLineOpenLED)
  53. ! call json%get(p,'KillLineCloseLED',pval)
  54. ! call json%get(pval,data%Equipments%BopControlPanel%KillLineCloseLED)
  55. ! call json%get(p,'ChokeLineOpenLED',pval)
  56. ! call json%get(pval,data%Equipments%BopControlPanel%ChokeLineOpenLED)
  57. ! call json%get(p,'ChokeLineCloseLED',pval)
  58. ! call json%get(pval,data%Equipments%BopControlPanel%ChokeLineCloseLED)
  59. ! call json%get(p,'LowerRamsOpenLED',pval)
  60. ! call json%get(pval,data%Equipments%BopControlPanel%LowerRamsOpenLED)
  61. ! call json%get(p,'LowerRamsCloseLED',pval)
  62. ! call json%get(pval,data%Equipments%BopControlPanel%LowerRamsCloseLED)
  63. ! call json%get(p,'AnnularStatus',pval)
  64. ! call json%get(pval,data%Equipments%BopControlPanel%AnnularStatus)
  65. ! call json%get(p,'UpperRamsStatus',pval)
  66. ! call json%get(pval,data%Equipments%BopControlPanel%UpperRamsStatus)
  67. ! call json%get(p,'MiddleRamsStatus',pval)
  68. ! call json%get(pval,data%Equipments%BopControlPanel%MiddleRamsStatus)
  69. ! call json%get(p,'LowerRamsStatus',pval)
  70. ! call json%get(pval,data%Equipments%BopControlPanel%LowerRamsStatus)
  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