|
- module CStringConfiguration
- use CStringConfigurationVariables
- implicit none
- public
- contains
-
- integer function SetStringConfigurations(count, array, bit)
- !DEC$ ATTRIBUTES DLLEXPORT::SetStringConfigurations
- !DEC$ ATTRIBUTES ALIAS: 'SetStringConfigurations' :: SetStringConfigurations
- use CManifolds
- implicit none
- integer, intent(in) :: count
- integer :: i, j
- type(CStringItem), intent(inout), target :: array(count)
- type(CBitInfo), intent(inout) :: bit
- type(CStringItem), pointer :: item
- StringConfiguration%BitDefinition%BitType = bit%BitType
- StringConfiguration%BitDefinition%BitSize = bit%BitSize
- StringConfiguration%BitDefinition%BitCodeHundreds = bit%BitCodeHundreds
- StringConfiguration%BitDefinition%BitCodeTens = bit%BitCodeTens
- StringConfiguration%BitDefinition%BitCodeOnes = bit%BitCodeOnes
- StringConfiguration%BitDefinition%BitNozzleSize = bit%BitNozzleSize
- StringConfiguration%BitDefinition%BitLength = bit%BitLength
- StringConfiguration%BitDefinition%BitWeightPerLength = bit%BitWeightPerLength
- StringConfiguration%BitDefinition%BitNozzleNo = bit%BitNozzleNo
- StringConfiguration%BitDefinition%FloatValve = bit%FloatValve
- StringConfiguration%StringConfigurationCount = count
-
- if(StringConfiguration%BitDefinition%FloatValve) then
- call InstallFloatValve()
- else
- call RemoveFloatValve()
- endif
-
- if(size(StringConfiguration%StringConfigurations) > 0) then
- deallocate(StringConfiguration%StringConfigurations)
- end if
- if(count > 0) then
- allocate(StringConfiguration%StringConfigurations(count))
- !j = count
- do i = 1, count
- item => array(i)
- StringConfiguration%StringConfigurations(i)%ComponentType = item%ComponentType
- StringConfiguration%StringConfigurations(i)%NumberOfJoint = item%NumberOfJoint
- StringConfiguration%StringConfigurations(i)%LengthPerJoint = item%LengthPerJoint
- StringConfiguration%StringConfigurations(i)%NominalOd = item%NominalOd
- StringConfiguration%StringConfigurations(i)%NominalId = item%NominalId
- StringConfiguration%StringConfigurations(i)%WeightPerLength = item%WeightPerLength
- StringConfiguration%StringConfigurations(i)%ComponentLength = item%ComponentLength
- StringConfiguration%StringConfigurations(i)%NominalToolJointOd = item%NominalToolJointOd
- StringConfiguration%StringConfigurations(i)%Grade = item%Grade
- !print*, 'type=', StringConfigurations(i)%ComponentType
- !print*, 'NumberOfJoint=', StringConfigurations(i)%NumberOfJoint
- !print*, '-----------------------------------------------------------'
- !j = j - 1
- end do
- end if
-
- SetStringConfigurations = 0
- end function SetStringConfigurations
-
- end module CStringConfiguration
|