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.
 
 
 
 
 
 

75 lines
3.8 KiB

  1. # 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/Equipments/ControlPanels/CChokeControlPanel.f90"
  2. module CChokeControlPanel
  3. use CChokeControlPanelVariables
  4. use SimulationVariables
  5. implicit none
  6. public
  7. contains
  8. subroutine ChokeControlPanelFromJson(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,'ChokeControl',p)
  14. ! 2. get member of data type from node
  15. call json%get(p,'ChokePanelPumpSelectorSwitch',pval)
  16. call json%get(pval,data%Equipments%ChokeControlPanel%ChokePanelPumpSelectorSwitch)
  17. call json%get(p,'ChokePanelStrokeResetSwitch',pval)
  18. call json%get(pval,data%Equipments%ChokeControlPanel%ChokePanelStrokeResetSwitch)
  19. call json%get(p,'ChokeSelectorSwitch',pval)
  20. call json%get(pval,data%Equipments%ChokeControlPanel%ChokeSelectorSwitch)
  21. call json%get(p,'ChokeRateControlKnob',pval)
  22. call json%get(pval,data%Equipments%ChokeControlPanel%ChokeRateControlKnob)
  23. call json%get(p,'ChokeControlLever',pval)
  24. call json%get(pval,data%Equipments%ChokeControlPanel%ChokeControlLever)
  25. call json%get(p,'ChokePanelRigAirSwitch',pval)
  26. call json%get(pval,data%Equipments%ChokeControlPanel%ChokePanelRigAirSwitch)
  27. ! call json%get(p,'EnableAutoChoke',pval)
  28. ! call json%get(pval,data%Equipments%ChokeControlPanel%EnableAutoChoke)
  29. ! call json%get(p,'StandPipePressure',pval)
  30. ! call json%get(pval,data%Equipments%ChokeControlPanel%StandPipePressure)
  31. ! call json%get(p,'CasingPressure',pval)
  32. ! call json%get(pval,data%Equipments%ChokeControlPanel%CasingPressure)
  33. ! call json%get(p,'ChokePosition',pval)
  34. ! call json%get(pval,data%Equipments%ChokeControlPanel%ChokePosition)
  35. ! call json%get(p,'ChokePanelSPMCounter',pval)
  36. ! call json%get(pval,data%Equipments%ChokeControlPanel%ChokePanelSPMCounter)
  37. ! call json%get(p,'ChokePanelTotalStrokeCounter',pval)
  38. ! call json%get(pval,data%Equipments%ChokeControlPanel%ChokePanelTotalStrokeCounter)
  39. ! call json%get(p,'Choke1LED',pval)
  40. ! call json%get(pval,data%Equipments%ChokeControlPanel%Choke1LED)
  41. ! call json%get(p,'Choke2LED',pval)
  42. ! call json%get(pval,data%Equipments%ChokeControlPanel%Choke2LED)
  43. end subroutine
  44. subroutine ChokeControlPanelToJson(parent)
  45. type(json_value),pointer :: parent
  46. type(json_core) :: json
  47. type(json_value),pointer :: p
  48. ! 1. create new node
  49. call json%create_object(p,'ChokeControl')
  50. ! call json%add(p,"ChokePanelPumpSelectorSwitch",data%Equipments%ChokeControlPanel%ChokePanelPumpSelectorSwitch)
  51. ! call json%add(p,"ChokePanelStrokeResetSwitch",data%Equipments%ChokeControlPanel%ChokePanelStrokeResetSwitch)
  52. ! call json%add(p,"ChokeSelectorSwitch",data%Equipments%ChokeControlPanel%ChokeSelectorSwitch)
  53. ! call json%add(p,"ChokeRateControlKnob",data%Equipments%ChokeControlPanel%ChokeRateControlKnob)
  54. ! call json%add(p,"ChokeControlLever",data%Equipments%ChokeControlPanel%ChokeControlLever)
  55. ! call json%add(p,"ChokePanelRigAirSwitch",data%Equipments%ChokeControlPanel%ChokePanelRigAirSwitch)
  56. ! call json%add(p,"EnableAutoChoke",data%Equipments%ChokeControlPanel%EnableAutoChoke)
  57. call json%add(p,"StandPipePressure",data%Equipments%ChokeControlPanel%StandPipePressure)
  58. call json%add(p,"CasingPressure",data%Equipments%ChokeControlPanel%CasingPressure)
  59. call json%add(p,"ChokePosition",data%Equipments%ChokeControlPanel%ChokePosition)
  60. call json%add(p,"ChokePanelSPMCounter",data%Equipments%ChokeControlPanel%ChokePanelSPMCounter)
  61. call json%add(p,"ChokePanelTotalStrokeCounter",data%Equipments%ChokeControlPanel%ChokePanelTotalStrokeCounter)
  62. call json%add(p,"Choke1LED",data%Equipments%ChokeControlPanel%Choke1LED)
  63. call json%add(p,"Choke2LED",data%Equipments%ChokeControlPanel%Choke2LED)
  64. call json%add(parent,p)
  65. end subroutine
  66. end module CChokeControlPanel