Make ERC off-grid check user-configurable.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14110
This commit is contained in:
parent
372c5d7963
commit
95032bd487
|
@ -37,7 +37,8 @@ PANEL_SETUP_FORMATTING::PANEL_SETUP_FORMATTING( wxWindow* aWindow, SCH_EDIT_FRAM
|
|||
m_frame( aFrame ),
|
||||
m_textSize( aFrame, m_textSizeLabel, m_textSizeCtrl, m_textSizeUnits ),
|
||||
m_lineWidth( aFrame, m_lineWidthLabel, m_lineWidthCtrl, m_lineWidthUnits ),
|
||||
m_pinSymbolSize( aFrame, m_pinSymbolSizeLabel, m_pinSymbolSizeCtrl, m_pinSymbolSizeUnits )
|
||||
m_pinSymbolSize( aFrame, m_pinSymbolSizeLabel, m_pinSymbolSizeCtrl, m_pinSymbolSizeUnits ),
|
||||
m_connectionGridSize( aFrame, m_connectionGridLabel, m_connectionGridCtrl, m_connectionGridUnits )
|
||||
{
|
||||
wxSize minSize = m_dashLengthCtrl->GetMinSize();
|
||||
int minWidth = m_dashLengthCtrl->GetTextExtent( wxT( "XXX.XXX" ) ).GetWidth();
|
||||
|
@ -84,11 +85,13 @@ bool PANEL_SETUP_FORMATTING::TransferDataToWindow()
|
|||
m_textSize.SetUnits( EDA_UNITS::MILS );
|
||||
m_lineWidth.SetUnits( EDA_UNITS::MILS );
|
||||
m_pinSymbolSize.SetUnits( EDA_UNITS::MILS );
|
||||
m_connectionGridSize.SetUnits( EDA_UNITS::MILS );
|
||||
|
||||
m_textSize.SetValue( settings.m_DefaultTextSize );
|
||||
m_lineWidth.SetValue( settings.m_DefaultLineWidth );
|
||||
m_pinSymbolSize.SetValue( settings.m_PinSymbolSize );
|
||||
m_choiceJunctionDotSize->SetSelection( settings.m_JunctionSizeChoice );
|
||||
m_connectionGridSize.SetValue( settings.m_ConnectionGridSize );
|
||||
|
||||
m_showIntersheetsReferences->SetValue( settings.m_IntersheetRefsShow );
|
||||
|
||||
|
@ -128,6 +131,9 @@ bool PANEL_SETUP_FORMATTING::TransferDataToWindow()
|
|||
|
||||
bool PANEL_SETUP_FORMATTING::TransferDataFromWindow()
|
||||
{
|
||||
if( !m_connectionGridSize.Validate( MIN_CONNECTION_GRID_MILS, 10000, EDA_UNITS::MILS ) )
|
||||
return false;
|
||||
|
||||
SCHEMATIC_SETTINGS& settings = m_frame->Schematic().Settings();
|
||||
|
||||
// Reference style one of: "A" ".A" "-A" "_A" ".1" "-1" "_1"
|
||||
|
@ -151,9 +157,10 @@ bool PANEL_SETUP_FORMATTING::TransferDataFromWindow()
|
|||
LIB_SYMBOL::SetSubpartIdNotation( refSeparator, firstRefId );
|
||||
}
|
||||
|
||||
settings.m_DefaultTextSize = (int) m_textSize.GetValue();
|
||||
settings.m_DefaultLineWidth = (int) m_lineWidth.GetValue();
|
||||
settings.m_PinSymbolSize = (int) m_pinSymbolSize.GetValue();
|
||||
settings.m_DefaultTextSize = m_textSize.GetIntValue();
|
||||
settings.m_DefaultLineWidth = m_lineWidth.GetIntValue();
|
||||
settings.m_PinSymbolSize = m_pinSymbolSize.GetIntValue();
|
||||
settings.m_ConnectionGridSize = m_connectionGridSize.GetIntValue();
|
||||
|
||||
if( m_choiceJunctionDotSize->GetSelection() != wxNOT_FOUND )
|
||||
settings.m_JunctionSizeChoice = m_choiceJunctionDotSize->GetSelection();
|
||||
|
@ -197,6 +204,7 @@ void PANEL_SETUP_FORMATTING::ImportSettingsFrom( SCHEMATIC_SETTINGS& aSettings )
|
|||
m_textSize.SetValue( aSettings.m_DefaultTextSize );
|
||||
m_lineWidth.SetValue( aSettings.m_DefaultLineWidth );
|
||||
m_pinSymbolSize.SetValue( aSettings.m_PinSymbolSize );
|
||||
m_connectionGridSize.SetValue( aSettings.m_ConnectionGridSize );
|
||||
|
||||
m_showIntersheetsReferences->SetValue( aSettings.m_IntersheetRefsShow );
|
||||
m_radioFormatStandard->SetValue( aSettings.m_IntersheetRefsFormatShort );
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2020-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2020-2023 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
|
@ -48,6 +48,7 @@ private:
|
|||
UNIT_BINDER m_lineWidth;
|
||||
|
||||
UNIT_BINDER m_pinSymbolSize;
|
||||
UNIT_BINDER m_connectionGridSize;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -150,21 +150,36 @@ PANEL_SETUP_FORMATTING_BASE::PANEL_SETUP_FORMATTING_BASE( wxWindow* parent, wxWi
|
|||
wxStaticBoxSizer* sbSizer2;
|
||||
sbSizer2 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Connections") ), wxVERTICAL );
|
||||
|
||||
wxBoxSizer* bSizer61;
|
||||
bSizer61 = new wxBoxSizer( wxHORIZONTAL );
|
||||
wxGridBagSizer* gbSizer1;
|
||||
gbSizer1 = new wxGridBagSizer( 5, 5 );
|
||||
gbSizer1->SetFlexibleDirection( wxBOTH );
|
||||
gbSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
|
||||
|
||||
m_staticText261 = new wxStaticText( sbSizer2->GetStaticBox(), wxID_ANY, _("Junction dot size:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticText261->Wrap( -1 );
|
||||
bSizer61->Add( m_staticText261, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 );
|
||||
gbSizer1->Add( m_staticText261, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 );
|
||||
|
||||
wxString m_choiceJunctionDotSizeChoices[] = { _("None"), _("Smallest"), _("Small"), _("Default"), _("Large"), _("Largest") };
|
||||
int m_choiceJunctionDotSizeNChoices = sizeof( m_choiceJunctionDotSizeChoices ) / sizeof( wxString );
|
||||
m_choiceJunctionDotSize = new wxChoice( sbSizer2->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceJunctionDotSizeNChoices, m_choiceJunctionDotSizeChoices, 0 );
|
||||
m_choiceJunctionDotSize->SetSelection( 3 );
|
||||
bSizer61->Add( m_choiceJunctionDotSize, 1, wxRIGHT|wxALIGN_CENTER_VERTICAL, 5 );
|
||||
gbSizer1->Add( m_choiceJunctionDotSize, wxGBPosition( 0, 1 ), wxGBSpan( 1, 2 ), wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
|
||||
|
||||
m_connectionGridLabel = new wxStaticText( sbSizer2->GetStaticBox(), wxID_ANY, _("Connection grid:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_connectionGridLabel->Wrap( -1 );
|
||||
gbSizer1->Add( m_connectionGridLabel, wxGBPosition( 1, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 );
|
||||
|
||||
m_connectionGridCtrl = new wxTextCtrl( sbSizer2->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
gbSizer1->Add( m_connectionGridCtrl, wxGBPosition( 1, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
|
||||
|
||||
m_connectionGridUnits = new wxStaticText( sbSizer2->GetStaticBox(), wxID_ANY, _("mils"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_connectionGridUnits->Wrap( -1 );
|
||||
gbSizer1->Add( m_connectionGridUnits, wxGBPosition( 1, 2 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 );
|
||||
|
||||
|
||||
sbSizer2->Add( bSizer61, 0, wxEXPAND|wxBOTTOM|wxRIGHT, 5 );
|
||||
gbSizer1->AddGrowableCol( 1 );
|
||||
|
||||
sbSizer2->Add( gbSizer1, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
|
||||
bLeftColumn->Add( sbSizer2, 1, wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT, 5 );
|
||||
|
|
|
@ -1410,17 +1410,26 @@
|
|||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND|wxBOTTOM|wxRIGHT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxBoxSizer" expanded="1">
|
||||
<property name="flag">wxEXPAND|wxRIGHT|wxLEFT</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxGridBagSizer" expanded="1">
|
||||
<property name="empty_cell_size"></property>
|
||||
<property name="flexible_direction">wxBOTH</property>
|
||||
<property name="growablecols">1</property>
|
||||
<property name="growablerows"></property>
|
||||
<property name="hgap">5</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">bSizer61</property>
|
||||
<property name="orient">wxHORIZONTAL</property>
|
||||
<property name="name">gbSizer1</property>
|
||||
<property name="non_flexible_grow_mode">wxFLEX_GROWMODE_SPECIFIED</property>
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="vgap">5</property>
|
||||
<object class="gbsizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL</property>
|
||||
<property name="proportion">0</property>
|
||||
<property name="colspan">1</property>
|
||||
<property name="column">0</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL</property>
|
||||
<property name="row">0</property>
|
||||
<property name="rowspan">1</property>
|
||||
<object class="wxStaticText" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
|
@ -1478,10 +1487,13 @@
|
|||
<property name="wrap">-1</property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<object class="gbsizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxRIGHT|wxALIGN_CENTER_VERTICAL</property>
|
||||
<property name="proportion">1</property>
|
||||
<property name="colspan">2</property>
|
||||
<property name="column">1</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxEXPAND</property>
|
||||
<property name="row">0</property>
|
||||
<property name="rowspan">1</property>
|
||||
<object class="wxChoice" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
|
@ -1542,6 +1554,201 @@
|
|||
<property name="window_style"></property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="gbsizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="colspan">1</property>
|
||||
<property name="column">0</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL</property>
|
||||
<property name="row">1</property>
|
||||
<property name="rowspan">1</property>
|
||||
<object class="wxStaticText" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Connection grid:</property>
|
||||
<property name="markup">0</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_connectionGridLabel</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass">; ; forward_declare</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<property name="wrap">-1</property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="gbsizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="colspan">1</property>
|
||||
<property name="column">1</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxEXPAND</property>
|
||||
<property name="row">1</property>
|
||||
<property name="rowspan">1</property>
|
||||
<object class="wxTextCtrl" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="maxlength"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_connectionGridCtrl</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass">; ; forward_declare</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="value"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="gbsizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="colspan">1</property>
|
||||
<property name="column">2</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL</property>
|
||||
<property name="row">1</property>
|
||||
<property name="rowspan">1</property>
|
||||
<object class="wxStaticText" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">mils</property>
|
||||
<property name="markup">0</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_connectionGridUnits</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass">; ; forward_declare</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<property name="wrap">-1</property>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
#include <wx/sizer.h>
|
||||
#include <wx/statbox.h>
|
||||
#include <wx/textctrl.h>
|
||||
#include <wx/gbsizer.h>
|
||||
#include <wx/checkbox.h>
|
||||
#include <wx/radiobut.h>
|
||||
#include <wx/spinctrl.h>
|
||||
|
@ -62,6 +63,9 @@ class PANEL_SETUP_FORMATTING_BASE : public wxPanel
|
|||
wxStaticText* m_pinSymbolSizeUnits;
|
||||
wxStaticText* m_staticText261;
|
||||
wxChoice* m_choiceJunctionDotSize;
|
||||
wxStaticText* m_connectionGridLabel;
|
||||
wxTextCtrl* m_connectionGridCtrl;
|
||||
wxStaticText* m_connectionGridUnits;
|
||||
wxCheckBox* m_showIntersheetsReferences;
|
||||
wxCheckBox* m_listOwnPage;
|
||||
wxRadioButton* m_radioFormatStandard;
|
||||
|
|
|
@ -978,15 +978,9 @@ int ERC_TESTER::TestLibSymbolIssues()
|
|||
}
|
||||
|
||||
|
||||
int ERC_TESTER::TestOffGridEndpoints( int aGridSize )
|
||||
int ERC_TESTER::TestOffGridEndpoints()
|
||||
{
|
||||
// The minimal grid size allowed to place a pin is 25 mils
|
||||
// the best grid size is 50 mils, but 25 mils is still usable
|
||||
// this is because all symbols are using a 50 mils grid to place pins, and therefore
|
||||
// the wires must be on the 50 mils grid
|
||||
// So raise an error if a pin is not on a 25 mil (or bigger: 50 mil or 100 mil) grid
|
||||
const int min_grid_size = schIUScale.MilsToIU( 25 );
|
||||
const int clamped_grid_size = ( aGridSize < min_grid_size ) ? min_grid_size : aGridSize;
|
||||
const int gridSize = m_schematic->Settings().m_ConnectionGridSize;
|
||||
|
||||
SCH_SCREENS screens( m_schematic->Root() );
|
||||
int err_count = 0;
|
||||
|
@ -1001,16 +995,16 @@ int ERC_TESTER::TestOffGridEndpoints( int aGridSize )
|
|||
{
|
||||
SCH_LINE* line = static_cast<SCH_LINE*>( item );
|
||||
|
||||
if( ( line->GetStartPoint().x % clamped_grid_size ) != 0
|
||||
|| ( line->GetStartPoint().y % clamped_grid_size) != 0 )
|
||||
if( ( line->GetStartPoint().x % gridSize ) != 0
|
||||
|| ( line->GetStartPoint().y % gridSize ) != 0 )
|
||||
{
|
||||
std::shared_ptr<ERC_ITEM> ercItem = ERC_ITEM::Create( ERCE_ENDPOINT_OFF_GRID );
|
||||
ercItem->SetItems( line );
|
||||
|
||||
markers.emplace_back( new SCH_MARKER( ercItem, line->GetStartPoint() ) );
|
||||
}
|
||||
else if( ( line->GetEndPoint().x % clamped_grid_size ) != 0
|
||||
|| ( line->GetEndPoint().y % clamped_grid_size) != 0 )
|
||||
else if( ( line->GetEndPoint().x % gridSize ) != 0
|
||||
|| ( line->GetEndPoint().y % gridSize ) != 0 )
|
||||
{
|
||||
std::shared_ptr<ERC_ITEM> ercItem = ERC_ITEM::Create( ERCE_ENDPOINT_OFF_GRID );
|
||||
ercItem->SetItems( line );
|
||||
|
@ -1026,11 +1020,9 @@ int ERC_TESTER::TestOffGridEndpoints( int aGridSize )
|
|||
{
|
||||
VECTOR2I pinPos = pin->GetTransformedPosition();
|
||||
|
||||
if( ( pinPos.x % clamped_grid_size ) != 0
|
||||
|| ( pinPos.y % clamped_grid_size) != 0 )
|
||||
if( ( pinPos.x % gridSize ) != 0 || ( pinPos.y % gridSize ) != 0 )
|
||||
{
|
||||
std::shared_ptr<ERC_ITEM> ercItem =
|
||||
ERC_ITEM::Create( ERCE_ENDPOINT_OFF_GRID );
|
||||
auto ercItem = ERC_ITEM::Create( ERCE_ENDPOINT_OFF_GRID );
|
||||
ercItem->SetItems( pin );
|
||||
|
||||
markers.emplace_back( new SCH_MARKER( ercItem, pinPos ) );
|
||||
|
@ -1221,8 +1213,7 @@ void ERC_TESTER::RunTests( DS_PROXY_VIEW_ITEM* aDrawingSheet, SCH_EDIT_FRAME* aE
|
|||
if( aProgressReporter )
|
||||
aProgressReporter->AdvancePhase( _( "Checking for off grid pins and wires..." ) );
|
||||
|
||||
if( aEditFrame )
|
||||
TestOffGridEndpoints( aEditFrame->GetCanvas()->GetView()->GetGAL()->GetGridSize().x );
|
||||
TestOffGridEndpoints();
|
||||
}
|
||||
|
||||
m_schematic->ResolveERCExclusionsPostUpdate();
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* Copyright (C) 2009 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@gmail.com>
|
||||
* Copyright (C) 2009-2020 KiCad Developers, see change_log.txt for contributors.
|
||||
* Copyright (C) 2009-2023 KiCad Developers, see change_log.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
|
@ -23,10 +23,6 @@
|
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file erc.h
|
||||
*/
|
||||
|
||||
#ifndef _ERC_H
|
||||
#define _ERC_H
|
||||
|
||||
|
@ -134,7 +130,7 @@ public:
|
|||
* Test pins and wire ends for being off grid.
|
||||
* @return the error count
|
||||
*/
|
||||
int TestOffGridEndpoints( int aGridSize );
|
||||
int TestOffGridEndpoints();
|
||||
|
||||
/**
|
||||
* Test SPICE models for various issues.
|
||||
|
|
|
@ -45,6 +45,7 @@ SCHEMATIC_SETTINGS::SCHEMATIC_SETTINGS( JSON_SETTINGS* aParent, const std::strin
|
|||
m_PinSymbolSize( DEFAULT_TEXT_SIZE * schIUScale.IU_PER_MILS / 2 ),
|
||||
m_JunctionSizeChoice( 3 ),
|
||||
m_JunctionSize( DEFAULT_JUNCTION_DIAM * schIUScale.IU_PER_MILS ),
|
||||
m_ConnectionGridSize( DEFAULT_CONNECTION_GRID_MILS * schIUScale.IU_PER_MILS ),
|
||||
m_AnnotateStartNum( 0 ),
|
||||
m_IntersheetRefsShow( false ),
|
||||
m_IntersheetRefsListOwnPage( true ),
|
||||
|
@ -119,12 +120,12 @@ SCHEMATIC_SETTINGS::SCHEMATIC_SETTINGS( JSON_SETTINGS* aParent, const std::strin
|
|||
&m_OPO_IRange, wxS( "~A" ) ) );
|
||||
|
||||
m_params.emplace_back( new PARAM_SCALED<int>( "drawing.default_line_thickness",
|
||||
&m_DefaultLineWidth, schIUScale.MilsToIU( defaultLineThickness ), schIUScale.MilsToIU( 5 ), schIUScale.MilsToIU( 1000 ),
|
||||
1 / schIUScale.IU_PER_MILS ) );
|
||||
&m_DefaultLineWidth, schIUScale.MilsToIU( defaultLineThickness ),
|
||||
schIUScale.MilsToIU( 5 ), schIUScale.MilsToIU( 1000 ), 1 / schIUScale.IU_PER_MILS ) );
|
||||
|
||||
m_params.emplace_back( new PARAM_SCALED<int>( "drawing.default_text_size",
|
||||
&m_DefaultTextSize, schIUScale.MilsToIU( defaultTextSize ), schIUScale.MilsToIU( 5 ), schIUScale.MilsToIU( 1000 ),
|
||||
1 / schIUScale.IU_PER_MILS ) );
|
||||
&m_DefaultTextSize, schIUScale.MilsToIU( defaultTextSize ),
|
||||
schIUScale.MilsToIU( 5 ), schIUScale.MilsToIU( 1000 ), 1 / schIUScale.IU_PER_MILS ) );
|
||||
|
||||
m_params.emplace_back( new PARAM<double>( "drawing.text_offset_ratio",
|
||||
&m_TextOffsetRatio, DEFAULT_TEXT_OFFSET_RATIO, 0.0, 2.0 ) );
|
||||
|
@ -136,15 +137,19 @@ SCHEMATIC_SETTINGS::SCHEMATIC_SETTINGS( JSON_SETTINGS* aParent, const std::strin
|
|||
&m_FontMetrics.m_OverbarHeight, m_FontMetrics.m_OverbarHeight ) );
|
||||
|
||||
m_params.emplace_back( new PARAM_SCALED<int>( "drawing.pin_symbol_size",
|
||||
&m_PinSymbolSize, schIUScale.MilsToIU( defaultPinSymbolSize ), schIUScale.MilsToIU( 0 ), schIUScale.MilsToIU( 1000 ),
|
||||
&m_PinSymbolSize, schIUScale.MilsToIU( defaultPinSymbolSize ),
|
||||
schIUScale.MilsToIU( 0 ), schIUScale.MilsToIU( 1000 ), 1 / schIUScale.IU_PER_MILS ) );
|
||||
|
||||
m_params.emplace_back( new PARAM_SCALED<int>( "connection_grid_size",
|
||||
&m_ConnectionGridSize, schIUScale.MilsToIU( DEFAULT_CONNECTION_GRID_MILS ),
|
||||
schIUScale.MilsToIU( MIN_CONNECTION_GRID_MILS ), schIUScale.MilsToIU( 10000 ),
|
||||
1 / schIUScale.IU_PER_MILS ) );
|
||||
|
||||
// m_JunctionSize is only a run-time cache of the calculated size. Do not save it.
|
||||
|
||||
// User choice for junction dot size ( e.g. none = 0, smallest = 1, small = 2, etc )
|
||||
m_params.emplace_back( new PARAM<int>( "drawing.junction_size_choice",
|
||||
&m_JunctionSizeChoice,
|
||||
defaultJunctionSizeChoice ) );
|
||||
&m_JunctionSizeChoice, defaultJunctionSizeChoice ) );
|
||||
|
||||
m_params.emplace_back( new PARAM_LAMBDA<nlohmann::json>( "drawing.field_names",
|
||||
[&]() -> nlohmann::json
|
||||
|
|
|
@ -28,6 +28,15 @@
|
|||
|
||||
class NGSPICE_SETTINGS;
|
||||
|
||||
|
||||
// The minimal grid size allowed to place a pin is 25 mils. Tthe best grid size is 50 mils,
|
||||
// but 25 mils is still usable.
|
||||
// This is because all symbols are using a 50 mils grid to place pins, and therefore the wires
|
||||
// must be on the 50 mils grid.
|
||||
#define MIN_CONNECTION_GRID_MILS 25
|
||||
#define DEFAULT_CONNECTION_GRID_MILS 50
|
||||
|
||||
|
||||
/**
|
||||
* These settings were stored in SCH_BASE_FRAME previously.
|
||||
* The backing store is currently the project file.
|
||||
|
@ -54,6 +63,8 @@ public:
|
|||
int m_JunctionSizeChoice; // none = 0, smallest = 1, small = 2, etc.
|
||||
int m_JunctionSize; // a runtime cache of the calculated size
|
||||
|
||||
int m_ConnectionGridSize; // usually 50mils (IU internally; mils in the JSON file)
|
||||
|
||||
int m_AnnotateStartNum; // Starting value for annotation
|
||||
|
||||
bool m_IntersheetRefsShow;
|
||||
|
|
Loading…
Reference in New Issue