|
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
- PathGeneration%ItemCount = count
- if(size(PathGeneration%Items) > 0) then
- deallocate(PathGeneration%Items)
- end if
- if(count > 0) then
- allocate(PathGeneration%Items(count))
- do i = 1, count
- item => array(i)
- PathGeneration%Items(i)%HoleType = item%HoleType
- PathGeneration%Items(i)%Angle = item%Angle
- PathGeneration%Items(i)%Length = item%Length
- PathGeneration%Items(i)%FinalAngle = item%FinalAngle
- PathGeneration%Items(i)%TotalLength = item%TotalLength
- PathGeneration%Items(i)%MeasuredDepth = item%MeasuredDepth
- PathGeneration%Items(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
- PathGeneration%DataPointsCount = count
- if(size(PathGeneration%DataPoints) > 0) then
- deallocate(PathGeneration%DataPoints)
- end if
- if(count > 0) then
- allocate(PathGeneration%DataPoints(count))
- do i = 1, count
- item => array(i)
- PathGeneration%DataPoints(i)%X = item%X
- PathGeneration%DataPoints(i)%Y = item%Y
- end do
- end if
-
- SetPathGenerationDataPoints = 0
- end function SetPathGenerationDataPoints
- end module CPathGeneration
|