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.
 
 
 
 
 
 

291 lines
16 KiB

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