Simulation Core
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 
 
 

89 行
4.1 KiB

  1. # 1 "/home/admin/SimulationCore2/CSharp/Equipments/DrillWatch/DrillWatch.f90"
  2. module DrillingWatchModule
  3. use SimulationVariables
  4. contains
  5. ! subroutine DrillingWatchFromJson(parent)
  6. ! type(json_value),pointer :: parent
  7. ! type(json_core) :: json
  8. ! type(json_value),pointer :: p,pval
  9. ! logical::is_found
  10. ! ! 1. get related root
  11. ! call json%get(parent,'DrillingWatch',p)
  12. ! ! 2. get member of data type from node
  13. ! call json%get(p,'Depth',pval)
  14. ! call json%get(pval,data%Equipments%DrillingWatch%Depth)
  15. ! call json%get(p,'BitPosition',pval)
  16. ! call json%get(pval,data%Equipments%DrillingWatch%BitPosition)
  17. ! call json%get(p,'HookLoad',pval)
  18. ! call json%get(pval,data%Equipments%DrillingWatch%HookLoad)
  19. ! call json%get(p,'WeightOnBit',pval)
  20. ! call json%get(pval,data%Equipments%DrillingWatch%WeightOnBit)
  21. ! call json%get(p,'RPM',pval)
  22. ! call json%get(pval,data%Equipments%DrillingWatch%RPM)
  23. ! call json%get(p,'ROP',pval)
  24. ! call json%get(pval,data%Equipments%DrillingWatch%ROP)
  25. ! call json%get(p,'Torque',pval)
  26. ! call json%get(pval,data%Equipments%DrillingWatch%Torque)
  27. ! call json%get(p,'PumpPressure',pval)
  28. ! call json%get(pval,data%Equipments%DrillingWatch%PumpPressure)
  29. ! call json%get(p,'SPM1',pval)
  30. ! call json%get(pval,data%Equipments%DrillingWatch%SPM1)
  31. ! call json%get(p,'SPM2',pval)
  32. ! call json%get(pval,data%Equipments%DrillingWatch%SPM2)
  33. ! call json%get(p,'CasingPressure',pval)
  34. ! call json%get(pval,data%Equipments%DrillingWatch%CasingPressure)
  35. ! call json%get(p,'PercentFlow',pval)
  36. ! call json%get(pval,data%Equipments%DrillingWatch%PercentFlow)
  37. ! call json%get(p,'PitGainLose',pval)
  38. ! call json%get(pval,data%Equipments%DrillingWatch%PitGainLose)
  39. ! call json%get(p,'PitVolume',pval)
  40. ! call json%get(pval,data%Equipments%DrillingWatch%PitVolume)
  41. ! call json%get(p,'KillMudVolume',pval)
  42. ! call json%get(pval,data%Equipments%DrillingWatch%KillMudVolume)
  43. ! call json%get(p,'TripTankVolume',pval)
  44. ! call json%get(pval,data%Equipments%DrillingWatch%TripTankVolume)
  45. ! call json%get(p,'MudWeightIn',pval)
  46. ! call json%get(pval,data%Equipments%DrillingWatch%MudWeightIn)
  47. ! call json%get(p,'FillVolume',pval)
  48. ! call json%get(pval,data%Equipments%DrillingWatch%FillVolume)
  49. ! call json%get(p,'MudWeightOut',pval)
  50. ! call json%get(pval,data%Equipments%DrillingWatch%MudWeightOut)
  51. ! end subroutine
  52. subroutine DrillingWatchToJson(parent)
  53. type(json_value),pointer :: parent
  54. type(json_core) :: json
  55. type(json_value),pointer :: p
  56. ! 1. create new node
  57. call json%create_object(p,'DrillingWatch')
  58. call json%add(p,"Depth",data%Equipments%DrillingWatch%Depth)
  59. call json%add(p,"BitPosition",data%Equipments%DrillingWatch%BitPosition)
  60. call json%add(p,"HookLoad",data%Equipments%DrillingWatch%HookLoad)
  61. call json%add(p,"WeightOnBit",data%Equipments%DrillingWatch%WeightOnBit)
  62. call json%add(p,"RPM",data%Equipments%DrillingWatch%RPM)
  63. call json%add(p,"ROP",data%Equipments%DrillingWatch%ROP)
  64. call json%add(p,"Torque",data%Equipments%DrillingWatch%Torque)
  65. call json%add(p,"PumpPressure",data%Equipments%DrillingWatch%PumpPressure)
  66. call json%add(p,"SPM1",data%Equipments%DrillingWatch%SPM1)
  67. call json%add(p,"SPM2",data%Equipments%DrillingWatch%SPM2)
  68. call json%add(p,"CasingPressure",data%Equipments%DrillingWatch%CasingPressure)
  69. ! call json%add(p,"PercentFlow",50)
  70. call json%add(p,"PercentFlow",data%Equipments%DrillingWatch%PercentFlow)
  71. call json%add(p,"PitGainLose",data%Equipments%DrillingWatch%PitGainLose)
  72. call json%add(p,"PitVolume",data%Equipments%DrillingWatch%PitVolume)
  73. call json%add(p,"KillMudVolume",data%Equipments%DrillingWatch%KillMudVolume)
  74. call json%add(p,"TripTankVolume",data%Equipments%DrillingWatch%TripTankVolume)
  75. call json%add(p,"MudWeightIn",data%Equipments%DrillingWatch%MudWeightIn)
  76. call json%add(p,"FillVolume",data%Equipments%DrillingWatch%FillVolume)
  77. call json%add(p,"MudWeightOut",data%Equipments%DrillingWatch%MudWeightOut)
  78. call json%add(parent,p)
  79. end subroutine
  80. end module DrillingWatchModule