Fixes issues with IDF file I/O on Windows (the famous 'ascii vs. binary' issue) and the reported problem of partial paths when KISYS3DMOD is specified.
This commit is contained in:
parent
960ea566d6
commit
b269128b8c
|
@ -378,7 +378,7 @@ static void idf_export_module( BOARD* aPcb, MODULE* aModule,
|
||||||
|
|
||||||
IDF3_COMP_OUTLINE* outline;
|
IDF3_COMP_OUTLINE* outline;
|
||||||
|
|
||||||
outline = aIDFBoard.GetComponentOutline( modfile->GetShape3DName() );
|
outline = aIDFBoard.GetComponentOutline( modfile->GetShape3DFullFilename() );
|
||||||
|
|
||||||
if( !outline )
|
if( !outline )
|
||||||
throw( std::runtime_error( aIDFBoard.GetError() ) );
|
throw( std::runtime_error( aIDFBoard.GetError() ) );
|
||||||
|
|
|
@ -200,6 +200,9 @@ void BOARD_OUTLINE::readOutlines( std::ifstream& aBoardFile, IDF3::IDF_VERSION a
|
||||||
// rewind to the start of the last line; the routine invoking
|
// rewind to the start of the last line; the routine invoking
|
||||||
// this is responsible for checking that the current '.END_ ...'
|
// this is responsible for checking that the current '.END_ ...'
|
||||||
// matches the section header.
|
// matches the section header.
|
||||||
|
if(aBoardFile.eof())
|
||||||
|
aBoardFile.clear();
|
||||||
|
|
||||||
aBoardFile.seekg( pos );
|
aBoardFile.seekg( pos );
|
||||||
|
|
||||||
if( outlines.size() > 0 )
|
if( outlines.size() > 0 )
|
||||||
|
@ -2998,6 +3001,9 @@ void IDF3_COMP_OUTLINE::readProperties( std::ifstream& aLibFile )
|
||||||
|
|
||||||
if( token.size() >= 5 && CompareToken( ".END_", token.substr( 0, 5 ) ) )
|
if( token.size() >= 5 && CompareToken( ".END_", token.substr( 0, 5 ) ) )
|
||||||
{
|
{
|
||||||
|
if(aLibFile.eof())
|
||||||
|
aLibFile.clear();
|
||||||
|
|
||||||
aLibFile.seekg( pos );
|
aLibFile.seekg( pos );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2306,7 +2306,7 @@ void IDF3_BOARD::readBoardFile( const std::string& aFileName, bool aNoSubstitute
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
brd.open( aFileName.c_str(), std::ios_base::in );
|
brd.open( aFileName.c_str(), std::ios_base::in | std::ios_base::binary );
|
||||||
|
|
||||||
if( !brd.is_open() )
|
if( !brd.is_open() )
|
||||||
{
|
{
|
||||||
|
@ -2682,7 +2682,7 @@ void IDF3_BOARD::readLibFile( const std::string& aFileName )
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
lib.open( aFileName.c_str(), std::ios_base::in );
|
lib.open( aFileName.c_str(), std::ios_base::in | std::ios_base::binary );
|
||||||
|
|
||||||
IDF3::FILE_STATE state = IDF3::FILE_START;
|
IDF3::FILE_STATE state = IDF3::FILE_START;
|
||||||
|
|
||||||
|
@ -3883,7 +3883,7 @@ IDF3_COMP_OUTLINE* IDF3_BOARD::GetComponentOutline( wxString aFullFileName )
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
model.open( fname.c_str(), std::ios_base::in );
|
model.open( fname.c_str(), std::ios_base::in | std::ios_base::binary );
|
||||||
|
|
||||||
|
|
||||||
std::string iline; // the input line
|
std::string iline; // the input line
|
||||||
|
|
Loading…
Reference in New Issue