|
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- module CPathGeneration
- use CPathGenerationVariables
- implicit none
- public
- contains
- integer function SetPathGeneration(count, array)
- !DEC$ ATTRIBUTES DLLEXPORT::SetPathGeneration
- !DEC$ ATTRIBUTES ALIAS: 'SetPathGeneration' :: SetPathGeneration
- implicit none
- integer, intent(in) :: count
- integer :: i
- type(CPathGenerationItem), intent(inout), target :: array(count)
- type(CPathGenerationItem), pointer :: item
- PathGenerationCount = count
- if(size(PathGenerations) > 0) then
- deallocate(PathGenerations)
- end if
- if(count > 0) then
- allocate(PathGenerations(count))
- do i = 1, count
- item => array(i)
- PathGenerations(i)%HoleType = item%HoleType
- PathGenerations(i)%Angle = item%Angle
- PathGenerations(i)%Length = item%Length
- PathGenerations(i)%FinalAngle = item%FinalAngle
- PathGenerations(i)%TotalLength = item%TotalLength
- PathGenerations(i)%MeasuredDepth = item%MeasuredDepth
- PathGenerations(i)%TotalVerticalDepth = item%TotalVerticalDepth
- end do
- end if
-
- SetPathGeneration = 0
- end function SetPathGeneration
-
-
- integer function SetPathGenerationDataPoints(count, array)
- !DEC$ ATTRIBUTES DLLEXPORT::SetPathGenerationDataPoints
- !DEC$ ATTRIBUTES ALIAS: 'SetPathGenerationDataPoints' :: SetPathGenerationDataPoints
- implicit none
- integer, intent(in) :: count
- integer :: i
- type(CDataPointItem), intent(inout), target :: array(count)
- type(CDataPointItem), pointer :: item
- PathGenerationDataPointsCount = count
- if(size(PathGenerationDataPoints) > 0) then
- deallocate(PathGenerationDataPoints)
- end if
- if(count > 0) then
- allocate(PathGenerationDataPoints(count))
- do i = 1, count
- item => array(i)
- PathGenerationDataPoints(i)%X = item%X
- PathGenerationDataPoints(i)%Y = item%Y
- end do
- end if
-
- SetPathGenerationDataPoints = 0
- end function SetPathGenerationDataPoints
- end module CPathGeneration
|