This routine load stl_files table from configuration file Need to look for: * filename (mandatory) * fileformat (default binary)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_stlHead_type), | intent(inout) | :: | me |
contain stl files information from config file |
||
type(flu_State) | :: | conf | ||||
integer, | intent(in) | :: | thandle |
subroutine tem_load_stlHead_single( me, conf, thandle )
! --------------------------------------------------------------------------!
!> contain stl files information from config file
type(tem_stlHead_type), intent(inout) :: me
type(flu_State) :: conf !< lua state
integer, intent(in) :: thandle !< stl object handle
! --------------------------------------------------------------------------!
integer :: iError
character(len=6) :: formString
! --------------------------------------------------------------------------!
me%fileformat = stl_bin
call aot_get_val(L=conf, thandle=thandle, &
& val=me%filename, ErrCode=iError, &
& key='filename', pos=1)
if (btest(iError, aoterr_Fatal)) then
write(logunit(0),*) 'FATAL Error occured, while retrieving filename:'
if (btest(iError, aoterr_NonExistent)) &
& write(logunit(0),*) 'Variable not existent!'
if (btest(iError, aoterr_WrongType)) &
& write(logunit(0),*) 'Variable has wrong type!'
call tem_abort()
end if
call aot_get_val(L=conf, thandle=thandle, &
& val=formString, ErrCode=iError, &
& key='format', pos=3, default='binary')
if (btest(iError, aoterr_Fatal)) then
write(logunit(0),*) 'FATAL Error occured, while retrieving fileformat:'
if (btest(iError, aoterr_NonExistent)) &
& write(logunit(0),*) 'Variable not existent!'
if (btest(iError, aoterr_WrongType)) &
& write(logunit(0),*) 'Variable has wrong type!'
call tem_abort()
else
if (btest(iError, aoterr_NonExistent)) &
& write(logunit(5),*) 'Variable fileformat not set in configuration, ' &
& // 'using default value!'
end if
if (formString(1:1) == 'a') me%fileformat = stl_ascii
select case(me%fileformat)
case(stl_bin)
formstring = 'binary'
case(stl_ascii)
formstring = 'ascii'
end select
write(logunit(1),"(A)") ' STL file: '//trim(me%filename)
write(logunit(1),"(A)") ' format: '//trim(formstring)
end subroutine tem_load_stlHead_single