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.
 
 
 
 
 
 

45 lines
1.7 KiB

  1. module CPathGeneration
  2. use SimulationVariables !@
  3. use json_module
  4. implicit none
  5. public
  6. contains
  7. subroutine PathGenerationToJson(parent)
  8. type(json_value),pointer :: parent
  9. type(json_core) :: json
  10. type(json_value),pointer :: ppath,pitems,pdp,p
  11. integer::i
  12. ! 1. create new node
  13. call json%create_object(ppath,'Path')
  14. call json%create_array(pitems,'Items')
  15. do i=1,data%Configuration%Path%ItemCount
  16. call json%create_object(p,'')
  17. call json%add(p,"HoleType",data%Configuration%Path%items(i)%HoleType)
  18. call json%add(p,"Angle",data%Configuration%Path%items(i)%Angle)
  19. call json%add(p,"Length",data%Configuration%Path%items(i)%Length)
  20. call json%add(p,"FinalAngle",data%Configuration%Path%items(i)%FinalAngle)
  21. call json%add(p,"TotalLength",data%Configuration%Path%items(i)%TotalLength)
  22. call json%add(p,"MeasuredDepth",data%Configuration%Path%items(i)%MeasuredDepth)
  23. call json%add(p,"TotalVerticalDepth",data%Configuration%Path%items(i)%TotalVerticalDepth)
  24. call json%add(pitems,p)
  25. end do
  26. call json%create_array(pdp,'DataPoints')
  27. do i=1,data%Configuration%Path%DataPointsCount
  28. call json%create_object(p,'')
  29. call json%add(p,"X",data%Configuration%Path%DataPoints(i)%X)
  30. call json%add(p,"Y",data%Configuration%Path%DataPoints(i)%Y)
  31. call json%add(pdp,p)
  32. end do
  33. ! 3. add new node to parent
  34. call json%add(ppath,pitems)
  35. call json%add(ppath,pdp)
  36. call json%add(parent,ppath)
  37. end subroutine
  38. end module CPathGeneration