KiCad PCB EDA Suite
Loading...
Searching...
No Matches
template_fieldnames.cpp File Reference
#include "template_fieldnames.h"
#include <mutex>
#include <template_fieldnames_lexer.h>
#include <string_utils.h>

Go to the source code of this file.

Macros

#define REFERENCE_CANONICAL   "Reference"
 
#define VALUE_CANONICAL   "Value"
 
#define FOOTPRINT_CANONICAL   "Footprint"
 
#define DATASHEET_CANONICAL   "Datasheet"
 
#define DESCRIPTION_CANONICAL   "Description"
 
#define USER_FIELD_CANONICAL   "Field%d"
 

Functions

static wxString s_CanonicalReference (REFERENCE_CANONICAL)
 
static wxString s_CanonicalValue (VALUE_CANONICAL)
 
static wxString s_CanonicalFootprint (FOOTPRINT_CANONICAL)
 
static wxString s_CanonicalDatasheet (DATASHEET_CANONICAL)
 
static wxString s_CanonicalDescription (DESCRIPTION_CANONICAL)
 
wxString GetDefaultFieldName (int aFieldNdx, bool aTranslateForHI)
 Return a default symbol field name for field aFieldNdx for all components.
 
wxString GetUserFieldName (int aFieldNdx, bool aTranslateForHI)
 

Macro Definition Documentation

◆ DATASHEET_CANONICAL

#define DATASHEET_CANONICAL   "Datasheet"

Definition at line 38 of file template_fieldnames.cpp.

◆ DESCRIPTION_CANONICAL

#define DESCRIPTION_CANONICAL   "Description"

Definition at line 39 of file template_fieldnames.cpp.

◆ FOOTPRINT_CANONICAL

#define FOOTPRINT_CANONICAL   "Footprint"

Definition at line 37 of file template_fieldnames.cpp.

◆ REFERENCE_CANONICAL

#define REFERENCE_CANONICAL   "Reference"

Definition at line 35 of file template_fieldnames.cpp.

◆ USER_FIELD_CANONICAL

#define USER_FIELD_CANONICAL   "Field%d"

Definition at line 40 of file template_fieldnames.cpp.

◆ VALUE_CANONICAL

#define VALUE_CANONICAL   "Value"

Definition at line 36 of file template_fieldnames.cpp.

Function Documentation

◆ GetDefaultFieldName()

wxString GetDefaultFieldName ( int  aFieldNdx,
bool  aTranslateForHI 
)

Return a default symbol field name for field aFieldNdx for all components.

These field names are not modifiable but template field names are.

Parameters
aFieldNdxThe field number index, > 0.
aTranslateForHIIf true, return the translated field name, else get the canonical name (defualt). Translation is intended only for dialogs

Definition at line 49 of file template_fieldnames.cpp.

References _, DATASHEET_CANONICAL, DATASHEET_FIELD, DESCRIPTION_CANONICAL, DESCRIPTION_FIELD, FOOTPRINT_CANONICAL, FOOTPRINT_FIELD, GetUserFieldName(), REFERENCE_CANONICAL, REFERENCE_FIELD, s_CanonicalDatasheet(), s_CanonicalDescription(), s_CanonicalFootprint(), s_CanonicalReference(), s_CanonicalValue(), VALUE_CANONICAL, and VALUE_FIELD.

Referenced by DIALOG_CHANGE_SYMBOLS::DIALOG_CHANGE_SYMBOLS(), DIALOG_UPDATE_SYMBOL_FIELDS::DIALOG_UPDATE_SYMBOL_FIELDS(), SCH_EDIT_TOOL::editFieldText(), GetCanonicalFieldName(), SCH_FIELD::GetName(), FIELDS_GRID_TABLE::GetValue(), EESCHEMA_JOBS_HANDLER::JobExportBom(), DIALOG_SYMBOL_FIELDS_TABLE::LoadFieldNames(), SCH_IO_KICAD_LEGACY::loadSymbol(), and SCH_FIELD::SCH_FIELD().

◆ GetUserFieldName()

◆ s_CanonicalDatasheet()

static wxString s_CanonicalDatasheet ( DATASHEET_CANONICAL  )
static

Referenced by GetDefaultFieldName().

◆ s_CanonicalDescription()

static wxString s_CanonicalDescription ( DESCRIPTION_CANONICAL  )
static

Referenced by GetDefaultFieldName().

◆ s_CanonicalFootprint()

static wxString s_CanonicalFootprint ( FOOTPRINT_CANONICAL  )
static

Referenced by GetDefaultFieldName().

◆ s_CanonicalReference()

static wxString s_CanonicalReference ( REFERENCE_CANONICAL  )
static

Referenced by GetDefaultFieldName().

◆ s_CanonicalValue()

static wxString s_CanonicalValue ( VALUE_CANONICAL  )
static

Referenced by GetDefaultFieldName().