24#define DISPLAY_NAME_COLUMN 0
28#define SHOW_FIELD_COLUMN 2
29#define GROUP_BY_COLUMN 3
32#define FIELD_NAME_COLUMN 4
53 m_Refs.push_back( aFirstReference );
94 void AddColumn(
const wxString& aFieldName,
const wxString& aLabel,
bool aAddedByUser );
100 wxCHECK_RET( aCol >= 0 && aCol < (
int)
m_cols.size(),
"Invalid Column Number" );
102 if( aCol == aNewPos )
104 else if( aCol < aNewPos )
105 std::rotate( std::begin(
m_cols ) + aCol, std::begin(
m_cols ) + aCol + 1,
106 std::begin(
m_cols ) + aNewPos + 1 );
108 std::rotate( std::begin(
m_cols ) + aNewPos, std::begin(
m_cols ) + aCol,
109 std::begin(
m_cols ) + aCol + 1 );
117 wxCHECK_RET( aCol >= 0 && aCol < (
int)
m_cols.size(),
"Invalid Column Number" );
118 m_cols[aCol].m_label = aLabel;
124 wxCHECK( aCol >= 0 && aCol < (
int)
m_cols.size(), wxString() );
125 return m_cols[aCol].m_label;
130 wxCHECK( aCol >= 0 && aCol < (
int)
m_cols.size(), wxString() );
131 return m_cols[aCol].m_fieldName;
144 wxString
GetValue(
int aRow,
int aCol )
override;
146 const wxString& refDelimiter = wxT(
", " ),
147 const wxString& refRangDelimiter = wxT(
"-" ),
148 bool resolveVars =
false );
151 const wxString& refRangeDelimiter )
153 return GetValue(
m_rows[aRow], aCol, refDelimiter, refRangeDelimiter,
true );
156 void SetValue(
int aRow,
int aCol,
const wxString& aValue )
override;
162 wxCHECK( aRow >= 0 && aRow < (
int)
m_rows.size(), std::vector<SCH_REFERENCE>() );
163 return m_rows[aRow].m_Refs;
174 wxCHECK_RET( aCol >= 0 && aCol < (
int)
m_cols.size(),
"Invalid Column Number" );
224 wxCHECK_RET( aCol >= 0 && aCol < (
int)
m_cols.size(),
"Invalid Column Number" );
230 wxCHECK_MSG( aCol >= 0 && aCol < (
int)
m_cols.size(),
false,
"Invalid Column Number" );
231 return m_cols[aCol].m_group;
236 wxCHECK_RET( aCol >= 0 && aCol < (
int)
m_cols.size(),
"Invalid Column Number" );
237 m_cols[aCol].m_show = show;
242 wxCHECK_MSG( aCol >= 0 && aCol < (
int)
m_cols.size(),
false,
"Invalid Column Number" );
243 return m_cols[aCol].m_show;
267 const wxString& aValue );
wxString GetColFieldName(int aCol)
std::vector< DATA_MODEL_ROW > m_rows
int GetFieldNameCol(wxString aFieldName)
void ApplyBomPreset(const BOM_PRESET &preset)
void SetFieldsOrder(const std::vector< wxString > &aNewOrder)
std::vector< SCH_REFERENCE > GetRowReferences(int aRow) const
SCH_REFERENCE_LIST m_symbolsList
void SetGroupingEnabled(bool group)
SCH_REFERENCE_LIST getSymbolReferences(SCH_SYMBOL *aSymbol)
wxString getAttributeValue(const SCH_SYMBOL &, const wxString &aAttributeName)
bool ColIsItemNumber(int aCol)
int GetNumberCols() override
bool ColIsQuantity(int aCol)
bool GetGroupColumn(int aCol)
void updateDataStoreSymbolField(const SCH_SYMBOL &aSymbol, const wxString &aFieldName)
bool groupMatch(const SCH_REFERENCE &lhRef, const SCH_REFERENCE &rhRef)
const SCH_SHEET_PATH & GetPath()
wxString GetColLabelValue(int aCol) override
BOM_PRESET GetBomSettings()
void SetScope(SCOPE aScope)
bool unitMatch(const SCH_REFERENCE &lhRef, const SCH_REFERENCE &rhRef)
bool ColIsReference(int aCol)
wxString GetExportValue(int aRow, int aCol, const wxString &refDelimiter, const wxString &refRangeDelimiter)
bool GetGroupingEnabled()
void SetPath(const SCH_SHEET_PATH &aPath)
int GetNumberRows() override
void CollapseRow(int aRow)
wxString getFieldShownText(const SCH_REFERENCE &aRef, const wxString &aFieldName)
bool IsEmptyCell(int aRow, int aCol) override
void RenameColumn(int aCol, const wxString &newName)
wxString Export(const BOM_FMT_PRESET &settings)
void AddColumn(const wxString &aFieldName, const wxString &aLabel, bool aAddedByUser)
std::vector< DATA_MODEL_COL > m_cols
void SetSorting(int aCol, bool ascending)
void ExpandCollapseRow(int aRow)
void SetFilter(const wxString &aFilter)
static bool cmp(const DATA_MODEL_ROW &lhGroup, const DATA_MODEL_ROW &rhGroup, FIELDS_EDITOR_GRID_DATA_MODEL *dataModel, int sortCol, bool ascending)
FIELDS_EDITOR_GRID_DATA_MODEL(SCH_REFERENCE_LIST &aSymbolsList)
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 UpdateReferences(const SCH_REFERENCE_LIST &aRefs)
void ApplyData(std::function< void(SCH_SYMBOL &, SCH_SHEET_PATH &)> symbolChangeHandler)
void RemoveColumn(int aCol)
GROUP_TYPE GetRowFlags(int aRow)
const wxString & GetFilter()
std::map< KIID, std::map< wxString, wxString > > m_dataStore
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)
void SetValue(int aRow, int aCol, const wxString &aValue) override
bool ColIsAttribute(int aCol)
bool GetShowColumn(int aCol)
void SetColLabelValue(int aCol, const wxString &aLabel) override
void MoveColumn(int aCol, int aNewPos)
void RemoveReferences(const SCH_REFERENCE_LIST &aRefs)
bool GetIncludeExcludedFromBOM()
void SetShowColumn(int aCol, bool show)
void storeReferenceFields(SCH_REFERENCE &aRef)
void setAttributeValue(SCH_SYMBOL &aSymbol, const wxString &aAttributeName, const wxString &aValue)
void AddReferences(const SCH_REFERENCE_LIST &aRefs)
const std::vector< BOM_FIELD > GetFieldsOrdered()
Container to create a flattened list of symbols because in a complex hierarchy, a symbol can be used ...
void SplitReferences()
Attempt to split all reference designators into a name (U) and number (1).
A helper to define a symbol's reference designator in a schematic.
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
@ GROUP_COLLAPSED_DURING_SORT
std::vector< SCH_REFERENCE > m_Refs
DATA_MODEL_ROW(const SCH_REFERENCE &aFirstReference, GROUP_TYPE aType)