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.
 
 
 
 
 
 

59 lines
2.0 KiB

  1. module CPathGeneration
  2. use CPathGenerationVariables
  3. implicit none
  4. public
  5. contains
  6. integer function SetPathGeneration(count, array)
  7. !DEC$ ATTRIBUTES DLLEXPORT::SetPathGeneration
  8. !DEC$ ATTRIBUTES ALIAS: 'SetPathGeneration' :: SetPathGeneration
  9. implicit none
  10. integer, intent(in) :: count
  11. integer :: i
  12. type(CPathGenerationItem), intent(inout), target :: array(count)
  13. type(CPathGenerationItem), pointer :: item
  14. PathGeneration%ItemCount = count
  15. if(size(PathGeneration%Items) > 0) then
  16. deallocate(PathGeneration%Items)
  17. end if
  18. if(count > 0) then
  19. allocate(PathGeneration%Items(count))
  20. do i = 1, count
  21. item => array(i)
  22. PathGeneration%Items(i)%HoleType = item%HoleType
  23. PathGeneration%Items(i)%Angle = item%Angle
  24. PathGeneration%Items(i)%Length = item%Length
  25. PathGeneration%Items(i)%FinalAngle = item%FinalAngle
  26. PathGeneration%Items(i)%TotalLength = item%TotalLength
  27. PathGeneration%Items(i)%MeasuredDepth = item%MeasuredDepth
  28. PathGeneration%Items(i)%TotalVerticalDepth = item%TotalVerticalDepth
  29. end do
  30. end if
  31. SetPathGeneration = 0
  32. end function SetPathGeneration
  33. integer function SetPathGenerationDataPoints(count, array)
  34. !DEC$ ATTRIBUTES DLLEXPORT::SetPathGenerationDataPoints
  35. !DEC$ ATTRIBUTES ALIAS: 'SetPathGenerationDataPoints' :: SetPathGenerationDataPoints
  36. implicit none
  37. integer, intent(in) :: count
  38. integer :: i
  39. type(CDataPointItem), intent(inout), target :: array(count)
  40. type(CDataPointItem), pointer :: item
  41. PathGeneration%DataPointsCount = count
  42. if(size(PathGeneration%DataPoints) > 0) then
  43. deallocate(PathGeneration%DataPoints)
  44. end if
  45. if(count > 0) then
  46. allocate(PathGeneration%DataPoints(count))
  47. do i = 1, count
  48. item => array(i)
  49. PathGeneration%DataPoints(i)%X = item%X
  50. PathGeneration%DataPoints(i)%Y = item%Y
  51. end do
  52. end if
  53. SetPathGenerationDataPoints = 0
  54. end function SetPathGenerationDataPoints
  55. end module CPathGeneration