Compare commits

...

20 Commits

Author SHA1 Message Date
Wayne Stambaugh 2c061ed67a Tag release version 6.0.4. 2022-03-17 19:33:28 -04:00
Seth Hillbrand 9bfbe3acd8 Revert "Special-case synthetic click after tool selection."
This reverts commit dd55ffb75c.
2022-03-17 16:21:39 -07:00
Seth Hillbrand 40bdd26e39 Revert "Make sure LIB_ID escape context allows for formatting constructs."
This reverts commit 02252be29d.
2022-03-17 16:21:38 -07:00
Seth Hillbrand b0f8055377 Revert "Pull some fixes back from master."
This reverts commit 5c63df28e4.
2022-03-17 16:21:37 -07:00
Seth Hillbrand 33f4fc9873 Revert "Improved performance for Cleanup Tracks & Vias."
This reverts commit 14378812be.
2022-03-17 16:21:34 -07:00
Jeff Young c90842dd08 Update value & footprint from clipboard whether keeping annotation or not.
Fixes https://gitlab.com/kicad/code/kicad/issues/11116

(cherry picked from commit 400cff994d)
2022-03-17 22:34:52 +00:00
Jeff Young 310b4cdf75 Re-entrancy blocker for line/wire/bus tool.
Also clear infobar messages after a cancelInteractive.

Fixes https://gitlab.com/kicad/code/kicad/issues/11155

(cherry picked from commit 05bca282f7)
2022-03-17 22:34:52 +00:00
Seth Hillbrand 2208e0db16 Avoid marking symbols that will not be processed
We want to shorting the processing time by marking symbols that have
already been processed.  But we must avoid marking symbols that will not
be processed due to their other flags

Fixes https://gitlab.com/kicad/code/kicad/issues/11164
2022-03-17 10:10:21 -07:00
jean-pierre charras cf4c403094 Gerber plotter: fix incorrect handling of arcs in polygons.
From master branch.
Fixes #11156
https://gitlab.com/kicad/code/kicad/issues/11156
2022-03-17 13:06:37 +01:00
Jeff Young dd55ffb75c Special-case synthetic click after tool selection.
Fixes https://gitlab.com/kicad/code/kicad/issues/11057

(cherry picked from commit 1f745b000d)
2022-03-16 17:11:07 +00:00
Jeff Young d34faf30cc Save pointer to markers provider.
Fixes https://gitlab.com/kicad/code/kicad/issues/11136

(cherry picked from commit a81c8d4922)
2022-03-16 16:23:10 +00:00
Jeff Young 3720a52ecb Bubble ESC up from the 3D preview.
Fixes https://gitlab.com/kicad/code/kicad/issues/9984

(cherry picked from commit 32fdab8902)
2022-03-16 16:21:24 +00:00
Jeff Young 47de9f8f04 Fix typo which leads to catastrophic performance on boards with tons of zones.
(cherry picked from commit 392a3ec131)
2022-03-16 15:16:11 +00:00
Jeff Young 14378812be Improved performance for Cleanup Tracks & Vias. 2022-03-16 15:15:20 +00:00
Jeff Young 0070a4686e Cherry-pick the short-arc-is-really-a-segment fix from master.
Fixes https://gitlab.com/kicad/code/kicad/issues/11119
2022-03-16 15:15:15 +00:00
Jeff Young 5c63df28e4 Pull some fixes back from master.
Mostly wxT(), but also some performance, and some for better response
to Cancel button.
2022-03-16 15:15:09 +00:00
Jeff Young e5ea37507c Exclude hidden text from selection in FP Editor.
Fixes https://gitlab.com/kicad/code/kicad/issues/11111

(cherry picked from commit 06c1bccccd)
2022-03-16 15:15:01 +00:00
Jeff Young 53bd87d792 Performance fixes for the board from hell....
(cherry picked from commit e4b56ab7f1)
2022-03-16 15:14:51 +00:00
Jeff Young 02252be29d Make sure LIB_ID escape context allows for formatting constructs.
Also make sure that value field is updated from name changes when the
symbol is a power symbol (even if it's from the schematic instead of
the library).

Fixes https://gitlab.com/kicad/code/kicad/issues/11093

(cherry picked from commit a9eb7a0e28)
2022-03-16 15:14:29 +00:00
Wayne Stambaugh 9e9598af5f Begin version 6.0.4 development. 2022-03-15 20:14:40 -04:00
19 changed files with 138 additions and 39 deletions
@@ -29,6 +29,7 @@
#include <kiface_base.h>
#include <tools/eda_3d_controller.h>
#include "eda_3d_actions.h"
#include "dialogs/panel_preview_3d_model.h"
#include <3d_rendering/opengl/render_3d_opengl.h>
@@ -113,10 +114,36 @@ int EDA_3D_CONTROLLER::Main( const TOOL_EVENT& aEvent )
// Main loop: keep receiving events
while( TOOL_EVENT* evt = Wait() )
{
if( evt->IsClick( BUT_RIGHT ) )
if( evt->IsCancelInteractive() )
{
wxWindow* canvas = m_toolMgr->GetToolHolder()->GetToolCanvas();
wxWindow* topLevelParent = canvas->GetParent();
while( topLevelParent && !topLevelParent->IsTopLevel() )
topLevelParent = topLevelParent->GetParent();
if( topLevelParent && dynamic_cast<DIALOG_SHIM*>( topLevelParent ) )
{
DIALOG_SHIM* dialog = static_cast<DIALOG_SHIM*>( topLevelParent );
if( dialog->IsQuasiModal() )
dialog->EndQuasiModal( wxID_CANCEL );
else
dialog->EndModal( wxID_CANCEL );
}
else
{
evt->SetPassEvent();
}
}
else if( evt->IsClick( BUT_RIGHT ) )
{
m_menu.ShowContextMenu();
}
else
{
evt->SetPassEvent();
}
}
return 0;
+3 -1
View File
@@ -4,7 +4,7 @@
* Copyright (C) 2016 Mario Luzeiro <mrluzeiro@ua.pt>
* Copyright (C) 2015 Cirilo Bernardo <cirilo.bernardo@gmail.com>
* Copyright (C) 2017 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2015-2021 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2015-2022 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
@@ -124,8 +124,10 @@ PANEL_PREVIEW_3D_MODEL::PANEL_PREVIEW_3D_MODEL( wxWindow* aParent, PCB_BASE_FRAM
m_SizerPanelView->Add( m_previewPane, 1, wxEXPAND, 5 );
for( wxEventType eventType : { wxEVT_MENU_OPEN, wxEVT_MENU_CLOSE, wxEVT_MENU_HIGHLIGHT } )
{
Connect( eventType, wxMenuEventHandler( PANEL_PREVIEW_3D_MODEL::OnMenuEvent ), nullptr,
this );
}
#ifdef __WXOSX__
// Call layout once to get the proper button sizes after the bitmaps have been set
+1 -1
View File
@@ -37,7 +37,7 @@
# KiCad.
#
# Note: This version string should follow the semantic versioning system
set( KICAD_SEMANTIC_VERSION "6.0.3" )
set( KICAD_SEMANTIC_VERSION "6.0.4" )
# Default the version to the semantic version.
# This is overridden by the git repository tag though (if using git)
+11 -17
View File
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2019 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2022 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
@@ -842,18 +842,6 @@ void GERBER_PLOTTER::plotArc( const SHAPE_ARC& aArc, bool aPlotInRegion )
wxPoint start( aArc.GetP0() );
wxPoint end( aArc.GetP1() );
wxPoint center( aArc.GetCenter() );
double startAngle = aArc.GetStartAngle();
double endAngle = aArc.GetEndAngle();
if( startAngle > endAngle )
{
if( endAngle < 0.0 )
endAngle = NormalizeAnglePos( endAngle ) ;
else
{
startAngle = NormalizeAnglePos( startAngle ) - 3600.0;
}
}
if( !aPlotInRegion )
MoveTo( start);
@@ -861,14 +849,20 @@ void GERBER_PLOTTER::plotArc( const SHAPE_ARC& aArc, bool aPlotInRegion )
LineTo( start );
DPOINT devEnd = userToDeviceCoordinates( end );
DPOINT devCenter = userToDeviceCoordinates( center ) - userToDeviceCoordinates( start );
DPOINT devCenter = userToDeviceCoordinates( center - start );
VECTOR2I arcMidPoint = aArc.GetArcMid();
// We need to know if the arc is CW or CCW in device coordinates, so build this arc.
SHAPE_ARC deviceArc( userToDeviceCoordinates( start ),
userToDeviceCoordinates( wxPoint( arcMidPoint.x, arcMidPoint.y ) ),
devEnd, 0 );
fprintf( m_outputFile, "G75*\n" ); // Multiquadrant (360 degrees) mode
if( startAngle > endAngle )
fprintf( m_outputFile, "G03*\n" ); // Active circular interpolation, CCW
else
if( deviceArc.IsClockwise() )
fprintf( m_outputFile, "G02*\n" ); // Active circular interpolation, CW
else
fprintf( m_outputFile, "G03*\n" ); // Active circular interpolation, CCW
fprintf( m_outputFile, "X%dY%dI%dJ%dD01*\n",
KiROUND( devEnd.x ), KiROUND( devEnd.y ),
+2 -1
View File
@@ -730,7 +730,8 @@ void CONNECTION_GRAPH::buildItemSubGraphs()
SCH_CONNECTION* conn = aItem->GetOrInitConnection( sheet, this );
bool unique = !( aItem->GetFlags() & CANDIDATE );
aItem->SetFlags( CANDIDATE );
if( conn && !conn->SubgraphCode() )
aItem->SetFlags( CANDIDATE );
return ( unique && conn && ( conn->SubgraphCode() == 0 ) );
};
+8
View File
@@ -192,6 +192,8 @@ int SCH_DRAWING_TOOLS::PlaceSymbol( const TOOL_EVENT& aEvent )
if( evt->IsCancelInteractive() )
{
m_frame->GetInfoBar()->Dismiss();
if( symbol )
{
cleanup();
@@ -430,6 +432,8 @@ int SCH_DRAWING_TOOLS::PlaceImage( const TOOL_EVENT& aEvent )
if( evt->IsCancelInteractive() )
{
m_frame->GetInfoBar()->Dismiss();
if( image )
{
cleanup();
@@ -1063,6 +1067,8 @@ int SCH_DRAWING_TOOLS::TwoClickPlace( const TOOL_EVENT& aEvent )
if( evt->IsCancelInteractive() )
{
m_frame->GetInfoBar()->Dismiss();
if( item )
{
cleanup();
@@ -1290,6 +1296,8 @@ int SCH_DRAWING_TOOLS::DrawSheet( const TOOL_EVENT& aEvent )
if( evt->IsCancelInteractive() )
{
m_frame->GetInfoBar()->Dismiss();
if( sheet )
{
cleanup();
+4 -7
View File
@@ -1534,19 +1534,16 @@ void SCH_EDITOR_CONTROL::updatePastedSymbol( SCH_SYMBOL* aSymbol, SCH_SCREEN* aP
}
if( aForceKeepAnnotations && !reference.IsEmpty() )
{
aSymbol->SetRef( &aPastePath, reference );
aSymbol->SetValue( &aPastePath, value );
aSymbol->SetFootprint( &aPastePath, footprint );
}
else
{
aSymbol->ClearAnnotation( &aPastePath );
}
// We might clear annotations but always leave the original unit number from the paste
// We might clear annotations but always leave the original unit number, value and footprint
// from the paste
aSymbol->SetUnitSelection( &aPastePath, unit );
aSymbol->SetUnit( unit );
aSymbol->SetValue( &aPastePath, value );
aSymbol->SetFootprint( &aPastePath, footprint );
}
+14 -1
View File
@@ -164,7 +164,8 @@ private:
SCH_LINE_WIRE_BUS_TOOL::SCH_LINE_WIRE_BUS_TOOL() :
EE_TOOL_BASE<SCH_EDIT_FRAME>( "eeschema.InteractiveDrawingLineWireBus" )
EE_TOOL_BASE<SCH_EDIT_FRAME>( "eeschema.InteractiveDrawingLineWireBus" ),
m_inDrawingTool( false )
{
m_busUnfold = {};
m_wires.reserve( 16 );
@@ -278,6 +279,11 @@ bool SCH_LINE_WIRE_BUS_TOOL::IsDrawingLineWireOrBus( const SELECTION& aSelection
int SCH_LINE_WIRE_BUS_TOOL::DrawSegments( const TOOL_EVENT& aEvent )
{
if( m_inDrawingTool )
return 0;
REENTRANCY_GUARD guard( &m_inDrawingTool );
DRAW_SEGMENT_EVENT_PARAMS* params = aEvent.Parameter<DRAW_SEGMENT_EVENT_PARAMS*>();
std::string tool = aEvent.GetCommandStr().get();
@@ -300,6 +306,11 @@ int SCH_LINE_WIRE_BUS_TOOL::DrawSegments( const TOOL_EVENT& aEvent )
int SCH_LINE_WIRE_BUS_TOOL::UnfoldBus( const TOOL_EVENT& aEvent )
{
if( m_inDrawingTool )
return 0;
REENTRANCY_GUARD guard( &m_inDrawingTool );
wxString* netPtr = aEvent.Parameter<wxString*>();
wxString net;
SCH_LINE* segment = nullptr;
@@ -591,6 +602,8 @@ int SCH_LINE_WIRE_BUS_TOOL::doDrawSegments( const std::string& aTool, int aType,
//
if( evt->IsCancelInteractive() )
{
m_frame->GetInfoBar()->Dismiss();
if( segment || m_busUnfold.in_progress )
{
cleanup();
+3 -4
View File
@@ -133,11 +133,10 @@ private:
void computeBreakPoint( const std::pair<SCH_LINE*, SCH_LINE*>& aSegments, wxPoint& aPosition );
private:
/// Data related to bus unfolding tool.
BUS_UNFOLDING_T m_busUnfold;
bool m_inDrawingTool; // Reentrancy guard
/// Storage for the line segments while drawing
std::vector<SCH_LINE*> m_wires;
BUS_UNFOLDING_T m_busUnfold;
std::vector<SCH_LINE*> m_wires; // Lines being drawn
};
#endif /* SCH_LINE_WIRE_BUS_TOOL_H */
+3
View File
@@ -384,6 +384,9 @@ int SCH_MOVE_TOOL::Main( const TOOL_EVENT& aEvent )
//
else if( evt->IsCancelInteractive() || evt->IsActivate() )
{
if( evt->IsCancelInteractive() )
m_frame->GetInfoBar()->Dismiss();
if( m_moveInProgress )
{
if( evt->IsActivate() )
@@ -118,6 +118,8 @@ int SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace( const TOOL_EVENT& aEvent )
if( evt->IsCancelInteractive() )
{
m_frame->GetInfoBar()->Dismiss();
if( item )
{
cleanup();
@@ -536,6 +536,17 @@ void TransformArcToPolygon( SHAPE_POLY_SET& aCornerBuffer, const wxPoint& aStart
const wxPoint& aMid, const wxPoint& aEnd, int aWidth,
int aError, ERROR_LOC aErrorLoc )
{
SEG startToEnd( aStart, aEnd );
int distanceToMid = startToEnd.Distance( aMid );
if( distanceToMid <= 1 )
{
// Not an arc but essentially a straight line with a small error
TransformOvalToPolygon( aCornerBuffer, aStart, aEnd, aWidth + distanceToMid, aError,
aErrorLoc );
return;
}
SHAPE_ARC arc( aStart, aMid, aEnd, aWidth );
// Currentlye have currently 2 algos:
// the first approximates the thick arc from its outlines
+1 -1
View File
@@ -1518,7 +1518,7 @@ bool SHAPE_POLY_SET::Collide( const SHAPE* aShape, int aClearance, int* aActual,
return false;
}
const_cast<SHAPE_POLY_SET*>( this )->CacheTriangulation( true );
const_cast<SHAPE_POLY_SET*>( this )->CacheTriangulation( false );
int actual = INT_MAX;
VECTOR2I location;
+3
View File
@@ -204,6 +204,9 @@ int PL_EDIT_TOOL::Main( const TOOL_EVENT& aEvent )
//
else if( evt->IsCancelInteractive() || evt->IsActivate() )
{
if( evt->IsCancelInteractive() )
m_frame->GetInfoBar()->Dismiss();
if( m_moveInProgress )
{
if( evt->IsActivate() )
+2 -1
View File
@@ -1,7 +1,7 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2020 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2020-2022 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
@@ -160,6 +160,7 @@ void DIALOG_FOOTPRINT_CHECKER::runChecks()
void DIALOG_FOOTPRINT_CHECKER::SetMarkersProvider( RC_ITEMS_PROVIDER* aProvider )
{
m_markersProvider = aProvider;
m_markersTreeModel->SetProvider( aProvider );
updateDisplayedCounts();
}
+31 -2
View File
@@ -310,11 +310,37 @@ public:
*/
bool QueryColliding( EDA_RECT aBox, SHAPE* aRefShape, PCB_LAYER_ID aLayer ) const
{
SHAPE_POLY_SET* poly = dynamic_cast<SHAPE_POLY_SET*>( aRefShape );
int min[2] = { aBox.GetX(), aBox.GetY() };
int max[2] = { aBox.GetRight(), aBox.GetBottom() };
bool collision = false;
auto visit =
// Special case the polygon case. Otherwise we'll call its Collide() method which will
// triangulate it as well and then do triangle/triangle collisions. This ends up being
// slower than 4 calls to PointInside().
auto polyVisitor =
[&]( ITEM_WITH_SHAPE* aItem ) -> bool
{
SHAPE* shape = aItem->shape;
wxASSERT( dynamic_cast<SHAPE_POLY_SET::TRIANGULATED_POLYGON::TRI*>( shape ) );
auto tri = static_cast<SHAPE_POLY_SET::TRIANGULATED_POLYGON::TRI*>( shape );
const SHAPE_LINE_CHAIN& outline = poly->Outline( 0 );
if( outline.PointInside( tri->GetPoint( 0 ) )
|| outline.PointInside( tri->GetPoint( 1 ) )
|| outline.PointInside( tri->GetPoint( 2 ) )
|| tri->PointInside( outline.CPoint( 0 ) ) )
{
collision = true;
return false;
}
return true;
};
auto visitor =
[&]( ITEM_WITH_SHAPE* aItem ) -> bool
{
if( aRefShape->Collide( aItem->shape, 0 ) )
@@ -326,7 +352,10 @@ public:
return true;
};
this->m_tree[aLayer]->Search( min, max, visit );
if( poly && poly->OutlineCount() == 1 )
this->m_tree[aLayer]->Search( min, max, polyVisitor );
else
this->m_tree[aLayer]->Search( min, max, visitor );
return collision;
}
+3 -2
View File
@@ -440,9 +440,10 @@ bool calcIsInsideArea( BOARD_ITEM* aItem, const EDA_RECT& aItemBBox, PCB_EXPR_CO
ZONE* aArea )
{
BOARD* board = aArea->GetBoard();
EDA_RECT areaBBox = aArea->GetBoundingBox();
std::shared_ptr<SHAPE> shape;
if( !aArea->GetBoundingBox().Intersects( aItemBBox ) )
if( !areaBBox.Intersects( aItemBBox ) )
return false;
// Collisions include touching, so we need to deflate outline by enough to exclude it.
@@ -546,7 +547,7 @@ bool calcIsInsideArea( BOARD_ITEM* aItem, const EDA_RECT& aItemBBox, PCB_EXPR_CO
{
if( aCtx->GetLayer() == layer || aCtx->GetLayer() == UNDEFINED_LAYER )
{
if( zoneRTree->QueryColliding( aItemBBox, &areaOutline, layer ) )
if( zoneRTree->QueryColliding( areaBBox, &areaOutline, layer ) )
return true;
}
}
+6
View File
@@ -2087,6 +2087,7 @@ bool PCB_SELECTION_TOOL::Selectable( const BOARD_ITEM* aItem, bool checkVisibili
const ZONE* zone = nullptr;
const PCB_VIA* via = nullptr;
const PAD* pad = nullptr;
const FP_TEXT* text = nullptr;
switch( aItem->Type() )
{
@@ -2145,6 +2146,11 @@ bool PCB_SELECTION_TOOL::Selectable( const BOARD_ITEM* aItem, bool checkVisibili
case PCB_FP_TEXT_T:
if( m_isFootprintEditor )
{
text = static_cast<const FP_TEXT*>( aItem );
if( !text->IsVisible() && !view()->IsLayerVisible( LAYER_MOD_TEXT_INVISIBLE ) )
return false;
if( !view()->IsLayerVisible( aItem->GetLayer() ) )
return false;
}
+2
View File
@@ -1090,6 +1090,8 @@ void ZONE::CacheTriangulation( PCB_LAYER_ID aLayer )
{
for( std::pair<const PCB_LAYER_ID, SHAPE_POLY_SET>& pair : m_FilledPolysList )
pair.second.CacheTriangulation();
m_Poly->CacheTriangulation( false );
}
else
{