本文整理汇总了C++中COMPONENT::SetLibrary方法的典型用法代码示例。如果您正苦于以下问题:C++ COMPONENT::SetLibrary方法的具体用法?C++ COMPONENT::SetLibrary怎么用?C++ COMPONENT::SetLibrary使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类COMPONENT
的用法示例。
在下文中一共展示了COMPONENT::SetLibrary方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: parseComponent
//.........这里部分代码省略.........
* A component need a reference, value, footprint name and a full time stamp
* The full time stamp is the sheetpath time stamp + the component time stamp
*/
FPID fpid;
wxString footprint;
wxString tmp;
wxString ref;
wxString value;
wxString library;
wxString name;
wxString pathtimestamp, timestamp;
// The token comp was read, so the next data is (ref P1)
while( (token = NextTok()) != T_RIGHT )
{
if( token == T_LEFT )
token = NextTok();
switch( token )
{
case T_ref:
NeedSYMBOLorNUMBER();
ref = FROM_UTF8( CurText() );
NeedRIGHT();
break;
case T_value:
NeedSYMBOLorNUMBER();
value = FROM_UTF8( CurText() );
NeedRIGHT();
break;
case T_footprint:
NeedSYMBOLorNUMBER();
footprint = FromUTF8();
NeedRIGHT();
break;
case T_libsource:
// Read libsource
while( (token = NextTok()) != T_RIGHT )
{
if( token == T_LEFT )
token = NextTok();
if( token == T_lib )
{
NeedSYMBOLorNUMBER();
library = FROM_UTF8( CurText() );
NeedRIGHT();
}
else if( token == T_part )
{
NeedSYMBOLorNUMBER();
name = FROM_UTF8( CurText() );
NeedRIGHT();
}
else
{
Expecting( "part or lib" );
}
}
break;
case T_sheetpath:
while( ( token = NextTok() ) != T_tstamps );
NeedSYMBOLorNUMBER();
pathtimestamp = FROM_UTF8( CurText() );
NeedRIGHT();
NeedRIGHT();
break;
case T_tstamp:
NeedSYMBOLorNUMBER();
timestamp = FROM_UTF8( CurText() );
NeedRIGHT();
break;
default:
// Skip not used data (i.e all other tokens)
skipCurrent();
break;
}
}
if( !footprint.IsEmpty() && fpid.Parse( footprint ) >= 0 )
{
wxString error;
error.Printf( _( "invalid PFID in\nfile: <%s>\nline: %d\noffset: %d" ),
GetChars( CurSource() ), CurLineNumber(), CurOffset() );
THROW_IO_ERROR( error );
}
pathtimestamp += timestamp;
COMPONENT* component = new COMPONENT( fpid, ref, value, pathtimestamp );
component->SetName( name );
component->SetLibrary( library );
m_netlist->AddComponent( component );
}