20#ifndef CONSTRAINT_RULES_LIST_H
21#define CONSTRAINT_RULES_LIST_H
71 void SetDefaults( std::vector<std::pair<wxString, std::function<wxString()>>> aDefaults )
115 void onPrimary( wxCommandEvent& aEvent );
116 void onNewRule( wxCommandEvent& aEvent );
117 void onMoveUp( wxCommandEvent& aEvent );
120 void onRemove( wxCommandEvent& aEvent );
127 void buildEditor(
const std::shared_ptr<DRC_RE_BASE_CONSTRAINT_DATA>& aData,
133 int indexOf(
const std::shared_ptr<DRC_RE_BASE_CONSTRAINT_DATA>& aData )
const;
161 std::vector<std::pair<wxString, std::function<wxString()>>>
m_defaults;
Information pertinent to a Pcbnew printed circuit board.
CONSTRAINT_RULES_LIST_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxTAB_TRAVERSAL, const wxString &name=wxEmptyString)
bool ConfirmPendingRule()
Asks what to do with a rule left in the form.
std::function< void()> m_onChanged
void RefreshOverrideNote()
Rebuilds the line saying what the rule being edited displaces.
wxString sharedWithText(int aIndex) const
bool EditRule(int aIndex)
Selects a rule and opens it in the editor. False if a rule left in the form kept it closed.
static wxString inUserUnits(const wxString &aClause, UNITS_PROVIDER *aUnits)
void onDuplicate(wxCommandEvent &aEvent)
static wxString ConstraintText(const DRC_RE_LOADED_PANEL_ENTRY &aEntry, DRC_RULE_EDITOR_CONSTRAINT_NAME aType, UNITS_PROVIDER *aUnits)
The constraint a rule sets, written the way the rule table shows it.
int addNetclassRows()
Fills the leading rows with the net class values, and returns how many it added.
std::vector< int > m_rowToIndex
The document index each row shows, or NETCLASS_ROW where the row is a net class value.
void onNewRule(wxCommandEvent &aEvent)
bool ApplyPendingRule()
Adds or updates the rule the form holds.
NETCLASS_CONSTRAINT_PART m_netclassPart
void buildEditor(const std::shared_ptr< DRC_RE_BASE_CONSTRAINT_DATA > &aData, DRC_RULE_EDITOR_CONSTRAINT_NAME aPanelType)
static constexpr int NETCLASS_ROW
What m_rowToIndex holds for a row that is not a rule of this document.
bool HasPendingRule() const
True while the form holds typing that has not been added to the list.
void onRemove(wxCommandEvent &aEvent)
void SetDefaults(std::vector< std::pair< wxString, std::function< wxString()> > > aDefaults)
The board defaults this constraint falls back to, each with the name the note gives it.
int indexOf(const std::shared_ptr< DRC_RE_BASE_CONSTRAINT_DATA > &aData) const
static void copyRuleData(DRC_RE_BASE_CONSTRAINT_DATA &aTarget, const DRC_RE_BASE_CONSTRAINT_DATA &aSource)
Copies everything the form edits, the rule name included.
int selectedIndex() const
void showRule(int aIndex)
void onMoveUp(wxCommandEvent &aEvent)
void selectIndex(int aIndex)
DRC_RULE_DOCUMENT * m_document
std::function< std::optional< int >(const NETCLASS &)> m_netclassValue
void SetNetclasses(std::function< std::optional< int >(const NETCLASS &)> aValue, NETCLASS_CONSTRAINT_PART aPart)
Lists the net class values for this constraint above the rules, where a class can set one.
std::shared_ptr< DRC_RE_BASE_CONSTRAINT_DATA > m_editingData
DRC_RULE_EDITOR_CONSTRAINT_NAME m_editingType
void SetChangeCallback(std::function< void()> aCallback)
Called after this list changed the document.
static wxString layersText(const DRC_RE_LOADED_PANEL_ENTRY &aEntry)
DRC_RULE_EDITOR_CONSTRAINT_NAME m_type
CONSTRAINT_RULES_LIST(wxWindow *aParent, PCB_EDIT_FRAME *aFrame, DRC_RULE_DOCUMENT *aDocument, DRC_RULE_EDITOR_CONSTRAINT_NAME aType, const wxString &aTitle)
void moveSelected(int aDelta)
PANEL_DRC_RULE_EDITOR * m_editor
std::vector< std::pair< wxString, std::function< wxString()> > > m_defaults
void onPrimary(wxCommandEvent &aEvent)
void reportError(const wxString &aMessage)
void SetTitleWindow(wxWindow *aWindow)
A window whose label is the section title.
void DiscardPendingRule()
Reloads the form from the document, dropping whatever was typed.
void onMoveDown(wxCommandEvent &aEvent)
static wxString severityText(const DRC_RE_LOADED_PANEL_ENTRY &aEntry)
The custom rules of one board, held in memory while Board Setup is open.
A collection of nets and the parameters used to route or test these nets.
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.
@ MINIMUM
Raises the minimum, as a net class clearance does.
Represents a rule loaded from a .kicad_dru file and mapped to a panel.