20#ifndef PANEL_SETUP_CONSTRAINT_RULES_H
21#define PANEL_SETUP_CONSTRAINT_RULES_H
37class wxScrolledWindow;
91 std::vector<CONSTRAINT_DEFAULT_FIELD>
defaults;
92 std::optional<DRC_RULE_EDITOR_CONSTRAINT_NAME>
ruleType;
136 static std::map<int, std::vector<wxString>>
NetclassValuesFor(
const wxString& aSetting,
151 static void LinkToPage( wxWindow* aField,
const wxString& aPage,
int aSlot = 1 );
159 static std::vector<std::pair<wxString, CONSTRAINT_DEFAULT_FIELD>>
EditedDefaults();
190 static std::optional<CONSTRAINT_SECTION>
sectionForSetting(
const wxString& aSetting );
194 void showPage(
const wxString& aTitle );
Container for design settings for a BOARD object.
Information pertinent to a Pcbnew printed circuit board.
The rules of one constraint type, in evaluation order, with an editor that opens in place.
The custom rules of one board, held in memory while Board Setup is open.
A warning icon drawn inside the right edge of a field, left of its dropdown button when it has one,...
A collection of nets and the parameters used to route or test these nets.
NET_SETTINGS stores various net-related settings in a project context.
PANEL_SETUP_CONSTRAINT_RULES(wxWindow *aParent, PCB_EDIT_FRAME *aFrame, DRC_RULE_DOCUMENT *aDocument, BOARD_DESIGN_SETTINGS &aSettings, const CONSTRAINT_SECTION &aSection)
CONSTRAINT_SECTION m_section
void showPage(const wxString &aTitle)
bool TransferDataToWindow() override
wxStaticText * m_defaultsNote
wxTimer m_validationTimer
static wxString PageEditingDefault(const wxString &aSetting)
The title of the page that edits a board default, or empty where no rule page edits one.
void RefreshFromDocument()
std::vector< DEFAULT_FIELD > m_defaults
static std::vector< CONSTRAINT_SECTION > SectionsFor(FAMILY aFamily)
The sections of one family, in the order they are shown in the tree.
wxScrolledWindow * m_scrolled
bool Validate() override
The rule form is always on screen, so its fields are empty until a rule is being written.
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::vector< std::pair< wxString, CONSTRAINT_DEFAULT_FIELD > > EditedDefaults()
Every board default a rule page edits, each with the group it is imported with.
DRC_RULE_DOCUMENT * m_document
BOARD_DESIGN_SETTINGS * m_settings
bool TransferDataFromWindow() override
Called when the dialog is accepted.
void updateWarnings()
Shows a warning icon, with the reason as its tooltip, over each default whose value has an issue.
wxString m_defaultsNoteText
wxString ImportGroup() const
The Import Settings group this page's defaults travel with.
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.
bool confirmPendingRule()
Offers what to do with a rule the form holds.
void RefreshDefaults()
Reads the board defaults back into their fields, after something other than this page changed them.
void writeDefaults(BOARD_DESIGN_SETTINGS &aSettings) const
Copies the defaults this page edits into aSettings.
bool applyDefaults()
Writes the default fields to the board, or reports the first value out of range.
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.
CONSTRAINT_RULES_LIST * m_list
Null until the section is built, and where a section carries no rules of its own.
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.
static std::optional< CONSTRAINT_SECTION > sectionForSetting(const wxString &aSetting)
The section whose board defaults include a setting, where one holds it.
The main frame for Pcbnew.
DRC_RULE_EDITOR_CONSTRAINT_NAME
NETCLASS_CONSTRAINT_PART
What a net class value does to a constraint, which is not always raise its minimum.
@ OPTIMUM
Asks for a value without raising the minimum, as a net class track width does.
@ MINIMUM
Raises the minimum, as a net class clearance does.
CONSTRAINT_VALUE
What a board default measures, which decides how its field is read and written.
@ LENGTH
A distance in board units, shown in the user's units.
int BOARD_DESIGN_SETTINGS::* member
One constraint on a Design Rules page: its board default, the net class values that apply to it,...
std::optional< DRC_RULE_EDITOR_CONSTRAINT_NAME > ruleType
std::vector< CONSTRAINT_DEFAULT_FIELD > defaults
std::function< std::optional< int >(const NETCLASS &)> netclassValue
wxString settingsPage
The group this section's defaults are imported with.
NETCLASS_CONSTRAINT_PART netclassPart
What a net class value does to this constraint, where a class can set one.
One board default, as this page shows it.
int BOARD_DESIGN_SETTINGS::* member
int loaded
The value as this page last read it, so an untouched field does not write back over an edit made to t...
FIELD_WARNING_ICON * warning
std::unique_ptr< UNIT_BINDER > binder