59 auto it = std::find_if( aNodes.begin(), aNodes.end(),
62 return node.m_nodeId == aTargetId;
65 if( it != aNodes.end() )
94 if(
Prj().IsReadOnly() )
96 m_infoBar->ShowMessage(
_(
"Project is missing or read-only. Settings will not be "
107 new wxDataViewCtrl(
this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxDV_ROW_LINES | wxDV_SINGLE );
127 SetMinSize( wxSize( 400, 500 ) );
130 wxLogTrace(
"debug_dlg_size",
"DRC TransferDataToWindow: size=%s minSize=%s",
131 GetSize().IsFullySpecified() ? wxString::Format(
"%dx%d", GetSize().x, GetSize().y )
132 : wxString(
"default" ),
133 GetMinSize().IsFullySpecified()
134 ? wxString::Format(
"%dx%d", GetMinSize().x, GetMinSize().y )
135 : wxString(
"default" ) );
154 std::vector<RULE_TREE_NODE>
result;
157 int electricalItemId;
158 int manufacturabilityItemId;
159 int highSpeedDesignId;
178 result.insert(
result.end(), subItemNodes.begin(), subItemNodes.end() );
181 result.insert(
result.end(), subItemNodes.begin(), subItemNodes.end() );
184 result.insert(
result.end(), subItemNodes.begin(), subItemNodes.end() );
187 result.insert(
result.end(), subItemNodes.begin(), subItemNodes.end() );
200 wxFileName rulesFile(
m_frame->GetDesignRulesPath() );
202 if( !rulesFile.FileExists() )
206 std::vector<DRC_RE_LOADED_PANEL_ENTRY> entries = loader.
LoadFile( rulesFile.GetFullPath() );
208 wxLogTrace( wxS(
"KI_TRACE_DRC_RULE_EDITOR" ),
209 wxS(
"[LoadExistingRules] Loaded %zu entries from %s" ),
210 entries.size(), rulesFile.GetFullPath() );
213 wxLogTrace( wxS(
"KI_TRACE_DRC_RULE_EDITOR" ),
214 wxS(
"[LoadExistingRules] Available constraint nodes in m_ruleTreeNodeDatas:" ) );
220 wxLogTrace( wxS(
"KI_TRACE_DRC_RULE_EDITOR" ),
221 wxS(
"[LoadExistingRules] Node '%s': nodeId=%d, m_nodeTypeMap=%d" ),
222 wxString( node.m_nodeName ), node.m_nodeId,
223 node.m_nodeTypeMap ?
static_cast<int>( *node.m_nodeTypeMap ) : -1 );
228 std::function<wxTreeItemId( wxTreeItemId,
int )> findItem =
229 [&]( wxTreeItemId aItem,
int aTargetId ) -> wxTreeItemId
234 if( data && data->
GetNodeId() == aTargetId )
237 wxTreeItemIdValue cookie;
238 wxTreeItemId child =
m_ruleTreeCtrl->GetFirstChild( aItem, cookie );
240 while( child.IsOk() )
242 wxTreeItemId
res = findItem( child, aTargetId );
250 return wxTreeItemId();
257 wxLogTrace( wxS(
"KI_TRACE_DRC_RULE_EDITOR" ),
258 wxS(
"[LoadExistingRules] Processing entry: rule='%s', panelType=%d" ),
259 entry.ruleName,
static_cast<int>( type ) );
266 if( node.m_nodeType ==
CONSTRAINT && node.m_nodeTypeMap && *node.m_nodeTypeMap == type )
268 parentId = node.m_nodeId;
275 wxLogTrace( wxS(
"KI_TRACE_DRC_RULE_EDITOR" ),
276 wxS(
"[LoadExistingRules] No parent found for panelType=%d, skipping" ),
277 static_cast<int>( type ) );
281 wxTreeItemId parentItem = findItem(
m_ruleTreeCtrl->GetRootItem(), parentId );
283 if( !parentItem.IsOk() )
285 wxLogTrace( wxS(
"KI_TRACE_DRC_RULE_EDITOR" ),
286 wxS(
"[LoadExistingRules] Tree item not found for parentId=%d, skipping" ),
291 wxLogTrace( wxS(
"KI_TRACE_DRC_RULE_EDITOR" ),
292 wxS(
"[LoadExistingRules] Found parent node: parentId=%d" ), parentId );
298 auto ruleData = std::dynamic_pointer_cast<DRC_RE_BASE_CONSTRAINT_DATA>( entry.constraintData );
303 ruleData->SetParentId( parentId );
304 ruleData->SetOriginalRuleText( entry.originalRuleText );
305 ruleData->SetWasEdited( entry.wasEdited );
306 ruleData->SetLayerSource( entry.layerSource );
308 if( !entry.layerSource.IsEmpty() )
309 ruleData->SetLayers( entry.layerCondition.Seq() );
311 ruleData->SetSeverity( entry.severity );
318 wxLogTrace( wxS(
"KI_TRACE_DRC_RULE_EDITOR" ),
319 wxS(
"[LoadExistingRules] Appended rule '%s' to tree under parentId=%d" ),
320 entry.ruleName, parentId );
327 wxTreeItemId treeItemId;
348 auto sourceDataPtr = dynamic_pointer_cast<RULE_EDITOR_DATA_BASE>( sourceTreeNode->
m_nodeData );
354 wxString baseName = sourceDataPtr->GetRuleName();
355 int lastSpace = baseName.Find(
' ',
true );
357 if( lastSpace != wxNOT_FOUND )
359 wxString suffix = baseName.Mid( lastSpace + 1 );
362 if( suffix.ToLong( &num ) )
363 baseName = baseName.Left( lastSpace );
381 std::vector<RULE_TREE_NODE*> ruleNodes;
384 std::vector<DRC_RULE_ROW> rows;
385 rows.reserve( ruleNodes.size() );
390 wxString type = parentNode ? parentNode->
m_nodeName : wxString{};
391 rows.push_back( { type, ruleNode->m_nodeData->GetRuleName(), ruleNode->m_nodeData->GetComment() } );
403 wxString constraintName = paretNodeDetail->
m_nodeName;
408 &constraintName, dynamic_pointer_cast<DRC_RE_BASE_CONSTRAINT_DATA>( nodeDetail->
m_nodeData ) );
415 [
this](
int aNodeId )
421 [
this](
int aNodeId )
427 [
this](
int aNodeId )
433 [
this](
int aNodeId, wxString aRuleName )
439 [
this](
int aNodeId ) ->
int
462 bool isNew = data && data->IsNew();
469 std::vector<RULE_TREE_NODE*> modifiedRules;
472 if( modifiedRules.empty() )
484 if(
result == wxID_CANCEL )
490 std::map<wxString, wxString> errors;
497 if( errors.find( node.m_nodeName ) != errors.end() )
501 wxString msg = wxString::Format(
502 _(
"Cannot save due to validation errors in rule '%s':\n\n%s" ),
503 node.m_nodeName, errors[node.m_nodeName] );
533 auto constraintData =
534 std::dynamic_pointer_cast<DRC_RE_BASE_CONSTRAINT_DATA>( nodeDetail->
m_nodeData );
537 constraintData->SetWasEdited(
true );
559 default:
return true;
572 if(
OKOrCancelDialog(
this,
_(
"Confirmation" ),
"",
_(
"Are you sure you want to delete?" ),
_(
"Delete" ) )
594 std::vector<RULE_TREE_NODE>
result;
638 std::vector<RULE_TREE_NODE>
result;
705 std::vector<RULE_TREE_NODE>
result;
738 std::vector<RULE_TREE_NODE>
result;
796bool nodeExists(
const std::vector<RULE_TREE_NODE>& aRuleTreeNodes,
const wxString& aTargetName )
798 for(
const auto& node : aRuleTreeNodes )
811 const wxString& aBaseName )
814 using ConstraintDataFactory =
818 static const std::unordered_map<DRC_RULE_EDITOR_CONSTRAINT_NAME, ConstraintDataFactory> s_constraintFactories = {
822 return std::make_shared<DRC_RE_VIA_STYLE_CONSTRAINT_DATA>( data );
827 return std::make_shared<DRC_RE_MINIMUM_TEXT_HEIGHT_THICKNESS_CONSTRAINT_DATA>( data );
832 return std::make_shared<DRC_RE_ROUTING_DIFF_PAIR_CONSTRAINT_DATA>( data );
837 return std::make_shared<DRC_RE_ROUTING_WIDTH_CONSTRAINT_DATA>( data );
842 return std::make_shared<DRC_RE_PERMITTED_LAYERS_CONSTRAINT_DATA>( data );
847 return std::make_shared<DRC_RE_ALLOWED_ORIENTATION_CONSTRAINT_DATA>( data );
852 return std::make_shared<DRC_RE_CUSTOM_RULE_CONSTRAINT_DATA>( data );
857 return std::make_shared<DRC_RE_ABSOLUTE_LENGTH_TWO_CONSTRAINT_DATA>( data );
862 return std::make_shared<DRC_RE_MATCHED_LENGTH_DIFF_PAIR_CONSTRAINT_DATA>( data );
871 treeItemData = aRuleTreeItemData;
882 wxString base = aBaseName.IsEmpty() ? nodeDetail->
m_nodeName : aBaseName;
883 wxString nodeName = base +
" 1";
894 nodeName = base + wxString::Format(
" %d", loop );
908 if( s_constraintFactories.find( nodeType ) != s_constraintFactories.end() )
910 newRuleNode.
m_nodeData = s_constraintFactories.at( nodeType )( clearanceData );
918 newRuleNode.
m_nodeData = std::make_shared<DRC_RE_BOOL_INPUT_CONSTRAINT_DATA>( clearanceData );
922 wxLogWarning(
"No factory found for constraint type: %d", nodeType );
923 newRuleNode.
m_nodeData = std::make_shared<DRC_RE_BASE_CONSTRAINT_DATA>( clearanceData );
926 std::static_pointer_cast<DRC_RE_BASE_CONSTRAINT_DATA>( newRuleNode.
m_nodeData )
941 return node.m_nodeId == aNodeId;
996 wxLogTrace( wxS(
"KI_TRACE_DRC_RULE_EDITOR" ),
997 wxS(
"[ShowMatches] nodeId=%d, condition='%s'" ), aNodeId, condition );
1000 if( condition.IsEmpty() )
1010 if( !testCondition.
Compile(
nullptr ) )
1012 wxLogTrace( wxS(
"KI_TRACE_DRC_RULE_EDITOR" ), wxS(
"[ShowMatches] compile failed" ) );
1018 std::vector<BOARD_ITEM*> allMatches =
1022 std::vector<BOARD_ITEM*> matches;
1026 switch( item->Type() )
1034 matches.push_back( item );
1039 int matchCount =
static_cast<int>( matches.size() );
1041 wxLogTrace( wxS(
"KI_TRACE_DRC_RULE_EDITOR" ), wxS(
"[ShowMatches] matched_count=%d (filtered from %zu)" ),
1042 matchCount, allMatches.size() );
1047 if( matches.size() > 0 )
1049 std::vector<EDA_ITEM*> selectItems;
1052 selectItems.push_back( item );
1059 m_frame->FocusOnItems( matches );
1071 return node.m_nodeName == aRuleName && node.m_nodeId != aNodeId
1072 && node.m_nodeType == RULE;
1091 return node.m_nodeId == aNodeId;
1104 std::vector<RULE_TREE_NODE> children;
1107 for(
const auto& child : children )
1112 aResult.push_back( childNode );
1123 if( node.m_nodeType !=
RULE )
1126 if( node.m_nodeData && node.m_nodeData->IsNew() )
1128 aResult.push_back( &node );
1132 auto constraintData = std::dynamic_pointer_cast<DRC_RE_BASE_CONSTRAINT_DATA>( node.m_nodeData );
1134 if( constraintData && constraintData->WasEdited() )
1135 aResult.push_back( &node );
1142 bool allValid =
true;
1145 std::map<wxString, std::set<wxString>> ruleConditions;
1149 if( node.m_nodeType !=
RULE )
1152 auto constraintData = std::dynamic_pointer_cast<DRC_RE_BASE_CONSTRAINT_DATA>( node.m_nodeData );
1154 if( constraintData )
1163 for(
const wxString& err :
result.errors )
1165 if( !errorMsg.IsEmpty() )
1166 errorMsg += wxS(
"\n" );
1171 aErrors[node.m_nodeName] = errorMsg;
1176 wxString ruleName = constraintData->GetRuleName();
1177 wxString condition = constraintData->GetRuleCondition();
1178 ruleConditions[ruleName].insert( condition );
1183 for(
const auto& [ruleName, conditions] : ruleConditions )
1185 if( conditions.size() > 1 )
1187 wxString errorMsg =
_(
"Multiple rules with the same name have different conditions. "
1188 "Rules with the same name must have identical conditions to be merged." );
1189 aErrors[ruleName] = errorMsg;
1200 std::vector<RULE_TREE_NODE*> modifiedRules;
1203 if( modifiedRules.empty() )
1206 wxString message =
_(
"The following rules have unsaved changes:\n\n" );
1209 message += wxString::Format( wxS(
" \u2022 %s\n" ), rule->m_nodeName );
1211 message +=
_(
"\nDo you want to save your changes?" );
1213 int result = wxMessageBox( message,
_(
"Save Changes?" ),
1214 wxYES_NO | wxCANCEL | wxICON_QUESTION,
this );
1218 else if(
result == wxNO )
1228 wxTreeItemIdValue cookie;
1231 std::function<wxTreeItemId( wxTreeItemId )> findItem = [&]( wxTreeItemId parent ) -> wxTreeItemId
1233 wxTreeItemId item =
m_ruleTreeCtrl->GetFirstChild( parent, cookie );
1235 while( item.IsOk() )
1240 if( data && data->
GetNodeId() == aNodeId )
1243 wxTreeItemId found = findItem( item );
1251 return wxTreeItemId();
1254 wxTreeItemId itemId = findItem( root );
1263 const std::optional<DRC_RULE_EDITOR_CONSTRAINT_NAME>& aConstraintType,
1264 const std::vector<RULE_TREE_NODE>& aChildNodes,
const std::optional<int>&
id )
1283 baseData.
SetId( newId );
1291 .m_nodeName = aName,
1292 .m_nodeType = aNodeType,
1294 .m_nodeTypeMap = aConstraintType,
1295 .m_childNodes = aChildNodes,
1296 .m_nodeData = std::make_shared<RULE_EDITOR_DATA_BASE>( baseData ) };
1301 const std::optional<int>& aParentId )
1307 auto baseData = std::dynamic_pointer_cast<DRC_RE_BASE_CONSTRAINT_DATA>( node.
m_nodeData );
1334 std::vector<DRC_RE_LOADED_PANEL_ENTRY> entries;
1338 if( node.m_nodeType !=
RULE )
1341 auto data = std::dynamic_pointer_cast<DRC_RE_BASE_CONSTRAINT_DATA>( node.m_nodeData );
1348 if( node.m_nodeTypeMap )
1354 entry.
ruleName = data->GetRuleName();
1355 entry.
condition = data->GetRuleCondition();
1358 entry.
severity = data->GetSeverity();
1362 entries.push_back( entry );
1370 m_frame->GetBoard()->GetDesignSettings().m_DRCEngine->InitEngine(
1371 m_frame->GetDesignRulesPath() );
1375 wxLogError(
_(
"Failed to reload DRC rules: %s" ), pe.
What() );
static TOOL_ACTION zoomFitSelection
static TOOL_ACTION selectionClear
Clear the current selection.
static TOOL_ACTION selectItems
Select a list of items (specified as the event parameter)
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
std::vector< RULE_TREE_NODE > m_ruleTreeNodeDatas
PANEL_DRC_GROUP_HEADER * m_groupHeaderPanel
bool validateAllRules(std::map< wxString, wxString > &aErrors)
Validates all rules and returns any that have validation errors.
~DIALOG_DRC_RULE_EDITOR()
std::vector< RULE_TREE_NODE > buildElectricalRuleTreeNodes(int &aParentId)
std::vector< RULE_TREE_NODE > buildHighspeedDesignRuleTreeNodes(int &aParentId)
void UpdateRuleTypeTreeItemData(RULE_TREE_ITEM_DATA *aCurrentRuleTreeItemData) override
Updates the rule tree item data by transferring data from the rule editor panel and updating the item...
void collectChildRuleNodes(int aParentId, std::vector< RULE_TREE_NODE * > &aResult)
Collects all child rule nodes for a given parent node ID.
int highlightMatchingItems(int aNodeId)
Highlights board items matching the current rule condition.
RULE_TREE_NODE buildRuleTreeNodeData(const wxString &aName, const DRC_RULE_EDITOR_ITEM_TYPE &aNodeType, const std::optional< int > &aParentId=std::nullopt, const std::optional< DRC_RULE_EDITOR_CONSTRAINT_NAME > &aConstraintType=std::nullopt, const std::vector< RULE_TREE_NODE > &aChildNodes={}, const std::optional< int > &aId=std::nullopt)
Creates a new rule tree node with the specified parameters, generating a new ID if not provided.
RULE_TREE_NODE buildRuleTreeNode(RULE_TREE_ITEM_DATA *aRuleTreeItemData, const wxString &aBaseName=wxEmptyString)
Creates a new rule tree node with a unique name and assigns the appropriate constraint data.
RC_TREE_MODEL * m_markersTreeModel
void saveRule(int aNodeId)
Saves the rule after validating the rule editor panel.
void AddNewRule(RULE_TREE_ITEM_DATA *aRuleTreeItemData) override
Adds a new rule to the rule tree, either as a child or under the parent, based on the node type (CONS...
void RuleTreeItemSelectionChanged(RULE_TREE_ITEM_DATA *aCurrentRuleTreeItemData) override
Handles rule tree item selection changes, updating the content panel with appropriate editor or heade...
int promptUnsavedChanges()
Shows a prompt for unsaved changes when closing with modifications.
RULE_TREE_NODE buildRuleNodeFromKicadDrc(const wxString &aName, const wxString &aCode, const std::optional< int > &aParentId=std::nullopt)
Build a rule tree node from a constraint keyword loaded from a .kicad_drc file.
std::vector< RULE_TREE_NODE > GetDefaultRuleTreeItems() override
Pure virtual method to get the default rule tree items.
bool TransferDataFromWindow() override
std::shared_ptr< RC_ITEMS_PROVIDER > m_markersProvider
std::vector< RULE_TREE_NODE > buildManufacturabilityRuleTreeNodes(int &aParentId)
wxDataViewCtrl * m_markerDataView
void RemoveRule(int aNodeId) override
Removes a rule from the rule tree after confirmation, deleting the item and associated data.
void OnCancel(wxCommandEvent &aEvent) override
bool TransferDataToWindow() override
std::vector< RULE_TREE_NODE > buildFootprintsRuleTreeNodes(int &aParentId)
RULE_TREE_NODE * getRuleTreeNodeInfo(const int &aNodeId)
Retrieves the rule tree node for a given ID.
void selectRuleNode(int aNodeId)
Selects a rule node in the tree by its ID.
PANEL_DRC_RULE_EDITOR * m_ruleEditorPanel
void collectModifiedRules(std::vector< RULE_TREE_NODE * > &aResult)
Collects all rule nodes that have unsaved changes (new or edited).
bool deleteTreeNodeData(const int &aNodeId)
Deletes a rule tree node by its ID.
bool isEnabled(RULE_TREE_ITEM_DATA *aRuleTreeItemData, RULE_EDITOR_TREE_CONTEXT_OPT aOption) override
Verifies if a context menu option should be enabled based on the rule tree item type.
void closeRuleEntryView(int aNodeId)
Closes the rule entry view and re-enables controls.
void OnSave(wxCommandEvent &aEvent) override
void DuplicateRule(RULE_TREE_ITEM_DATA *aRuleTreeItemData) override
Duplicates a rule from the source tree node and appends it as a new item under the same parent.
bool validateRuleName(int aNodeId, wxString aRuleName)
Validates if the rule name is unique for the given node ID.
bool Compile(REPORTER *aReporter, int aSourceLine=0, int aSourceOffset=0)
static bool IsNumericInputType(const DRC_RULE_EDITOR_CONSTRAINT_NAME &aConstraintType)
static wxString ConstraintToKicadDrc(DRC_RULE_EDITOR_CONSTRAINT_NAME aType)
Convert a constraint type into the keyword used in a .kicad_drc file.
static bool ConstraintFromKicadDrc(const wxString &aCode, DRC_RE_BASE_CONSTRAINT_DATA *aData)
Populate a constraint data object using a keyword from a .kicad_drc file.
static std::optional< DRC_RULE_EDITOR_CONSTRAINT_NAME > GetConstraintTypeFromCode(const wxString &aCode)
Resolve a constraint keyword from a rules file into the corresponding rule tree enumeration value.
static std::shared_ptr< DRC_RE_NUMERIC_INPUT_CONSTRAINT_DATA > CreateNumericConstraintData(DRC_RULE_EDITOR_CONSTRAINT_NAME aType)
static bool IsBoolInputType(const DRC_RULE_EDITOR_CONSTRAINT_NAME &aConstraintType)
Loads DRC rules from .kicad_dru files and converts them to panel entries.
std::vector< DRC_RE_LOADED_PANEL_ENTRY > LoadFile(const wxString &aPath)
Load all rules from a .kicad_dru file.
Saves DRC panel entries back to .kicad_dru files.
bool SaveFile(const wxString &aPath, const std::vector< DRC_RE_LOADED_PANEL_ENTRY > &aEntries, const BOARD *aBoard=nullptr)
Save all panel entries to a file.
virtual const wxString What() const
A composite of Problem() and Where()
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
LSET is a set of PCB_LAYER_IDs.
The main frame for Pcbnew.
virtual void AdvancePhase() override
Use the next available virtual zone of the dialog progress bar.
PROGRESS_REPORTER_BASE(int aNumPhases)
virtual void SetCurrentProgress(double aProgress) override
Set the progress value to aProgress (0..1).
std::atomic_bool m_cancelled
virtual void AdvancePhase()=0
Use the next available virtual zone of the dialog progress bar.
Concrete class representing the base data structure for a rule editor.
bool IsNew()
Check if the rule is marked as new.
int GetId()
Get the unique ID of the rule.
void SetIsNew(bool aIsNew)
Mark the rule as new or not.
void SetId(int aId)
Set the unique ID of the rule.
void SetParentId(int aParentId)
Set the parent ID of the rule.
void CopyFrom(const ICopyable &aSource) override
Implementation of the polymorphic CopyFrom method.
wxString GetRuleName()
Get the name of the rule.
void DeleteRuleTreeItem(wxTreeItemId aItemId, const int &aNodeId)
Deletes a tree item and removes its corresponding node from history.
void UpdateRuleTreeItemText(wxTreeItemId aItemId, wxString aItemText)
Updates the text of a specified rule tree item.
void SetModified()
Marks the dialog as modified, indicating unsaved changes.
void AppendNewRuleTreeItem(const RULE_TREE_NODE &aRuleTreeNode, wxTreeItemId aParentTreeItemId)
Adds a new rule tree item under the specified parent and updates the tree history.
void InitRuleTreeItems(const std::vector< RULE_TREE_NODE > &aRuleTreeNodes)
Initializes the rule tree by adding nodes, setting up the structure, and saving its state.
void SetContentPanel(wxPanel *aContentPanel)
Replaces the current content panel with a new one based on the selected constraint type.
wxTreeCtrl * m_ruleTreeCtrl
wxScrolledWindow * m_scrolledContentWin
void ClearModified()
Clears the modified flag, typically after saving.
bool TransferDataToWindow() override
RULE_EDITOR_DIALOG_BASE(wxWindow *aParent, const wxString &aTitle, const wxSize &aInitialSize=wxDefaultSize)
friend class DIALOG_DRC_RULE_EDITOR
bool IsModified() const
Returns whether the dialog has unsaved changes.
bool TransferDataFromWindow() override
void getRuleTreeChildNodes(const std::vector< RULE_TREE_NODE > &aNodes, int aParentId, std::vector< RULE_TREE_NODE > &aResult)
Retrieves child nodes of a given parent node.
RULE_TREE_ITEM_DATA * GetCurrentlySelectedRuleTreeItemData()
Retrieves the currently selected rule tree item data.
void SetControlsEnabled(bool aEnable)
Enables or disables controls within the rule editor dialog.
A class representing additional data associated with a wxTree item.
wxTreeItemId GetTreeItemId() const
wxTreeItemId GetParentTreeItemId() const
int OKOrCancelDialog(wxWindow *aParent, const wxString &aWarning, const wxString &aMessage, const wxString &aDetailedMessage, const wxString &aOKLabel, const wxString &aCancelLabel, bool *aApplyToAll)
Display a warning dialog with aMessage and returns the user response.
void DisplayErrorMessage(wxWindow *aParent, const wxString &aText, const wxString &aExtraInfo)
Display an error message with aMessage.
This file is part of the common library.
bool nodeExists(const RULE_TREE_NODE &aRuleTreeNode, const wxString &aTargetName)
Checks if a node with the given name exists in the rule tree or its child nodes.
const RULE_TREE_NODE * FindNodeById(const std::vector< RULE_TREE_NODE > &aNodes, int aTargetId)
#define DIALOG_DRC_RULE_EDITOR_WINDOW_NAME
SIM_MODEL::PARAM::CATEGORY CATEGORY
DRC_RULE_EDITOR_CONSTRAINT_NAME
@ MINIMUM_SOLDERMASK_SILVER
@ SILK_TO_SOLDERMASK_CLEARANCE
@ MINIMUM_CONNECTION_WIDTH
@ MINIMUM_THERMAL_RELIEF_SPOKE_COUNT
@ MINIMUM_TEXT_HEIGHT_AND_THICKNESS
@ COPPER_TO_HOLE_CLEARANCE
@ MAXIMUM_ALLOWED_DEVIATION
@ MATCHED_LENGTH_DIFF_PAIR
@ COPPER_TO_EDGE_CLEARANCE
DRC_RULE_EDITOR_ITEM_TYPE
RULE_EDITOR_TREE_CONTEXT_OPT
Enumeration representing the available context menu options for the rule editor tree.
Represents a rule loaded from a .kicad_dru file and mapped to a panel.
wxString originalRuleText
wxString layerSource
Original layer text: "inner", "outer", or layer name.
std::shared_ptr< DRC_RE_BASE_CONSTRAINT_DATA > constraintData
DRC_RULE_EDITOR_CONSTRAINT_NAME panelType
A filename or source description, a problem input line, a line number, a byte offset,...
Structure representing a node in a rule tree, collection of this used for building the rule tree.
std::shared_ptr< RULE_EDITOR_DATA_BASE > m_nodeData
std::optional< int > m_nodeTypeMap
std::vector< RULE_TREE_NODE > m_childNodes
Result of a validation operation.
wxString result
Test unit parsing edge cases and error handling.
@ PCB_GENERATOR_T
class PCB_GENERATOR, generator on a layer
@ PCB_GROUP_T
class PCB_GROUP, a set of BOARD_ITEMs
@ PCB_NETINFO_T
class NETINFO_ITEM, a description of a net