23#include <wx/settings.h>
58 default:
return wxT(
"unknown column" );
86 return wxT(
"bad wxWidgets!" );
103 wxFAIL_MSG( wxString::Format( wxT(
"column %d doesn't hold a bool value" ), aCol ) );
122 rowData.
label = aValue;
126 wxFAIL_MSG( wxString::Format( wxT(
"column %d doesn't hold a string value" ), aCol ) );
129 GetView()->Refresh();
145 wxFAIL_MSG( wxString::Format( wxT(
"column %d doesn't hold a bool value" ), aCol ) );
151 bool aShow,
bool aGroupBy )
155 if( wxGrid*
grid = GetView() )
157 wxGridTableMessage msg(
this, wxGRIDTABLE_NOTIFY_ROWS_APPENDED, 1 );
158 grid->ProcessTableMessage( msg );
169 if( wxGrid*
grid = GetView() )
171 wxGridTableMessage msg(
this, wxGRIDTABLE_NOTIFY_ROWS_DELETED, aRow, 1 );
172 grid->ProcessTableMessage( msg );
179 wxCHECK( aRow >= 0 && aRow <
GetNumberRows(), wxEmptyString );
193 rowData.
name = aName;
202 bool aAddedByUser,
const wxString& aVariantName )
208 m_cols.push_back( { aFieldName, aLabel, aAddedByUser,
false,
false } );
216 const wxString& aFieldName,
217 const wxString& aVariantName )
232 if( field->IsPrivate() )
269 if( wxGrid*
grid = GetView() )
271 wxGridTableMessage msg(
this, wxGRIDTABLE_NOTIFY_COLS_DELETED, aCol, 1 );
272 grid->ProcessTableMessage( msg );
287 node.key() = newName;
292 m_cols[aCol].m_fieldName = newName;
293 m_cols[aCol].m_label = newName;
299 for(
size_t i = 0; i <
m_cols.size(); i++ )
301 if(
m_cols[i].m_fieldName == aFieldName )
302 return static_cast<int>( i );
311 std::vector<BOM_FIELD> fields;
314 fields.push_back( { col.m_fieldName, col.m_label, col.m_show, col.m_group } );
322 size_t foundCount = 0;
324 for(
const wxString& newField : aNewOrder )
326 if( foundCount >=
m_cols.size() )
331 if( col.m_fieldName == newField )
333 std::swap(
m_cols[foundCount], col );
345 for(
int col = 0; col < aCol; ++col )
364 wxGridCellAttr* attr =
nullptr;
378 && aCol >= 0 && aCol < (
int)
m_cols.size() )
380 const wxString& fieldName =
m_cols[aCol].m_fieldName;
388 bool hasVariantDifference =
false;
399 symbolKey.push_back( symbol->m_Uuid );
403 wxString currentValue;
408 if( currentValue != defaultValue )
410 hasVariantDifference =
true;
415 if( hasVariantDifference )
419 attr =
new wxGridCellAttr();
424 wxGridCellAttr* newAttr = attr->Clone();
431 wxColour bg = wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW );
432 bool isDark = ( bg.Red() + bg.Green() + bg.Blue() ) < 384;
435 attr->SetBackgroundColour( wxColour( 80, 80, 40 ) );
437 attr->SetBackgroundColour( wxColour( 255, 255, 200 ) );
450 const wxString& refDelimiter,
451 const wxString& refRangeDelimiter,
453 bool listMixedValues )
455 std::vector<SCH_REFERENCE> references;
456 std::set<wxString> mixedValues;
463 references.push_back( ref );
482 else if( refFieldValue.Contains( wxT(
"${" ) ) )
486 std::function<bool( wxString* )> symbolResolver =
487 [&]( wxString* token ) ->
bool
492 refFieldValue =
ExpandTextVars( refFieldValue, & symbolResolver );
496 if( listMixedValues )
497 mixedValues.insert( refFieldValue );
498 else if( &ref == &
group.m_Refs.front() )
499 fieldValue = refFieldValue;
500 else if( fieldValue != refFieldValue )
505 if( listMixedValues )
507 fieldValue = wxEmptyString;
509 for(
const wxString& value : mixedValues )
511 if( value.IsEmpty() )
513 else if( fieldValue.IsEmpty() )
516 fieldValue +=
"," + value;
523 std::sort( references.begin(), references.end(),
526 wxString l_ref( l.GetRef() << l.GetRefNumber() );
527 wxString r_ref( r.GetRef() << r.GetRefNumber() );
528 return StrNumCmp( l_ref, r_ref, true ) < 0;
531 auto logicalEnd = std::unique( references.begin(), references.end(),
536 if( l.GetRefNumber() == wxT(
"?" ) )
539 wxString l_ref( l.GetRef() << l.GetRefNumber() );
540 wxString r_ref( r.GetRef() << r.GetRefNumber() );
541 return l_ref == r_ref;
544 references.erase( logicalEnd, references.end() );
550 fieldValue = wxString::Format( wxT(
"%d" ), (
int) references.size() );
552 fieldValue = wxString::Format( wxT(
"%d" ),
group.m_ItemNumber );
560 wxCHECK_RET( aCol >= 0 && aCol <
static_cast<int>(
m_cols.size() ), wxS(
"Invalid column number" ) );
572 bool isSharedInstance =
false;
581 screen =
static_cast<const SCH_SCREEN*
>( symbol->GetParent() );
583 isSharedInstance = ( screen && ( screen->
GetRefCount() > 1 ) );
584 sharedSymbol = symbol;
597 if( row.m_ItemNumber == aRow + 1 )
617 wxCHECK( aCol >= 0 && aCol <
static_cast<int>(
m_cols.size() ),
false );
624 wxCHECK( aCol >= 0 && aCol <
static_cast<int>(
m_cols.size() ),
false );
631 wxCHECK( aCol >= 0 && aCol <
static_cast<int>(
m_cols.size() ),
false );
638 wxCHECK( aCol >= 0 && aCol <
static_cast<int>(
m_cols.size() ),
false );
645 wxCHECK( aCol >= 0 && aCol <
static_cast<int>(
m_cols.size() ),
false );
656 if( lhGroup.
m_Refs.size() == 0 )
658 else if( rhGroup.
m_Refs.size() == 0 )
664 [ ascending ](
const auto a,
const auto b )
676 wxString lhs = dataModel->
GetValue( lhGroup, sortCol ).Trim(
true ).Trim(
false );
677 wxString rhs = dataModel->
GetValue( rhGroup, sortCol ).Trim(
true ).Trim(
false );
681 wxString lhRef = lhGroup.
m_Refs[0].GetRef() + lhGroup.
m_Refs[0].GetRefNumber();
682 wxString rhRef = rhGroup.
m_Refs[0].GetRef() + rhGroup.
m_Refs[0].GetRefNumber();
683 return local_cmp(
StrNumCmp( lhRef, rhRef,
true ), 0 );
700 std::sort( row.m_Refs.begin(), row.m_Refs.end(),
703 wxString lhs_ref( lhs.GetRef() << lhs.GetRefNumber() );
704 wxString rhs_ref( rhs.GetRef() << rhs.GetRefNumber() );
705 return StrNumCmp( lhs_ref, rhs_ref, true ) < 0;
712 return cmp( lhs, rhs, this, m_sortColumn, m_sortAscending );
720 row.m_ItemNumber = itemNumber++;
740 bool matchFound =
false;
747 if(
m_cols[refCol].m_group )
760 for(
size_t i = 0; i <
m_cols.size(); ++i )
763 if(
static_cast<int>( i ) == refCol )
805 const wxString& aFieldName )
812 return wxEmptyString;
824 std::function<bool( wxString* )> symbolResolver =
825 [&]( wxString* token ) ->
bool
833 return wxEmptyString;
839 return aFieldName == wxS(
"${DNP}" )
840 || aFieldName == wxS(
"${EXCLUDE_FROM_BOARD}" )
841 || aFieldName == wxS(
"${EXCLUDE_FROM_BOM}" )
842 || aFieldName == wxS(
"${EXCLUDE_FROM_SIM}" );
847 const wxString& aVariantName )
849 if( aAttributeName == wxS(
"${DNP}" ) )
850 return aRef.
GetSymbolDNP( aVariantName ) ? wxS(
"1" ) : wxS(
"0" );
852 if( aAttributeName == wxS(
"${EXCLUDE_FROM_BOARD}" ) )
855 if( aAttributeName == wxS(
"${EXCLUDE_FROM_BOM}" ) )
858 if( aAttributeName == wxS(
"${EXCLUDE_FROM_SIM}" ) )
866 const wxString& aFieldName )
871 return wxEmptyString;
880 if( field->IsPrivate() )
881 return wxEmptyString;
885 field->GetText( &aRef.
GetSheetPath(), wxEmptyString ) );
893 return wxEmptyString;
898 const wxString& aAttributeName,
899 const wxString& aValue,
900 const wxString& aVariantName )
902 bool attrChanged =
false;
903 bool newValue = aValue == wxS(
"1" );
905 if( aAttributeName == wxS(
"${DNP}" ) )
907 attrChanged = aRef.
GetSymbolDNP( aVariantName ) != newValue;
910 else if( aAttributeName == wxS(
"${EXCLUDE_FROM_BOARD}" ) )
915 else if( aAttributeName == wxS(
"${EXCLUDE_FROM_BOM}" ) )
920 else if( aAttributeName == wxS(
"${EXCLUDE_FROM_SIM}" ) )
951 static_cast<WX_GRID*
>( GetView() )->CommitPendingChanges(
true );
953 wxGridTableMessage msg(
this, wxGRIDTABLE_NOTIFY_ROWS_DELETED, 0,
m_rows.size() );
954 GetView()->ProcessTableMessage( msg );
996 bool isExcluded =
false;
1023 || (
m_scope == SCOPE::SCOPE_SHEET_RECURSIVE
1029 bool matchFound =
false;
1047 row.m_Refs.push_back( ref );
1053 row.m_Refs.push_back( ref );
1065 wxGridTableMessage msg(
this, wxGRIDTABLE_NOTIFY_ROWS_APPENDED,
m_rows.size() );
1066 GetView()->ProcessTableMessage( msg );
1075 std::vector<DATA_MODEL_ROW> children;
1079 bool matchFound =
false;
1089 child.m_Refs.push_back( ref );
1098 if( children.size() < 2 )
1101 std::sort( children.begin(), children.end(),
1104 return cmp( lhs, rhs, this, m_sortColumn, m_sortAscending );
1108 m_rows.insert(
m_rows.begin() + aRow + 1, children.begin(), children.end() );
1110 wxGridTableMessage msg(
this, wxGRIDTABLE_NOTIFY_ROWS_INSERTED, aRow, children.size() );
1111 GetView()->ProcessTableMessage( msg );
1117 auto firstChild =
m_rows.begin() + aRow + 1;
1118 auto afterLastChild = firstChild;
1121 while( afterLastChild !=
m_rows.end() && afterLastChild->m_Flag == CHILD_ITEM )
1128 m_rows.erase( firstChild, afterLastChild );
1130 wxGridTableMessage msg(
this, wxGRIDTABLE_NOTIFY_ROWS_DELETED, aRow + 1, deleted );
1131 GetView()->ProcessTableMessage( msg );
1148 for(
size_t i = 0; i <
m_rows.size(); ++i )
1161 for(
size_t i = 0; i <
m_rows.size(); ++i )
1170 const wxString& aVariantName )
1172 bool symbolModified =
false;
1173 std::unique_ptr<SCH_SYMBOL> symbolCopy;
1184 symbolCopy = std::make_unique<SCH_SYMBOL>( *symbol );
1187 const std::map<wxString, wxString>& fieldStore =
m_dataStore[key];
1189 for(
const auto& [srcName, srcValue] : fieldStore )
1205 if( destField && destField->
IsPrivate() )
1207 if( srcValue.IsEmpty() )
1214 bool userAdded = ( col != -1 &&
m_cols[col].m_userAdded );
1217 bool createField = !destField && ( !srcValue.IsEmpty() || userAdded );
1225 destField->
SetVisible( srcTemplate->m_Visible );
1230 symbolModified =
true;
1245 if( !createField && ( previousValue != srcValue ) )
1246 symbolModified =
true;
1249 for(
int ii =
static_cast<int>( symbol->
GetFields().size() ) - 1; ii >= 0; ii-- )
1254 if( fieldStore.count( symbol->
GetFields()[ii].GetName() ) == 0 )
1257 symbolModified =
true;
1261 if( symbolModified && ( symbol != nextSymbol ) )
1265 if( symbol != nextSymbol )
1268 symbolCopy = std::make_unique<SCH_SYMBOL>( *nextSymbol );
1270 symbolCopy.reset(
nullptr );
1272 symbolModified =
false;
1293 for(
unsigned symbolRef = 0; symbolRef <
m_symbolsList.GetCount(); ++symbolRef )
1310 for(
size_t i = 0; i <
m_cols.size(); i++ )
1316 std::set<wxString> seen;
1317 std::vector<wxString> order;
1323 if( !field.
name || seen.count( field.
name ) )
1326 seen.insert( field.
name );
1327 order.emplace_back( field.
name );
1398 for(
size_t col = 0; col <
m_cols.size(); col++ )
1401 last_col =
static_cast<int>( col );
1405 if( last_col == -1 )
1409 [&]( wxString field,
bool last ) -> wxString
1413 field.Replace( wxS(
"\r" ), wxS(
"" ) );
1414 field.Replace( wxS(
"\n" ), wxS(
"" ) );
1419 field.Replace( wxS(
"\t" ), wxS(
"" ) );
1433 for(
size_t col = 0; col <
m_cols.size(); col++ )
1435 if( !
m_cols[col].m_show )
1438 out.Append( formatField(
m_cols[col].m_label, col ==
static_cast<size_t>( last_col ) ) );
1442 for(
size_t row = 0; row <
m_rows.size(); row++ )
1445 if(
GetRowFlags(
static_cast<int>( row ) ) == CHILD_ITEM )
1448 for(
size_t col = 0; col <
m_cols.size(); col++ )
1450 if( !
m_cols[col].m_show )
1454 out.Append( formatField(
GetExportValue(
static_cast<int>( row ),
static_cast<int>( col ),
1456 col ==
static_cast<size_t>( last_col ) ) );
1466 bool refListChanged =
false;
1481 if( !field.IsPrivate() )
1483 wxString
name = field.GetCanonicalName();
1490 refListChanged =
true;
1494 if( refListChanged )
1508 std::vector<KIID_PATH> keysToRemove;
1512 if( !key.empty() && ( key.back() == symbolUuid ) )
1513 keysToRemove.push_back( key );
1516 for(
const KIID_PATH& key : keysToRemove )
1523 return ref.GetSymbol()->m_Uuid == aSymbol.m_Uuid;
1546 const wxString& aVariantName )
1548 bool refListChanged =
false;
1565 refListChanged =
true;
1569 if( refListChanged )
1576 size_t curNumRows =
m_rows.size();
1578 if( aPosition >= curNumRows )
1580 wxFAIL_MSG( wxString::Format( wxT(
"Called FIELDS_EDITOR_GRID_DATA_MODEL::DeleteRows(aPosition=%lu, "
1581 "aNumRows=%lu)\nPosition value is invalid for present table with %lu rows" ),
1582 (
unsigned long) aPosition, (
unsigned long) aNumRows,
1583 (
unsigned long) curNumRows ) );
1588 if( aNumRows > curNumRows - aPosition )
1590 aNumRows = curNumRows - aPosition;
1593 if( aNumRows >= curNumRows )
1600 const auto first =
m_rows.begin() + aPosition;
1601 std::vector<SCH_REFERENCE> dataMapRefs = first->m_Refs;
1602 m_rows.erase( first, first + aNumRows );
1610 wxGridTableMessage msg(
this, wxGRIDTABLE_NOTIFY_ROWS_DELETED, aPosition, aNumRows );
1611 GetView()->ProcessTableMessage( msg );
COMMIT & Modified(EDA_ITEM *aItem, EDA_ITEM *aCopy, BASE_SCREEN *aScreen=nullptr)
Create an undo entry for an item that has been already modified.
bool Find(const wxString &aTerm, int &aMatchersTriggered, int &aPosition)
Look in all existing matchers, return the earliest match of any of the existing.
const EDA_ANGLE & GetTextAngle() const
void SetTextPos(const VECTOR2I &aPoint)
virtual void SetVisible(bool aVisible)
virtual void SetTextAngle(const EDA_ANGLE &aAngle)
int GetFieldNameCol(const wxString &aFieldName) const
void AddColumn(const wxString &aFieldName, const wxString &aLabel, bool aAddedByUser, const wxString &aVariantName)
wxString GetColFieldName(int aCol)
std::vector< DATA_MODEL_ROW > m_rows
void SetFieldsOrder(const std::vector< wxString > &aNewOrder)
SCH_REFERENCE_LIST m_symbolsList
The flattened by hierarchy list of symbols.
void SetGroupingEnabled(bool group)
void UpdateReferences(const SCH_REFERENCE_LIST &aRefs, const wxString &aVariantName)
bool ColIsItemNumber(int aCol)
int GetNumberCols() override
bool ColIsQuantity(int aCol)
wxString m_currentVariant
Current variant name for highlighting.
bool DeleteRows(size_t aPosition=0, size_t aNumRows=1) override
bool groupMatch(const SCH_REFERENCE &lhRef, const SCH_REFERENCE &rhRef)
wxGridCellAttr * m_urlEditor
void updateDataStoreSymbolField(const SCH_REFERENCE &aSymbolRef, const wxString &aFieldName, const wxString &aVariantName)
BOM_PRESET GetBomSettings()
bool unitMatch(const SCH_REFERENCE &lhRef, const SCH_REFERENCE &rhRef)
wxString getAttributeValue(const SCH_REFERENCE &aRef, const wxString &aAttributeName, const wxString &aVariantNames)
bool ColIsReference(int aCol)
wxString GetExportValue(int aRow, int aCol, const wxString &refDelimiter, const wxString &refRangeDelimiter)
bool GetGroupingEnabled()
wxString getDefaultFieldValue(const SCH_REFERENCE &aRef, const wxString &aFieldName)
Get the default (non-variant) value for a field.
int GetNumberRows() override
void CollapseRow(int aRow)
wxString getFieldShownText(const SCH_REFERENCE &aRef, const wxString &aFieldName)
void RenameColumn(int aCol, const wxString &newName)
FIELDS_EDITOR_GRID_DATA_MODEL(const SCH_REFERENCE_LIST &aSymbolsList, wxGridCellAttr *aURLEditor)
bool IsExpanderColumn(int aCol) const override
wxString Export(const BOM_FMT_PRESET &settings)
std::vector< wxString > m_variantNames
Variant names for multi-variant DNP filtering.
std::vector< DATA_MODEL_COL > m_cols
void SetSorting(int aCol, bool ascending)
void ExpandCollapseRow(int aRow)
wxGridCellAttr * GetAttr(int aRow, int aCol, wxGridCellAttr::wxAttrKind aKind) override
void SetFilter(const wxString &aFilter)
bool setAttributeValue(SCH_REFERENCE &aRef, const wxString &aAttributeName, const wxString &aValue, const wxString &aVariantName=wxEmptyString)
Set the attribute value.
static bool cmp(const DATA_MODEL_ROW &lhGroup, const DATA_MODEL_ROW &rhGroup, FIELDS_EDITOR_GRID_DATA_MODEL *dataModel, int sortCol, bool ascending)
void ApplyBomPreset(const BOM_PRESET &preset, const wxString &aVariantName)
static const wxString ITEM_NUMBER_VARIABLE
void SetIncludeExcludedFromBOM(bool include)
bool isAttribute(const wxString &aFieldName)
wxString GetValue(int aRow, int aCol) override
int GetDataWidth(int aCol)
void RemoveColumn(int aCol)
GROUP_TYPE GetRowFlags(int aRow)
const wxString & GetFilter()
static const wxString QUANTITY_VARIABLE
bool ColIsValue(int aCol)
void SetGroupColumn(int aCol, bool group)
void SetExcludeDNP(bool exclude)
void RemoveSymbol(const SCH_SYMBOL &aSymbol)
std::vector< BOM_FIELD > GetFieldsOrdered()
void SetValue(int aRow, int aCol, const wxString &aValue) override
std::map< KIID_PATH, std::map< wxString, wxString > > m_dataStore
bool ColIsAttribute(int aCol)
void ApplyData(SCH_COMMIT &aCommit, TEMPLATES &aTemplateFieldnames, const wxString &aVariantName)
void SetColLabelValue(int aCol, const wxString &aLabel) override
void SetCurrentVariant(const wxString &aVariantName)
Set the current variant name for highlighting purposes.
void RemoveReferences(const SCH_REFERENCE_LIST &aRefs)
bool GetIncludeExcludedFromBOM()
void SetShowColumn(int aCol, bool show)
void AddReferences(const SCH_REFERENCE_LIST &aRefs)
wxString ConvertKIIDsToRefs(const wxString &aSource) const
wxString ConvertRefsToKIIDs(const wxString &aSource) const
virtual const wxString & GetText() const override
Return the string associated with the text object.
wxString GetShownText(const SCH_SHEET_PATH *aPath, bool aAllowExtraText, int aDepth=0, const wxString &aVariantName=wxEmptyString) const
void SetText(const wxString &aText) override
void SetPrivate(bool aPrivate)
SCHEMATIC * Schematic() const
Search the item hierarchy to find a SCHEMATIC.
Container to create a flattened list of symbols because in a complex hierarchy, a symbol can be used ...
static wxString Shorthand(std::vector< SCH_REFERENCE > aList, const wxString &refDelimiter, const wxString &refRangeDelimiter)
Return a shorthand string representing all the references in the list.
A helper to define a symbol's reference designator in a schematic.
void SetSymbolExcludedFromBoard(bool aEnable)
const SCH_SHEET_PATH & GetSheetPath() const
void SetSymbolExcludedFromBOM(bool aEnable, const wxString &aVariant=wxEmptyString)
bool GetSymbolExcludedFromBOM(const wxString &aVariant=wxEmptyString) const
bool GetSymbolDNP(const wxString &aVariant=wxEmptyString) const
SCH_SYMBOL * GetSymbol() const
void SetSymbolExcludedFromSim(bool aEnable, const wxString &aVariant=wxEmptyString)
bool GetSymbolExcludedFromBoard() const
wxString GetFullRef(bool aIncludeUnit=true) const
Return reference name with unit altogether.
bool GetSymbolExcludedFromSim(const wxString &aVariant=wxEmptyString) const
wxString GetRefNumber() const
void SetSymbolDNP(bool aEnable, const wxString &aVariant=wxEmptyString)
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
bool GetExcludedFromBOM() const
KIID_PATH Path() const
Get the sheet path as an KIID_PATH.
bool IsContainedWithin(const SCH_SHEET_PATH &aSheetPathToTest) const
Check if this path is contained inside aSheetPathToTest.
bool GetExcludedFromBOM(const SCH_SHEET_PATH *aInstance=nullptr, const wxString &aVariantName=wxEmptyString) const override
void GetFields(std::vector< SCH_FIELD * > &aVector, bool aVisibleOnly) const override
Populate a std::vector with SCH_FIELDs, sorted in ordinal order.
VECTOR2I GetPosition() const override
bool ResolveTextVar(const SCH_SHEET_PATH *aPath, wxString *token, int aDepth=0) const
Resolve any references to system tokens supported by the symbol.
SCH_FIELD * AddField(const SCH_FIELD &aField)
Add a field to the symbol.
virtual bool GetDNP(const SCH_SHEET_PATH *aInstance=nullptr, const wxString &aVariantName=wxEmptyString) const override
Set or clear the 'Do Not Populate' flag.
SCH_FIELD * GetField(FIELD_T aFieldType)
Return a mandatory field in this symbol.
const TEMPLATE_FIELDNAME * GetFieldName(const wxString &aName)
Search for aName in the template field name list.
void SetValueAsBool(int aRow, int aCol, bool aValue) override
wxString GetCanonicalFieldName(int aRow)
wxString GetColLabelValue(int aCol) override
std::vector< BOM_FIELD > m_fields
void SetValue(int aRow, int aCol, const wxString &aValue) override
int GetNumberRows() override
void AppendRow(const wxString &aFieldName, const wxString &aBOMName, bool aShow, bool aGroupBy)
bool GetValueAsBool(int aRow, int aCol) override
void SetCanonicalFieldName(int aRow, const wxString &aName)
wxString GetValue(int aRow, int aCol) override
wxGridCellAttr * enhanceAttr(wxGridCellAttr *aInputAttr, int aRow, int aCol, wxGridCellAttr::wxAttrKind aKind)
wxGridCellAttr * GetAttr(int aRow, int aCol, wxGridCellAttr::wxAttrKind aKind) override
wxString ExpandTextVars(const wxString &aSource, const PROJECT *aProject, int aFlags)
bool IsGeneratedField(const wxString &aSource)
Returns true if the string is generated, e.g contains a single text var reference.
static KIID_PATH makeDataStoreKey(const SCH_SHEET_PATH &aSheetPath, const SCH_SYMBOL &aSymbol)
Create a unique key for the data store by combining the KIID_PATH from the SCH_SHEET_PATH with the sy...
#define DISPLAY_NAME_COLUMN
#define SHOW_FIELD_COLUMN
KICOMMON_API wxSize GetTextSize(const wxString &aSingleLine, wxWindow *aWindow)
Return the size of aSingleLine of text when it is rendered in aWindow using whatever font is currentl...
int StrNumCmp(const wxString &aString1, const wxString &aString2, bool aIgnoreCase)
Compare two strings with alphanumerical content.
int ValueStringCompare(const wxString &strFWord, const wxString &strSWord)
Compare strings like the strcmp function but handle numbers and modifiers within the string text corr...
bool IsURL(wxString aStr)
Performs a URL sniff-test on a string.
wxString refRangeDelimiter
std::vector< BOM_FIELD > fieldsOrdered
bool includeExcludedFromBOM
std::vector< SCH_REFERENCE > m_Refs
Hold a name of a symbol's field, field value, and default visibility.
wxString GetDefaultFieldName(FIELD_T aFieldId, bool aTranslateForHI)
Return a default symbol field name for a mandatory field type.
FIELD_T
The set of all field indices assuming an array like sequence that a SCH_COMPONENT or LIB_PART can hol...
@ USER
The field ID hasn't been set yet; field is invalid.
@ DATASHEET
name of datasheet
@ REFERENCE
Field Reference of part, i.e. "IC21".
@ VALUE
Field Value of part, i.e. "3.3K".
wxString GetCanonicalFieldName(FIELD_T aFieldType)
#define INDETERMINATE_STATE
Used for holding indeterminate values, such as with multiple selections holding different values or c...
GROUP_COLLAPSED_DURING_SORT