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.i90 8.4 KiB

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