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.i90 3.4 KiB

1 year ago
1 year ago
1 year ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. # 1 "/home/admin/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(jsonfile)
  9. type(json_file)::jsonfile
  10. logical::found
  11. call jsonfile%get('Equipments.ChokeControl.ChokePanelPumpSelectorSwitch',data%Equipments%ChokeControlPanel%ChokePanelPumpSelectorSwitch,found)
  12. if ( .not. found ) call logg(4,"Not found: ChokeControlPanel%ChokePanelPumpSelectorSwitch")
  13. call jsonfile%get('Equipments.ChokeControl.ChokePanelStrokeResetSwitch',data%Equipments%ChokeControlPanel%ChokePanelStrokeResetSwitch,found)
  14. if ( .not. found ) call logg(4,"Not found: ChokeControlPanel%ChokePanelStrokeResetSwitch")
  15. call jsonfile%get('Equipments.ChokeControl.ChokeSelectorSwitch',data%Equipments%ChokeControlPanel%ChokeSelectorSwitch,found)
  16. if ( .not. found ) call logg(4,"Not found: ChokeControlPanel%ChokeSelectorSwitch")
  17. call jsonfile%get('Equipments.ChokeControl.ChokeRateControlKnob',data%Equipments%ChokeControlPanel%ChokeRateControlKnob,found)
  18. if ( .not. found ) call logg(4,"Not found: ChokeControlPanel%ChokeRateControlKnob")
  19. call jsonfile%get('Equipments.ChokeControl.ChokeControlLever',data%Equipments%ChokeControlPanel%ChokeControlLever,found)
  20. if ( .not. found ) call logg(4,"Not found: ChokeControlPanel%ChokeControlLever")
  21. call jsonfile%get('Equipments.ChokeControl.ChokePanelRigAirSwitch',data%Equipments%ChokeControlPanel%ChokePanelRigAirSwitch,found)
  22. if ( .not. found ) call logg(4,"Not found: ChokeControlPanel%ChokePanelRigAirSwitch")
  23. ! print *,data%Equipments%ChokeControlPanel%ChokeSelectorSwitch
  24. end subroutine
  25. subroutine ChokeControlPanelToJson(parent)
  26. type(json_value),pointer :: parent
  27. type(json_core) :: json
  28. type(json_value),pointer :: p
  29. ! 1. create new node
  30. call json%create_object(p,'ChokeControl')
  31. call json%add(p,"ChokePanelPumpSelectorSwitch",data%Equipments%ChokeControlPanel%ChokePanelPumpSelectorSwitch)
  32. call json%add(p,"ChokePanelStrokeResetSwitch",data%Equipments%ChokeControlPanel%ChokePanelStrokeResetSwitch)
  33. call json%add(p,"ChokeSelectorSwitch",data%Equipments%ChokeControlPanel%ChokeSelectorSwitch)
  34. call json%add(p,"ChokeRateControlKnob",data%Equipments%ChokeControlPanel%ChokeRateControlKnob)
  35. call json%add(p,"ChokeControlLever",data%Equipments%ChokeControlPanel%ChokeControlLever)
  36. call json%add(p,"ChokePanelRigAirSwitch",data%Equipments%ChokeControlPanel%ChokePanelRigAirSwitch)
  37. ! call json%add(p,"EnableAutoChoke",data%Equipments%ChokeControlPanel%EnableAutoChoke)
  38. call json%add(p,"StandPipePressure",data%Equipments%ChokeControlPanel%StandPipePressure)
  39. call json%add(p,"CasingPressure",data%Equipments%ChokeControlPanel%CasingPressure)
  40. call json%add(p,"ChokePosition",data%Equipments%ChokeControlPanel%ChokePosition)
  41. call json%add(p,"ChokePanelSPMCounter",data%Equipments%ChokeControlPanel%ChokePanelSPMCounter)
  42. call json%add(p,"ChokePanelTotalStrokeCounter",data%Equipments%ChokeControlPanel%ChokePanelTotalStrokeCounter)
  43. call json%add(p,"Choke1LED",data%Equipments%ChokeControlPanel%Choke1LED)
  44. call json%add(p,"Choke2LED",data%Equipments%ChokeControlPanel%Choke2LED)
  45. call json%add(parent,p)
  46. end subroutine
  47. end module CChokeControlPanel