mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-14 02:03:12 +02:00
Merge branch kicad:master into master
This commit is contained in:
commit
d4e6915cc7
@ -30,11 +30,15 @@
|
||||
#include <common.h>
|
||||
#include <math/util.h> // for KiROUND
|
||||
#include <potracelib.h>
|
||||
#include <vector>
|
||||
#include <wx/arrstr.h>
|
||||
#include <wx/clipbrd.h>
|
||||
#include <wx/dnd.h>
|
||||
#include <wx/rawbmp.h>
|
||||
#include <wx/msgdlg.h>
|
||||
#include <wx/dcclient.h>
|
||||
#include <wx/log.h>
|
||||
#include <wx/string.h>
|
||||
|
||||
#define DEFAULT_DPI 300 // the image DPI used in formats that do not define a DPI
|
||||
|
||||
@ -58,8 +62,11 @@ BITMAP2CMP_PANEL::BITMAP2CMP_PANEL( BITMAP2CMP_FRAME* aParent ) :
|
||||
|
||||
m_buttonExportFile->Enable( false );
|
||||
m_buttonExportClipboard->Enable( false );
|
||||
}
|
||||
|
||||
m_InitialPicturePanel->SetDropTarget( new DROP_FILE( this ) );
|
||||
m_GreyscalePicturePanel->SetDropTarget( new DROP_FILE( this ) );
|
||||
m_BNPicturePanel->SetDropTarget( new DROP_FILE( this ) );
|
||||
}
|
||||
|
||||
wxWindow* BITMAP2CMP_PANEL::GetCurrentPage()
|
||||
{
|
||||
@ -562,3 +569,33 @@ void BITMAP2CMP_PANEL::OnFormatChange( wxCommandEvent& event )
|
||||
m_layerLabel->Enable( m_rbFootprint->GetValue() );
|
||||
m_layerCtrl->Enable( m_rbFootprint->GetValue() );
|
||||
}
|
||||
|
||||
|
||||
DROP_FILE::DROP_FILE( BITMAP2CMP_PANEL* panel ) :
|
||||
m_panel( panel )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
bool DROP_FILE::OnDropFiles( wxCoord x, wxCoord y, const wxArrayString& filenames )
|
||||
{
|
||||
m_panel->SetFocus();
|
||||
|
||||
// If a file is already loaded
|
||||
if( m_panel->GetOutputSizeX().GetOriginalSizePixels() != 0 )
|
||||
{
|
||||
wxString cap = _( "Replace Loaded File?" );
|
||||
wxString msg = _( "There is already a file loaded. Do you want to replace it?" );
|
||||
wxMessageDialog acceptFileDlg( m_panel, msg, cap, wxYES_NO | wxICON_QUESTION | wxYES_DEFAULT );
|
||||
int replace = acceptFileDlg.ShowModal();
|
||||
|
||||
if( replace == wxID_NO )
|
||||
return false;
|
||||
}
|
||||
|
||||
std::vector<wxString> fNameVec;
|
||||
fNameVec.insert( fNameVec.begin(), filenames.begin(), filenames.end() );
|
||||
m_panel->OpenProjectFiles( fNameVec );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -25,7 +25,7 @@
|
||||
|
||||
#include <bitmap2cmp_panel_base.h>
|
||||
#include <eda_units.h>
|
||||
|
||||
#include <wx/dnd.h>
|
||||
|
||||
class BITMAP2CMP_FRAME;
|
||||
class BITMAP2CMP_SETTINGS;
|
||||
@ -134,4 +134,18 @@ private:
|
||||
bool m_negative;
|
||||
double m_aspectRatio;
|
||||
};
|
||||
|
||||
|
||||
class DROP_FILE : public wxFileDropTarget
|
||||
{
|
||||
public:
|
||||
DROP_FILE( BITMAP2CMP_PANEL* panel );
|
||||
DROP_FILE() = delete;
|
||||
|
||||
bool OnDropFiles( wxCoord x, wxCoord y, const wxArrayString& filenames ) override;
|
||||
|
||||
private:
|
||||
BITMAP2CMP_PANEL* m_panel;
|
||||
};
|
||||
|
||||
#endif// BITMAP2CMP_PANEL
|
||||
|
@ -865,6 +865,7 @@ set( PCB_COMMON_SRCS
|
||||
${CMAKE_SOURCE_DIR}/pcbnew/teardrop/teardrop_parameters.cpp
|
||||
${CMAKE_SOURCE_DIR}/pcbnew/teardrop/teardrop_utils.cpp
|
||||
${CMAKE_SOURCE_DIR}/pcbnew/zone_settings.cpp
|
||||
${CMAKE_SOURCE_DIR}/pcbnew/pcb_board_outline.cpp
|
||||
|
||||
# IO files
|
||||
${CMAKE_SOURCE_DIR}/pcbnew/pcb_io/pcb_io.cpp
|
||||
|
@ -33,7 +33,10 @@ JOB_EXPORT_PCB_PDF::JOB_EXPORT_PCB_PDF() :
|
||||
JOB_EXPORT_PCB_PLOT( JOB_EXPORT_PCB_PLOT::PLOT_FORMAT::PDF, "pdf", false ),
|
||||
m_pdfFrontFPPropertyPopups( true ),
|
||||
m_pdfBackFPPropertyPopups( true ),
|
||||
m_pdfMetadata( true ), m_pdfSingle( false ), m_pdfGenMode( GEN_MODE::ALL_LAYERS_ONE_FILE )
|
||||
m_pdfMetadata( true ),
|
||||
m_pdfSingle( false ),
|
||||
m_pdfGenMode( GEN_MODE::ALL_LAYERS_ONE_FILE ),
|
||||
m_pdfBackgroundColor( "rgba(0,0,0,0)" ) // represents an unspecified color
|
||||
{
|
||||
m_plotDrawingSheet = false;
|
||||
|
||||
@ -51,6 +54,7 @@ JOB_EXPORT_PCB_PDF::JOB_EXPORT_PCB_PDF() :
|
||||
&m_pdfBackFPPropertyPopups, m_pdfBackFPPropertyPopups ) );
|
||||
m_params.emplace_back( new JOB_PARAM<GEN_MODE>( "pdf_gen_mode",
|
||||
&m_pdfGenMode, m_pdfGenMode ) );
|
||||
m_params.emplace_back( new JOB_PARAM<wxString>( "background_color", &m_pdfBackgroundColor, m_pdfBackgroundColor ) );
|
||||
}
|
||||
|
||||
|
||||
|
@ -56,6 +56,9 @@ public:
|
||||
|
||||
///< uused by the cli, will be removed when the other behavior is deprecated
|
||||
GEN_MODE m_pdfGenMode;
|
||||
|
||||
///< The background color specified in a hex string
|
||||
wxString m_pdfBackgroundColor;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -152,6 +152,7 @@ wxString LayerName( int aLayer )
|
||||
case LAYER_SELECT_OVERLAY: return _( "Selection highlight" );
|
||||
case LAYER_LOCKED_ITEM_SHADOW: return _( "Locked item shadow" );
|
||||
case LAYER_CONFLICTS_SHADOW: return _( "Courtyard collision shadow" );
|
||||
case LAYER_BOARD_OUTLINE_AREA: return _( "Board outline area" );
|
||||
case NETNAMES_LAYER_ID_START: return _( "Track net names" );
|
||||
case LAYER_PAD_NETNAMES: return _( "Pad net names" );
|
||||
case LAYER_VIA_NETNAMES: return _( "Via net names" );
|
||||
|
@ -815,6 +815,7 @@ GAL_SET GAL_SET::DefaultVisible()
|
||||
LAYER_ZONES,
|
||||
LAYER_FILLED_SHAPES,
|
||||
LAYER_LOCKED_ITEM_SHADOW,
|
||||
// LAYER_BOARD_OUTLINE_AREA, // currently hidden by default
|
||||
LAYER_CONFLICTS_SHADOW
|
||||
};
|
||||
|
||||
|
@ -171,6 +171,7 @@ static const std::map<int, COLOR4D> s_defaultTheme =
|
||||
{ LAYER_VIA_HOLEWALLS, CSS_COLOR( 236, 236, 236, 1 ) },
|
||||
{ LAYER_DRAWINGSHEET, CSS_COLOR( 200, 114, 171, 1 ) },
|
||||
{ LAYER_PAGE_LIMITS, CSS_COLOR( 132, 132, 132, 1 ) },
|
||||
{ LAYER_BOARD_OUTLINE_AREA, CSS_COLOR( 50, 50, 50, 1 ) },
|
||||
{ NETNAMES_LAYER_ID_START, CSS_COLOR( 255, 255, 255, 0.7 ) },
|
||||
{ LAYER_PAD_NETNAMES, CSS_COLOR( 255, 255, 255, 0.9 ) },
|
||||
{ LAYER_VIA_NETNAMES, CSS_COLOR( 50, 50, 50, 0.9 ) },
|
||||
@ -445,6 +446,7 @@ static const std::map<int, COLOR4D> s_classicTheme =
|
||||
{ LAYER_VIA_HOLEWALLS, COLOR4D( WHITE ) },
|
||||
{ LAYER_DRAWINGSHEET, COLOR4D( DARKRED ) },
|
||||
{ LAYER_PAGE_LIMITS, COLOR4D( DARKGRAY) },
|
||||
{ LAYER_BOARD_OUTLINE_AREA, CSS_COLOR( 50, 50, 50, 1 ) },
|
||||
{ NETNAMES_LAYER_ID_START, CSS_COLOR( 255, 255, 255, 0.7 ) },
|
||||
{ LAYER_PAD_NETNAMES, CSS_COLOR( 255, 255, 255, 0.9 ) },
|
||||
{ LAYER_VIA_NETNAMES, CSS_COLOR( 50, 50, 50, 0.9 ) },
|
||||
|
@ -138,6 +138,7 @@ COLOR_SETTINGS::COLOR_SETTINGS( const wxString& aFilename, bool aAbsolutePath )
|
||||
CLR( "board.via_hole_walls", LAYER_VIA_HOLEWALLS );
|
||||
CLR( "board.worksheet", LAYER_DRAWINGSHEET );
|
||||
CLR( "board.page_limits", LAYER_PAGE_LIMITS );
|
||||
CLR( "board.outline_area", LAYER_BOARD_OUTLINE_AREA );
|
||||
CLR( "board.track_net_names", NETNAMES_LAYER_ID_START );
|
||||
CLR( "board.pad_net_names", LAYER_PAD_NETNAMES );
|
||||
CLR( "board.via_net_names", LAYER_VIA_NETNAMES );
|
||||
|
@ -45,6 +45,7 @@ GAL_SET UserVisbilityLayers()
|
||||
LAYER_DRC_EXCLUSION,
|
||||
LAYER_LOCKED_ITEM_SHADOW,
|
||||
LAYER_CONFLICTS_SHADOW,
|
||||
LAYER_BOARD_OUTLINE_AREA,
|
||||
LAYER_DRAWINGSHEET,
|
||||
LAYER_GRID,
|
||||
};
|
||||
@ -76,6 +77,7 @@ GAL_LAYER_ID RenderLayerFromVisibilityLayer( VISIBILITY_LAYER aLayer )
|
||||
case VISIBILITY_LAYER::DRC_EXCLUSIONS: return LAYER_DRC_EXCLUSION;
|
||||
case VISIBILITY_LAYER::LOCKED_ITEM_SHADOWS: return LAYER_LOCKED_ITEM_SHADOW;
|
||||
case VISIBILITY_LAYER::CONFLICT_SHADOWS: return LAYER_CONFLICTS_SHADOW;
|
||||
case VISIBILITY_LAYER::BOARD_OUTLINE_AREA: return LAYER_BOARD_OUTLINE_AREA;
|
||||
case VISIBILITY_LAYER::DRAWING_SHEET: return LAYER_DRAWINGSHEET;
|
||||
case VISIBILITY_LAYER::GRID: return LAYER_GRID;
|
||||
}
|
||||
@ -106,6 +108,7 @@ std::optional<VISIBILITY_LAYER> VisibilityLayerFromRenderLayer( GAL_LAYER_ID aLa
|
||||
case LAYER_DRC_EXCLUSION: return VISIBILITY_LAYER::DRC_EXCLUSIONS;
|
||||
case LAYER_LOCKED_ITEM_SHADOW: return VISIBILITY_LAYER::LOCKED_ITEM_SHADOWS;
|
||||
case LAYER_CONFLICTS_SHADOW: return VISIBILITY_LAYER::CONFLICT_SHADOWS;
|
||||
case LAYER_BOARD_OUTLINE_AREA: return VISIBILITY_LAYER::BOARD_OUTLINE_AREA;
|
||||
case LAYER_DRAWINGSHEET: return VISIBILITY_LAYER::DRAWING_SHEET;
|
||||
case LAYER_GRID: return VISIBILITY_LAYER::GRID;
|
||||
default:
|
||||
|
@ -243,6 +243,15 @@
|
||||
"viewports": []
|
||||
},
|
||||
"boards": [],
|
||||
"component_class_settings": {
|
||||
"assignments": [],
|
||||
"meta": {
|
||||
"version": 0
|
||||
},
|
||||
"sheet_component_classes": {
|
||||
"enabled": false
|
||||
}
|
||||
},
|
||||
"cvpcb": {
|
||||
"equivalence_files": []
|
||||
},
|
||||
@ -493,6 +502,7 @@
|
||||
"priority": 2147483647,
|
||||
"schematic_color": "rgba(0, 0, 0, 0.000)",
|
||||
"track_width": 0.2,
|
||||
"tuning_profile": "",
|
||||
"via_diameter": 0.6,
|
||||
"via_drill": 0.4,
|
||||
"wire_width": 6
|
||||
@ -511,13 +521,14 @@
|
||||
"priority": 0,
|
||||
"schematic_color": "rgba(0, 0, 0, 0.000)",
|
||||
"track_width": 0.4,
|
||||
"tuning_profile": "",
|
||||
"via_diameter": 0.8,
|
||||
"via_drill": 0.4,
|
||||
"wire_width": 6
|
||||
}
|
||||
],
|
||||
"meta": {
|
||||
"version": 4
|
||||
"version": 5
|
||||
},
|
||||
"net_colors": null,
|
||||
"netclass_assignments": null,
|
||||
@ -616,6 +627,7 @@
|
||||
"default_text_size": 50.0,
|
||||
"default_wire_thickness": 6.0,
|
||||
"field_names": [],
|
||||
"hop_over_size_choice": 1,
|
||||
"intersheets_ref_own_page": false,
|
||||
"intersheets_ref_prefix": "",
|
||||
"intersheets_ref_short": false,
|
||||
@ -673,5 +685,11 @@
|
||||
"inout_user"
|
||||
]
|
||||
],
|
||||
"text_variables": {}
|
||||
"text_variables": {},
|
||||
"time_domain_parameters": {
|
||||
"delay_profiles_user_defined": [],
|
||||
"meta": {
|
||||
"version": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -243,6 +243,15 @@
|
||||
"viewports": []
|
||||
},
|
||||
"boards": [],
|
||||
"component_class_settings": {
|
||||
"assignments": [],
|
||||
"meta": {
|
||||
"version": 0
|
||||
},
|
||||
"sheet_component_classes": {
|
||||
"enabled": false
|
||||
}
|
||||
},
|
||||
"cvpcb": {
|
||||
"equivalence_files": []
|
||||
},
|
||||
@ -492,6 +501,7 @@
|
||||
"priority": 2147483647,
|
||||
"schematic_color": "rgba(0, 0, 0, 0.000)",
|
||||
"track_width": 0.2,
|
||||
"tuning_profile": "",
|
||||
"via_diameter": 0.889,
|
||||
"via_drill": 0.4,
|
||||
"wire_width": 6
|
||||
@ -510,13 +520,14 @@
|
||||
"priority": 0,
|
||||
"schematic_color": "rgba(0, 0, 0, 0.000)",
|
||||
"track_width": 0.25,
|
||||
"tuning_profile": "",
|
||||
"via_diameter": 0.8,
|
||||
"via_drill": 0.4,
|
||||
"wire_width": 6
|
||||
}
|
||||
],
|
||||
"meta": {
|
||||
"version": 4
|
||||
"version": 5
|
||||
},
|
||||
"net_colors": null,
|
||||
"netclass_assignments": null,
|
||||
@ -621,6 +632,7 @@
|
||||
"default_text_size": 50.0,
|
||||
"default_wire_thickness": 6.0,
|
||||
"field_names": [],
|
||||
"hop_over_size_choice": 1,
|
||||
"intersheets_ref_own_page": false,
|
||||
"intersheets_ref_prefix": "",
|
||||
"intersheets_ref_short": false,
|
||||
@ -698,5 +710,11 @@
|
||||
"modul"
|
||||
]
|
||||
],
|
||||
"text_variables": {}
|
||||
"text_variables": {},
|
||||
"time_domain_parameters": {
|
||||
"delay_profiles_user_defined": [],
|
||||
"meta": {
|
||||
"version": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,56 +0,0 @@
|
||||
// Do not edit this file, it is autogenerated by CMake from the .md file
|
||||
_HKI( "# 1. Summary\n"
|
||||
"\n"
|
||||
"The Bill of Materials tool creates a BOM which lists all of the components in the design.\n"
|
||||
"\n"
|
||||
"The tool uses an external script to generate a BOM in the desired output format. Choosing a different script changes how the BOM is formatted.\n"
|
||||
"\n"
|
||||
"Generating a BOM is described in more detail in the Schematic Editor manual.\n"
|
||||
"\n"
|
||||
"# 2. Usage\n"
|
||||
"\n"
|
||||
"Select a generator script in the **BOM generator scripts** list. Details for the selected generator are shown on the right of the dialog.\n"
|
||||
"\n"
|
||||
"Clicking the **Generate** button creates a BOM file with the selected generator.\n"
|
||||
"\n"
|
||||
"The default settings present several generator script options, although some additional scripts are installed with KiCad and can be added to the list with the **+** button.\n"
|
||||
"\n"
|
||||
"**Note:** On Windows, there is an additional option **Show console window**. When this option is unchecked, BOM generators run in a hidden console window and any output is redirected and printed in the dialog. When this option is checked, BOM generators run in a visisble console window.\n"
|
||||
"\n"
|
||||
"# 3. Custom generators and command lines\n"
|
||||
"\n"
|
||||
"Internally, KiCad creates an intermediate netlist file in XML format that contains information about all of the components in the design. A BOM generator script converts the intermediate netlist file to the desired output format. KiCad runs the BOM generator scripts according to the command line entered at the bottom of the BOM dialog.\n"
|
||||
"\n"
|
||||
"The command line format accepts parameters for filenames. Each formatting parameter is replaced with a project-specific path or filename. The supported formatting parameters are:\n"
|
||||
"\n"
|
||||
" * `%I`: absolute path and filename of the intermediate netlist file, which is the input to the BOM generator\n"
|
||||
" * `%O`: absolute path and filename of the output BOM file (without file extension)\n"
|
||||
" * `%B`: base filename of the output BOM file (without file extension)\n"
|
||||
" * `%P`: absolute path of the project directory, without trailing slash\n"
|
||||
"\n"
|
||||
"**Note:** the `%O` output file parameter does not include a file extension. KiCad will attempt to add an appropriate extension to the command line automatically, but an extension may need to be added by hand.\n"
|
||||
"\n"
|
||||
"Python is the recommended tool for BOM generator scripts, but other tools can also be used.\n"
|
||||
"\n"
|
||||
"## Example command lines for Python scripts\n"
|
||||
"\n"
|
||||
"The command line format for a Python script is of the form:\n"
|
||||
"\n"
|
||||
"```\n"
|
||||
"python <script file name> <input filename> <output filename>\n"
|
||||
"```\n"
|
||||
"\n"
|
||||
"On Windows, if the desired generator script for a CSV BOM is `C:\\Users\\username\\kicad\\my_python_script.py`, the command line would be:\n"
|
||||
"\n"
|
||||
"```\n"
|
||||
"python.exe C:\\Users\\username\\kicad\\my_python_script.py \"%I\" \"%O.csv\"\n"
|
||||
"```\n"
|
||||
"\n"
|
||||
"On Linux, if the desired generator script for a CSV BOM is `/home/username/kicad/my_python_script.py`, the command line would be:\n"
|
||||
"\n"
|
||||
"```\n"
|
||||
"python /home/username/kicad/my_python_script.py \"%I\" \"%O.csv\"\n"
|
||||
"```\n"
|
||||
"\n"
|
||||
"Double quotes (`\"`) around the arguments are recommended in case filenames contain spaces or special characters.\n"
|
||||
"" );
|
@ -48,15 +48,15 @@ DIALOG_LIB_NEW_SYMBOL::DIALOG_LIB_NEW_SYMBOL( EDA_DRAW_FRAME* aParent,
|
||||
{
|
||||
if( aSymbolNames.GetCount() )
|
||||
{
|
||||
wxArrayString escapedNames;
|
||||
wxArrayString unescapedNames;
|
||||
|
||||
for( const wxString& name : aSymbolNames )
|
||||
escapedNames.Add( UnescapeString( name ) );
|
||||
unescapedNames.Add( UnescapeString( name ) );
|
||||
|
||||
m_comboInheritanceSelect->SetStringList( escapedNames );
|
||||
m_comboInheritanceSelect->SetStringList( unescapedNames );
|
||||
|
||||
if( !aInheritFromSymbolName.IsEmpty() )
|
||||
m_comboInheritanceSelect->SetSelectedString( aInheritFromSymbolName );
|
||||
m_comboInheritanceSelect->SetSelectedString( UnescapeString( aInheritFromSymbolName ) );
|
||||
}
|
||||
|
||||
m_textName->SetValidator( FIELD_VALIDATOR( FIELD_T::VALUE ) );
|
||||
@ -64,15 +64,15 @@ DIALOG_LIB_NEW_SYMBOL::DIALOG_LIB_NEW_SYMBOL( EDA_DRAW_FRAME* aParent,
|
||||
|
||||
if( !aInheritFromSymbolName.IsEmpty() )
|
||||
{
|
||||
m_textName->ChangeValue( getDerivativeName( aInheritFromSymbolName ) );
|
||||
m_textName->ChangeValue( UnescapeString( getDerivativeName( aInheritFromSymbolName ) ) );
|
||||
m_nameIsDefaulted = true;
|
||||
}
|
||||
|
||||
m_pinTextPosition.SetValue( schIUScale.MilsToIU( DEFAULT_PIN_NAME_OFFSET ) );
|
||||
|
||||
m_comboInheritanceSelect->Connect(
|
||||
FILTERED_ITEM_SELECTED,
|
||||
wxCommandEventHandler( DIALOG_LIB_NEW_SYMBOL::onParentSymbolSelect ), nullptr, this );
|
||||
m_comboInheritanceSelect->Connect( FILTERED_ITEM_SELECTED,
|
||||
wxCommandEventHandler( DIALOG_LIB_NEW_SYMBOL::onParentSymbolSelect ),
|
||||
nullptr, this );
|
||||
|
||||
m_textName->Bind( wxEVT_TEXT,
|
||||
[this]( wxCommandEvent& aEvent )
|
||||
@ -80,8 +80,9 @@ DIALOG_LIB_NEW_SYMBOL::DIALOG_LIB_NEW_SYMBOL( EDA_DRAW_FRAME* aParent,
|
||||
m_nameIsDefaulted = false;
|
||||
} );
|
||||
|
||||
m_checkTransferUserFields->Connect(
|
||||
wxEVT_CHECKBOX, wxCommandEventHandler( DIALOG_LIB_NEW_SYMBOL::onCheckTransferUserFields ), nullptr, this );
|
||||
m_checkTransferUserFields->Connect( wxEVT_CHECKBOX,
|
||||
wxCommandEventHandler( DIALOG_LIB_NEW_SYMBOL::onCheckTransferUserFields ),
|
||||
nullptr, this );
|
||||
|
||||
// Trigger the event handler to show/hide the info bar message.
|
||||
wxCommandEvent dummyEvent;
|
||||
@ -103,11 +104,12 @@ DIALOG_LIB_NEW_SYMBOL::DIALOG_LIB_NEW_SYMBOL( EDA_DRAW_FRAME* aParent,
|
||||
|
||||
DIALOG_LIB_NEW_SYMBOL::~DIALOG_LIB_NEW_SYMBOL()
|
||||
{
|
||||
m_comboInheritanceSelect->Disconnect(
|
||||
FILTERED_ITEM_SELECTED,
|
||||
wxCommandEventHandler( DIALOG_LIB_NEW_SYMBOL::onParentSymbolSelect ), nullptr, this );
|
||||
m_checkTransferUserFields->Disconnect(
|
||||
wxEVT_CHECKBOX, wxCommandEventHandler( DIALOG_LIB_NEW_SYMBOL::onCheckTransferUserFields ), nullptr, this );
|
||||
m_comboInheritanceSelect->Disconnect( FILTERED_ITEM_SELECTED,
|
||||
wxCommandEventHandler( DIALOG_LIB_NEW_SYMBOL::onParentSymbolSelect ),
|
||||
nullptr, this );
|
||||
m_checkTransferUserFields->Disconnect( wxEVT_CHECKBOX,
|
||||
wxCommandEventHandler( DIALOG_LIB_NEW_SYMBOL::onCheckTransferUserFields ),
|
||||
nullptr, this );
|
||||
}
|
||||
|
||||
bool DIALOG_LIB_NEW_SYMBOL::TransferDataFromWindow()
|
||||
@ -123,7 +125,7 @@ void DIALOG_LIB_NEW_SYMBOL::onParentSymbolSelect( wxCommandEvent& aEvent )
|
||||
if( !parent.IsEmpty() )
|
||||
{
|
||||
m_infoBar->RemoveAllButtons();
|
||||
m_infoBar->ShowMessage( wxString::Format( _( "Deriving from symbol '%s'." ), parent ),
|
||||
m_infoBar->ShowMessage( wxString::Format( _( "Deriving from symbol '%s'." ), UnescapeString( parent ) ),
|
||||
wxICON_INFORMATION );
|
||||
}
|
||||
else
|
||||
|
@ -499,7 +499,8 @@ SCH_EASYEDAPRO_PARSER::ParseSymbol( const std::vector<nlohmann::json>& aLines,
|
||||
std::vector<double> points = line.at( 2 );
|
||||
wxString styleStr = line.at( 3 );
|
||||
|
||||
auto shape = std::make_unique<SCH_SHAPE>( SHAPE_T::BEZIER, LAYER_DEVICE );
|
||||
std::unique_ptr<SCH_SHAPE> shape =
|
||||
std::make_unique<SCH_SHAPE>( SHAPE_T::BEZIER, LAYER_DEVICE );
|
||||
|
||||
for( size_t i = 1; i < points.size(); i += 2 )
|
||||
{
|
||||
|
@ -1084,11 +1084,14 @@ std::vector<VECTOR3I> SCH_LINE::BuildWireWithHopShape( const SCH_SCREEN* aScreen
|
||||
if( IsEndPoint( *intersect ) || existingLine->IsEndPoint( *intersect ) )
|
||||
continue;
|
||||
|
||||
intersections.push_back( *intersect );
|
||||
// Ensure intersecting point is not yet entered. it can be already just entered
|
||||
// if more than two wires are intersecting at the same point,
|
||||
// creating bad hop over shapes for the current wire
|
||||
if( intersections.size() == 0 || intersections.back() != *intersect )
|
||||
intersections.push_back( *intersect );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if( intersections.empty() )
|
||||
{
|
||||
wire_shape.emplace_back( currentLineStartPoint.x, currentLineStartPoint.y, 0 );
|
||||
|
@ -664,7 +664,6 @@ void SCH_SCREEN::UpdateSymbolLinks( REPORTER* aReporter )
|
||||
wxCHECK_RET( Schematic(), "Cannot call SCH_SCREEN::UpdateSymbolLinks with no SCHEMATIC" );
|
||||
|
||||
wxString msg;
|
||||
std::unique_ptr< LIB_SYMBOL > libSymbol;
|
||||
std::vector<SCH_SYMBOL*> symbols;
|
||||
SYMBOL_LIB_TABLE* libs = PROJECT_SCH::SchSymbolLibTable( &Schematic()->Prj() );
|
||||
|
||||
@ -674,7 +673,7 @@ void SCH_SCREEN::UpdateSymbolLinks( REPORTER* aReporter )
|
||||
for( SCH_ITEM* item : Items().OfType( SCH_SYMBOL_T ) )
|
||||
symbols.push_back( static_cast<SCH_SYMBOL*>( item ) );
|
||||
|
||||
// Remove them from the R tree. There bounding box size may change.
|
||||
// Remove them from the R tree. Their bounding box size may change.
|
||||
for( SCH_SYMBOL* symbol : symbols )
|
||||
Remove( symbol );
|
||||
|
||||
@ -684,7 +683,6 @@ void SCH_SCREEN::UpdateSymbolLinks( REPORTER* aReporter )
|
||||
for( SCH_SYMBOL* symbol : symbols )
|
||||
{
|
||||
LIB_SYMBOL* tmp = nullptr;
|
||||
libSymbol.reset();
|
||||
|
||||
// If the symbol is already in the internal library, map the symbol to it.
|
||||
auto it = m_libSymbols.find( symbol->GetSchSymbolLibraryName() );
|
||||
@ -777,11 +775,11 @@ void SCH_SCREEN::UpdateSymbolLinks( REPORTER* aReporter )
|
||||
if( tmp )
|
||||
{
|
||||
// We want a full symbol not just the top level child symbol.
|
||||
libSymbol = tmp->Flatten();
|
||||
std::unique_ptr<LIB_SYMBOL> libSymbol = tmp->Flatten();
|
||||
libSymbol->SetParent();
|
||||
|
||||
m_libSymbols.insert( { symbol->GetSchSymbolLibraryName(),
|
||||
new LIB_SYMBOL( *libSymbol.get() ) } );
|
||||
new LIB_SYMBOL( *libSymbol ) } );
|
||||
|
||||
if( aReporter )
|
||||
{
|
||||
@ -791,6 +789,8 @@ void SCH_SCREEN::UpdateSymbolLinks( REPORTER* aReporter )
|
||||
UnescapeString( symbol->GetLibId().Format() ) );
|
||||
aReporter->ReportTail( msg, RPT_SEVERITY_INFO );
|
||||
}
|
||||
|
||||
symbol->SetLibSymbol( libSymbol.release() );
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -802,9 +802,6 @@ void SCH_SCREEN::UpdateSymbolLinks( REPORTER* aReporter )
|
||||
aReporter->ReportTail( msg, RPT_SEVERITY_ERROR );
|
||||
}
|
||||
}
|
||||
|
||||
if( libSymbol.get() ) // Only change the old link if the new link exists
|
||||
symbol->SetLibSymbol( libSymbol.release() );
|
||||
}
|
||||
|
||||
// Changing the symbol may adjust the bbox of the symbol. This re-inserts the
|
||||
@ -828,12 +825,10 @@ void SCH_SCREEN::UpdateLocalLibSymbolLinks()
|
||||
|
||||
auto it = m_libSymbols.find( symbol->GetSchSymbolLibraryName() );
|
||||
|
||||
LIB_SYMBOL* libSymbol = nullptr;
|
||||
|
||||
if( it != m_libSymbols.end() )
|
||||
libSymbol = new LIB_SYMBOL( *it->second );
|
||||
|
||||
symbol->SetLibSymbol( libSymbol );
|
||||
symbol->SetLibSymbol( new LIB_SYMBOL( *it->second ) );
|
||||
else
|
||||
symbol->SetLibSymbol( nullptr );
|
||||
|
||||
m_rtree.insert( symbol );
|
||||
}
|
||||
|
@ -1,133 +0,0 @@
|
||||
// Do not edit this file, it is autogenerated by CMake from the .md file
|
||||
_HKI( "<table>\n"
|
||||
" <tr>\n"
|
||||
" <th>Markup</th>\n"
|
||||
" <th></th>\n"
|
||||
" <th>Result</th>\n"
|
||||
" </tr>\n"
|
||||
" <tr>\n"
|
||||
" <td> <br><samp>^{superscript}</samp></td>\n"
|
||||
" <td></td>\n"
|
||||
" <td> <br><samp><sup>superscript</sup> </samp></td>\n"
|
||||
" </tr>\n"
|
||||
" <tr>\n"
|
||||
" <td> <br><samp>Driver Board^{Rev A}</samp></td>\n"
|
||||
" <td></td>\n"
|
||||
" <td> <br><samp>Driver Board<sup>Rev A</sup></samp></td>\n"
|
||||
" </tr>\n"
|
||||
" <tr>\n"
|
||||
" <td><br></td>\n"
|
||||
" </tr>\n"
|
||||
" <tr>\n"
|
||||
" <td> <br><samp>_{subscript}</samp></td>\n"
|
||||
" <td></td>\n"
|
||||
" <td> <br><samp><sub>subscript</sub> </samp></td>\n"
|
||||
" </tr>\n"
|
||||
" <tr>\n"
|
||||
" <td> <br><samp>D_{0} - D_{15}</samp></td>\n"
|
||||
" <td></td>\n"
|
||||
" <td> <br><samp>D<sub>0</sub> - D<sub>15</sub></samp></td>\n"
|
||||
" </tr>\n"
|
||||
" <tr>\n"
|
||||
" <td></td>\n"
|
||||
" </tr>\n"
|
||||
" <tr>\n"
|
||||
" <td> <br><samp>~{overbar}</samp><br> <br><samp>~{CLK}</samp></td>\n"
|
||||
" <td></td>\n"
|
||||
" <td> <samp><u> </u></samp><br> <samp>overbar</samp><br> <samp><u> </u></samp><br> <samp>CLK</samp></td>\n"
|
||||
" </tr>\n"
|
||||
" <tr>\n"
|
||||
" <td></td>\n"
|
||||
" </tr>\n"
|
||||
" <tr>\n"
|
||||
" <td> <br><samp>${variable}</samp></td>\n"
|
||||
" <td></td>\n"
|
||||
" <td> <br><samp><i>variable_value</i></samp></td>\n"
|
||||
" </tr>\n"
|
||||
" <tr>\n"
|
||||
" <td> <br><samp>${REVISION}</samp></td>\n"
|
||||
" <td></td>\n"
|
||||
" <td> <br><samp>2020.1</samp></td>\n"
|
||||
" </tr>\n"
|
||||
" <tr>\n"
|
||||
" <td><br></td>\n"
|
||||
" </tr>\n"
|
||||
" <tr>\n"
|
||||
" <td> <br><samp>${refdes:field}</samp></td>\n"
|
||||
" <td></td>\n"
|
||||
" <td> <br><samp><i>field_value</i> of symbol <i>refdes</i></samp></td>\n"
|
||||
" </tr>\n"
|
||||
" <tr>\n"
|
||||
" <td> <br><samp>${R3:VALUE}</samp></td>\n"
|
||||
" <td></td>\n"
|
||||
" <td> <br><samp>150K</samp></td>\n"
|
||||
" </tr>\n"
|
||||
" <tr>\n"
|
||||
" <td><br></td>\n"
|
||||
" </tr>\n"
|
||||
" <tr>\n"
|
||||
" <td><br></td>\n"
|
||||
" </tr>\n"
|
||||
" <tr>\n"
|
||||
" <th>Bus Definition</th>\n"
|
||||
" <th> </th>\n"
|
||||
" <th>Resultant Nets</th>\n"
|
||||
" </tr>\n"
|
||||
" <tr>\n"
|
||||
" <td> <br><samp>prefix[m..n]</samp></td>\n"
|
||||
" <td></td>\n"
|
||||
" <td> <br><samp>prefixm to prefixn</samp></td>\n"
|
||||
" </tr>\n"
|
||||
" <tr>\n"
|
||||
" <td> <br><samp>D[0..7]</samp></td>\n"
|
||||
" <td></td>\n"
|
||||
" <td> <br><samp>D0, D1, D2, D3, D4, D5, D6, D7</samp></td>\n"
|
||||
" </tr>\n"
|
||||
" <tr>\n"
|
||||
" <td><br></td>\n"
|
||||
" </tr>\n"
|
||||
" <tr>\n"
|
||||
" <td> <br><samp>{net1 net2 ...}</samp></td>\n"
|
||||
" <td></td>\n"
|
||||
" <td> <br><samp>net1, net2, ...</samp></td>\n"
|
||||
" </tr>\n"
|
||||
" <tr>\n"
|
||||
" <td> <br><samp>{SCL SDA}</samp></td>\n"
|
||||
" <td></td>\n"
|
||||
" <td> <br><samp>SCL, SDA</samp></td>\n"
|
||||
" </tr>\n"
|
||||
" <tr>\n"
|
||||
" <td><br></td>\n"
|
||||
" </tr>\n"
|
||||
" <tr>\n"
|
||||
" <td> <br><samp>prefix{net1 net2 ...}</samp></td>\n"
|
||||
" <td></td>\n"
|
||||
" <td> <br><samp>prefix.net1, prefix.net2, ...</samp></td>\n"
|
||||
" </tr>\n"
|
||||
" <tr>\n"
|
||||
" <td> <br><samp>USB1{D+ D-}</samp></td>\n"
|
||||
" <td></td>\n"
|
||||
" <td> <br><samp>USB1.D+, USB1.D-</samp></td>\n"
|
||||
" </tr>\n"
|
||||
" <tr>\n"
|
||||
" <td><br></td>\n"
|
||||
" </tr>\n"
|
||||
" <tr>\n"
|
||||
" <td> <br><samp>MEM{D[1..2] LATCH}</samp></td>\n"
|
||||
" <td></td>\n"
|
||||
" <td> <br> <samp>MEM.D1, MEM.D2, MEM.LATCH</samp> </td>\n"
|
||||
" </tr>\n"
|
||||
" <tr>\n"
|
||||
" <td> <br><samp>MEM{D_{[1..2]} ~{LATCH}}</samp></td>\n"
|
||||
" <td></td>\n"
|
||||
" <td> <samp> <sub> </sub> <sub> </sub> <u> </u></samp><br> <samp>MEM.D<sub>1</sub>, MEM.D<sub>2</sub>, MEM.LATCH</samp> </td>\n"
|
||||
" </tr>\n"
|
||||
" <tr>\n"
|
||||
" <td><br></td>\n"
|
||||
" </tr>\n"
|
||||
"</table>\n"
|
||||
"<p></p>\n"
|
||||
"<p></p>\n"
|
||||
"<i>Note that markup has precedence over bus definitions.</i>\n"
|
||||
"\n"
|
||||
"" );
|
@ -565,7 +565,7 @@ int SCH_TEXTBOX::compare( const SCH_ITEM& aOther, int aCompareFlags ) const
|
||||
return IsItalic() - tmp->IsItalic();
|
||||
|
||||
if( GetHorizJustify() != tmp->GetHorizJustify() )
|
||||
return GetHorizJustify() - tmp->GetHorizJustify();
|
||||
return (int) GetHorizJustify() - (int) tmp->GetHorizJustify();
|
||||
|
||||
if( GetTextAngle().AsTenthsOfADegree() != tmp->GetTextAngle().AsTenthsOfADegree() )
|
||||
return GetTextAngle().AsTenthsOfADegree() - tmp->GetTextAngle().AsTenthsOfADegree();
|
||||
|
@ -1,37 +0,0 @@
|
||||
// Do not edit this file, it is autogenerated by CMake from the .md file
|
||||
_HKI( "SPICE functions:\n"
|
||||
"\n"
|
||||
" sqrt(x)\n"
|
||||
" sin(x)\n"
|
||||
" cos(x)\n"
|
||||
" tan(x)\n"
|
||||
" sinh(x)\n"
|
||||
" cosh(x)\n"
|
||||
" tanh(x)\n"
|
||||
" asin(x)\n"
|
||||
" acos(x)\n"
|
||||
" atan(x)\n"
|
||||
" asinh(x)\n"
|
||||
" acosh(x)\n"
|
||||
" atanh(x)\n"
|
||||
" arctan(x)\n"
|
||||
" exp(x)\n"
|
||||
" ln(x)\n"
|
||||
" log(x)\n"
|
||||
" abs(x)\n"
|
||||
" nint(x)\n"
|
||||
" int(x)\n"
|
||||
" floor(x)\n"
|
||||
" ceil(x)\n"
|
||||
" pow(x, y)\n"
|
||||
" pwr(x, y)\n"
|
||||
" min(x, y)\n"
|
||||
" max(x, y)\n"
|
||||
" sgn(x)\n"
|
||||
" ternary_fcn(x, y, z)\n"
|
||||
" gauss(nom, rvar, sigma)\n"
|
||||
" agauss(nom, avar, sigma)\n"
|
||||
" unif(nom, rvar)\n"
|
||||
" aunif(nom, avar)\n"
|
||||
" limit(nom, avar)\n"
|
||||
"" );
|
@ -884,7 +884,7 @@ public:
|
||||
wxStaticText* label = new wxStaticText( this, wxID_ANY, _( "Name:" ) );
|
||||
bNameSizer->Add( label, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 );
|
||||
|
||||
m_symbolNameCtrl = new wxTextCtrl( this, wxID_ANY, aSymbolName );
|
||||
m_symbolNameCtrl = new wxTextCtrl( this, wxID_ANY, UnescapeString( aSymbolName ) );
|
||||
bNameSizer->Add( m_symbolNameCtrl, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
|
||||
|
||||
wxButton* newLibraryButton = new wxButton( this, ID_MAKE_NEW_LIBRARY, _( "New Library..." ) );
|
||||
@ -919,7 +919,7 @@ public:
|
||||
symbolName.Trim( true );
|
||||
symbolName.Trim( false );
|
||||
symbolName.Replace( " ", "_" );
|
||||
return symbolName;
|
||||
return EscapeString( symbolName, CTX_LIBID );
|
||||
}
|
||||
|
||||
protected:
|
||||
@ -980,7 +980,8 @@ void SYMBOL_EDIT_FRAME::saveSymbolCopyAs( bool aOpenCopy )
|
||||
{
|
||||
msg = wxString::Format( _( "Library '%s' is read-only. Choose a "
|
||||
"different library to save the symbol '%s' to." ),
|
||||
newLib, newName );
|
||||
newLib,
|
||||
UnescapeString( newName ) );
|
||||
wxMessageBox( msg );
|
||||
return wxID_CANCEL;
|
||||
}
|
||||
@ -996,7 +997,8 @@ void SYMBOL_EDIT_FRAME::saveSymbolCopyAs( bool aOpenCopy )
|
||||
{
|
||||
msg = wxString::Format( _( "Symbol '%s' cannot replace another symbol '%s' "
|
||||
"that it descends from" ),
|
||||
symbolName, newName );
|
||||
symbolName,
|
||||
UnescapeString( newName ) );
|
||||
wxMessageBox( msg );
|
||||
return wxID_CANCEL;
|
||||
}
|
||||
@ -1005,7 +1007,8 @@ void SYMBOL_EDIT_FRAME::saveSymbolCopyAs( bool aOpenCopy )
|
||||
{
|
||||
msg = wxString::Format( _( "Symbol '%s' cannot replace another symbol '%s' "
|
||||
"that is a descendent of it." ),
|
||||
symbolName, newName );
|
||||
symbolName,
|
||||
UnescapeString( newName ) );
|
||||
wxMessageBox( msg );
|
||||
return wxID_CANCEL;
|
||||
}
|
||||
@ -1018,7 +1021,8 @@ void SYMBOL_EDIT_FRAME::saveSymbolCopyAs( bool aOpenCopy )
|
||||
// The simplest case is when the symbol itself has a conflict
|
||||
msg = wxString::Format( _( "Symbol '%s' already exists in library '%s'. "
|
||||
"Do you want to overwrite it?" ),
|
||||
newName, newLib );
|
||||
UnescapeString( newName ),
|
||||
newLib );
|
||||
|
||||
KIDIALOG errorDlg( this, msg, _( "Confirmation" ),
|
||||
wxOK | wxCANCEL | wxICON_WARNING );
|
||||
@ -1035,7 +1039,8 @@ void SYMBOL_EDIT_FRAME::saveSymbolCopyAs( bool aOpenCopy )
|
||||
// existing symbol in the target lib, or rename all the parents somehow.
|
||||
msg = wxString::Format( _( "The following symbols in the inheritance chain of "
|
||||
"'%s' already exist in library '%s':\n" ),
|
||||
symbolName, newLib );
|
||||
UnescapeString( symbolName ),
|
||||
newLib );
|
||||
|
||||
for( const wxString& conflict : conflicts )
|
||||
msg += wxString::Format( " %s\n", conflict );
|
||||
@ -1050,10 +1055,9 @@ void SYMBOL_EDIT_FRAME::saveSymbolCopyAs( bool aOpenCopy )
|
||||
switch( errorDlg.ShowModal() )
|
||||
{
|
||||
case wxID_YES: return ID_OVERWRITE_CONFLICTS;
|
||||
case wxID_NO: return ID_RENAME_CONFLICTS;
|
||||
default: break;
|
||||
case wxID_NO: return ID_RENAME_CONFLICTS;
|
||||
default: return wxID_CANCEL;
|
||||
}
|
||||
return wxID_CANCEL;
|
||||
}
|
||||
|
||||
return wxID_OK;
|
||||
|
@ -679,11 +679,14 @@ bool SYMBOL_LIBRARY_MANAGER::SymbolNameInUse( const wxString& aName, const wxStr
|
||||
{
|
||||
wxArrayString existing;
|
||||
|
||||
// NB: GetSymbolNames() is mostly used for GUI stuff, so it returns unescaped names
|
||||
GetSymbolNames( aLibrary, existing );
|
||||
|
||||
wxString unescapedName = UnescapeString( aName );
|
||||
|
||||
for( wxString& candidate : existing )
|
||||
{
|
||||
if( candidate.CmpNoCase( aName ) == 0 )
|
||||
if( candidate.CmpNoCase( unescapedName ) == 0 )
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -108,6 +108,7 @@ enum KICAD_T
|
||||
PCB_ITEM_LIST_T, ///< class BOARD_ITEM_LIST, a list of board items
|
||||
PCB_NETINFO_T, ///< class NETINFO_ITEM, a description of a net
|
||||
PCB_GROUP_T, ///< class PCB_GROUP, a set of BOARD_ITEMs
|
||||
PCB_BOARD_OUTLINE_T, ///< class PCB_BOARD_OUTLINE_T, a pcb board outline item
|
||||
|
||||
// Be prudent with these types:
|
||||
// they should be used only to locate a specific field type among PCB_FIELD_Ts
|
||||
@ -470,6 +471,7 @@ constexpr bool IsPcbnewType( const KICAD_T aType )
|
||||
case PCB_SHAPE_LOCATE_ARC_T:
|
||||
case PCB_SHAPE_LOCATE_POLY_T:
|
||||
case PCB_SHAPE_LOCATE_BEZIER_T:
|
||||
case PCB_BOARD_OUTLINE_T:
|
||||
return true;
|
||||
|
||||
default:
|
||||
|
@ -314,6 +314,7 @@ enum GAL_LAYER_ID: int
|
||||
LAYER_DRC_SHAPE1 = GAL_LAYER_ID_START + 42, ///< Custom shape for DRC marker.
|
||||
LAYER_DRC_SHAPE2 = GAL_LAYER_ID_START + 43, ///< Custom shape for DRC marker.
|
||||
|
||||
LAYER_BOARD_OUTLINE_AREA = GAL_LAYER_ID_START + 44, ///< PCB board outline
|
||||
// Add layers below this point that do not have visibility controls, so don't need explicit
|
||||
// enum values
|
||||
|
||||
|
@ -49,6 +49,7 @@ enum class VISIBILITY_LAYER
|
||||
DRC_EXCLUSIONS,
|
||||
LOCKED_ITEM_SHADOWS,
|
||||
CONFLICT_SHADOWS,
|
||||
BOARD_OUTLINE_AREA,
|
||||
DRAWING_SHEET,
|
||||
GRID
|
||||
};
|
||||
|
@ -68,6 +68,9 @@ namespace CLI
|
||||
#define ARG_SCALE "--scale"
|
||||
#define ARG_SCALE_DESC "Scale for the PCB, not for the border and title. Use 0 for autoscale"
|
||||
|
||||
#define ARG_BACKGROUND_COLOR "--bg-color"
|
||||
#define ARG_BACKGROUND_COLOR_DESC "Background color, can be in hex #rrggbb, #rrggbbaa; or css rgb(r,g,b), rgba(r,g,b,a) format"
|
||||
|
||||
struct PCB_EXPORT_BASE_COMMAND : public COMMAND
|
||||
{
|
||||
PCB_EXPORT_BASE_COMMAND( const std::string& aName, bool aInputCanBeDir = false,
|
||||
|
@ -119,6 +119,11 @@ CLI::PCB_EXPORT_PDF_COMMAND::PCB_EXPORT_PDF_COMMAND() :
|
||||
.scan<'g', double>()
|
||||
.default_value( 1.0 )
|
||||
.metavar( "SCALE" );
|
||||
|
||||
m_argParser.add_argument( ARG_BACKGROUND_COLOR )
|
||||
.default_value( std::string() )
|
||||
.help( UTF8STDSTR( _( ARG_BACKGROUND_COLOR_DESC ) ) )
|
||||
.metavar( "COLOR" );
|
||||
}
|
||||
|
||||
|
||||
@ -157,6 +162,10 @@ int CLI::PCB_EXPORT_PDF_COMMAND::doPerform( KIWAY& aKiway )
|
||||
pdfJob->m_sketchDNPFPsOnFabLayers = m_argParser.get<bool>( ARG_SKETCH_DNP_FPS_ON_FAB_LAYERS );
|
||||
pdfJob->m_crossoutDNPFPsOnFabLayers = m_argParser.get<bool>( ARG_CROSSOUT_DNP_FPS_ON_FAB_LAYERS );
|
||||
|
||||
wxString bgColor = From_UTF8( m_argParser.get<std::string>( ARG_BACKGROUND_COLOR ).c_str() );
|
||||
if( bgColor != wxEmptyString )
|
||||
pdfJob->m_pdfBackgroundColor = bgColor;
|
||||
|
||||
int drillShape = m_argParser.get<int>( ARG_DRILL_SHAPE_OPTION );
|
||||
pdfJob->m_drillShapeOption = static_cast<DRILL_MARKS>( drillShape );
|
||||
|
||||
|
@ -1,11 +0,0 @@
|
||||
// Do not edit this file, it is autogenerated by CMake from the .md file
|
||||
_HKI( "### Bridged Tee Attenuator\n"
|
||||
"___a___ is attenuation in dB<br>\n"
|
||||
"___Z<sub>in</sub>___ is desired input impedance in Ω<br>\n"
|
||||
"___Z<sub>out</sub>___ is desired output impedance in Ω<br>\n"
|
||||
"___Z<sub>0</sub> = Z<sub>in</sub> = Z<sub>out</sub>___\n"
|
||||
"\n"
|
||||
"___L = 10<sup>a/20</sup>___<br>\n"
|
||||
"___R1 = Z<sub>0</sub> · (L−1)___<br>\n"
|
||||
"___R2 = Z<sub>0</sub> / (L−1)___\n"
|
||||
"" );
|
@ -1,13 +0,0 @@
|
||||
// Do not edit this file, it is autogenerated by CMake from the .md file
|
||||
_HKI( "### Pi Attenuator\n"
|
||||
"___a___ is attenuation in dB<br>\n"
|
||||
"___Z<sub>in</sub>___ is desired input impedance in Ω<br>\n"
|
||||
"___Z<sub>out</sub>___ is desired output impedance in Ω<br>\n"
|
||||
"\n"
|
||||
"___K = V<sub>I</sub>/V<sub>O</sub> = 10<sup>a/20</sup>___<br>\n"
|
||||
"___L = K<sup>2</sup> = 10<sup>a/10</sup>___<br>\n"
|
||||
"___A = (L+1) / (L−1)___<br><br>\n"
|
||||
"___R2 = (L−1) / 2·√(Z<sub>in</sub> · Z<sub>out</sub> / L)___<br>\n"
|
||||
"___R1 = 1 / (A/Z<sub>in</sub> − 1/R2)___<br>\n"
|
||||
"___R3 = 1 / (A/Z<sub>out</sub> − 1/R2)___\n"
|
||||
"" );
|
@ -1,9 +0,0 @@
|
||||
// Do not edit this file, it is autogenerated by CMake from the .md file
|
||||
_HKI( "### Split Attenuator\n"
|
||||
"Attenuation is 6 dB<br>\n"
|
||||
"___Z<sub>in</sub>___ is desired input impedance in Ω<br>\n"
|
||||
"___Z<sub>out</sub>___ is desired output impedance in Ω<br>\n"
|
||||
"___Z<sub>0</sub> = Z<sub>in</sub> = Z<sub>out</sub>___\n"
|
||||
"\n"
|
||||
"___R1 = R2 = R3 = Z<sub>0</sub>/3___\n"
|
||||
"" );
|
@ -1,13 +0,0 @@
|
||||
// Do not edit this file, it is autogenerated by CMake from the .md file
|
||||
_HKI( "### Tee Attenuator\n"
|
||||
"___a___ is attenuation in dB<br>\n"
|
||||
"___Z<sub>in</sub>___ is desired input impedance in Ω<br>\n"
|
||||
"___Z<sub>out</sub>___ is desired output impedance in Ω<br>\n"
|
||||
"\n"
|
||||
"___K = V<sub>I</sub>/V<sub>O</sub> = 10<sup>a/20</sup>___<br>\n"
|
||||
"___L = K<sup>2</sup> = 10<sup>a/10</sup>___<br>\n"
|
||||
"___A = (L+1) / (L−1)___<br><br>\n"
|
||||
"___R2 = 2·√(L · Z<sub>in</sub> · Z<sub>out</sub>) / (L−1)___<br>\n"
|
||||
"___R1 = Z<sub>in</sub> · A − R2___<br>\n"
|
||||
"___R3 = Z<sub>out</sub> · A − R2___\n"
|
||||
"" );
|
@ -1,14 +0,0 @@
|
||||
// Do not edit this file, it is autogenerated by CMake from the .md file
|
||||
_HKI( "Passive components are commonly made with E-series values appropriate to their precision.\n"
|
||||
"Capacitors commonly use E12 values. 10% and 5% resistors commonly use E24 values. 1%\n"
|
||||
"resistors use E96 values. Other series are not commonly used.\n"
|
||||
"\n"
|
||||
"To select a value begin with the calculated target value and then round it to 2\n"
|
||||
"significant figures for E24 or below or 3 significant figures for E48 and up.\n"
|
||||
"Then find the value in the table which is nearest to the significant figures\n"
|
||||
"remaining and substitute it for those figures.\n"
|
||||
"\n"
|
||||
"For example if the calculated target value is 16,834.2Ω then this rounds to 16,800Ω.\n"
|
||||
"The nearest value to 168 is 169 and the selected E96 value is 16.9kΩ.\n"
|
||||
"\n"
|
||||
"The value 0 is a special case and is not present in any series." );
|
@ -1,7 +0,0 @@
|
||||
// Do not edit this file, it is autogenerated by CMake from the .md file
|
||||
_HKI( "You can use this calculator to check if a small track can handle a large current for a short period of time.<br>\n"
|
||||
"This tool allows you to design a track fuse but should be used as an estimate only.\n"
|
||||
"\n"
|
||||
"The calculator estimates the energy required to heat the wire up<br>\n"
|
||||
"to its melting point as well as the energy required for the change of phase.<br>\n"
|
||||
"This energy is then compared to the one dissipated by the wire resistance." );
|
@ -1,7 +0,0 @@
|
||||
// Do not edit this file, it is autogenerated by CMake from the .md file
|
||||
_HKI( "This table shows the difference in electrochemical potential between various metals and alloys. Galvanic corrosion affects different metals in contact and under certain conditions.<br>\n"
|
||||
"The anode of an electrochemical pair gets oxidized and eaten away, while the cathode gets dissolved metals plated onto it but stays protected.<br>\n"
|
||||
"A positive number indicates that the row is anodic (-) and the column is cathodic (+), cold and warm coloring hues also indicate rows' potential.<br>\n"
|
||||
"EN 50310 suggests a voltage difference below 300mV. Known practices make use of a third interface metal in between the main pair(ie the ENIG surface finish).<br>\n"
|
||||
"Selected cells shown with the default system's coloring choice after a table refill.\n"
|
||||
"" );
|
@ -1,8 +0,0 @@
|
||||
// Do not edit this file, it is autogenerated by CMake from the .md file
|
||||
_HKI( "The goal of the IEC60664-1 is to provide guidance on designing insulation for products that have a connection to mains supply.\n"
|
||||
"\n"
|
||||
"However some cases are not covered by this calculator:\n"
|
||||
"\n"
|
||||
"- For frequencies higher than 30kHz, the dielectric perfomances are degraded. IEC60664-4 covers those cases\n"
|
||||
"- When using a conformal coating or a potting in order to protect for pollution, if all conditions specified by IEC60664-3 are met, the clearance and creepage distances can be reduced. Soldermask is usually not considered as a conformal coating.\n"
|
||||
"- Insulations trough liquids, compressed air or gases other than air are not in the scope of IEC60664" );
|
@ -1,14 +0,0 @@
|
||||
// Do not edit this file, it is autogenerated by CMake from the .md file
|
||||
_HKI( "- This calculator finds combinations of standard E-series (between 10Ω and 1MΩ) to create arbitrary values.\n"
|
||||
"- You can enter the required resistance from 0.0025 to 4000 kΩ.\n"
|
||||
"- Solutions using up to 4 components are given.\n"
|
||||
"\n"
|
||||
"The requested value is always excluded from the solution set.<br>\n"
|
||||
"Optionally up to two additional values can be excluded in case of component availability problems.\n"
|
||||
"\n"
|
||||
"Solutions are given in the following formats:\n"
|
||||
"\n"
|
||||
" R1 + R2 +...+ Rn resistors in series\n"
|
||||
" R1 | R2 |...| Rn resistors in parallel\n"
|
||||
" R1 + (R2|R3)... any combination of the above\n"
|
||||
"" );
|
@ -1,18 +0,0 @@
|
||||
// Do not edit this file, it is autogenerated by CMake from the .md file
|
||||
_HKI( "If you specify the maximum current, then the track widths will be calculated to suit.\n"
|
||||
"\n"
|
||||
"If you specify one of the track widths, the maximum current it can handle will be calculated. The width for the other track to also handle this current will then be calculated.\n"
|
||||
"\n"
|
||||
"The controlling value is shown in bold.\n"
|
||||
"\n"
|
||||
"The calculations are valid for currents up to 35 A (external) or 17.5 A (internal), temperature rises up to 100 °C, and widths of up to 400 mils (10 mm).\n"
|
||||
"\n"
|
||||
"The formula, from IPC 2221, is\n"
|
||||
"<center>___I = K · ΔT<sup>0.44</sup> · (W · H)<sup>0.725</sup>___</center>\n"
|
||||
"where:<br>\n"
|
||||
"___I___ is maximum current in A<br>\n"
|
||||
"___ΔT___ is temperature rise above ambient in °C<br>\n"
|
||||
"___W___ is width in mils<br>\n"
|
||||
"___H___ is thickness (height) in mils<br>\n"
|
||||
"___K___ is 0.024 for internal tracks or 0.048 for external tracks\n"
|
||||
"" );
|
@ -68,6 +68,7 @@
|
||||
#include <thread_pool.h>
|
||||
#include <zone.h>
|
||||
#include <mutex>
|
||||
#include <pcb_board_outline.h>
|
||||
|
||||
// This is an odd place for this, but CvPcb won't link if it's in board_item.cpp like I first
|
||||
// tried it.
|
||||
@ -97,6 +98,7 @@ BOARD::BOARD() :
|
||||
|
||||
m_DRCMaxClearance = 0;
|
||||
m_DRCMaxPhysicalClearance = 0;
|
||||
m_boardOutline = new PCB_BOARD_OUTLINE( this );
|
||||
|
||||
// we have not loaded a board yet, assume latest until then.
|
||||
m_fileFormatVersionAtLoad = LEGACY_BOARD_FILE_VERSION;
|
||||
@ -167,6 +169,7 @@ BOARD::~BOARD()
|
||||
for( PCB_GENERATOR* g : m_generators )
|
||||
ownedItems.insert( g );
|
||||
|
||||
delete m_boardOutline;
|
||||
m_generators.clear();
|
||||
|
||||
// Delete the owned items after clearing the containers, because some item dtors
|
||||
@ -432,8 +435,8 @@ bool BOARD::ResolveTextVar( wxString* token, int aDepth ) const
|
||||
{
|
||||
if( token->Contains( ':' ) )
|
||||
{
|
||||
wxString remainder;
|
||||
wxString ref = token->BeforeFirst( ':', &remainder );
|
||||
wxString remainder;
|
||||
wxString ref = token->BeforeFirst( ':', &remainder );
|
||||
BOARD_ITEM* refItem = ResolveItem( KIID( ref ), true );
|
||||
|
||||
if( refItem && refItem->Type() == PCB_FOOTPRINT_T )
|
||||
@ -1598,7 +1601,7 @@ BOARD_ITEM* BOARD::ResolveItem( const KIID& aID, bool aAllowNullptrReturn ) cons
|
||||
if( aAllowNullptrReturn )
|
||||
return nullptr;
|
||||
else
|
||||
return DELETED_BOARD_ITEM::GetInstance();
|
||||
return DELETED_BOARD_ITEM::GetInstance();
|
||||
}
|
||||
|
||||
|
||||
@ -3108,3 +3111,15 @@ bool BOARD::operator==( const BOARD_ITEM& aItem ) const
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void BOARD::UpdateBoardOutline()
|
||||
{
|
||||
m_boardOutline->GetOutline().RemoveAllContours();
|
||||
|
||||
bool has_outline = GetBoardPolygonOutlines( m_boardOutline->GetOutline() );
|
||||
|
||||
if( has_outline )
|
||||
m_boardOutline->GetOutline().Fracture();
|
||||
}
|
||||
|
||||
|
||||
|
@ -67,6 +67,9 @@ class CONNECTIVITY_DATA;
|
||||
class COMPONENT;
|
||||
class PROJECT;
|
||||
class PROGRESS_REPORTER;
|
||||
class PCB_BOARD_OUTLINE;
|
||||
|
||||
|
||||
namespace KIFONT
|
||||
{
|
||||
class OUTLINE_FONT;
|
||||
@ -360,6 +363,10 @@ public:
|
||||
|
||||
const GENERATORS& Generators() const { return m_generators; }
|
||||
|
||||
PCB_BOARD_OUTLINE* BoardOutline() { return m_boardOutline; }
|
||||
const PCB_BOARD_OUTLINE* BoardOutline() const { return m_boardOutline; }
|
||||
void UpdateBoardOutline();
|
||||
|
||||
const MARKERS& Markers() const { return m_markers; }
|
||||
|
||||
// SWIG requires non-const accessors for some reason to make the custom iterators in board.i
|
||||
@ -1388,6 +1395,7 @@ private:
|
||||
GROUPS m_groups;
|
||||
ZONES m_zones;
|
||||
GENERATORS m_generators;
|
||||
PCB_BOARD_OUTLINE* m_boardOutline;
|
||||
|
||||
// Cache for fast access to items in the containers above by KIID, including children
|
||||
std::unordered_map<KIID, BOARD_ITEM*> m_itemByIdCache;
|
||||
|
89
pcbnew/board_bounding_box.cpp
Normal file
89
pcbnew/board_bounding_box.cpp
Normal file
@ -0,0 +1,89 @@
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2023 Ethan Chien <liangtie.qian@gmail.com>
|
||||
* Copyright (C) 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 Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you may find one here:
|
||||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||
* or you may search the http://www.gnu.org website for the version 2 license,
|
||||
* or you may write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include "board_bounding_box.h"
|
||||
|
||||
#include <memory>
|
||||
#include <board_item_container.h>
|
||||
|
||||
BOARD_BOUNDING_BOX::BOARD_BOUNDING_BOX( BOX2I const& aBoundingBox ) :
|
||||
EDA_ITEM( KICAD_T::PCB_BOUNDING_BOX_T ),
|
||||
m_boundingBox( std::make_shared<BOX2I>( aBoundingBox ) )
|
||||
{
|
||||
SetFlags( SKIP_STRUCT );
|
||||
}
|
||||
|
||||
BOARD_BOUNDING_BOX::BOARD_BOUNDING_BOX( const BOARD_BOUNDING_BOX& aOther ) :
|
||||
EDA_ITEM( KICAD_T::PCB_BOUNDING_BOX_T ), m_boundingBox( aOther.m_boundingBox )
|
||||
{
|
||||
SetFlags( SKIP_STRUCT );
|
||||
}
|
||||
|
||||
BOARD_BOUNDING_BOX& BOARD_BOUNDING_BOX::operator=( const BOARD_BOUNDING_BOX& aOther )
|
||||
{
|
||||
m_parent = aOther.m_parent;
|
||||
m_boundingBox = aOther.m_boundingBox;
|
||||
return *this;
|
||||
}
|
||||
|
||||
EDA_ITEM* BOARD_BOUNDING_BOX::Clone() const
|
||||
{
|
||||
return new BOARD_BOUNDING_BOX( *this );
|
||||
}
|
||||
|
||||
BOARD_BOUNDING_BOX::~BOARD_BOUNDING_BOX()
|
||||
{
|
||||
}
|
||||
|
||||
const BOX2I BOARD_BOUNDING_BOX::GetBoundingBox() const
|
||||
{
|
||||
return *m_boundingBox;
|
||||
}
|
||||
|
||||
void BOARD_BOUNDING_BOX::SetBoundingBox( BOX2I const& aBoundingBox )
|
||||
{
|
||||
m_boundingBox = std::make_shared<BOX2I>( aBoundingBox );
|
||||
}
|
||||
|
||||
wxString BOARD_BOUNDING_BOX::GetClass() const
|
||||
{
|
||||
return "BOARD_BOUNDING_BOX";
|
||||
}
|
||||
|
||||
void BOARD_BOUNDING_BOX::ViewGetLayers( int aLayers[], int& aCount ) const
|
||||
{
|
||||
aCount = 1;
|
||||
aLayers[0] = LAYER_BOARD_BOUNDING_BOX;
|
||||
}
|
||||
|
||||
#if defined( DEBUG )
|
||||
|
||||
|
||||
void BOARD_BOUNDING_BOX::Show( int nestLevel, std::ostream& os ) const
|
||||
{
|
||||
NestedSpace( nestLevel, os ) << '<' << GetClass().Lower().mb_str() << m_boundingBox->Format()
|
||||
<< "/>\n";
|
||||
}
|
||||
|
||||
#endif
|
66
pcbnew/board_bounding_box.h
Normal file
66
pcbnew/board_bounding_box.h
Normal file
@ -0,0 +1,66 @@
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2023 Ethan Chien <liangtie.qian@gmail.com>
|
||||
* Copyright (C) 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 Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you may find one here:
|
||||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||
* or you may search the http://www.gnu.org website for the version 2 license,
|
||||
* or you may write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
|
||||
#ifndef BOARD_BOUNDING_BOX_H
|
||||
#define BOARD_BOUNDING_BOX_H
|
||||
|
||||
#include <board_item.h>
|
||||
#include <memory>
|
||||
|
||||
|
||||
class BOARD_BOUNDING_BOX : public EDA_ITEM
|
||||
{
|
||||
public:
|
||||
BOARD_BOUNDING_BOX( BOX2I const& aBoundingBox );
|
||||
|
||||
BOARD_BOUNDING_BOX( const BOARD_BOUNDING_BOX& aOther );
|
||||
|
||||
BOARD_BOUNDING_BOX& operator=( const BOARD_BOUNDING_BOX& aOther );
|
||||
|
||||
EDA_ITEM* Clone() const override;
|
||||
|
||||
~BOARD_BOUNDING_BOX() override;
|
||||
|
||||
const BOX2I GetBoundingBox() const override;
|
||||
|
||||
void SetBoundingBox( BOX2I const& aBoundingBox );
|
||||
|
||||
wxString GetClass() const override;
|
||||
|
||||
void ViewGetLayers( int aLayers[], int& aCount ) const override;
|
||||
|
||||
|
||||
#if defined( DEBUG )
|
||||
|
||||
void Show( int nestLevel, std::ostream& os ) const override;
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
private:
|
||||
std::shared_ptr<BOX2I> m_boundingBox;
|
||||
};
|
||||
|
||||
#endif
|
@ -42,6 +42,7 @@
|
||||
#include <connectivity/connectivity_data.h>
|
||||
#include <connectivity/connectivity_algo.h>
|
||||
#include <teardrop/teardrop.h>
|
||||
#include <pcb_board_outline.h>
|
||||
|
||||
#include <functional>
|
||||
#include <project/project_file.h>
|
||||
@ -135,7 +136,7 @@ void BOARD_COMMIT::propagateDamage( BOARD_ITEM* aChangedItem, std::vector<ZONE*>
|
||||
aStaleZones->push_back( static_cast<ZONE*>( aChangedItem ) );
|
||||
|
||||
aChangedItem->RunOnChildren( std::bind( &BOARD_COMMIT::propagateDamage, this, _1, aStaleZones, aStaleRuleAreas ),
|
||||
RECURSE_MODE::NO_RECURSE );
|
||||
RECURSE_MODE::NO_RECURSE );
|
||||
|
||||
BOARD* board = static_cast<BOARD*>( m_toolMgr->GetModel() );
|
||||
BOX2I damageBBox = aChangedItem->GetBoundingBox();
|
||||
@ -189,6 +190,7 @@ void BOARD_COMMIT::Push( const wxString& aMessage, int aCommitFlags )
|
||||
// Dirty flags and lists
|
||||
bool solderMaskDirty = false;
|
||||
bool autofillZones = false;
|
||||
bool updateBoardBoundingBox = false;
|
||||
std::vector<BOARD_ITEM*> staleTeardropPadsAndVias;
|
||||
std::set<PCB_TRACK*> staleTeardropTracks;
|
||||
std::vector<ZONE*> staleZonesStorage;
|
||||
@ -235,6 +237,11 @@ void BOARD_COMMIT::Push( const wxString& aMessage, int aCommitFlags )
|
||||
solderMaskDirty = true;
|
||||
}
|
||||
|
||||
if( boardItem->GetLayer() == Edge_Cuts )
|
||||
{
|
||||
updateBoardBoundingBox = true;
|
||||
}
|
||||
|
||||
if( !( aCommitFlags & SKIP_TEARDROPS ) )
|
||||
{
|
||||
if( boardItem->Type() == PCB_FOOTPRINT_T )
|
||||
@ -509,6 +516,19 @@ void BOARD_COMMIT::Push( const wxString& aMessage, int aCommitFlags )
|
||||
frame->HideSolderMask();
|
||||
}
|
||||
|
||||
if( updateBoardBoundingBox && view )
|
||||
{
|
||||
if( PCB_BOARD_OUTLINE* outline = board->BoardOutline() )
|
||||
{
|
||||
board->UpdateBoardOutline();
|
||||
|
||||
if( view->HasItem( outline ) )
|
||||
view->Update( outline );
|
||||
else
|
||||
view->Add( outline );
|
||||
}
|
||||
}
|
||||
|
||||
if( PCBNEW_SETTINGS* cfg = GetAppSettings<PCBNEW_SETTINGS>( "pcbnew" ) )
|
||||
{
|
||||
if( !staleRuleAreas.empty() && ( cfg->m_Display.m_TrackClearance == SHOW_WITH_VIA_ALWAYS
|
||||
|
@ -41,6 +41,7 @@
|
||||
#include <dialog_gendrill.h>
|
||||
#include <widgets/wx_html_report_panel.h>
|
||||
#include <widgets/std_bitmap_button.h>
|
||||
#include <widgets/color_swatch.h>
|
||||
#include <tool/tool_manager.h>
|
||||
#include <tools/zone_filler_tool.h>
|
||||
#include <tools/drc_tool.h>
|
||||
@ -118,6 +119,8 @@ DIALOG_PLOT::DIALOG_PLOT( PCB_EDIT_FRAME* aEditFrame, wxWindow* aParent,
|
||||
{
|
||||
BOARD* board = m_editFrame->GetBoard();
|
||||
|
||||
m_pdfBackgroundColorSwatch->SetDefaultColor( COLOR4D::UNSPECIFIED );
|
||||
|
||||
SetName( DLG_WINDOW_NAME );
|
||||
m_DRCWarningTemplate = m_DRCExclusionsWarning->GetLabel();
|
||||
|
||||
@ -433,6 +436,8 @@ void DIALOG_PLOT::init_Dialog()
|
||||
m_backFPPropertyPopups->SetValue( m_plotOpts.m_PDFBackFPPropertyPopups );
|
||||
m_pdfMetadata->SetValue( m_plotOpts.m_PDFMetadata );
|
||||
m_pdfSingle->SetValue( m_plotOpts.m_PDFSingle );
|
||||
m_pdfBackgroundColorSwatch->SetSwatchColor( m_plotOpts.m_PDFBackgroundColor, false );
|
||||
updatePdfColorOptions();
|
||||
|
||||
// Initialize a few other parameters, which can also be modified
|
||||
// from the drill dialog
|
||||
@ -500,6 +505,7 @@ void DIALOG_PLOT::transferPlotParamsToJob()
|
||||
pdfJob->m_pdfBackFPPropertyPopups = m_plotOpts.m_PDFBackFPPropertyPopups;
|
||||
pdfJob->m_pdfMetadata = m_plotOpts.m_PDFMetadata;
|
||||
pdfJob->m_pdfSingle = m_plotOpts.m_PDFSingle;
|
||||
pdfJob->m_pdfBackgroundColor = m_plotOpts.m_PDFBackgroundColor.ToCSSString();
|
||||
|
||||
// we need to embed this for the cli deprecation fix
|
||||
if( pdfJob->m_pdfSingle )
|
||||
@ -1044,6 +1050,7 @@ void DIALOG_PLOT::applyPlotSettings()
|
||||
tempOptions.m_PDFBackFPPropertyPopups = m_backFPPropertyPopups->GetValue();
|
||||
tempOptions.m_PDFMetadata = m_pdfMetadata->GetValue();
|
||||
tempOptions.m_PDFSingle = m_pdfSingle->GetValue();
|
||||
tempOptions.m_PDFBackgroundColor = m_pdfBackgroundColorSwatch->GetSwatchColor();
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1401,3 +1408,24 @@ void DIALOG_PLOT::onSketchPads( wxCommandEvent& aEvent )
|
||||
{
|
||||
m_plotPadNumbers->Enable( aEvent.IsChecked() );
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_PLOT::updatePdfColorOptions()
|
||||
{
|
||||
if( m_PDFColorChoice->GetSelection() == 1 )
|
||||
{
|
||||
m_pdfBackgroundColorSwatch->Disable();
|
||||
m_pdfBackgroundColorText->Disable();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pdfBackgroundColorSwatch->Enable();
|
||||
m_pdfBackgroundColorText->Enable();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_PLOT::onPDFColorChoice( wxCommandEvent& aEvent )
|
||||
{
|
||||
updatePdfColorOptions();
|
||||
}
|
@ -66,6 +66,7 @@ private:
|
||||
|
||||
void onDNPCheckbox( wxCommandEvent& event ) override;
|
||||
void onSketchPads( wxCommandEvent& event ) override;
|
||||
void onPDFColorChoice( wxCommandEvent& event ) override;
|
||||
|
||||
// other functions
|
||||
void init_Dialog(); // main initialization
|
||||
@ -76,6 +77,7 @@ private:
|
||||
void arrangeAllLayersList( const LSEQ& aSeq );
|
||||
void loadPlotParamsFromJob();
|
||||
void transferPlotParamsToJob();
|
||||
void updatePdfColorOptions();
|
||||
|
||||
private:
|
||||
PCB_EDIT_FRAME* m_editFrame;
|
||||
|
@ -5,6 +5,7 @@
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "widgets/color_swatch.h"
|
||||
#include "widgets/std_bitmap_button.h"
|
||||
#include "widgets/wx_html_report_panel.h"
|
||||
|
||||
@ -392,7 +393,14 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr
|
||||
gbSizer4->Add( m_pdfMetadata, wxGBPosition( 3, 0 ), wxGBSpan( 1, 2 ), wxLEFT|wxRIGHT, 5 );
|
||||
|
||||
m_pdfSingle = new wxCheckBox( m_PDFOptionsSizer->GetStaticBox(), wxID_ANY, _("Single document"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
gbSizer4->Add( m_pdfSingle, wxGBPosition( 4, 0 ), wxGBSpan( 1, 2 ), wxBOTTOM|wxLEFT|wxRIGHT, 5 );
|
||||
gbSizer4->Add( m_pdfSingle, wxGBPosition( 4, 0 ), wxGBSpan( 1, 2 ), wxLEFT|wxRIGHT, 5 );
|
||||
|
||||
m_pdfBackgroundColorText = new wxStaticText( m_PDFOptionsSizer->GetStaticBox(), wxID_ANY, _("Background Color"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_pdfBackgroundColorText->Wrap( -1 );
|
||||
gbSizer4->Add( m_pdfBackgroundColorText, wxGBPosition( 5, 0 ), wxGBSpan( 1, 1 ), wxALL, 5 );
|
||||
|
||||
m_pdfBackgroundColorSwatch = new COLOR_SWATCH( m_PDFOptionsSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
gbSizer4->Add( m_pdfBackgroundColorSwatch, wxGBPosition( 5, 1 ), wxGBSpan( 1, 1 ), wxALL, 5 );
|
||||
|
||||
|
||||
m_PDFOptionsSizer->Add( gbSizer4, 1, wxEXPAND|wxBOTTOM, 5 );
|
||||
@ -457,6 +465,7 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr
|
||||
m_boardSetup->Connect( wxEVT_COMMAND_HYPERLINK, wxHyperlinkEventHandler( DIALOG_PLOT_BASE::onBoardSetup ), NULL, this );
|
||||
m_useGerberX2Format->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnGerberX2Checked ), NULL, this );
|
||||
m_DXF_plotModeOpt->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnChangeDXFPlotMode ), NULL, this );
|
||||
m_PDFColorChoice->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_PLOT_BASE::onPDFColorChoice ), NULL, this );
|
||||
m_buttonDRC->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::onRunDRC ), NULL, this );
|
||||
m_sdbSizer1Apply->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::CreateDrillFile ), NULL, this );
|
||||
m_sdbSizer1OK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::Plot ), NULL, this );
|
||||
@ -474,6 +483,7 @@ DIALOG_PLOT_BASE::~DIALOG_PLOT_BASE()
|
||||
m_boardSetup->Disconnect( wxEVT_COMMAND_HYPERLINK, wxHyperlinkEventHandler( DIALOG_PLOT_BASE::onBoardSetup ), NULL, this );
|
||||
m_useGerberX2Format->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnGerberX2Checked ), NULL, this );
|
||||
m_DXF_plotModeOpt->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnChangeDXFPlotMode ), NULL, this );
|
||||
m_PDFColorChoice->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_PLOT_BASE::onPDFColorChoice ), NULL, this );
|
||||
m_buttonDRC->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::onRunDRC ), NULL, this );
|
||||
m_sdbSizer1Apply->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::CreateDrillFile ), NULL, this );
|
||||
m_sdbSizer1OK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::Plot ), NULL, this );
|
||||
|
@ -3812,6 +3812,7 @@
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnChoice">onPDFColorChoice</event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="gbsizeritem" expanded="true">
|
||||
@ -4022,7 +4023,7 @@
|
||||
<property name="border">5</property>
|
||||
<property name="colspan">2</property>
|
||||
<property name="column">0</property>
|
||||
<property name="flag">wxBOTTOM|wxLEFT|wxRIGHT</property>
|
||||
<property name="flag">wxLEFT|wxRIGHT</property>
|
||||
<property name="row">4</property>
|
||||
<property name="rowspan">1</property>
|
||||
<object class="wxCheckBox" expanded="true">
|
||||
@ -4086,6 +4087,137 @@
|
||||
<property name="window_style"></property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="gbsizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="colspan">1</property>
|
||||
<property name="column">0</property>
|
||||
<property name="flag">wxALL</property>
|
||||
<property name="row">5</property>
|
||||
<property name="rowspan">1</property>
|
||||
<object class="wxStaticText" expanded="true">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</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="drag_accept_files">0</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">Background Color</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_pdfBackgroundColorText</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="true">
|
||||
<property name="border">5</property>
|
||||
<property name="colspan">1</property>
|
||||
<property name="column">1</property>
|
||||
<property name="flag">wxALL</property>
|
||||
<property name="row">5</property>
|
||||
<property name="rowspan">1</property>
|
||||
<object class="CustomControl" expanded="true">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</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="class">COLOR_SWATCH</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="construction"></property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="declaration"></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="drag_accept_files">0</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="include"></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_pdfBackgroundColorSwatch</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="settings"></property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="subclass">COLOR_SWATCH; widgets/color_swatch.h; 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>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
|
@ -10,6 +10,7 @@
|
||||
#include <wx/artprov.h>
|
||||
#include <wx/xrc/xmlres.h>
|
||||
#include <wx/intl.h>
|
||||
class COLOR_SWATCH;
|
||||
class STD_BITMAP_BUTTON;
|
||||
class WX_HTML_REPORT_PANEL;
|
||||
|
||||
@ -118,6 +119,8 @@ class DIALOG_PLOT_BASE : public DIALOG_SHIM
|
||||
wxCheckBox* m_backFPPropertyPopups;
|
||||
wxCheckBox* m_pdfMetadata;
|
||||
wxCheckBox* m_pdfSingle;
|
||||
wxStaticText* m_pdfBackgroundColorText;
|
||||
COLOR_SWATCH* m_pdfBackgroundColorSwatch;
|
||||
WX_HTML_REPORT_PANEL* m_messagesPanel;
|
||||
wxBoxSizer* m_sizerButtons;
|
||||
wxButton* m_buttonDRC;
|
||||
@ -137,6 +140,7 @@ class DIALOG_PLOT_BASE : public DIALOG_SHIM
|
||||
virtual void onBoardSetup( wxHyperlinkEvent& event ) { event.Skip(); }
|
||||
virtual void OnGerberX2Checked( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnChangeDXFPlotMode( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void onPDFColorChoice( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void onRunDRC( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void CreateDrillFile( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void Plot( wxCommandEvent& event ) { event.Skip(); }
|
||||
|
@ -712,6 +712,7 @@ PANEL_PCBNEW_COLOR_SETTINGS::PANEL_PCBNEW_COLOR_SETTINGS( wxWindow* aParent, BOA
|
||||
// These layers are not in GAL_LAYER_ID_START ... GAL_LAYER_ID_BITMASK_END
|
||||
m_validLayers.push_back( LAYER_LOCKED_ITEM_SHADOW );
|
||||
m_validLayers.push_back( LAYER_CONFLICTS_SHADOW );
|
||||
m_validLayers.push_back( LAYER_BOARD_OUTLINE_AREA );
|
||||
m_validLayers.push_back( LAYER_PAGE_LIMITS );
|
||||
m_validLayers.push_back( LAYER_DRC_WARNING );
|
||||
m_validLayers.push_back( LAYER_DRC_EXCLUSION );
|
||||
|
133
pcbnew/pcb_board_outline.cpp
Normal file
133
pcbnew/pcb_board_outline.cpp
Normal file
@ -0,0 +1,133 @@
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2023 Ethan Chien <liangtie.qian@gmail.com>
|
||||
* Copyright (C) 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 Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you may find one here:
|
||||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||
* or you may search the http://www.gnu.org website for the version 2 license,
|
||||
* or you may write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include "pcb_board_outline.h"
|
||||
#include <eda_item_flags.h>
|
||||
#include <eda_item.h>
|
||||
#include <layer_ids.h>
|
||||
#include <memory>
|
||||
#include <board_item_container.h>
|
||||
|
||||
void PCB_BOARD_OUTLINE::CopyPros( const PCB_BOARD_OUTLINE& aCopyFrom, PCB_BOARD_OUTLINE& aCopyTo )
|
||||
{
|
||||
aCopyTo.m_outlines = aCopyFrom.m_outlines;
|
||||
aCopyTo.m_parent = aCopyFrom.m_parent;
|
||||
}
|
||||
|
||||
|
||||
PCB_BOARD_OUTLINE::PCB_BOARD_OUTLINE( BOARD_ITEM* aParent ) :
|
||||
BOARD_ITEM( aParent, KICAD_T::PCB_BOARD_OUTLINE_T, Edge_Cuts )
|
||||
{
|
||||
SetFlags( SKIP_STRUCT );
|
||||
}
|
||||
|
||||
PCB_BOARD_OUTLINE::PCB_BOARD_OUTLINE( const PCB_BOARD_OUTLINE& aOther ) :
|
||||
PCB_BOARD_OUTLINE( aOther.GetParent() )
|
||||
{
|
||||
CopyPros( aOther, *this );
|
||||
}
|
||||
|
||||
PCB_BOARD_OUTLINE& PCB_BOARD_OUTLINE::operator=( const PCB_BOARD_OUTLINE& aOther )
|
||||
{
|
||||
CopyPros( aOther, *this );
|
||||
return *this;
|
||||
}
|
||||
|
||||
PCB_BOARD_OUTLINE::~PCB_BOARD_OUTLINE()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
std::vector<int> PCB_BOARD_OUTLINE::ViewGetLayers() const
|
||||
{
|
||||
std::vector<int> layers { LAYER_BOARD_OUTLINE_AREA };
|
||||
return layers;
|
||||
}
|
||||
|
||||
|
||||
const BOX2I PCB_BOARD_OUTLINE::GetBoundingBox() const
|
||||
{
|
||||
return m_outlines.BBox();
|
||||
}
|
||||
|
||||
|
||||
PCB_LAYER_ID PCB_BOARD_OUTLINE::GetLayer() const
|
||||
{
|
||||
return UNDEFINED_LAYER;
|
||||
}
|
||||
|
||||
|
||||
LSET PCB_BOARD_OUTLINE::GetLayerSet() const
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
||||
bool PCB_BOARD_OUTLINE::IsOnLayer( PCB_LAYER_ID aLayer ) const
|
||||
{
|
||||
WXUNUSED( aLayer )
|
||||
return {};
|
||||
}
|
||||
|
||||
double PCB_BOARD_OUTLINE::Similarity( const BOARD_ITEM& aItem ) const
|
||||
{
|
||||
if( aItem.Type() == KICAD_T::PCB_BOARD_OUTLINE_T )
|
||||
{
|
||||
if( m_parent == aItem.GetParent() )
|
||||
return 1.0;
|
||||
|
||||
return 0.5;
|
||||
}
|
||||
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
bool PCB_BOARD_OUTLINE::operator==( const BOARD_ITEM& aItem ) const
|
||||
{
|
||||
if( const PCB_BOARD_OUTLINE* outline = dynamic_cast<const PCB_BOARD_OUTLINE*>( &aItem ) )
|
||||
{
|
||||
return outline->m_parent == m_parent;
|
||||
}
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
EDA_ITEM* PCB_BOARD_OUTLINE::Clone() const
|
||||
{
|
||||
return new PCB_BOARD_OUTLINE( *this );
|
||||
}
|
||||
|
||||
wxString PCB_BOARD_OUTLINE::GetClass() const
|
||||
{
|
||||
return "PCB_BOARD_OUTLINE";
|
||||
}
|
||||
|
||||
|
||||
#if defined( DEBUG )
|
||||
|
||||
void PCB_BOARD_OUTLINE::Show( int nestLevel, std::ostream& os ) const
|
||||
{
|
||||
NestedSpace( nestLevel, os ) << '<' << GetClass().Lower().mb_str() << ">\n";
|
||||
}
|
||||
|
||||
#endif
|
81
pcbnew/pcb_board_outline.h
Normal file
81
pcbnew/pcb_board_outline.h
Normal file
@ -0,0 +1,81 @@
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2023 Ethan Chien <liangtie.qian@gmail.com>
|
||||
* Copyright (C) 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 Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you may find one here:
|
||||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||
* or you may search the http://www.gnu.org website for the version 2 license,
|
||||
* or you may write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#ifndef PCB_BOARD_OUTLINE_H
|
||||
#define PCB_BOARD_OUTLINE_H
|
||||
|
||||
#include <geometry/shape_poly_set.h>
|
||||
#include <eda_item.h>
|
||||
#include <board_item.h>
|
||||
#include <memory>
|
||||
|
||||
|
||||
class PCB_BOARD_OUTLINE : public BOARD_ITEM
|
||||
{
|
||||
public:
|
||||
PCB_BOARD_OUTLINE( BOARD_ITEM* aParent );
|
||||
|
||||
PCB_BOARD_OUTLINE( const PCB_BOARD_OUTLINE& aOther );
|
||||
|
||||
PCB_BOARD_OUTLINE& operator=( const PCB_BOARD_OUTLINE& aOther );
|
||||
|
||||
~PCB_BOARD_OUTLINE() override;
|
||||
|
||||
const SHAPE_POLY_SET& GetOutline() const { return m_outlines; }
|
||||
|
||||
SHAPE_POLY_SET& GetOutline() { return m_outlines; }
|
||||
|
||||
std::vector<int> ViewGetLayers() const override;
|
||||
|
||||
const BOX2I GetBoundingBox() const override;
|
||||
|
||||
PCB_LAYER_ID GetLayer() const override;
|
||||
|
||||
LSET GetLayerSet() const override;
|
||||
|
||||
bool IsOnLayer( PCB_LAYER_ID aLayer ) const override;
|
||||
|
||||
double Similarity( const BOARD_ITEM& aItem ) const override;
|
||||
|
||||
bool operator==( const BOARD_ITEM& aItem ) const override;
|
||||
|
||||
EDA_ITEM* Clone() const override;
|
||||
|
||||
bool HasOutline() const { return !m_outlines.IsEmpty(); }
|
||||
|
||||
static void CopyPros( const PCB_BOARD_OUTLINE& aCopyFrom, PCB_BOARD_OUTLINE& aCopyTo );
|
||||
|
||||
#if defined( DEBUG )
|
||||
|
||||
void Show( int nestLevel, std::ostream& os ) const override;
|
||||
|
||||
#endif
|
||||
|
||||
wxString GetClass() const override;
|
||||
|
||||
private:
|
||||
SHAPE_POLY_SET m_outlines;
|
||||
};
|
||||
|
||||
#endif
|
@ -1729,11 +1729,19 @@ const BOX2I PCB_DIM_CENTER::GetBoundingBox() const
|
||||
return bBox;
|
||||
}
|
||||
|
||||
|
||||
// fixme: we cannot use GetBoundingBox() as it returns the bbox of the 'leader' segment (used in hit testing and other non-view logic)
|
||||
const BOX2I PCB_DIM_CENTER::ViewBBox() const
|
||||
{
|
||||
return BOX2I( VECTOR2I( GetBoundingBox().GetPosition() ),
|
||||
VECTOR2I( GetBoundingBox().GetSize() ) );
|
||||
const int maxSize = std::max(m_end.x - m_start.x, m_end.y - m_start.y) + m_lineThickness / 2.0;
|
||||
|
||||
BOX2I bBox;
|
||||
|
||||
bBox.SetX( m_start.x - maxSize );
|
||||
bBox.SetY( m_start.y - maxSize );
|
||||
bBox.SetWidth( maxSize * 2 );
|
||||
bBox.SetHeight( maxSize * 2 );
|
||||
|
||||
return bBox;
|
||||
}
|
||||
|
||||
|
||||
|
@ -40,6 +40,7 @@
|
||||
#include <pcbnew_settings.h>
|
||||
#include <ratsnest/ratsnest_data.h>
|
||||
#include <ratsnest/ratsnest_view_item.h>
|
||||
#include <pcb_board_outline.h>
|
||||
|
||||
#include <pgm_base.h>
|
||||
#include <settings/settings_manager.h>
|
||||
@ -355,6 +356,8 @@ const int GAL_LAYER_ORDER[] =
|
||||
BITMAP_LAYER_FOR( B_CrtYd ),
|
||||
BITMAP_LAYER_FOR( B_Fab ),
|
||||
|
||||
LAYER_BOARD_OUTLINE_AREA,
|
||||
|
||||
LAYER_DRAWINGSHEET
|
||||
};
|
||||
|
||||
@ -436,6 +439,9 @@ void PCB_DRAW_PANEL_GAL::DisplayBoard( BOARD* aBoard, PROGRESS_REPORTER* aReport
|
||||
for( PCB_GENERATOR* generator : aBoard->Generators() )
|
||||
m_view->Add( generator );
|
||||
|
||||
aBoard->UpdateBoardOutline();
|
||||
m_view->Add( aBoard->BoardOutline() );
|
||||
|
||||
// Ratsnest
|
||||
if( !aBoard->IsFootprintHolder() )
|
||||
{
|
||||
@ -584,7 +590,7 @@ void PCB_DRAW_PANEL_GAL::SetTopLayer( PCB_LAYER_ID aLayer )
|
||||
m_view->SetTopLayer( PAD_COPPER_LAYER_FOR( layer ) );
|
||||
m_view->SetTopLayer( VIA_COPPER_LAYER_FOR( layer ) );
|
||||
m_view->SetTopLayer( CLEARANCE_LAYER_FOR( layer ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Move the active layer to the top of the stack but below all the overlay layers
|
||||
@ -838,6 +844,7 @@ void PCB_DRAW_PANEL_GAL::setDefaultLayerDeps()
|
||||
|
||||
m_view->SetLayerDisplayOnly( LAYER_LOCKED_ITEM_SHADOW );
|
||||
m_view->SetLayerDisplayOnly( LAYER_CONFLICTS_SHADOW );
|
||||
m_view->SetLayerDisplayOnly( LAYER_BOARD_OUTLINE_AREA );
|
||||
|
||||
// Some more required layers settings
|
||||
m_view->SetRequired( LAYER_PAD_NETNAMES, LAYER_PADS );
|
||||
|
@ -1786,14 +1786,12 @@ void ALTIUM_PCB::HelperParseDimensions6Leader( const ADIMENSION6& aElem )
|
||||
|
||||
if( dirVec.x != 0 || dirVec.y != 0 )
|
||||
{
|
||||
double scaling = dirVec.EuclideanNorm() / aElem.arrowsize;
|
||||
VECTOR2I arrVec =
|
||||
VECTOR2I( KiROUND( dirVec.x / scaling ), KiROUND( dirVec.y / scaling ) );
|
||||
double scaling = (double) dirVec.EuclideanNorm() / aElem.arrowsize;
|
||||
VECTOR2I arrVec = VECTOR2I( KiROUND( dirVec.x / scaling ), KiROUND( dirVec.y / scaling ) );
|
||||
RotatePoint( arrVec, EDA_ANGLE( 20.0, DEGREES_T ) );
|
||||
|
||||
{
|
||||
std::unique_ptr<PCB_SHAPE> shape1 =
|
||||
std::make_unique<PCB_SHAPE>( m_board, SHAPE_T::SEGMENT );
|
||||
std::unique_ptr<PCB_SHAPE> shape1 = std::make_unique<PCB_SHAPE>( m_board, SHAPE_T::SEGMENT );
|
||||
|
||||
shape1->SetLayer( klayer );
|
||||
shape1->SetStroke( STROKE_PARAMS( aElem.linewidth, LINE_STYLE::SOLID ) );
|
||||
@ -1806,8 +1804,7 @@ void ALTIUM_PCB::HelperParseDimensions6Leader( const ADIMENSION6& aElem )
|
||||
RotatePoint( arrVec, EDA_ANGLE( -40.0, DEGREES_T ) );
|
||||
|
||||
{
|
||||
std::unique_ptr<PCB_SHAPE> shape2 =
|
||||
std::make_unique<PCB_SHAPE>( m_board, SHAPE_T::SEGMENT );
|
||||
std::unique_ptr<PCB_SHAPE> shape2 = std::make_unique<PCB_SHAPE>( m_board, SHAPE_T::SEGMENT );
|
||||
|
||||
shape2->SetLayer( klayer );
|
||||
shape2->SetStroke( STROKE_PARAMS( aElem.linewidth, LINE_STYLE::SOLID ) );
|
||||
@ -1928,9 +1925,8 @@ void ALTIUM_PCB::ParseDimensions6Data( const ALTIUM_PCB_COMPOUND_FILE& aAlti
|
||||
case ALTIUM_DIMENSION_KIND::ANGULAR:
|
||||
if( m_reporter )
|
||||
{
|
||||
m_reporter->Report(
|
||||
wxString::Format( _( "Ignored Angular dimension (not yet supported)." ) ),
|
||||
RPT_SEVERITY_INFO );
|
||||
m_reporter->Report( wxString::Format( _( "Ignored Angular dimension (not yet supported)." ) ),
|
||||
RPT_SEVERITY_INFO );
|
||||
}
|
||||
break;
|
||||
case ALTIUM_DIMENSION_KIND::RADIAL:
|
||||
@ -1942,18 +1938,16 @@ void ALTIUM_PCB::ParseDimensions6Data( const ALTIUM_PCB_COMPOUND_FILE& aAlti
|
||||
case ALTIUM_DIMENSION_KIND::DATUM:
|
||||
if( m_reporter )
|
||||
{
|
||||
m_reporter->Report(
|
||||
wxString::Format( _( "Ignored Datum dimension (not yet supported)." ) ),
|
||||
RPT_SEVERITY_INFO );
|
||||
m_reporter->Report( wxString::Format( _( "Ignored Datum dimension (not yet supported)." ) ),
|
||||
RPT_SEVERITY_INFO );
|
||||
}
|
||||
// HelperParseDimensions6Datum( elem );
|
||||
break;
|
||||
case ALTIUM_DIMENSION_KIND::BASELINE:
|
||||
if( m_reporter )
|
||||
{
|
||||
m_reporter->Report(
|
||||
wxString::Format( _( "Ignored Baseline dimension (not yet supported)." ) ),
|
||||
RPT_SEVERITY_INFO );
|
||||
m_reporter->Report( wxString::Format( _( "Ignored Baseline dimension (not yet supported)." ) ),
|
||||
RPT_SEVERITY_INFO );
|
||||
}
|
||||
break;
|
||||
case ALTIUM_DIMENSION_KIND::CENTER:
|
||||
@ -1962,17 +1956,15 @@ void ALTIUM_PCB::ParseDimensions6Data( const ALTIUM_PCB_COMPOUND_FILE& aAlti
|
||||
case ALTIUM_DIMENSION_KIND::LINEAR_DIAMETER:
|
||||
if( m_reporter )
|
||||
{
|
||||
m_reporter->Report(
|
||||
wxString::Format( _( "Ignored Linear dimension (not yet supported)." ) ),
|
||||
RPT_SEVERITY_INFO );
|
||||
m_reporter->Report( wxString::Format( _( "Ignored Linear dimension (not yet supported)." ) ),
|
||||
RPT_SEVERITY_INFO );
|
||||
}
|
||||
break;
|
||||
case ALTIUM_DIMENSION_KIND::RADIAL_DIAMETER:
|
||||
if( m_reporter )
|
||||
{
|
||||
m_reporter->Report(
|
||||
wxString::Format( _( "Ignored Radial dimension (not yet supported)." ) ),
|
||||
RPT_SEVERITY_INFO );
|
||||
m_reporter->Report( wxString::Format( _( "Ignored Radial dimension (not yet supported)." ) ),
|
||||
RPT_SEVERITY_INFO );
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@ -2014,10 +2006,9 @@ void ALTIUM_PCB::ParseModelsData( const ALTIUM_PCB_COMPOUND_FILE& aAltiumPcb
|
||||
std::vector<std::string> stepPath = aRootDir;
|
||||
stepPath.emplace_back( std::to_string( idx ) );
|
||||
|
||||
bool validName = !elem.name.IsEmpty() && elem.name.IsAscii() &&
|
||||
wxString::npos == elem.name.find_first_of( invalidChars );
|
||||
wxString storageName = !validName ? wxString::Format( wxT( "model_%d" ), idx )
|
||||
: elem.name;
|
||||
bool validName = !elem.name.IsEmpty() && elem.name.IsAscii()
|
||||
&& wxString::npos == elem.name.find_first_of( invalidChars );
|
||||
wxString storageName = validName ? elem.name : wxString::Format( wxT( "model_%d" ), idx );
|
||||
|
||||
idx++;
|
||||
|
||||
@ -2028,8 +2019,7 @@ void ALTIUM_PCB::ParseModelsData( const ALTIUM_PCB_COMPOUND_FILE& aAltiumPcb
|
||||
if( m_reporter )
|
||||
{
|
||||
wxString msg;
|
||||
msg.Printf( _( "File not found: '%s'. 3D-model not imported." ),
|
||||
FormatPath( stepPath ) );
|
||||
msg.Printf( _( "File not found: '%s'. 3D-model not imported." ), FormatPath( stepPath ) );
|
||||
m_reporter->Report( msg, RPT_SEVERITY_ERROR );
|
||||
}
|
||||
|
||||
|
@ -43,6 +43,7 @@
|
||||
#include <pcb_marker.h>
|
||||
#include <pcb_dimension.h>
|
||||
#include <pcb_target.h>
|
||||
#include <pcb_board_outline.h>
|
||||
|
||||
#include <layer_ids.h>
|
||||
#include <lset.h>
|
||||
@ -709,6 +710,10 @@ bool PCB_PAINTER::Draw( const VIEW_ITEM* aItem, int aLayer )
|
||||
draw( static_cast<const PCB_MARKER*>( item ), aLayer );
|
||||
break;
|
||||
|
||||
case PCB_BOARD_OUTLINE_T:
|
||||
draw( static_cast<const PCB_BOARD_OUTLINE*>( item ), aLayer );
|
||||
break;
|
||||
|
||||
default:
|
||||
// Painter does not know how to draw the object
|
||||
return false;
|
||||
@ -3004,5 +3009,25 @@ void PCB_PAINTER::draw( const PCB_MARKER* aMarker, int aLayer )
|
||||
}
|
||||
}
|
||||
|
||||
void PCB_PAINTER::draw( const PCB_BOARD_OUTLINE* aBoardOutline, int aLayer )
|
||||
{
|
||||
if( !aBoardOutline->HasOutline() )
|
||||
return;
|
||||
|
||||
GAL_SCOPED_ATTRS scopedAttrs( *m_gal, GAL_SCOPED_ATTRS::ALL_ATTRS );
|
||||
m_gal->Save();
|
||||
|
||||
const COLOR4D& outlineColor = m_pcbSettings.GetColor( aBoardOutline, aLayer );
|
||||
m_gal->SetFillColor( outlineColor );
|
||||
m_gal->AdvanceDepth();
|
||||
m_gal->SetLineWidth( 0 );
|
||||
m_gal->SetIsFill( true );
|
||||
m_gal->SetIsStroke( false );
|
||||
m_gal->DrawPolygon( aBoardOutline->GetOutline() );
|
||||
|
||||
m_gal->Restore();
|
||||
}
|
||||
|
||||
|
||||
|
||||
const double PCB_RENDER_SETTINGS::MAX_FONT_SIZE = pcbIUScale.mmToIU( 10.0 );
|
||||
|
@ -61,6 +61,7 @@ class PCB_MARKER;
|
||||
class NET_SETTINGS;
|
||||
class NETINFO_LIST;
|
||||
class TEXT_ATTRIBUTES;
|
||||
class PCB_BOARD_OUTLINE;
|
||||
|
||||
namespace KIFONT
|
||||
{
|
||||
@ -211,6 +212,7 @@ protected:
|
||||
void draw( const PCB_DIMENSION_BASE* aDimension, int aLayer );
|
||||
void draw( const PCB_TARGET* aTarget );
|
||||
void draw( const PCB_MARKER* aMarker, int aLayer );
|
||||
void draw( const PCB_BOARD_OUTLINE* aBoardOutline, int aLayer );
|
||||
|
||||
/**
|
||||
* Get the thickness to draw for a line (e.g. 0 thickness lines get a minimum value).
|
||||
|
@ -104,6 +104,7 @@ PCB_PLOT_PARAMS::PCB_PLOT_PARAMS()
|
||||
m_PDFBackFPPropertyPopups = true;
|
||||
m_PDFMetadata = true;
|
||||
m_PDFSingle = false;
|
||||
m_PDFBackgroundColor = COLOR4D::UNSPECIFIED;
|
||||
|
||||
// This parameter controls if the NPTH pads will be plotted or not
|
||||
// it is a "local" parameter
|
||||
|
@ -184,11 +184,15 @@ public:
|
||||
void SetDashedLineGapRatio( double aVal ) { m_dashedLineGapRatio = aVal; }
|
||||
double GetDashedLineGapRatio() const { return m_dashedLineGapRatio; }
|
||||
|
||||
void SetPDFBackgroundColor( const COLOR4D& aColor ) { m_PDFBackgroundColor = aColor; }
|
||||
COLOR4D GetPDFBackgroundColor() const { return m_PDFBackgroundColor; }
|
||||
|
||||
public:
|
||||
bool m_PDFFrontFPPropertyPopups; ///< Generate PDF property popup menus for footprints
|
||||
bool m_PDFBackFPPropertyPopups; ///< on front and/or back of board
|
||||
bool m_PDFMetadata; ///< Generate PDF metadata for SUBJECT and AUTHOR
|
||||
bool m_PDFSingle; ///< Generate a single PDF file for all layers
|
||||
COLOR4D m_PDFBackgroundColor; ///< Background color to use if m_PDFUseBackgroundColor is true
|
||||
|
||||
private:
|
||||
friend class PCB_PLOT_PARAMS_PARSER;
|
||||
|
@ -424,6 +424,7 @@ void PCB_PLOTTER::PlotJobToPlotOpts( PCB_PLOT_PARAMS& aOpts, JOB_EXPORT_PCB_PLOT
|
||||
aOpts.m_PDFBackFPPropertyPopups = pdfJob->m_pdfBackFPPropertyPopups;
|
||||
aOpts.m_PDFMetadata = pdfJob->m_pdfMetadata;
|
||||
aOpts.m_PDFSingle = pdfJob->m_pdfSingle;
|
||||
aOpts.m_PDFBackgroundColor = COLOR4D( pdfJob->m_pdfBackgroundColor );
|
||||
}
|
||||
|
||||
if( aJob->m_plotFormat == JOB_EXPORT_PCB_PLOT::PLOT_FORMAT::POST )
|
||||
|
@ -1187,6 +1187,24 @@ static void FillNegativeKnockout( PLOTTER *aPlotter, const BOX2I &aBbbox )
|
||||
}
|
||||
|
||||
|
||||
static void plotPdfBackground( BOARD* aBoard, const PCB_PLOT_PARAMS* aPlotOpts, PLOTTER* aPlotter )
|
||||
{
|
||||
if( aPlotter->GetColorMode()
|
||||
&& aPlotOpts->GetPDFBackgroundColor() != COLOR4D::UNSPECIFIED )
|
||||
{
|
||||
aPlotter->SetColor( aPlotOpts->GetPDFBackgroundColor() );
|
||||
|
||||
// Use page size selected in pcb to know the schematic bg area
|
||||
const PAGE_INFO& actualPage = aBoard->GetPageSettings();
|
||||
|
||||
VECTOR2I end( actualPage.GetWidthIU( pcbIUScale.IU_PER_MILS ),
|
||||
actualPage.GetHeightIU( pcbIUScale.IU_PER_MILS ) );
|
||||
|
||||
aPlotter->Rect( VECTOR2I( 0, 0 ), end, FILL_T::FILLED_SHAPE, 1.0 );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Open a new plotfile using the options (and especially the format) specified in the options
|
||||
* and prepare the page for plotting.
|
||||
@ -1309,6 +1327,9 @@ PLOTTER* StartPlotBoard( BOARD *aBoard, const PCB_PLOT_PARAMS *aPlotOpts, int aL
|
||||
|
||||
if( startPlotSuccess )
|
||||
{
|
||||
if( aPlotOpts->GetFormat() == PLOT_FORMAT::PDF )
|
||||
plotPdfBackground( aBoard, aPlotOpts, plotter );
|
||||
|
||||
// Plot the frame reference if requested
|
||||
if( aPlotOpts->GetPlotFrameRef() )
|
||||
{
|
||||
@ -1345,6 +1366,8 @@ void setupPlotterNewPDFPage( PLOTTER* aPlotter, BOARD* aBoard, PCB_PLOT_PARAMS*
|
||||
const wxString& aSheetPath, const wxString& aPageNumber,
|
||||
int aPageCount )
|
||||
{
|
||||
plotPdfBackground( aBoard, aPlotOpts, aPlotter );
|
||||
|
||||
// Plot the frame reference if requested
|
||||
if( aPlotOpts->GetPlotFrameRef() )
|
||||
{
|
||||
|
@ -2471,7 +2471,7 @@ SHOVE::SHOVE_STATUS SHOVE::Run()
|
||||
{
|
||||
// Create a new NODE to store this version of the world
|
||||
assert( headLineEntry.origHead->LinkCount() == 0 );
|
||||
m_currentNode->Add( *headLineEntry.origHead );
|
||||
m_currentNode->Add( *headLineEntry.origHead, true );
|
||||
|
||||
//nodeStats( Dbg(), m_currentNode, "add-head" );
|
||||
|
||||
|
@ -43,7 +43,7 @@ bool TOPOLOGY::SimplifyLine( LINE* aLine )
|
||||
return false;
|
||||
|
||||
LINKED_ITEM* root = aLine->GetLink( 0 );
|
||||
LINE l = m_world->AssembleLine( root );
|
||||
LINE l = m_world->AssembleLine( root, nullptr, false, false, false );
|
||||
SHAPE_LINE_CHAIN simplified( l.CLine() );
|
||||
|
||||
simplified.Simplify();
|
||||
|
@ -48,6 +48,7 @@ using namespace std::placeholders;
|
||||
#include <board_commit.h>
|
||||
#include <drawing_sheet/ds_proxy_undo_item.h>
|
||||
#include <wx/msgdlg.h>
|
||||
#include <pcb_board_outline.h>
|
||||
|
||||
/* Functions to undo and redo edit commands.
|
||||
* commands to undo are stored in CurrentScreen->m_UndoList
|
||||
@ -221,6 +222,8 @@ void PCB_BASE_EDIT_FRAME::RestoreCopyFromUndoList( wxCommandEvent& aEvent )
|
||||
m_toolManager->ProcessEvent( { TC_MESSAGE, TA_UNDO_REDO_POST, AS_GLOBAL } );
|
||||
m_toolManager->PostEvent( EVENTS::SelectedItemsModified );
|
||||
|
||||
m_pcb->UpdateBoardOutline();
|
||||
GetCanvas()->GetView()->Update( m_pcb->BoardOutline() );
|
||||
GetCanvas()->Refresh();
|
||||
}
|
||||
|
||||
@ -251,6 +254,8 @@ void PCB_BASE_EDIT_FRAME::RestoreCopyFromRedoList( wxCommandEvent& aEvent )
|
||||
m_toolManager->ProcessEvent( EVENTS::UndoRedoPostEvent );
|
||||
m_toolManager->PostEvent( EVENTS::SelectedItemsModified );
|
||||
|
||||
m_pcb->UpdateBoardOutline();
|
||||
GetCanvas()->GetView()->Update( m_pcb->BoardOutline() );
|
||||
GetCanvas()->Refresh();
|
||||
}
|
||||
|
||||
@ -670,5 +675,7 @@ void PCB_BASE_EDIT_FRAME::RollbackFromUndo()
|
||||
ClearListAndDeleteItems( undo );
|
||||
delete undo;
|
||||
|
||||
m_pcb->UpdateBoardOutline();
|
||||
GetCanvas()->GetView()->Update( m_pcb->BoardOutline() );
|
||||
GetCanvas()->Refresh();
|
||||
}
|
||||
|
@ -351,6 +351,7 @@ const APPEARANCE_CONTROLS::APPEARANCE_SETTING APPEARANCE_CONTROLS::s_objectSetti
|
||||
RR( _HKI( "Anchors" ), LAYER_ANCHOR, _HKI( "Show footprint and text origins as a cross" ) ),
|
||||
RR( _HKI( "Locked Item Shadow" ), LAYER_LOCKED_ITEM_SHADOW, _HKI( "Show a shadow on locked items" ) ),
|
||||
RR( _HKI( "Colliding Courtyards" ), LAYER_CONFLICTS_SHADOW, _HKI( "Show colliding footprint courtyards" ) ),
|
||||
RR( _HKI( "Board Area Shadow" ), LAYER_BOARD_OUTLINE_AREA, _HKI( "Show board area shadow" ) ),
|
||||
RR( _HKI( "Drawing Sheet" ), LAYER_DRAWINGSHEET, _HKI( "Show drawing sheet borders and title block" ) ),
|
||||
RR( _HKI( "Grid" ), LAYER_GRID, _HKI( "Show the (x,y) grid dots" ) )
|
||||
// clang-format on
|
||||
|
@ -43,6 +43,7 @@
|
||||
#include <pcb_dimension.h>
|
||||
#include <pcb_target.h>
|
||||
#include <pcb_group.h>
|
||||
#include <pcb_board_outline.h>
|
||||
|
||||
class TEST_BOARD_ITEM_FIXTURE
|
||||
{
|
||||
@ -137,6 +138,7 @@ public:
|
||||
case PCB_ITEM_LIST_T:
|
||||
case PCB_NETINFO_T:
|
||||
case PCB_GENERATOR_T:
|
||||
case PCB_BOARD_OUTLINE_T:
|
||||
return nullptr;
|
||||
|
||||
default:
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user