|
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- 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
- BitDefinition%BitType = bit%BitType
- BitDefinition%BitSize = bit%BitSize
- BitDefinition%BitCodeHundreds = bit%BitCodeHundreds
- BitDefinition%BitCodeTens = bit%BitCodeTens
- BitDefinition%BitCodeOnes = bit%BitCodeOnes
- BitDefinition%BitNozzleSize = bit%BitNozzleSize
- BitDefinition%BitLength = bit%BitLength
- BitDefinition%BitWeightPerLength = bit%BitWeightPerLength
- BitDefinition%BitNozzleNo = bit%BitNozzleNo
- BitDefinition%FloatValve = bit%FloatValve
- StringConfigurationCount = count
-
- if(BitDefinition%FloatValve) then
- call InstallFloatValve()
- else
- call RemoveFloatValve()
- endif
-
- if(size(StringConfigurations) > 0) then
- deallocate(StringConfigurations)
- end if
- if(count > 0) then
- allocate(StringConfigurations(count))
- !j = count
- do i = 1, count
- item => array(i)
- StringConfigurations(i)%ComponentType = item%ComponentType
- StringConfigurations(i)%NumberOfJoint = item%NumberOfJoint
- StringConfigurations(i)%LengthPerJoint = item%LengthPerJoint
- StringConfigurations(i)%NominalOd = item%NominalOd
- StringConfigurations(i)%NominalId = item%NominalId
- StringConfigurations(i)%WeightPerLength = item%WeightPerLength
- StringConfigurations(i)%ComponentLength = item%ComponentLength
- StringConfigurations(i)%NominalToolJointOd = item%NominalToolJointOd
- 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
|