50 comp.m_mirror = wxT(
"M" );
62 if(
comp.m_comp_name.IsEmpty() )
65 comp.m_comp_name = wxString::Format(
"UNNAMED%zu",
m_compList.size() );
69 if(
comp.m_comp_name != originalRef )
71 wxLogWarning(
_(
"Component '%s' has non-ASCII characters in its designator; "
72 "converted to '%s' for ODB++ export." ),
73 originalRef,
comp.m_comp_name );
76 wxString base_comp_name =
comp.m_comp_name;
85 candidate = wxString::Format(
"%s_%zu", base_comp_name, suffix++ );
88 wxLogWarning(
_(
"Component '%s' has an ambiguous designator after conversion; "
89 "renamed to '%s' for ODB++ export." ),
90 originalRef, candidate );
92 comp.m_comp_name = candidate;
100 wxString key = field->GetName();
102 comp.m_prp[key] = wxString::Format(
"'%s'", field->GetShownText(
false ) );
142 ost <<
"# CMP " <<
m_index << std::endl;
150 for(
const auto& [key, value] :
m_prp )
152 ost <<
"PRP " << key <<
" " << value << std::endl;
160 ost <<
"#" << std::endl;
void WriteAttributes(std::ostream &ost, const std::string &prefix="") const
void AddSystemAttribute(Tr &r, Ta v)
void WriteAttributes(std::ostream &ost) const
virtual const BOARD * GetBoard() const
Return the BOARD in which this BOARD_ITEM resides, or NULL if none.
wxString GetCurrentVariant() const
std::list< ODB_COMPONENT > m_compList
ODB_COMPONENT & AddComponent(const FOOTPRINT *aFp, const EDA_DATA::PACKAGE &aPkg)
void Write(std::ostream &ost) const
std::set< wxString > m_usedCompNames
const UTF8 & GetLibItemName() const
const wxString GetFullLibraryName() const
const size_t m_index
! CMP index number on board to be used in SNT(TOP), 0~n-1
std::list< TOEPRINT > m_toeprints
std::pair< wxString, wxString > m_center
size_t m_pkg_ref
! package ref number from PKG in eda/data file, 0~n-1
wxString m_part_name
! Part identification is a single string of ASCII characters without spaces
void Write(std::ostream &ost) const
wxString m_comp_name
! Unique reference designator (component name)
std::map< wxString, wxString > m_prp
static std::string m_unitsStr
static constexpr EDA_ANGLE ANGLE_0
static constexpr EDA_ANGLE ANGLE_360
Hashing functions for EDA_ITEMs.
wxString GenLegalComponentName(const wxString &aStr)
void RemoveWhitespace(wxString &aStr)
std::pair< wxString, wxString > AddXY(const VECTOR2I &aVec)
wxString Double2String(double aVal)
size_t m_subnet_num
! Number of subnet (SNT record TOP) in the referenced net
std::pair< wxString, wxString > m_center
! Board location of the pin.
void Write(std::ostream &ost) const
size_t m_net_num
! Number of NET record in the eda/data file.
wxString m_mirror
! equal to CMP m_mirror.
const size_t m_pin_num
! index of PIN record in the eda/data file, 0~n-1.
wxString m_toeprint_name
! Name of the pad in PIN record
@ REFERENCE
Field Reference of part, i.e. "IC21".