|
KiCad PCB EDA Suite
|
#include <panel_setup_constraint_rules.h>
Classes | |
| struct | DEFAULT_FIELD |
| One board default, as this page shows it. More... | |
Public Types | |
| enum class | FAMILY { CLEARANCE , TRACKS_AND_VIAS , HOLES , SILKSCREEN , SOLDER_MASK , HIGH_SPEED , FOOTPRINT_RULES } |
Public Member Functions | |
| PANEL_SETUP_CONSTRAINT_RULES (wxWindow *aParent, PCB_EDIT_FRAME *aFrame, DRC_RULE_DOCUMENT *aDocument, BOARD_DESIGN_SETTINGS &aSettings, const CONSTRAINT_SECTION &aSection) | |
| void | ShowRule (DRC_RULE_EDITOR_CONSTRAINT_NAME aType, int aIndex) |
| Opens one of this page's rules in its editor, when the page holds that rule type. | |
| void | RefreshDefaults () |
| Reads the board defaults back into their fields, after something other than this page changed them. | |
| wxString | ImportGroup () const |
| The Import Settings group this page's defaults travel with. | |
| void | RefreshFromDocument () |
| bool | TransferDataToWindow () override |
| bool | TransferDataFromWindow () override |
| Called when the dialog is accepted. | |
| bool | Validate () override |
| The rule form is always on screen, so its fields are empty until a rule is being written. | |
Static Public Member Functions | |
| static std::vector< CONSTRAINT_SECTION > | SectionsFor (FAMILY aFamily) |
| The sections of one family, in the order they are shown in the tree. | |
| static bool | RulesCanOverride (const wxString &aSetting, DRC_CONSTRAINT_T *aConstraint) |
| Whether rules can set a value other than this board default, and the DRC constraint that does it. | |
| static wxString | PageTitleFor (DRC_RULE_EDITOR_CONSTRAINT_NAME aType) |
| The title of the page that edits rules of this type, or empty when no page does. | |
| static std::map< int, std::vector< wxString > > | NetclassValuesFor (const wxString &aSetting, const NET_SETTINGS &aNetSettings) |
| The net class values set for a constraint, grouped by value so equal classes list together. | |
| static wxString | PageEditingDefault (const wxString &aSetting) |
| The title of the page that edits a board default, or empty where no rule page edits one. | |
| static void | LinkToPage (wxWindow *aField, const wxString &aPage, int aSlot=1) |
| Puts a link to another page holding the same value at the field's right edge. | |
| static std::vector< std::pair< wxString, CONSTRAINT_DEFAULT_FIELD > > | EditedDefaults () |
| Every board default a rule page edits, each with the group it is imported with. | |
Private Member Functions | |
| void | buildSection () |
| void | wrapLabels () |
| void | showPage (const wxString &aTitle) |
| bool | applyDefaults () |
| Writes the default fields to the board, or reports the first value out of range. | |
| void | writeDefaults (BOARD_DESIGN_SETTINGS &aSettings) const |
| Copies the defaults this page edits into aSettings. | |
| void | updateWarnings () |
| Shows a warning icon, with the reason as its tooltip, over each default whose value has an issue. | |
| bool | confirmPendingRule () |
| Offers what to do with a rule the form holds. | |
Static Private Member Functions | |
| static std::optional< CONSTRAINT_SECTION > | sectionForSetting (const wxString &aSetting) |
| The section whose board defaults include a setting, where one holds it. | |
Private Attributes | |
| PCB_EDIT_FRAME * | m_frame |
| BOARD_DESIGN_SETTINGS * | m_settings |
| DRC_RULE_DOCUMENT * | m_document |
| wxScrolledWindow * | m_scrolled |
| CONSTRAINT_SECTION | m_section |
| std::vector< DEFAULT_FIELD > | m_defaults |
| wxStaticText * | m_note |
| wxString | m_noteText |
| wxStaticText * | m_defaultsNote |
| wxString | m_defaultsNoteText |
| wxTimer | m_validationTimer |
| CONSTRAINT_RULES_LIST * | m_list |
| Null until the section is built, and where a section carries no rules of its own. | |
Definition at line 103 of file panel_setup_constraint_rules.h.
|
strong |
| Enumerator | |
|---|---|
| CLEARANCE | |
| TRACKS_AND_VIAS | |
| HOLES | |
| SILKSCREEN | |
| SOLDER_MASK | |
| HIGH_SPEED | |
| FOOTPRINT_RULES | |
Definition at line 106 of file panel_setup_constraint_rules.h.
| PANEL_SETUP_CONSTRAINT_RULES::PANEL_SETUP_CONSTRAINT_RULES | ( | wxWindow * | aParent, |
| PCB_EDIT_FRAME * | aFrame, | ||
| DRC_RULE_DOCUMENT * | aDocument, | ||
| BOARD_DESIGN_SETTINGS & | aSettings, | ||
| const CONSTRAINT_SECTION & | aSection ) |
| aSettings | is where this page reads and writes its defaults. Board Setup passes a copy that reaches the board only when the dialog is accepted. |
Definition at line 47 of file panel_setup_constraint_rules.cpp.
References buildSection(), m_defaultsNote, m_document, m_frame, m_list, m_note, m_scrolled, m_section, m_settings, m_validationTimer, updateWarnings(), and wrapLabels().
|
private |
Writes the default fields to the board, or reports the first value out of range.
Definition at line 285 of file panel_setup_constraint_rules.cpp.
References PAGED_DIALOG::GetDialog(), m_defaults, m_frame, m_settings, BOARD_DESIGN_SETTINGS::ValidateDesignRules(), and writeDefaults().
Referenced by TransferDataFromWindow().
|
private |
Definition at line 89 of file panel_setup_constraint_rules.cpp.
References _, PANEL_SETUP_CONSTRAINT_RULES::DEFAULT_FIELD::binder, COUNT, PANEL_SETUP_CONSTRAINT_RULES::DEFAULT_FIELD::ctrl, KIUI::GetInfoFont(), KIUI::GetTextSize(), grid, CONSTRAINT_DEFAULT_FIELD::label, link, m_defaults, m_defaultsNote, m_defaultsNoteText, m_document, m_frame, m_list, m_note, m_noteText, m_scrolled, m_section, m_validationTimer, CONSTRAINT_DEFAULT_FIELD::member, PANEL_SETUP_CONSTRAINT_RULES::DEFAULT_FIELD::member, name, RefreshFromDocument(), CONSTRAINT_DEFAULT_FIELD::settingName, PANEL_SETUP_CONSTRAINT_RULES::DEFAULT_FIELD::settingName, UNIT_BINDER::SetUnits(), showPage(), UNSCALED, CONSTRAINT_DEFAULT_FIELD::value, and PANEL_SETUP_CONSTRAINT_RULES::DEFAULT_FIELD::warning.
Referenced by PANEL_SETUP_CONSTRAINT_RULES().
|
private |
Offers what to do with a rule the form holds.
False while the offer stands, which is what holds the page until it is answered.
Definition at line 377 of file panel_setup_constraint_rules.cpp.
References m_list.
Referenced by TransferDataFromWindow(), and Validate().
|
static |
Every board default a rule page edits, each with the group it is imported with.
A default is written by the page that edits it, so an import has to reach the board itself for a page that was never opened.
Definition at line 422 of file panel_setup_constraint_rules.cpp.
References CLEARANCE, FOOTPRINT_RULES, group, HIGH_SPEED, HOLES, importGroup(), SectionsFor(), SILKSCREEN, SOLDER_MASK, and TRACKS_AND_VIAS.
Referenced by BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().
| wxString PANEL_SETUP_CONSTRAINT_RULES::ImportGroup | ( | ) | const |
The Import Settings group this page's defaults travel with.
Definition at line 409 of file panel_setup_constraint_rules.cpp.
References importGroup(), and m_section.
|
static |
Puts a link to another page holding the same value at the field's right edge.
The field stays editable: the value can be set in either place.
| aSlot | is where the link sits among the icons at the field's right edge. |
Definition at line 501 of file panel_setup_constraint_rules.cpp.
References _, PAGED_DIALOG::GetDialog(), link, and small_new_window.
Referenced by PANEL_SETUP_CONSTRAINTS::PANEL_SETUP_CONSTRAINTS(), and PANEL_SETUP_MASK_AND_PASTE::PANEL_SETUP_MASK_AND_PASTE().
|
static |
The net class values set for a constraint, grouped by value so equal classes list together.
Definition at line 546 of file panel_setup_constraint_rules.cpp.
References sectionForSetting().
Referenced by PANEL_SETUP_CONSTRAINTS::showOverridingRules().
|
static |
The title of the page that edits a board default, or empty where no rule page edits one.
Definition at line 493 of file panel_setup_constraint_rules.cpp.
References sectionForSetting().
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), PANEL_SETUP_CONSTRAINTS::PANEL_SETUP_CONSTRAINTS(), PANEL_SETUP_MASK_AND_PASTE::PANEL_SETUP_MASK_AND_PASTE(), and PANEL_SETUP_CONSTRAINTS::showOverridingRules().
|
static |
The title of the page that edits rules of this type, or empty when no page does.
Definition at line 565 of file panel_setup_constraint_rules.cpp.
References CLEARANCE, FOOTPRINT_RULES, HIGH_SPEED, HOLES, SectionsFor(), SILKSCREEN, SOLDER_MASK, and TRACKS_AND_VIAS.
Referenced by BOOST_AUTO_TEST_CASE(), and PANEL_SETUP_CONSTRAINTS::showOverridingRules().
| void PANEL_SETUP_CONSTRAINT_RULES::RefreshDefaults | ( | ) |
Reads the board defaults back into their fields, after something other than this page changed them.
Definition at line 273 of file panel_setup_constraint_rules.cpp.
References m_defaults, m_settings, and updateWarnings().
Referenced by TransferDataToWindow().
| void PANEL_SETUP_CONSTRAINT_RULES::RefreshFromDocument | ( | ) |
Definition at line 415 of file panel_setup_constraint_rules.cpp.
References m_list.
Referenced by buildSection(), DIALOG_BOARD_SETUP::onAuxiliaryAction(), and TransferDataToWindow().
|
static |
Whether rules can set a value other than this board default, and the DRC constraint that does it.
Definition at line 461 of file panel_setup_constraint_rules.cpp.
References ANNULAR_WIDTH_CONSTRAINT, CLEARANCE_CONSTRAINT, CONNECTION_WIDTH_CONSTRAINT, EDGE_CLEARANCE_CONSTRAINT, HOLE_CLEARANCE_CONSTRAINT, HOLE_SIZE_CONSTRAINT, HOLE_TO_HOLE_CONSTRAINT, LINE_WIDTH_CONSTRAINT, SILK_CLEARANCE_CONSTRAINT, SOLDER_MASK_EXPANSION_CONSTRAINT, SOLDER_MASK_SLIVER_CONSTRAINT, SOLDER_PASTE_ABS_MARGIN_CONSTRAINT, TEXT_HEIGHT_CONSTRAINT, TRACK_WIDTH_CONSTRAINT, and VIA_DIAMETER_CONSTRAINT.
Referenced by BOOST_AUTO_TEST_CASE(), PANEL_SETUP_CONSTRAINTS::PANEL_SETUP_CONSTRAINTS(), and PANEL_SETUP_CONSTRAINTS::showOverridingRules().
|
staticprivate |
The section whose board defaults include a setting, where one holds it.
Definition at line 442 of file panel_setup_constraint_rules.cpp.
References CLEARANCE, FOOTPRINT_RULES, HIGH_SPEED, HOLES, SectionsFor(), CONSTRAINT_DEFAULT_FIELD::settingName, SILKSCREEN, SOLDER_MASK, and TRACKS_AND_VIAS.
Referenced by NetclassValuesFor(), and PageEditingDefault().
|
static |
The sections of one family, in the order they are shown in the tree.
Definition at line 581 of file panel_setup_constraint_rules.cpp.
References _, ABSOLUTE_LENGTH, ALLOWED_ORIENTATION, CLEARANCE, clearance, COPPER_TO_EDGE_CLEARANCE, COPPER_TO_HOLE_CLEARANCE, COUNT, COURTYARD_CLEARANCE, CREEPAGE_DISTANCE, FOOTPRINT_RULES, HIGH_SPEED, HOLE_ASPECT_RATIO, HOLE_SIZE, HOLE_TO_HOLE_DISTANCE, HOLES, MATCHED_LENGTH_DIFF_PAIR, MAXIMUM_VIA_COUNT, MICROVIA_STACK_DEPTH, MINIMUM_ANNULAR_WIDTH, MINIMUM_CLEARANCE, MINIMUM_CONNECTION_WIDTH, MINIMUM_DRILL_SIZE, MINIMUM_SOLDERMASK_SLIVER, MINIMUM_TEXT_HEIGHT_AND_THICKNESS, MINIMUM_THERMAL_RELIEF_SPOKE_COUNT, MINIMUM_VIA_DIAMETER, OPTIMUM, PERMITTED_LAYERS, PHYSICAL_CLEARANCE, ROUTING_DIFF_PAIR, ROUTING_WIDTH, SILK_TO_SILK_CLEARANCE, SILK_TO_SOLDERMASK_CLEARANCE, SILKSCREEN, SOLDER_MASK, SOLDERMASK_EXPANSION, SOLDERPASTE_EXPANSION, TRACKS_AND_VIAS, VIA_STYLE, and VIAS_UNDER_SMD.
Referenced by DIALOG_BOARD_SETUP::DIALOG_BOARD_SETUP(), EditedDefaults(), PageTitleFor(), and sectionForSetting().
|
private |
Definition at line 244 of file panel_setup_constraint_rules.cpp.
References PAGED_DIALOG::GetDialog().
Referenced by buildSection().
| void PANEL_SETUP_CONSTRAINT_RULES::ShowRule | ( | DRC_RULE_EDITOR_CONSTRAINT_NAME | aType, |
| int | aIndex ) |
Opens one of this page's rules in its editor, when the page holds that rule type.
Definition at line 558 of file panel_setup_constraint_rules.cpp.
|
override |
Called when the dialog is accepted.
A rule left in the form has not reached the document, so this is the last chance to add it.
Definition at line 389 of file panel_setup_constraint_rules.cpp.
References applyDefaults(), and confirmPendingRule().
|
override |
Definition at line 395 of file panel_setup_constraint_rules.cpp.
References RefreshDefaults(), and RefreshFromDocument().
|
private |
Shows a warning icon, with the reason as its tooltip, over each default whose value has an issue.
Definition at line 334 of file panel_setup_constraint_rules.cpp.
References BOARD_DESIGN_SETTINGS::GetDesignRuleWarnings(), m_defaults, m_frame, m_list, m_settings, m_validationTimer, BOARD_DESIGN_SETTINGS::ValidateDesignRules(), and writeDefaults().
Referenced by PANEL_SETUP_CONSTRAINT_RULES(), and RefreshDefaults().
|
override |
The rule form is always on screen, so its fields are empty until a rule is being written.
Their validators must not decide whether the page can be left, which is what the base class would use them for. The form reports its own errors when it is applied. What this does check is whether a rule is waiting to be added, since leaving the page would drop it.
Definition at line 383 of file panel_setup_constraint_rules.cpp.
References confirmPendingRule().
|
private |
Definition at line 251 of file panel_setup_constraint_rules.cpp.
References m_defaultsNote, m_defaultsNoteText, m_note, m_noteText, m_scrolled, and text.
Referenced by PANEL_SETUP_CONSTRAINT_RULES().
|
private |
Copies the defaults this page edits into aSettings.
Definition at line 327 of file panel_setup_constraint_rules.cpp.
References m_defaults.
Referenced by applyDefaults(), and updateWarnings().
|
private |
Definition at line 232 of file panel_setup_constraint_rules.h.
Referenced by applyDefaults(), buildSection(), RefreshDefaults(), updateWarnings(), and writeDefaults().
|
private |
Definition at line 235 of file panel_setup_constraint_rules.h.
Referenced by buildSection(), PANEL_SETUP_CONSTRAINT_RULES(), and wrapLabels().
|
private |
Definition at line 236 of file panel_setup_constraint_rules.h.
Referenced by buildSection(), and wrapLabels().
|
private |
Definition at line 213 of file panel_setup_constraint_rules.h.
Referenced by buildSection(), and PANEL_SETUP_CONSTRAINT_RULES().
|
private |
Definition at line 211 of file panel_setup_constraint_rules.h.
Referenced by applyDefaults(), buildSection(), PANEL_SETUP_CONSTRAINT_RULES(), and updateWarnings().
|
private |
Null until the section is built, and where a section carries no rules of its own.
Definition at line 239 of file panel_setup_constraint_rules.h.
Referenced by buildSection(), confirmPendingRule(), PANEL_SETUP_CONSTRAINT_RULES(), RefreshFromDocument(), ShowRule(), and updateWarnings().
|
private |
Definition at line 233 of file panel_setup_constraint_rules.h.
Referenced by buildSection(), PANEL_SETUP_CONSTRAINT_RULES(), and wrapLabels().
|
private |
Definition at line 234 of file panel_setup_constraint_rules.h.
Referenced by buildSection(), and wrapLabels().
|
private |
Definition at line 214 of file panel_setup_constraint_rules.h.
Referenced by buildSection(), PANEL_SETUP_CONSTRAINT_RULES(), and wrapLabels().
|
private |
Definition at line 231 of file panel_setup_constraint_rules.h.
Referenced by buildSection(), ImportGroup(), PANEL_SETUP_CONSTRAINT_RULES(), and ShowRule().
|
private |
Definition at line 212 of file panel_setup_constraint_rules.h.
Referenced by applyDefaults(), PANEL_SETUP_CONSTRAINT_RULES(), RefreshDefaults(), and updateWarnings().
|
private |
Definition at line 237 of file panel_setup_constraint_rules.h.
Referenced by buildSection(), PANEL_SETUP_CONSTRAINT_RULES(), and updateWarnings().