KiCad PCB EDA Suite
|
#include <panel_assign_component_classes.h>
Public Member Functions | |
PANEL_ASSIGN_COMPONENT_CLASSES (wxWindow *aParentWindow, PCB_EDIT_FRAME *aFrame, std::shared_ptr< COMPONENT_CLASS_SETTINGS > aSettings, DIALOG_SHIM *aDlg) | |
~PANEL_ASSIGN_COMPONENT_CLASSES () override | |
bool | TransferDataToWindow () override |
Loads current component class assignments from the board settings. | |
bool | TransferDataFromWindow () override |
Saves the component class assignments to the board settings. | |
void | ImportSettingsFrom (const std::shared_ptr< COMPONENT_CLASS_SETTINGS > &aOtherSettings) |
Loads component class assignments from the given settings object. | |
void | OnAddAssignmentClick (wxCommandEvent &event) override |
Adds a new component class assignment rule. | |
void | RemoveAssignment (PANEL_COMPONENT_CLASS_ASSIGNMENT *aPanel) |
Removes a given component class assignment rule. | |
const std::vector< wxString > & | GetSelectionRefs () const |
Returns references for all currently selected footprints. | |
const std::vector< wxString > & | GetFieldNames () const |
Returns names of all fields present in footprints. | |
const std::vector< wxString > & | GetSheetNames () const |
Returns names of all sheets present in footprints. | |
PCB_EDIT_FRAME * | GetFrame () const |
Gets the active edit frame. | |
bool | Validate () override |
Validates that all assignment rules can compile successfully. | |
Protected Attributes | |
wxCheckBox * | m_assignSheetClasses |
wxStaticLine * | m_staticline1 |
wxStaticText * | m_staticText3 |
wxButton * | m_btnAddAssignment |
wxScrolledWindow * | m_assignmentsScrollWindow |
Private Member Functions | |
PANEL_COMPONENT_CLASS_ASSIGNMENT * | addAssignment () |
Adds a new component class assignment rule. | |
void | scrollToAssignment (const PANEL_COMPONENT_CLASS_ASSIGNMENT *aAssignment) const |
Scrolls the panel to specified assignment rule. | |
Private Attributes | |
DIALOG_SHIM * | m_dlg |
The parent dialog. | |
PCB_EDIT_FRAME * | m_frame |
The active edit frame. | |
std::vector< PANEL_COMPONENT_CLASS_ASSIGNMENT * > | m_assignments |
Vector of all currently displayed assignment rules. | |
std::shared_ptr< COMPONENT_CLASS_SETTINGS > | m_componentClassSettings |
The active settings object. | |
std::vector< wxString > | m_selectionRefs |
All currently selected footprint references. | |
std::vector< wxString > | m_fieldNames |
All footprint fields names present on the board. | |
std::vector< wxString > | m_sheetNames |
All sheet names present on the board. | |
wxBoxSizer * | m_assignmentsList |
The list of all currently present component class assignments. | |
Definition at line 51 of file panel_assign_component_classes.h.
PANEL_ASSIGN_COMPONENT_CLASSES::PANEL_ASSIGN_COMPONENT_CLASSES | ( | wxWindow * | aParentWindow, |
PCB_EDIT_FRAME * | aFrame, | ||
std::shared_ptr< COMPONENT_CLASS_SETTINGS > | aSettings, | ||
DIALOG_SHIM * | aDlg | ||
) |
Definition at line 49 of file panel_assign_component_classes.cpp.
References BOARD::Footprints(), PCB_EDIT_FRAME::GetCurrentSelection(), PCB_EDIT_FRAME::GetModel(), FOOTPRINT::GetReferenceAsString(), m_fieldNames, m_frame, m_selectionRefs, m_sheetNames, PCB_FOOTPRINT_T, and EDA_ITEM::Replace().
|
override |
Definition at line 120 of file panel_assign_component_classes.cpp.
References BOARD::Footprints(), PCB_BASE_FRAME::GetCanvas(), PCB_EDIT_FRAME::GetModel(), TOOL_MANAGER::GetTool(), TOOLS_HOLDER::GetToolManager(), m_frame, EDA_DRAW_PANEL_GAL::Refresh(), and SELECTION_TOOL::UnbrightenItem().
|
private |
Adds a new component class assignment rule.
Definition at line 214 of file panel_assign_component_classes.cpp.
References m_assignments, m_assignmentsList, PANEL_ASSIGN_COMPONENT_CLASSES_BASE::m_assignmentsScrollWindow, and m_dlg.
Referenced by OnAddAssignmentClick(), and TransferDataToWindow().
|
inline |
Returns names of all fields present in footprints.
Definition at line 79 of file panel_assign_component_classes.h.
References m_fieldNames.
Referenced by PANEL_COMPONENT_CLASS_ASSIGNMENT::AddCondition().
|
inline |
Gets the active edit frame.
Definition at line 85 of file panel_assign_component_classes.h.
References m_frame.
Referenced by PANEL_COMPONENT_CLASS_ASSIGNMENT::OnHighlightItemsClick(), and Validate().
|
inline |
Returns references for all currently selected footprints.
Definition at line 76 of file panel_assign_component_classes.h.
References m_selectionRefs.
Referenced by PANEL_COMPONENT_CLASS_ASSIGNMENT::AddCondition().
|
inline |
Returns names of all sheets present in footprints.
Definition at line 82 of file panel_assign_component_classes.h.
References m_sheetNames.
Referenced by PANEL_COMPONENT_CLASS_ASSIGNMENT::AddCondition().
void PANEL_ASSIGN_COMPONENT_CLASSES::ImportSettingsFrom | ( | const std::shared_ptr< COMPONENT_CLASS_SETTINGS > & | aOtherSettings | ) |
Loads component class assignments from the given settings object.
Definition at line 253 of file panel_assign_component_classes.cpp.
References m_componentClassSettings, and TransferDataToWindow().
|
overridevirtual |
Adds a new component class assignment rule.
Reimplemented from PANEL_ASSIGN_COMPONENT_CLASSES_BASE.
Definition at line 207 of file panel_assign_component_classes.cpp.
References addAssignment(), and scrollToAssignment().
void PANEL_ASSIGN_COMPONENT_CLASSES::RemoveAssignment | ( | PANEL_COMPONENT_CLASS_ASSIGNMENT * | aPanel | ) |
Removes a given component class assignment rule.
Definition at line 244 of file panel_assign_component_classes.cpp.
References m_assignments, and m_assignmentsList.
Referenced by PANEL_COMPONENT_CLASS_ASSIGNMENT::OnDeleteAssignmentClick().
|
private |
Scrolls the panel to specified assignment rule.
Definition at line 233 of file panel_assign_component_classes.cpp.
References PANEL_ASSIGN_COMPONENT_CLASSES_BASE::m_assignmentsScrollWindow.
Referenced by OnAddAssignmentClick(), and Validate().
|
override |
Saves the component class assignments to the board settings.
Definition at line 157 of file panel_assign_component_classes.cpp.
References m_assignments, PANEL_ASSIGN_COMPONENT_CLASSES_BASE::m_assignSheetClasses, m_componentClassSettings, and Validate().
|
override |
Loads current component class assignments from the board settings.
Definition at line 132 of file panel_assign_component_classes.cpp.
References addAssignment(), PANEL_COMPONENT_CLASS_ASSIGNMENT::AddCondition(), PANEL_ASSIGN_COMPONENT_CLASSES_BASE::m_assignSheetClasses, m_componentClassSettings, PANEL_COMPONENT_CLASS_ASSIGNMENT::SetComponentClass(), PANEL_COMPONENT_CLASS_ASSIGNMENT::SetConditionsOperator(), CONDITION_DATA::SetPrimaryField(), and CONDITION_DATA::SetSecondaryField().
Referenced by ImportSettingsFrom().
|
override |
Validates that all assignment rules can compile successfully.
Definition at line 178 of file panel_assign_component_classes.cpp.
References _, COMPONENT_CLASS_MANAGER::CompileAssignmentRule(), PCB_BASE_FRAME::GetCanvas(), BOARD::GetComponentClassManager(), PAGED_DIALOG::GetDialog(), GetFrame(), PCB_EDIT_FRAME::GetModel(), m_assignments, EDA_DRAW_PANEL_GAL::Refresh(), scrollToAssignment(), and PAGED_DIALOG::SetError().
Referenced by TransferDataFromWindow().
|
private |
Vector of all currently displayed assignment rules.
Definition at line 104 of file panel_assign_component_classes.h.
Referenced by addAssignment(), RemoveAssignment(), TransferDataFromWindow(), and Validate().
|
private |
The list of all currently present component class assignments.
Definition at line 119 of file panel_assign_component_classes.h.
Referenced by addAssignment(), and RemoveAssignment().
|
protectedinherited |
Definition at line 50 of file panel_assign_component_classes_base.h.
Referenced by addAssignment(), PANEL_ASSIGN_COMPONENT_CLASSES_BASE::PANEL_ASSIGN_COMPONENT_CLASSES_BASE(), and scrollToAssignment().
|
protectedinherited |
Definition at line 46 of file panel_assign_component_classes_base.h.
Referenced by PANEL_ASSIGN_COMPONENT_CLASSES_BASE::PANEL_ASSIGN_COMPONENT_CLASSES_BASE(), TransferDataFromWindow(), and TransferDataToWindow().
|
protectedinherited |
Definition at line 49 of file panel_assign_component_classes_base.h.
Referenced by PANEL_ASSIGN_COMPONENT_CLASSES_BASE::PANEL_ASSIGN_COMPONENT_CLASSES_BASE(), and PANEL_ASSIGN_COMPONENT_CLASSES_BASE::~PANEL_ASSIGN_COMPONENT_CLASSES_BASE().
|
private |
The active settings object.
Definition at line 107 of file panel_assign_component_classes.h.
Referenced by ImportSettingsFrom(), TransferDataFromWindow(), and TransferDataToWindow().
|
private |
The parent dialog.
Definition at line 98 of file panel_assign_component_classes.h.
Referenced by addAssignment().
|
private |
All footprint fields names present on the board.
Definition at line 113 of file panel_assign_component_classes.h.
Referenced by GetFieldNames(), and PANEL_ASSIGN_COMPONENT_CLASSES().
|
private |
The active edit frame.
Definition at line 101 of file panel_assign_component_classes.h.
Referenced by GetFrame(), PANEL_ASSIGN_COMPONENT_CLASSES(), and ~PANEL_ASSIGN_COMPONENT_CLASSES().
|
private |
All currently selected footprint references.
Definition at line 110 of file panel_assign_component_classes.h.
Referenced by GetSelectionRefs(), and PANEL_ASSIGN_COMPONENT_CLASSES().
|
private |
All sheet names present on the board.
Definition at line 116 of file panel_assign_component_classes.h.
Referenced by GetSheetNames(), and PANEL_ASSIGN_COMPONENT_CLASSES().
|
protectedinherited |
Definition at line 47 of file panel_assign_component_classes_base.h.
Referenced by PANEL_ASSIGN_COMPONENT_CLASSES_BASE::PANEL_ASSIGN_COMPONENT_CLASSES_BASE().
|
protectedinherited |
Definition at line 48 of file panel_assign_component_classes_base.h.
Referenced by PANEL_ASSIGN_COMPONENT_CLASSES_BASE::PANEL_ASSIGN_COMPONENT_CLASSES_BASE().