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.i90 12 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
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. # 1 "/home/admin/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(jsonfile)
  13. type(json_value),pointer :: parent
  14. type(json_core) :: json
  15. type(json_value),pointer :: p,pval
  16. type(json_file)::jsonfile
  17. logical::found
  18. integer :: i
  19. call jsonfile%get('Equipments.Drilling.AssignmentSwitch',data%Equipments%DrillingConsole%AssignmentSwitch,found)
  20. if ( .not. found ) call logg(4,"Not found: AssignmentSwitch")
  21. call jsonfile%get('Equipments.Drilling.EmergencySwitch',data%Equipments%DrillingConsole%EmergencySwitch,found)
  22. if ( .not. found ) call logg(4,"Not found: EmergencySwitch")
  23. call jsonfile%get('Equipments.Drilling.RTTorqueLimitKnob',data%Equipments%DrillingConsole%RTTorqueLimitKnob,found)
  24. if ( .not. found ) call logg(4,"Not found: RTTorqueLimitKnob")
  25. call jsonfile%get('Equipments.Drilling.MP1CPSwitchI',data%Equipments%DrillingConsole%MP1CPSwitchI,found)
  26. if ( .not. found ) call logg(4,"Not found: MP1CPSwitchI")
  27. call jsonfile%get('Equipments.Drilling.MP1CPSwitchT',data%Equipments%DrillingConsole%MP1CPSwitchT,found)
  28. if ( .not. found ) call logg(4,"Not found: MP1CPSwitchT")
  29. call jsonfile%get('Equipments.Drilling.MP1CPSwitch',data%Equipments%DrillingConsole%MP1CPSwitch,found)
  30. if ( .not. found ) call logg(4,"Not found: MP1CPSwitch")
  31. call jsonfile%get('Equipments.Drilling.MP1ThrottleUpdate',data%Equipments%DrillingConsole%MP1ThrottleUpdate,found)
  32. if ( .not. found ) call logg(4,"Not found: MP1ThrottleUpdate")
  33. call jsonfile%get('Equipments.Drilling.MP1Throttle',data%Equipments%DrillingConsole%MP1Throttle,found)
  34. if ( .not. found ) then
  35. call logg(4,"Not found: MP1Throttle")
  36. endif
  37. call jsonfile%get('Equipments.Drilling.MP2SwitchI',data%Equipments%DrillingConsole%MP2SwitchI,found)
  38. if ( .not. found ) call logg(4,"Not found: MP2SwitchI")
  39. call jsonfile%get('Equipments.Drilling.MP2SwitchT',data%Equipments%DrillingConsole%MP2SwitchT,found)
  40. if ( .not. found ) call logg(4,"Not found: MP2SwitchT")
  41. call jsonfile%get('Equipments.Drilling.MP2Switch',data%Equipments%DrillingConsole%MP2Switch,found)
  42. if ( .not. found ) call logg(4,"Not found: MP2Switch")
  43. call jsonfile%get('Equipments.Drilling.MP2ThrottleUpdate',data%Equipments%DrillingConsole%MP2ThrottleUpdate,found)
  44. if ( .not. found ) call logg(4,"Not found: MP2ThrottleUpdate")
  45. call jsonfile%get('Equipments.Drilling.MP2Throttle',data%Equipments%DrillingConsole%MP2Throttle,found)
  46. if ( .not. found ) then
  47. call logg(4,"Not found: MP2Throttle")
  48. endif
  49. ! call jsonfile%get('Equipments.Drilling.DWSwitch',data%Equipments%DrillingConsole%DWSwitch,found)
  50. ! if ( .not. found ) call logg(4,"Not found: DWSwitch")
  51. call jsonfile%get('Equipments.Drilling.DWThrottle',data%Equipments%DrillingConsole%DWThrottle,found)
  52. if ( .not. found ) call logg(4,"Not found: DWThrottle")
  53. call jsonfile%get('Equipments.Drilling.RTSwitch',data%Equipments%DrillingConsole%RTSwitch,found)
  54. if ( .not. found ) call logg(4,"Not found: RTSwitch")
  55. call jsonfile%get('Equipments.Drilling.RTThrottle',i,found)
  56. data%Equipments%DrillingConsole%RTThrottle = real(i)
  57. if ( .not. found ) then
  58. call logg(4,"Not found: RTThrottle")
  59. endif
  60. call jsonfile%get('Equipments.Drilling.DWBreak',data%Equipments%DrillingConsole%DWBreak,found)
  61. if ( .not. found ) call logg(4,"Not found: DWBreak")
  62. call jsonfile%get('Equipments.Drilling.PreviousDWBreak',data%Equipments%DrillingConsole%PreviousDWBreak,found)
  63. if ( .not. found ) call logg(4,"Not found: PreviousDWBreak")
  64. call jsonfile%get('Equipments.Drilling.ForceBreak',data%Equipments%DrillingConsole%ForceBreak,found)
  65. if ( .not. found ) call logg(4,"Not found: ForceBreak")
  66. call jsonfile%get('Equipments.Drilling.DWAcceleretor',data%Equipments%DrillingConsole%DWAcceleretor,found)
  67. if ( .not. found ) call logg(4,"Not found: DWAcceleretor")
  68. call jsonfile%get('Equipments.Drilling.DWTransmisionLever',data%Equipments%DrillingConsole%DWTransmisionLever,found)
  69. if ( .not. found ) call logg(4,"Not found: DWTransmisionLever")
  70. call jsonfile%get('Equipments.Drilling.DWPowerLever',data%Equipments%DrillingConsole%DWPowerLever,found)
  71. if ( .not. found ) call logg(4,"Not found: DWPowerLever")
  72. call jsonfile%get('Equipments.Drilling.TongLever',data%Equipments%DrillingConsole%TongLever,found)
  73. if ( .not. found ) call logg(4,"Not found: TongLever")
  74. call jsonfile%get('Equipments.Drilling.RTTransmissionLever',data%Equipments%DrillingConsole%RTTransmissionLever,found)
  75. if ( .not. found ) call logg(4,"Not found: RTTransmissionLever")
  76. call jsonfile%get('Equipments.Drilling.DWClutchLever',data%Equipments%DrillingConsole%DWClutchLever,found)
  77. if ( .not. found ) call logg(4,"Not found: DWClutchLever")
  78. call jsonfile%get('Equipments.Drilling.EddyBreakLever',data%Equipments%DrillingConsole%EddyBreakLever,found)
  79. if ( .not. found ) call logg(4,"Not found: EddyBreakLever")
  80. call jsonfile%get('Equipments.Drilling.AutoDW',data%Equipments%DrillingConsole%AutoDW,found)
  81. if ( .not. found ) call logg(4,"Not found: AutoDW")
  82. call jsonfile%get('Equipments.Drilling.GEN1',data%Equipments%DrillingConsole%GEN1,found)
  83. if ( .not. found ) call logg(4,"Not found: GEN1")
  84. call jsonfile%get('Equipments.Drilling.GEN2',data%Equipments%DrillingConsole%GEN2,found)
  85. if ( .not. found ) call logg(4,"Not found: GEN2")
  86. call jsonfile%get('Equipments.Drilling.GEN3',data%Equipments%DrillingConsole%GEN3,found)
  87. if ( .not. found ) call logg(4,"Not found: GEN3")
  88. call jsonfile%get('Equipments.Drilling.GEN4',data%Equipments%DrillingConsole%GEN4,found)
  89. if ( .not. found ) call logg(4,"Not found: GEN4")
  90. call jsonfile%get('Equipments.Drilling.Permission_OpenKellyCock',data%Equipments%DrillingConsole%Permission_OpenKellyCock,found)
  91. if ( .not. found ) call logg(4,"Not found: Permission_OpenKellyCock")
  92. call jsonfile%get('Equipments.Drilling.OpenKellyCock',data%Equipments%DrillingConsole%OpenKellyCock,found)
  93. if ( .not. found ) call logg(4,"Not found: OpenKellyCock")
  94. call jsonfile%get('Equipments.Drilling.Permission_CloseKellyCock',data%Equipments%DrillingConsole%Permission_CloseKellyCock,found)
  95. if ( .not. found ) call logg(4,"Not found: Permission_CloseKellyCock")
  96. call jsonfile%get('Equipments.Drilling.CloseKellyCock',data%Equipments%DrillingConsole%CloseKellyCock,found)
  97. if ( .not. found ) call logg(4,"Not found: CloseKellyCock")
  98. call jsonfile%get('Equipments.Drilling.Permission_OpenSafetyValve',data%Equipments%DrillingConsole%Permission_OpenSafetyValve,found)
  99. if ( .not. found ) call logg(4,"Not found: Permission_OpenSafetyValve")
  100. call jsonfile%get('Equipments.Drilling.OpenSafetyValve',data%Equipments%DrillingConsole%OpenSafetyValve,found)
  101. if ( .not. found ) call logg(4,"Not found: OpenSafetyValve")
  102. call jsonfile%get('Equipments.Drilling.Permission_CloseSafetyValve',data%Equipments%DrillingConsole%Permission_CloseSafetyValve,found)
  103. if ( .not. found ) call logg(4,"Not found: Permission_CloseSafetyValve")
  104. call jsonfile%get('Equipments.Drilling.CloseSafetyValve',data%Equipments%DrillingConsole%CloseSafetyValve,found)
  105. if ( .not. found ) call logg(4,"Not found: CloseSafetyValve")
  106. call jsonfile%get('Equipments.Drilling.Permission_IRSafetyValve',data%Equipments%DrillingConsole%Permission_IRSafetyValve,found)
  107. if ( .not. found ) call logg(4,"Not found: Permission_IRSafetyValve")
  108. call jsonfile%get('Equipments.Drilling.IRSafetyValve',data%Equipments%DrillingConsole%IRSafetyValve,found)
  109. if ( .not. found ) call logg(4,"Not found: IRSafetyValve")
  110. call jsonfile%get('Equipments.Drilling.Permission_IRIBop',data%Equipments%DrillingConsole%Permission_IRIBop,found)
  111. if ( .not. found ) call logg(4,"Not found: Permission_IRIBop")
  112. call jsonfile%get('Equipments.Drilling.IRIBop',data%Equipments%DrillingConsole%IRIBop,found)
  113. if ( .not. found ) call logg(4,"Not found: IRIBop")
  114. call jsonfile%get('Equipments.Drilling.LatchPipe',data%Equipments%DrillingConsole%LatchPipe,found)
  115. if ( .not. found ) call logg(4,"Not found: LatchPipe")
  116. call jsonfile%get('Equipments.Drilling.UnlatchPipe',data%Equipments%DrillingConsole%UnlatchPipe,found)
  117. if ( .not. found ) call logg(4,"Not found: UnlatchPipe")
  118. call jsonfile%get('Equipments.Drilling.Swing',data%Equipments%DrillingConsole%Swing,found)
  119. if ( .not. found ) call logg(4,"Not found: Swing")
  120. call jsonfile%get('Equipments.Drilling.FillMouseHole',data%Equipments%DrillingConsole%FillMouseHole,found)
  121. if ( .not. found ) call logg(4,"Not found: FillMouseHole")
  122. call jsonfile%get('Equipments.Drilling.Slips',data%Equipments%DrillingConsole%Slips,found)
  123. if ( .not. found ) call logg(4,"Not found: Slips")
  124. call jsonfile%get('Equipments.Drilling.BrakeLeverCoefficient',data%Equipments%DrillingConsole%BrakeLeverCoefficient,found)
  125. if ( .not. found ) call logg(4,"Not found: BrakeLeverCoefficient")
  126. call jsonfile%get('Equipments.Drilling.HideDrillingBrake',data%Equipments%DrillingConsole%HideDrillingBrake,found)
  127. if ( .not. found ) call logg(4,"Not found: HideDrillingBrake")
  128. call jsonfile%get('Equipments.Drilling.ParkingBrakeBtn',data%Equipments%DrillingConsole%ParkingBrakeBtn,found)
  129. if ( .not. found ) call logg(4,"Not found: ParkingBrakeBtn")
  130. ! call jsonfile%destroy()
  131. data%Equipments%DrillingConsole%DWSwitch = -1
  132. data%Equipments%DrillingConsole%AssignmentSwitch = 1
  133. data%Equipments%DrillingConsole%MP1CPSwitch = -1
  134. data%Equipments%DrillingConsole%MP2Switch = -1
  135. data%Equipments%DrillingConsole%RTSwitch = -1
  136. end subroutine
  137. subroutine DrillingConsoleToJson(parent)
  138. type(json_value),pointer :: parent
  139. type(json_core) :: json
  140. type(json_value),pointer :: p
  141. ! 1. create new node
  142. call json%create_object(p,'Drilling')
  143. call json%add(p,"ParkingBrakeLed",data%Equipments%DrillingConsole%ParkingBrakeLed)
  144. call json%add(p,"GEN1LED",data%Equipments%DrillingConsole%GEN1LED)
  145. call json%add(p,"GEN2LED",data%Equipments%DrillingConsole%GEN2LED)
  146. call json%add(p,"GEN3LED",data%Equipments%DrillingConsole%GEN3LED)
  147. call json%add(p,"GEN4LED",data%Equipments%DrillingConsole%GEN4LED)
  148. call json%add(p,"SCR1LED",data%Equipments%DrillingConsole%SCR1LED)
  149. call json%add(p,"SCR2LED",data%Equipments%DrillingConsole%SCR2LED)
  150. call json%add(p,"SCR3LED",data%Equipments%DrillingConsole%SCR3LED)
  151. call json%add(p,"SCR4LED",data%Equipments%DrillingConsole%SCR4LED)
  152. call json%add(p,"MP1BLWR",data%Equipments%DrillingConsole%MP1BLWR)
  153. call json%add(p,"MP2BLWR",data%Equipments%DrillingConsole%MP2BLWR)
  154. call json%add(p,"DWBLWR",data%Equipments%DrillingConsole%DWBLWR)
  155. call json%add(p,"RTBLWR",data%Equipments%DrillingConsole%RTBLWR)
  156. call json%add(p,"PWRLIM",data%Equipments%DrillingConsole%PWRLIM)
  157. call json%add(p,"PWRLIMMTR",data%Equipments%DrillingConsole%PWRLIMMTR)
  158. call json%add(p,"RTTorqueLimitGauge",data%Equipments%DrillingConsole%RTTorqueLimitGauge)
  159. call json%add(p,"AutoDWLED",data%Equipments%DrillingConsole%AutoDWLED)
  160. call json%add(p,"GEN1BTNLED",data%Equipments%DrillingConsole%GEN1BTNLED)
  161. call json%add(p,"GEN2BTNLED",data%Equipments%DrillingConsole%GEN2BTNLED)
  162. call json%add(p,"GEN3BTNLED",data%Equipments%DrillingConsole%GEN3BTNLED)
  163. call json%add(p,"GEN4BTNLED",data%Equipments%DrillingConsole%GEN4BTNLED)
  164. call json%add(p,"OpenKellyCockLed",data%Equipments%DrillingConsole%OpenKellyCockLed)
  165. call json%add(p,"CloseKellyCockLed",data%Equipments%DrillingConsole%CloseKellyCockLed)
  166. call json%add(p,"OpenSafetyValveLed",data%Equipments%DrillingConsole%OpenSafetyValveLed)
  167. call json%add(p,"CloseSafetyValveLed",data%Equipments%DrillingConsole%CloseSafetyValveLed)
  168. call json%add(p,"IRSafetyValveLed",data%Equipments%DrillingConsole%IRSafetyValveLed)
  169. call json%add(p,"IRIBopLed",data%Equipments%DrillingConsole%IRIBopLed)
  170. call json%add(p,"LatchPipeLED",data%Equipments%DrillingConsole%LatchPipeLED)
  171. call json%add(p,"UnlatchPipeLED",data%Equipments%DrillingConsole%UnlatchPipeLED)
  172. call json%add(p,"SwingLed",data%Equipments%DrillingConsole%SwingLed)
  173. call json%add(p,"FillMouseHoleLed",data%Equipments%DrillingConsole%FillMouseHoleLed)
  174. call json%add(parent,p)
  175. end subroutine
  176. end module CDrillingConsole