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.

CDrillingConsole.f90 16 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289
  1. module CDrillingConsole
  2. use CDrillingConsoleVariables
  3. use SimulationVariables
  4. use SimulationVariables
  5. ! use CSimulationVariables
  6. use CLog4
  7. use CLog3
  8. implicit none
  9. public
  10. contains
  11. subroutine DrillingConsoleFromJson(parent)
  12. type(json_value),pointer :: parent
  13. type(json_core) :: json
  14. type(json_value),pointer :: p,pval
  15. ! 1. get related root
  16. call json%get(parent,'Drilling',p)
  17. ! 2. get member of data type from node
  18. call json%get(p,'AssignmentSwitch',pval)
  19. call json%get(pval,data%Equipments%DrillingConsole%AssignmentSwitch)
  20. call json%get(p,'EmergencySwitch',pval)
  21. call json%get(pval,data%Equipments%DrillingConsole%EmergencySwitch)
  22. call json%get(p,'RTTorqueLimitKnob',pval)
  23. call json%get(pval,data%Equipments%DrillingConsole%RTTorqueLimitKnob)
  24. call json%get(p,'MP1CPSwitchI',pval)
  25. call json%get(pval,data%Equipments%DrillingConsole%MP1CPSwitchI)
  26. call json%get(p,'MP1CPSwitchT',pval)
  27. call json%get(pval,data%Equipments%DrillingConsole%MP1CPSwitchT)
  28. call json%get(p,'MP1CPSwitch',pval)
  29. call json%get(pval,data%Equipments%DrillingConsole%MP1CPSwitch)
  30. call json%get(p,'MP1ThrottleUpdate',pval)
  31. call json%get(pval,data%Equipments%DrillingConsole%MP1ThrottleUpdate)
  32. call json%get(p,'MP1Throttle',pval)
  33. call json%get(pval,data%Equipments%DrillingConsole%MP1Throttle)
  34. call json%get(p,'MP2SwitchI',pval)
  35. call json%get(pval,data%Equipments%DrillingConsole%MP2SwitchI)
  36. call json%get(p,'MP2SwitchT',pval)
  37. call json%get(pval,data%Equipments%DrillingConsole%MP2SwitchT)
  38. call json%get(p,'MP2Switch',pval)
  39. call json%get(pval,data%Equipments%DrillingConsole%MP2Switch)
  40. call json%get(p,'MP2ThrottleUpdate',pval)
  41. call json%get(pval,data%Equipments%DrillingConsole%MP2ThrottleUpdate)
  42. call json%get(p,'MP2Throttle',pval)
  43. call json%get(pval,data%Equipments%DrillingConsole%MP2Throttle)
  44. call json%get(p,'DWSwitch',pval)
  45. call json%get(pval,data%Equipments%DrillingConsole%DWSwitch)
  46. call json%get(p,'DWThrottle',pval)
  47. call json%get(pval,data%Equipments%DrillingConsole%DWThrottle)
  48. call json%get(p,'RTSwitch',pval)
  49. call json%get(pval,data%Equipments%DrillingConsole%RTSwitch)
  50. call json%get(p,'RTThrottle',pval)
  51. call json%get(pval,data%Equipments%DrillingConsole%RTThrottle)
  52. call json%get(p,'DWBreak',pval)
  53. call json%get(pval,data%Equipments%DrillingConsole%DWBreak)
  54. call json%get(p,'PreviousDWBreak',pval)
  55. call json%get(pval,data%Equipments%DrillingConsole%PreviousDWBreak)
  56. call json%get(p,'ForceBreak',pval)
  57. call json%get(pval,data%Equipments%DrillingConsole%ForceBreak)
  58. call json%get(p,'DWAcceleretor',pval)
  59. call json%get(pval,data%Equipments%DrillingConsole%DWAcceleretor)
  60. call json%get(p,'DWTransmisionLever',pval)
  61. call json%get(pval,data%Equipments%DrillingConsole%DWTransmisionLever)
  62. call json%get(p,'DWPowerLever',pval)
  63. call json%get(pval,data%Equipments%DrillingConsole%DWPowerLever)
  64. call json%get(p,'TongLever',pval)
  65. call json%get(pval,data%Equipments%DrillingConsole%TongLever)
  66. call json%get(p,'RTTransmissionLever',pval)
  67. call json%get(pval,data%Equipments%DrillingConsole%RTTransmissionLever)
  68. call json%get(p,'DWClutchLever',pval)
  69. call json%get(pval,data%Equipments%DrillingConsole%DWClutchLever)
  70. call json%get(p,'EddyBreakLever',pval)
  71. call json%get(pval,data%Equipments%DrillingConsole%EddyBreakLever)
  72. call json%get(p,'AutoDW',pval)
  73. call json%get(pval,data%Equipments%DrillingConsole%AutoDW)
  74. call json%get(p,'GEN1',pval)
  75. call json%get(pval,data%Equipments%DrillingConsole%GEN1)
  76. call json%get(p,'GEN2',pval)
  77. call json%get(pval,data%Equipments%DrillingConsole%GEN2)
  78. call json%get(p,'GEN3',pval)
  79. call json%get(pval,data%Equipments%DrillingConsole%GEN3)
  80. call json%get(p,'GEN4',pval)
  81. call json%get(pval,data%Equipments%DrillingConsole%GEN4)
  82. call json%get(p,'Permission_OpenKellyCock',pval)
  83. call json%get(pval,data%Equipments%DrillingConsole%Permission_OpenKellyCock)
  84. call json%get(p,'OpenKellyCock',pval)
  85. call json%get(pval,data%Equipments%DrillingConsole%OpenKellyCock)
  86. call json%get(p,'Permission_CloseKellyCock',pval)
  87. call json%get(pval,data%Equipments%DrillingConsole%Permission_CloseKellyCock)
  88. call json%get(p,'CloseKellyCock',pval)
  89. call json%get(pval,data%Equipments%DrillingConsole%CloseKellyCock)
  90. call json%get(p,'Permission_OpenSafetyValve',pval)
  91. call json%get(pval,data%Equipments%DrillingConsole%Permission_OpenSafetyValve)
  92. call json%get(p,'OpenSafetyValve',pval)
  93. call json%get(pval,data%Equipments%DrillingConsole%OpenSafetyValve)
  94. call json%get(p,'Permission_CloseSafetyValve',pval)
  95. call json%get(pval,data%Equipments%DrillingConsole%Permission_CloseSafetyValve)
  96. call json%get(p,'CloseSafetyValve',pval)
  97. call json%get(pval,data%Equipments%DrillingConsole%CloseSafetyValve)
  98. call json%get(p,'Permission_IRSafetyValve',pval)
  99. call json%get(pval,data%Equipments%DrillingConsole%Permission_IRSafetyValve)
  100. call json%get(p,'IRSafetyValve',pval)
  101. call json%get(pval,data%Equipments%DrillingConsole%IRSafetyValve)
  102. call json%get(p,'Permission_IRIBop',pval)
  103. call json%get(pval,data%Equipments%DrillingConsole%Permission_IRIBop)
  104. call json%get(p,'IRIBop',pval)
  105. call json%get(pval,data%Equipments%DrillingConsole%IRIBop)
  106. call json%get(p,'LatchPipe',pval)
  107. call json%get(pval,data%Equipments%DrillingConsole%LatchPipe)
  108. call json%get(p,'UnlatchPipe',pval)
  109. call json%get(pval,data%Equipments%DrillingConsole%UnlatchPipe)
  110. call json%get(p,'Swing',pval)
  111. call json%get(pval,data%Equipments%DrillingConsole%Swing)
  112. call json%get(p,'FillMouseHole',pval)
  113. call json%get(pval,data%Equipments%DrillingConsole%FillMouseHole)
  114. call json%get(p,'Slips',pval)
  115. call json%get(pval,data%Equipments%DrillingConsole%Slips)
  116. call json%get(p,'BrakeLeverCoefficient',pval)
  117. call json%get(pval,data%Equipments%DrillingConsole%BrakeLeverCoefficient)
  118. call json%get(p,'HideDrillingBrake',pval)
  119. call json%get(pval,data%Equipments%DrillingConsole%HideDrillingBrake)
  120. call json%get(p,'ParkingBrakeBtn',pval)
  121. call json%get(pval,data%Equipments%DrillingConsole%ParkingBrakeBtn)
  122. ! call json%get(p,'ParkingBrakeLed',pval)
  123. ! call json%get(pval,data%Equipments%DrillingConsole%ParkingBrakeLed)
  124. ! call json%get(p,'GEN1LED',pval)
  125. ! call json%get(pval,data%Equipments%DrillingConsole%GEN1LED)
  126. ! call json%get(p,'GEN2LED',pval)
  127. ! call json%get(pval,data%Equipments%DrillingConsole%GEN2LED)
  128. ! call json%get(p,'GEN3LED',pval)
  129. ! call json%get(pval,data%Equipments%DrillingConsole%GEN3LED)
  130. ! call json%get(p,'GEN4LED',pval)
  131. ! call json%get(pval,data%Equipments%DrillingConsole%GEN4LED)
  132. ! call json%get(p,'SCR1LED',pval)
  133. ! call json%get(pval,data%Equipments%DrillingConsole%SCR1LED)
  134. ! call json%get(p,'SCR2LED',pval)
  135. ! call json%get(pval,data%Equipments%DrillingConsole%SCR2LED)
  136. ! call json%get(p,'SCR3LED',pval)
  137. ! call json%get(pval,data%Equipments%DrillingConsole%SCR3LED)
  138. ! call json%get(p,'SCR4LED',pval)
  139. ! call json%get(pval,data%Equipments%DrillingConsole%SCR4LED)
  140. ! call json%get(p,'MP1BLWR',pval)
  141. ! call json%get(pval,data%Equipments%DrillingConsole%MP1BLWR)
  142. ! call json%get(p,'MP2BLWR',pval)
  143. ! call json%get(pval,data%Equipments%DrillingConsole%MP2BLWR)
  144. ! call json%get(p,'DWBLWR',pval)
  145. ! call json%get(pval,data%Equipments%DrillingConsole%DWBLWR)
  146. ! call json%get(p,'RTBLWR',pval)
  147. ! call json%get(pval,data%Equipments%DrillingConsole%RTBLWR)
  148. ! call json%get(p,'PWRLIM',pval)
  149. ! call json%get(pval,data%Equipments%DrillingConsole%PWRLIM)
  150. ! call json%get(p,'PWRLIMMTR',pval)
  151. ! call json%get(pval,data%Equipments%DrillingConsole%PWRLIMMTR)
  152. ! call json%get(p,'RTTorqueLimitGauge',pval)
  153. ! call json%get(pval,data%Equipments%DrillingConsole%RTTorqueLimitGauge)
  154. ! call json%get(p,'AutoDWLED',pval)
  155. ! call json%get(pval,data%Equipments%DrillingConsole%AutoDWLED)
  156. ! call json%get(p,'GEN1BTNLED',pval)
  157. ! call json%get(pval,data%Equipments%DrillingConsole%GEN1BTNLED)
  158. ! call json%get(p,'GEN2BTNLED',pval)
  159. ! call json%get(pval,data%Equipments%DrillingConsole%GEN2BTNLED)
  160. ! call json%get(p,'GEN3BTNLED',pval)
  161. ! call json%get(pval,data%Equipments%DrillingConsole%GEN3BTNLED)
  162. ! call json%get(p,'GEN4BTNLED',pval)
  163. ! call json%get(pval,data%Equipments%DrillingConsole%GEN4BTNLED)
  164. ! call json%get(p,'OpenKellyCockLed',pval)
  165. ! call json%get(pval,data%Equipments%DrillingConsole%OpenKellyCockLed)
  166. ! call json%get(p,'CloseKellyCockLed',pval)
  167. ! call json%get(pval,data%Equipments%DrillingConsole%CloseKellyCockLed)
  168. ! call json%get(p,'OpenSafetyValveLed',pval)
  169. ! call json%get(pval,data%Equipments%DrillingConsole%OpenSafetyValveLed)
  170. ! call json%get(p,'CloseSafetyValveLed',pval)
  171. ! call json%get(pval,data%Equipments%DrillingConsole%CloseSafetyValveLed)
  172. ! call json%get(p,'IRSafetyValveLed',pval)
  173. ! call json%get(pval,data%Equipments%DrillingConsole%IRSafetyValveLed)
  174. ! call json%get(p,'IRIBopLed',pval)
  175. ! call json%get(pval,data%Equipments%DrillingConsole%IRIBopLed)
  176. ! call json%get(p,'LatchPipeLED',pval)
  177. ! call json%get(pval,data%Equipments%DrillingConsole%LatchPipeLED)
  178. ! call json%get(p,'UnlatchPipeLED',pval)
  179. ! call json%get(pval,data%Equipments%DrillingConsole%UnlatchPipeLED)
  180. ! call json%get(p,'SwingLed',pval)
  181. ! call json%get(pval,data%Equipments%DrillingConsole%SwingLed)
  182. ! call json%get(p,'FillMouseHoleLed',pval)
  183. ! call json%get(pval,data%Equipments%DrillingConsole%FillMouseHoleLed)
  184. end subroutine
  185. subroutine DrillingConsoleToJson(parent)
  186. type(json_value),pointer :: parent
  187. type(json_core) :: json
  188. type(json_value),pointer :: p
  189. ! 1. create new node
  190. call json%create_object(p,'Drilling')
  191. ! call json%add(p,"AssignmentSwitch",data%Equipments%DrillingConsole%AssignmentSwitch)
  192. ! call json%add(p,"EmergencySwitch",data%Equipments%DrillingConsole%EmergencySwitch)
  193. ! call json%add(p,"RTTorqueLimitKnob",data%Equipments%DrillingConsole%RTTorqueLimitKnob)
  194. ! call json%add(p,"MP1CPSwitchI",data%Equipments%DrillingConsole%MP1CPSwitchI)
  195. ! call json%add(p,"MP1CPSwitchT",data%Equipments%DrillingConsole%MP1CPSwitchT)
  196. ! call json%add(p,"MP1CPSwitch",data%Equipments%DrillingConsole%MP1CPSwitch)
  197. ! call json%add(p,"MP1ThrottleUpdate",data%Equipments%DrillingConsole%MP1ThrottleUpdate)
  198. ! call json%add(p,"MP1Throttle",data%Equipments%DrillingConsole%MP1Throttle)
  199. ! call json%add(p,"MP2SwitchI",data%Equipments%DrillingConsole%MP2SwitchI)
  200. ! call json%add(p,"MP2SwitchT",data%Equipments%DrillingConsole%MP2SwitchT)
  201. ! call json%add(p,"MP2Switch",data%Equipments%DrillingConsole%MP2Switch)
  202. ! call json%add(p,"MP2ThrottleUpdate",data%Equipments%DrillingConsole%MP2ThrottleUpdate)
  203. ! call json%add(p,"MP2Throttle",data%Equipments%DrillingConsole%MP2Throttle)
  204. ! call json%add(p,"DWSwitch",data%Equipments%DrillingConsole%DWSwitch)
  205. ! call json%add(p,"DWThrottle",data%Equipments%DrillingConsole%DWThrottle)
  206. ! call json%add(p,"RTSwitch",data%Equipments%DrillingConsole%RTSwitch)
  207. ! call json%add(p,"RTThrottle",data%Equipments%DrillingConsole%RTThrottle)
  208. ! call json%add(p,"DWBreak",data%Equipments%DrillingConsole%DWBreak)
  209. ! call json%add(p,"PreviousDWBreak",data%Equipments%DrillingConsole%PreviousDWBreak)
  210. ! call json%add(p,"ForceBreak",data%Equipments%DrillingConsole%ForceBreak)
  211. ! call json%add(p,"DWAcceleretor",data%Equipments%DrillingConsole%DWAcceleretor)
  212. ! call json%add(p,"DWTransmisionLever",data%Equipments%DrillingConsole%DWTransmisionLever)
  213. ! call json%add(p,"DWPowerLever",data%Equipments%DrillingConsole%DWPowerLever)
  214. ! call json%add(p,"TongLever",data%Equipments%DrillingConsole%TongLever)
  215. ! call json%add(p,"RTTransmissionLever",data%Equipments%DrillingConsole%RTTransmissionLever)
  216. ! call json%add(p,"DWClutchLever",data%Equipments%DrillingConsole%DWClutchLever)
  217. ! call json%add(p,"EddyBreakLever",data%Equipments%DrillingConsole%EddyBreakLever)
  218. ! call json%add(p,"AutoDW",data%Equipments%DrillingConsole%AutoDW)
  219. ! call json%add(p,"GEN1",data%Equipments%DrillingConsole%GEN1)
  220. ! call json%add(p,"GEN2",data%Equipments%DrillingConsole%GEN2)
  221. ! call json%add(p,"GEN3",data%Equipments%DrillingConsole%GEN3)
  222. ! call json%add(p,"GEN4",data%Equipments%DrillingConsole%GEN4)
  223. ! call json%add(p,"Permission_OpenKellyCock",data%Equipments%DrillingConsole%Permission_OpenKellyCock)
  224. ! call json%add(p,"OpenKellyCock",data%Equipments%DrillingConsole%OpenKellyCock)
  225. ! call json%add(p,"Permission_CloseKellyCock",data%Equipments%DrillingConsole%Permission_CloseKellyCock)
  226. ! call json%add(p,"CloseKellyCock",data%Equipments%DrillingConsole%CloseKellyCock)
  227. ! call json%add(p,"Permission_OpenSafetyValve",data%Equipments%DrillingConsole%Permission_OpenSafetyValve)
  228. ! call json%add(p,"OpenSafetyValve",data%Equipments%DrillingConsole%OpenSafetyValve)
  229. ! call json%add(p,"Permission_CloseSafetyValve",data%Equipments%DrillingConsole%Permission_CloseSafetyValve)
  230. ! call json%add(p,"CloseSafetyValve",data%Equipments%DrillingConsole%CloseSafetyValve)
  231. ! call json%add(p,"Permission_IRSafetyValve",data%Equipments%DrillingConsole%Permission_IRSafetyValve)
  232. ! call json%add(p,"IRSafetyValve",data%Equipments%DrillingConsole%IRSafetyValve)
  233. ! call json%add(p,"Permission_IRIBop",data%Equipments%DrillingConsole%Permission_IRIBop)
  234. ! call json%add(p,"IRIBop",data%Equipments%DrillingConsole%IRIBop)
  235. ! call json%add(p,"LatchPipe",data%Equipments%DrillingConsole%LatchPipe)
  236. ! call json%add(p,"UnlatchPipe",data%Equipments%DrillingConsole%UnlatchPipe)
  237. ! call json%add(p,"Swing",data%Equipments%DrillingConsole%Swing)
  238. ! call json%add(p,"FillMouseHole",data%Equipments%DrillingConsole%FillMouseHole)
  239. ! call json%add(p,"Slips",data%Equipments%DrillingConsole%Slips)
  240. ! call json%add(p,"BrakeLeverCoefficient",data%Equipments%DrillingConsole%BrakeLeverCoefficient)
  241. ! call json%add(p,"HideDrillingBrake",data%Equipments%DrillingConsole%HideDrillingBrake)
  242. ! call json%add(p,"ParkingBrakeBtn",data%Equipments%DrillingConsole%ParkingBrakeBtn)
  243. call json%add(p,"ParkingBrakeLed",data%Equipments%DrillingConsole%ParkingBrakeLed)
  244. call json%add(p,"GEN1LED",data%Equipments%DrillingConsole%GEN1LED)
  245. call json%add(p,"GEN2LED",data%Equipments%DrillingConsole%GEN2LED)
  246. call json%add(p,"GEN3LED",data%Equipments%DrillingConsole%GEN3LED)
  247. call json%add(p,"GEN4LED",data%Equipments%DrillingConsole%GEN4LED)
  248. call json%add(p,"SCR1LED",data%Equipments%DrillingConsole%SCR1LED)
  249. call json%add(p,"SCR2LED",data%Equipments%DrillingConsole%SCR2LED)
  250. call json%add(p,"SCR3LED",data%Equipments%DrillingConsole%SCR3LED)
  251. call json%add(p,"SCR4LED",data%Equipments%DrillingConsole%SCR4LED)
  252. call json%add(p,"MP1BLWR",data%Equipments%DrillingConsole%MP1BLWR)
  253. call json%add(p,"MP2BLWR",data%Equipments%DrillingConsole%MP2BLWR)
  254. call json%add(p,"DWBLWR",data%Equipments%DrillingConsole%DWBLWR)
  255. call json%add(p,"RTBLWR",data%Equipments%DrillingConsole%RTBLWR)
  256. call json%add(p,"PWRLIM",data%Equipments%DrillingConsole%PWRLIM)
  257. call json%add(p,"PWRLIMMTR",data%Equipments%DrillingConsole%PWRLIMMTR)
  258. call json%add(p,"RTTorqueLimitGauge",data%Equipments%DrillingConsole%RTTorqueLimitGauge)
  259. call json%add(p,"AutoDWLED",data%Equipments%DrillingConsole%AutoDWLED)
  260. call json%add(p,"GEN1BTNLED",data%Equipments%DrillingConsole%GEN1BTNLED)
  261. call json%add(p,"GEN2BTNLED",data%Equipments%DrillingConsole%GEN2BTNLED)
  262. call json%add(p,"GEN3BTNLED",data%Equipments%DrillingConsole%GEN3BTNLED)
  263. call json%add(p,"GEN4BTNLED",data%Equipments%DrillingConsole%GEN4BTNLED)
  264. call json%add(p,"OpenKellyCockLed",data%Equipments%DrillingConsole%OpenKellyCockLed)
  265. call json%add(p,"CloseKellyCockLed",data%Equipments%DrillingConsole%CloseKellyCockLed)
  266. call json%add(p,"OpenSafetyValveLed",data%Equipments%DrillingConsole%OpenSafetyValveLed)
  267. call json%add(p,"CloseSafetyValveLed",data%Equipments%DrillingConsole%CloseSafetyValveLed)
  268. call json%add(p,"IRSafetyValveLed",data%Equipments%DrillingConsole%IRSafetyValveLed)
  269. call json%add(p,"IRIBopLed",data%Equipments%DrillingConsole%IRIBopLed)
  270. call json%add(p,"LatchPipeLED",data%Equipments%DrillingConsole%LatchPipeLED)
  271. call json%add(p,"UnlatchPipeLED",data%Equipments%DrillingConsole%UnlatchPipeLED)
  272. call json%add(p,"SwingLed",data%Equipments%DrillingConsole%SwingLed)
  273. call json%add(p,"FillMouseHoleLed",data%Equipments%DrillingConsole%FillMouseHoleLed)
  274. call json%add(parent,p)
  275. end subroutine
  276. end module CDrillingConsole