kicad2step: Report lack of model definition rather than empty file names

This commit is contained in:
Maciej Suminski 2018-03-19 12:17:09 +01:00
parent 47e4798423
commit eebabf165b
2 changed files with 13 additions and 2 deletions

View File

@ -571,10 +571,21 @@ bool PCBMODEL::AddPadHole( KICADPAD* aPad )
// add a component at the given position and orientation
bool PCBMODEL::AddComponent( const std::string& aFileName, const std::string aRefDes,
bool PCBMODEL::AddComponent( const std::string& aFileName, const std::string& aRefDes,
bool aBottom, DOUBLET aPosition, double aRotation,
TRIPLET aOffset, TRIPLET aOrientation )
{
if( aFileName.empty() )
{
std::ostringstream ostr;
#ifdef __WXDEBUG__
ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
#endif /* __WXDEBUG */
ostr << " * no model defined for component '" << aRefDes << "'\n";
wxLogMessage( "%s", ostr.str().c_str() );
return false;
}
// first retrieve a label
TDF_Label lmodel;

View File

@ -114,7 +114,7 @@ public:
bool AddPadHole( KICADPAD* aPad );
// add a component at the given position and orientation
bool AddComponent( const std::string& aFileName, const std::string aRefDes,
bool AddComponent( const std::string& aFileName, const std::string& aRefDes,
bool aBottom, DOUBLET aPosition, double aRotation,
TRIPLET aOffset, TRIPLET aOrientation );