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.

CChokeControlPanel.f90 3.4 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. module CChokeControlPanel
  2. use CChokeControlPanelVariables
  3. use SimulationVariables
  4. implicit none
  5. public
  6. contains
  7. subroutine ChokeControlPanelFromJson(jsonfile)
  8. type(json_file)::jsonfile
  9. logical::found
  10. call jsonfile%get('Equipments.ChokeControl.ChokePanelPumpSelectorSwitch',data%Equipments%ChokeControlPanel%ChokePanelPumpSelectorSwitch,found)
  11. if ( .not. found ) call logg(4,"Not found: ChokeControlPanel%ChokePanelPumpSelectorSwitch")
  12. call jsonfile%get('Equipments.ChokeControl.ChokePanelStrokeResetSwitch',data%Equipments%ChokeControlPanel%ChokePanelStrokeResetSwitch,found)
  13. if ( .not. found ) call logg(4,"Not found: ChokeControlPanel%ChokePanelStrokeResetSwitch")
  14. call jsonfile%get('Equipments.ChokeControl.ChokeSelectorSwitch',data%Equipments%ChokeControlPanel%ChokeSelectorSwitch,found)
  15. if ( .not. found ) call logg(4,"Not found: ChokeControlPanel%ChokeSelectorSwitch")
  16. call jsonfile%get('Equipments.ChokeControl.ChokeRateControlKnob',data%Equipments%ChokeControlPanel%ChokeRateControlKnob,found)
  17. if ( .not. found ) call logg(4,"Not found: ChokeControlPanel%ChokeRateControlKnob")
  18. call jsonfile%get('Equipments.ChokeControl.ChokeControlLever',data%Equipments%ChokeControlPanel%ChokeControlLever,found)
  19. if ( .not. found ) call logg(4,"Not found: ChokeControlPanel%ChokeControlLever")
  20. call jsonfile%get('Equipments.ChokeControl.ChokePanelRigAirSwitch',data%Equipments%ChokeControlPanel%ChokePanelRigAirSwitch,found)
  21. if ( .not. found ) call logg(4,"Not found: ChokeControlPanel%ChokePanelRigAirSwitch")
  22. ! print *,data%Equipments%ChokeControlPanel%ChokeSelectorSwitch
  23. end subroutine
  24. subroutine ChokeControlPanelToJson(parent)
  25. type(json_value),pointer :: parent
  26. type(json_core) :: json
  27. type(json_value),pointer :: p
  28. ! 1. create new node
  29. call json%create_object(p,'ChokeControl')
  30. call json%add(p,"ChokePanelPumpSelectorSwitch",data%Equipments%ChokeControlPanel%ChokePanelPumpSelectorSwitch)
  31. call json%add(p,"ChokePanelStrokeResetSwitch",data%Equipments%ChokeControlPanel%ChokePanelStrokeResetSwitch)
  32. call json%add(p,"ChokeSelectorSwitch",data%Equipments%ChokeControlPanel%ChokeSelectorSwitch)
  33. call json%add(p,"ChokeRateControlKnob",data%Equipments%ChokeControlPanel%ChokeRateControlKnob)
  34. call json%add(p,"ChokeControlLever",data%Equipments%ChokeControlPanel%ChokeControlLever)
  35. call json%add(p,"ChokePanelRigAirSwitch",data%Equipments%ChokeControlPanel%ChokePanelRigAirSwitch)
  36. ! call json%add(p,"EnableAutoChoke",data%Equipments%ChokeControlPanel%EnableAutoChoke)
  37. call json%add(p,"StandPipePressure",data%Equipments%ChokeControlPanel%StandPipePressure)
  38. call json%add(p,"CasingPressure",data%Equipments%ChokeControlPanel%CasingPressure)
  39. call json%add(p,"ChokePosition",data%Equipments%ChokeControlPanel%ChokePosition)
  40. call json%add(p,"ChokePanelSPMCounter",data%Equipments%ChokeControlPanel%ChokePanelSPMCounter)
  41. call json%add(p,"ChokePanelTotalStrokeCounter",data%Equipments%ChokeControlPanel%ChokePanelTotalStrokeCounter)
  42. call json%add(p,"Choke1LED",data%Equipments%ChokeControlPanel%Choke1LED)
  43. call json%add(p,"Choke2LED",data%Equipments%ChokeControlPanel%Choke2LED)
  44. call json%add(parent,p)
  45. end subroutine
  46. end module CChokeControlPanel