|
KiCad PCB EDA Suite
|
Container panel that manages multiple condition rows with boolean operators. More...
#include <drc_re_condition_group_panel.h>
Classes | |
| struct | CONDITION_ENTRY |
Public Types | |
| enum class | BOOL_OPERATOR { AND = 0 , OR , AND_NOT , OR_NOT } |
Public Member Functions | |
| DRC_RE_CONDITION_GROUP_PANEL (wxWindow *aParent, BOARD *aBoard, bool aTwoObjectConstraint) | |
| void | ParseCondition (const wxString &aConditionExpr) |
| Parse a condition string and populate the UI. | |
| wxString | BuildCondition () const |
| Build a condition string from the current UI state. | |
| void | SetChangeCallback (std::function< void()> aCallback) |
| Set a callback to be invoked when any condition changes. | |
| bool | HasCustomQuerySelected () const |
Private Member Functions | |
| void | addConditionRow (BOOL_OPERATOR aOp=BOOL_OPERATOR::AND) |
| void | removeConditionRow (int aIndex) |
| void | onAddClicked (wxCommandEvent &aEvent) |
| void | rebuildLayout () |
| void | updateDeleteButtonVisibility () |
| bool | tokenizeCondition (const wxString &aExpr, std::vector< std::pair< BOOL_OPERATOR, wxString > > &aParts) |
| Tokenize a condition expression by boolean operators. | |
Private Attributes | |
| BOARD * | m_board |
| bool | m_twoObjectConstraint |
| bool | m_suppressCallbacks |
| std::vector< CONDITION_ENTRY > | m_conditions |
| wxBoxSizer * | m_mainSizer |
| wxBitmapButton * | m_addBtn |
| wxStaticText * | m_labelText |
| std::function< void()> | m_changeCallback |
Container panel that manages multiple condition rows with boolean operators.
Supports AND, OR, AND NOT, OR NOT operators between conditions. Evaluates left-to-right without parentheses.
Definition at line 43 of file drc_re_condition_group_panel.h.
|
strong |
| Enumerator | |
|---|---|
| AND | |
| OR | |
| AND_NOT | |
| OR_NOT | |
Definition at line 46 of file drc_re_condition_group_panel.h.
| DRC_RE_CONDITION_GROUP_PANEL::DRC_RE_CONDITION_GROUP_PANEL | ( | wxWindow * | aParent, |
| BOARD * | aBoard, | ||
| bool | aTwoObjectConstraint ) |
Definition at line 38 of file drc_re_condition_group_panel.cpp.
References _, addConditionRow(), KiBitmapBundle(), m_addBtn, m_board, m_labelText, m_mainSizer, m_suppressCallbacks, m_twoObjectConstraint, onAddClicked(), small_plus, and TRACE_COND.
|
private |
Definition at line 191 of file drc_re_condition_group_panel.cpp.
References _, DRC_RE_CONDITION_GROUP_PANEL::CONDITION_ENTRY::boolOp, m_board, m_changeCallback, m_conditions, m_mainSizer, m_suppressCallbacks, m_twoObjectConstraint, DRC_RE_CONDITION_GROUP_PANEL::CONDITION_ENTRY::operatorChoice, DRC_RE_CONDITION_GROUP_PANEL::CONDITION_ENTRY::panel, removeConditionRow(), DRC_RE_CONDITION_GROUP_PANEL::CONDITION_ENTRY::rowSizer, DRC_RE_CONDITION_ROW_PANEL::SetChangeCallback(), DRC_RE_CONDITION_ROW_PANEL::SetDeleteCallback(), TRACE_COND, and updateDeleteButtonVisibility().
Referenced by DRC_RE_CONDITION_GROUP_PANEL(), onAddClicked(), and ParseCondition().
| wxString DRC_RE_CONDITION_GROUP_PANEL::BuildCondition | ( | ) | const |
Build a condition string from the current UI state.
Definition at line 145 of file drc_re_condition_group_panel.cpp.
References AND, AND_NOT, m_conditions, OR, OR_NOT, and result.
| bool DRC_RE_CONDITION_GROUP_PANEL::HasCustomQuerySelected | ( | ) | const |
Definition at line 174 of file drc_re_condition_group_panel.cpp.
References m_conditions, and TRACE_COND.
Referenced by ParseCondition().
|
private |
Definition at line 317 of file drc_re_condition_group_panel.cpp.
References addConditionRow(), AND, m_changeCallback, and m_suppressCallbacks.
Referenced by DRC_RE_CONDITION_GROUP_PANEL().
| void DRC_RE_CONDITION_GROUP_PANEL::ParseCondition | ( | const wxString & | aConditionExpr | ) |
Parse a condition string and populate the UI.
| aConditionExpr | The complete condition expression |
Definition at line 72 of file drc_re_condition_group_panel.cpp.
References addConditionRow(), HasCustomQuerySelected(), m_conditions, m_suppressCallbacks, removeConditionRow(), tokenizeCondition(), TRACE_COND, and updateDeleteButtonVisibility().
|
private |
Definition at line 326 of file drc_re_condition_group_panel.cpp.
References m_addBtn, and m_mainSizer.
|
private |
Definition at line 270 of file drc_re_condition_group_panel.cpp.
References m_changeCallback, m_conditions, m_mainSizer, m_suppressCallbacks, DRC_RE_CONDITION_GROUP_PANEL::CONDITION_ENTRY::operatorChoice, DRC_RE_CONDITION_GROUP_PANEL::CONDITION_ENTRY::panel, removeConditionRow(), DRC_RE_CONDITION_GROUP_PANEL::CONDITION_ENTRY::rowSizer, and updateDeleteButtonVisibility().
Referenced by addConditionRow(), ParseCondition(), and removeConditionRow().
|
inline |
Set a callback to be invoked when any condition changes.
Definition at line 73 of file drc_re_condition_group_panel.h.
References m_changeCallback.
|
private |
Tokenize a condition expression by boolean operators.
| aExpr | The expression to tokenize |
| aParts | Output vector of (operator, expression) pairs |
Definition at line 346 of file drc_re_condition_group_panel.cpp.
References AND, AND_NOT, end, OR, and OR_NOT.
Referenced by ParseCondition().
|
private |
Definition at line 336 of file drc_re_condition_group_panel.cpp.
References m_conditions.
Referenced by addConditionRow(), ParseCondition(), and removeConditionRow().
|
private |
Definition at line 110 of file drc_re_condition_group_panel.h.
Referenced by DRC_RE_CONDITION_GROUP_PANEL(), and rebuildLayout().
|
private |
Definition at line 105 of file drc_re_condition_group_panel.h.
Referenced by addConditionRow(), and DRC_RE_CONDITION_GROUP_PANEL().
|
private |
Definition at line 113 of file drc_re_condition_group_panel.h.
Referenced by addConditionRow(), onAddClicked(), removeConditionRow(), and SetChangeCallback().
|
private |
Definition at line 108 of file drc_re_condition_group_panel.h.
Referenced by addConditionRow(), BuildCondition(), HasCustomQuerySelected(), ParseCondition(), removeConditionRow(), and updateDeleteButtonVisibility().
|
private |
Definition at line 111 of file drc_re_condition_group_panel.h.
Referenced by DRC_RE_CONDITION_GROUP_PANEL().
|
private |
Definition at line 109 of file drc_re_condition_group_panel.h.
Referenced by addConditionRow(), DRC_RE_CONDITION_GROUP_PANEL(), rebuildLayout(), and removeConditionRow().
|
private |
Definition at line 107 of file drc_re_condition_group_panel.h.
Referenced by addConditionRow(), DRC_RE_CONDITION_GROUP_PANEL(), onAddClicked(), ParseCondition(), and removeConditionRow().
|
private |
Definition at line 106 of file drc_re_condition_group_panel.h.
Referenced by addConditionRow(), and DRC_RE_CONDITION_GROUP_PANEL().