29 using namespace TFIELD_T;
31 #define REFCANONICAL "Reference" 32 #define VALCANONICAL "Value" 33 #define FTPCANONICAL "Footprint" 34 #define DSHCANONICAL "Datasheet" 38 static void* locale =
nullptr;
39 static wxString referenceDefault;
40 static wxString valueDefault;
41 static wxString footprintDefault;
42 static wxString datasheetDefault;
43 static wxString fieldDefault;
58 if(
Pgm().GetLocale() != locale )
64 fieldDefault =
_(
"Field%d" );
65 locale =
Pgm().GetLocale();
88 out->
Print( nestLevel,
"(field (name %s)", out->
Quotew( m_Name ).c_str() );
91 out->
Print( 0,
" visible" );
94 out->
Print( 0,
" url" );
96 out->
Print( 0,
")\n" );
106 if( ( tok = in->NextTok() ) != T_name )
107 in->Expecting( T_name );
109 in->NeedSYMBOLorNUMBER();
115 while( (tok = in->NextTok() ) != T_RIGHT && tok != T_EOF )
125 in->NeedSYMBOLorNUMBER();
138 in->Expecting(
"value|url|visible" );
149 out->
Print( nestLevel,
"(templatefields" );
154 temp.Format( out, nestLevel+1 );
156 out->
Print( 0,
")\n" );
164 while( ( tok = in->NextTok() ) != T_RIGHT && tok != T_EOF )
171 case T_templatefields:
187 AddTemplateFieldName( field, aGlobal );
192 in->Unexpected( in->CurText() );
205 m_resolved = m_project;
214 if( global.m_Name == project.m_Name )
218 m_resolved.push_back( global );
221 m_resolvedDirty =
false;
239 if( temp.m_Name == aFieldName.
m_Name )
242 m_resolvedDirty =
true;
249 target.push_back( aFieldName );
250 m_resolvedDirty =
true;
259 m_resolved = m_project;
264 m_resolved = m_globals;
267 m_resolvedDirty =
false;
273 if( m_resolvedDirty )
291 if( m_resolvedDirty )
296 if( field.m_Name == aName )
void Format(OUTPUTFORMATTER *out, int nestLevel, bool aGlobal) const
Serialize this object out as text into the given OUTPUTFORMATTER.
static wxString FROM_UTF8(const char *cstring)
Convert a UTF8 encoded C string to a wxString for all wxWidgets build modes.
void AddTemplateFieldName(const TEMPLATE_FIELDNAME &aFieldName, bool aGlobal)
Insert or append a wanted symbol field name into the field names template.
The first 4 are mandatory, and must be instantiated in SCH_COMPONENT and LIB_PART constructors.
void Parse(TEMPLATE_FIELDNAMES_LEXER *in, bool aGlobal)
Fill this object from information in the input stream handled by #TEMPLATE_FIELDNAMES_LEXER.
void Parse(TEMPLATE_FIELDNAMES_LEXER *aSpec)
Fill this object from information in the input stream aSpec, which is a #TEMPLATE_FIELDNAMES_LEXER.
void DeleteAllFieldNameTemplates(bool aGlobal)
Delete the entire contents.
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
void Format(OUTPUTFORMATTER *out, int nestLevel) const
Serialize this object out as text into the given OUTPUTFORMATTER.
This file contains miscellaneous commonly used macros and functions.
Field Value of part, i.e. "3.3K".
std::vector< TEMPLATE_FIELDNAME > TEMPLATE_FIELDNAMES
static const wxString GetDefaultFieldName(int aFieldNdx, bool aTranslate=true)
Return a default symbol field name for field aFieldNdx for all components.
const TEMPLATE_FIELDNAME * GetFieldName(const wxString &aName)
Search for aName in the the template field name list.
Field Name Module PCB, i.e. "16DIP300".
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Hold a name of a symbol's field, field value, and default visibility.
Field Reference of part, i.e. "IC21".
const TEMPLATE_FIELDNAMES & GetTemplateFieldNames()
Return a template field name list for read only access.