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.
 
 
 
 
 
 

77 line
3.9 KiB

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