ADDED: Interactive meander objects for length tuning.

This commit is contained in:
Alex Shvartzkop 2023-10-07 06:54:14 +03:00 committed by dsa-t
parent 455268f45e
commit a4832dd3c8
9 changed files with 1190 additions and 3 deletions

View File

@ -231,6 +231,7 @@ set( PCBNEW_MICROWAVE_SRCS
)
set( PCBNEW_GENERATORS_SRCS
generators/pcb_generator_meanders.cpp
)
set( PCBNEW_DRC_SRCS

File diff suppressed because it is too large Load Diff

View File

@ -312,6 +312,9 @@ void PCB_EDIT_FRAME::doReCreateMenuBar()
placeMenu->Add( PCB_ACTIONS::placeText );
placeMenu->Add( PCB_ACTIONS::drawTextBox );
placeMenu->AppendSeparator();
placeMenu->Add( PCB_ACTIONS::placeMeanders );
placeMenu->AppendSeparator();
placeMenu->Add( PCB_ACTIONS::drawAlignedDimension );
placeMenu->Add( PCB_ACTIONS::drawOrthogonalDimension );

View File

@ -957,6 +957,7 @@ void PCB_EDIT_FRAME::setupUIConditions()
CURRENT_EDIT_TOOL( PCB_ACTIONS::placeImage );
CURRENT_EDIT_TOOL( PCB_ACTIONS::placeText );
CURRENT_EDIT_TOOL( PCB_ACTIONS::drawTextBox );
CURRENT_EDIT_TOOL( PCB_ACTIONS::placeMeanders );
CURRENT_EDIT_TOOL( PCB_ACTIONS::drawAlignedDimension );
CURRENT_EDIT_TOOL( PCB_ACTIONS::drawOrthogonalDimension );
CURRENT_EDIT_TOOL( PCB_ACTIONS::drawCenterDimension );

View File

@ -52,6 +52,14 @@ enum MEANDER_STYLE {
MEANDER_STYLE_CHAMFER // chamfered (45 degree segment)
};
///< Initial side the meander is placed on.
enum MEANDER_SIDE
{
MEANDER_SIDE_LEFT = -1,
MEANDER_SIDE_DEFAULT = 0,
MEANDER_SIDE_RIGHT = 1
};
/**
* Dimensions for the meandering algorithm.
*/
@ -71,7 +79,7 @@ public:
m_cornerStyle = MEANDER_STYLE_ROUND;
m_cornerRadiusPercentage = 100;
m_singleSided = false;
m_segmentSide = 0;
m_segmentSide = MEANDER_SIDE_DEFAULT;
m_lengthTolerance = 100000;
}
@ -102,8 +110,8 @@ public:
///< Place meanders on one side.
bool m_singleSided;
///< Force initial side at segment (0: based on cursor, 1: right side, -1: left side)
int m_segmentSide;
///< Initial side when placing meanders at segment
MEANDER_SIDE m_segmentSide;
///< Allowable tuning error.
int m_lengthTolerance;

View File

@ -3387,6 +3387,7 @@ void DRAWING_TOOL::setTransitions()
Go( &DRAWING_TOOL::DrawVia, PCB_ACTIONS::drawVia.MakeEvent() );
Go( &DRAWING_TOOL::PlaceImage, PCB_ACTIONS::placeImage.MakeEvent() );
Go( &DRAWING_TOOL::PlaceText, PCB_ACTIONS::placeText.MakeEvent() );
Go( &DRAWING_TOOL::PlaceMeander, PCB_ACTIONS::placeMeanders.MakeEvent() );
Go( &DRAWING_TOOL::DrawRectangle, PCB_ACTIONS::drawTextBox.MakeEvent() );
Go( &DRAWING_TOOL::PlaceImportedGraphics, PCB_ACTIONS::placeImportedGraphics.MakeEvent() );
Go( &DRAWING_TOOL::SetAnchor, PCB_ACTIONS::setAnchor.MakeEvent() );

View File

@ -103,6 +103,10 @@ public:
*/
int PlaceStackup( const TOOL_EVENT& aEvent );
/**
*/
int PlaceMeander( const TOOL_EVENT& aEvent );
/**
* Start interactively drawing a line.
*

View File

@ -186,6 +186,14 @@ TOOL_ACTION PCB_ACTIONS::drawTextBox( TOOL_ACTION_ARGS()
.Icon( BITMAPS::add_textbox )
.Flags( AF_ACTIVATE ) );
TOOL_ACTION PCB_ACTIONS::placeMeanders( TOOL_ACTION_ARGS()
.Name( "pcbnew.InteractiveDrawing.placeMeanders" )
.Scope( AS_GLOBAL )
.MenuText( _( "Add Meanders" ) )
.Tooltip( _( "Add meanders for length tuning" ) )
.Icon( BITMAPS::ps_tune_length )
.Flags( AF_ACTIVATE ) );
TOOL_ACTION PCB_ACTIONS::drawAlignedDimension( TOOL_ACTION_ARGS()
.Name( "pcbnew.InteractiveDrawing.alignedDimension" )
.Scope( AS_GLOBAL )

View File

@ -198,6 +198,7 @@ public:
static TOOL_ACTION placeImage;
static TOOL_ACTION placeText;
static TOOL_ACTION drawTextBox;
static TOOL_ACTION placeMeanders;
static TOOL_ACTION drawAlignedDimension;
static TOOL_ACTION drawCenterDimension;
static TOOL_ACTION drawRadialDimension;