Commit f068c0d9 authored by jean-pierre charras's avatar jean-pierre charras

Pcbnew: Autoplace functions: renamed spread footprint functions. Rewritten.

Now footprints, after loaded by reading a netlist are grouped by sheets by the footprints spread function, and the grouping is better.
Rename 2 files. Fix minor issues. Clean code
parent 251f0c7f
...@@ -228,8 +228,6 @@ void EDA_3D_CANVAS::SetView3D( int keycode ) ...@@ -228,8 +228,6 @@ void EDA_3D_CANVAS::SetView3D( int keycode )
void EDA_3D_CANVAS::OnMouseWheel( wxMouseEvent& event ) void EDA_3D_CANVAS::OnMouseWheel( wxMouseEvent& event )
{ {
wxSize size( GetClientSize() );
if( event.ShiftDown() ) if( event.ShiftDown() )
{ {
if( event.GetWheelRotation() < 0 ) if( event.GetWheelRotation() < 0 )
......
...@@ -906,11 +906,22 @@ void EDA_DRAW_PANEL::OnMouseWheel( wxMouseEvent& event ) ...@@ -906,11 +906,22 @@ void EDA_DRAW_PANEL::OnMouseWheel( wxMouseEvent& event )
bool offCenterReq = event.ControlDown() && event.ShiftDown(); bool offCenterReq = event.ControlDown() && event.ShiftDown();
offCenterReq = offCenterReq || m_enableZoomNoCenter; offCenterReq = offCenterReq || m_enableZoomNoCenter;
#if wxMAJOR_VERSION >= 2 && wxMINOR_VERSION >= 9
int axis = event.GetWheelAxis();
#else
const int axis = 0;
#endif
// This is a zoom in or out command // This is a zoom in or out command
if( event.GetWheelRotation() > 0 ) if( event.GetWheelRotation() > 0 )
{ {
if( event.ShiftDown() && !event.ControlDown() ) if( event.ShiftDown() && !event.ControlDown() )
{
if( axis == 0 )
cmd.SetId( ID_PAN_UP ); cmd.SetId( ID_PAN_UP );
else
cmd.SetId( ID_PAN_RIGHT );
}
else if( event.ControlDown() && !event.ShiftDown() ) else if( event.ControlDown() && !event.ShiftDown() )
cmd.SetId( ID_PAN_LEFT ); cmd.SetId( ID_PAN_LEFT );
else if( offCenterReq ) else if( offCenterReq )
...@@ -921,7 +932,12 @@ void EDA_DRAW_PANEL::OnMouseWheel( wxMouseEvent& event ) ...@@ -921,7 +932,12 @@ void EDA_DRAW_PANEL::OnMouseWheel( wxMouseEvent& event )
else if( event.GetWheelRotation() < 0 ) else if( event.GetWheelRotation() < 0 )
{ {
if( event.ShiftDown() && !event.ControlDown() ) if( event.ShiftDown() && !event.ControlDown() )
{
if( axis == 0 )
cmd.SetId( ID_PAN_DOWN ); cmd.SetId( ID_PAN_DOWN );
else
cmd.SetId( ID_PAN_LEFT );
}
else if( event.ControlDown() && !event.ShiftDown() ) else if( event.ControlDown() && !event.ShiftDown() )
cmd.SetId( ID_PAN_RIGHT ); cmd.SetId( ID_PAN_RIGHT );
else if( offCenterReq ) else if( offCenterReq )
......
...@@ -1494,7 +1494,7 @@ public: ...@@ -1494,7 +1494,7 @@ public:
// Autoplacement: // Autoplacement:
void AutoPlace( wxCommandEvent& event ); void OnPlaceOrRouteFootprints( wxCommandEvent& event );
/** /**
* Function ScriptingConsoleEnableDisable * Function ScriptingConsoleEnableDisable
...@@ -1520,7 +1520,17 @@ public: ...@@ -1520,7 +1520,17 @@ public:
*/ */
bool ReOrientModules( const wxString& ModuleMask, double Orient, bool include_fixe ); bool ReOrientModules( const wxString& ModuleMask, double Orient, bool include_fixe );
void LockModule( MODULE* aModule, bool aLocked ); void LockModule( MODULE* aModule, bool aLocked );
void AutoMoveModulesOnPcb( bool PlaceModulesHorsPcb );
/**
* Function SpreadFootprints
* Footprints (after loaded by reading a netlist for instance) are moved
* to be in a small free area (outside the current board) without overlapping.
* @param aFootprintsOutsideBoardOnly: true to move only
* footprints outside the board outlines
* (they are outside if the position of a footprint is outside
* the board outlines bounding box
*/
void SpreadFootprints( bool aFootprintsOutsideBoardOnly );
/** /**
* Function AutoPlaceModule * Function AutoPlaceModule
......
...@@ -124,12 +124,14 @@ set( PCBNEW_IMPORT_DXF ...@@ -124,12 +124,14 @@ set( PCBNEW_IMPORT_DXF
) )
set( PCBNEW_AUTOROUTER_SRCS set( PCBNEW_AUTOROUTER_SRCS
autorouter/automove.cpp autorouter/rect_placement/rect_placement.cpp
autorouter/autoplac.cpp autorouter/move_and_route_event_functions.cpp
autorouter/auto_place_footprints.cpp
autorouter/autorout.cpp autorouter/autorout.cpp
autorouter/routing_matrix.cpp autorouter/routing_matrix.cpp
autorouter/dist.cpp autorouter/dist.cpp
autorouter/queue.cpp autorouter/queue.cpp
autorouter/spread_footprints.cpp
autorouter/solve.cpp autorouter/solve.cpp
autorouter/graphpcb.cpp autorouter/graphpcb.cpp
autorouter/work.cpp autorouter/work.cpp
......
...@@ -1085,7 +1085,7 @@ static bool Tri_PlaceModules( MODULE* ref, MODULE* compare ) ...@@ -1085,7 +1085,7 @@ static bool Tri_PlaceModules( MODULE* ref, MODULE* compare )
} }
static bool Tri_RatsModules( MODULE* ref, MODULE* compare ) static bool sortFootprintsByRatsnestSize( MODULE* ref, MODULE* compare )
{ {
double ff1, ff2; double ff1, ff2;
...@@ -1141,7 +1141,7 @@ static MODULE* PickModule( PCB_EDIT_FRAME* pcbframe, wxDC* DC ) ...@@ -1141,7 +1141,7 @@ static MODULE* PickModule( PCB_EDIT_FRAME* pcbframe, wxDC* DC )
pcbframe->GetBoard()->m_Status_Pcb &= ~RATSNEST_ITEM_LOCAL_OK; pcbframe->GetBoard()->m_Status_Pcb &= ~RATSNEST_ITEM_LOCAL_OK;
sort( moduleList.begin(), moduleList.end(), Tri_RatsModules ); sort( moduleList.begin(), moduleList.end(), sortFootprintsByRatsnestSize );
// Search for "best" module. // Search for "best" module.
MODULE* bestModule = NULL; MODULE* bestModule = NULL;
......
...@@ -55,15 +55,13 @@ typedef enum { ...@@ -55,15 +55,13 @@ typedef enum {
} SelectFixeFct; } SelectFixeFct;
static bool sortModulesbySize( MODULE* ref, MODULE* compare );
wxString ModulesMaskSelection = wxT( "*" ); wxString ModulesMaskSelection = wxT( "*" );
/* Called on events (popup menus) relative to automove and autoplace footprints /* Called on events (popup menus) relative to automove and autoplace footprints
*/ */
void PCB_EDIT_FRAME::AutoPlace( wxCommandEvent& event ) void PCB_EDIT_FRAME::OnPlaceOrRouteFootprints( wxCommandEvent& event )
{ {
int id = event.GetId(); int id = event.GetId();
...@@ -130,12 +128,19 @@ void PCB_EDIT_FRAME::AutoPlace( wxCommandEvent& event ) ...@@ -130,12 +128,19 @@ void PCB_EDIT_FRAME::AutoPlace( wxCommandEvent& event )
AutoPlaceModule( NULL, PLACE_INCREMENTAL, &dc ); AutoPlaceModule( NULL, PLACE_INCREMENTAL, &dc );
break; break;
case ID_POPUP_PCB_AUTOMOVE_ALL_MODULES: case ID_POPUP_PCB_SPREAD_ALL_MODULES:
AutoMoveModulesOnPcb( false ); if( !IsOK( this,
_("Not locked footprints inside the board will be moved. OK?") ) )
break; break;
// Fall through
case ID_POPUP_PCB_SPREAD_NEW_MODULES:
if( GetBoard()->m_Modules == NULL )
{
DisplayError( this, _( "No modules found!" ) );
return;
}
case ID_POPUP_PCB_AUTOMOVE_NEW_MODULES: SpreadFootprints( id == ID_POPUP_PCB_SPREAD_NEW_MODULES );
AutoMoveModulesOnPcb( true );
break; break;
case ID_POPUP_PCB_AUTOROUTE_ALL_MODULES: case ID_POPUP_PCB_AUTOROUTE_ALL_MODULES:
...@@ -159,7 +164,7 @@ void PCB_EDIT_FRAME::AutoPlace( wxCommandEvent& event ) ...@@ -159,7 +164,7 @@ void PCB_EDIT_FRAME::AutoPlace( wxCommandEvent& event )
break; break;
default: default:
wxMessageBox( wxT( "AutoPlace command error" ) ); wxMessageBox( wxT( "OnPlaceOrRouteFootprints command error" ) );
break; break;
} }
...@@ -168,135 +173,6 @@ void PCB_EDIT_FRAME::AutoPlace( wxCommandEvent& event ) ...@@ -168,135 +173,6 @@ void PCB_EDIT_FRAME::AutoPlace( wxCommandEvent& event )
} }
/* Function to move components in a rectangular area format 4 / 3,
* starting from the mouse cursor
* The components with the FIXED status set are not moved
*/
void PCB_EDIT_FRAME::AutoMoveModulesOnPcb( bool PlaceModulesHorsPcb )
{
std::vector <MODULE*> moduleList;
wxPoint start, current;
int Ymax_size, Xsize_allowed;
int pas_grille = (int) GetScreen()->GetGridSize().x;
double surface;
// Undo: init list
PICKED_ITEMS_LIST newList;
newList.m_Status = UR_CHANGED;
ITEM_PICKER picker( NULL, UR_CHANGED );
if( GetBoard()->m_Modules == NULL )
{
DisplayError( this, _( "No modules found!" ) );
return;
}
// Confirmation
if( !IsOK( this, _( "Move modules?" ) ) )
return;
EDA_RECT bbbox = GetBoard()->ComputeBoundingBox( true );
bool edgesExist = ( bbbox.GetWidth() || bbbox.GetHeight() );
// no edges exist
if( PlaceModulesHorsPcb && !edgesExist )
{
DisplayError( this,
_( "Could not automatically place modules. No board outlines detected." ) );
return;
}
// Build sorted footprints list (sort by decreasing size )
MODULE* Module = GetBoard()->m_Modules;
for( ; Module != NULL; Module = Module->Next() )
{
Module->CalculateBoundingBox();
moduleList.push_back(Module);
}
sort( moduleList.begin(), moduleList.end(), sortModulesbySize );
/* to move modules outside the board, the cursor is placed below
* the current board, to avoid placing components in board area.
*/
if( PlaceModulesHorsPcb && edgesExist )
{
if( GetCrossHairPosition().y < (bbbox.GetBottom() + 2000) )
{
wxPoint pos = GetCrossHairPosition();
pos.y = bbbox.GetBottom() + 2000;
SetCrossHairPosition( pos );
}
}
// calculate the area needed by footprints
surface = 0.0;
for( unsigned ii = 0; ii < moduleList.size(); ii++ )
{
Module = moduleList[ii];
if( PlaceModulesHorsPcb && edgesExist )
{
if( bbbox.Contains( Module->GetPosition() ) )
continue;
}
surface += Module->GetArea();
}
Xsize_allowed = (int) ( sqrt( surface ) * 4.0 / 3.0 );
start = current = GetCrossHairPosition();
Ymax_size = 0;
for( unsigned ii = 0; ii < moduleList.size(); ii++ )
{
Module = moduleList[ii];
if( Module->IsLocked() )
continue;
if( PlaceModulesHorsPcb && edgesExist )
{
if( bbbox.Contains( Module->GetPosition() ) )
continue;
}
// Undo: add copy of old Module to undo
picker.SetItem( Module );
picker.SetLink( Module->Clone() );
if( current.x > (Xsize_allowed + start.x) )
{
current.x = start.x;
current.y += Ymax_size + pas_grille;
Ymax_size = 0;
}
SetCrossHairPosition( current + Module->GetPosition() -
Module->GetBoundingBox().GetPosition() );
Ymax_size = std::max( Ymax_size, Module->GetBoundingBox().GetHeight() );
PlaceModule( Module, NULL, true );
// Undo: add new Module to undo
newList.PushItem( picker );
current.x += Module->GetBoundingBox().GetWidth() + pas_grille;
}
// Undo: commit
if( newList.GetCount() )
SaveCopyInUndoList( newList, UR_CHANGED );
m_canvas->Refresh();
}
/* Set or reset (true or false) Lock attribute of aModule or all modules if aModule == NULL /* Set or reset (true or false) Lock attribute of aModule or all modules if aModule == NULL
*/ */
void PCB_EDIT_FRAME::LockModule( MODULE* aModule, bool aLocked ) void PCB_EDIT_FRAME::LockModule( MODULE* aModule, bool aLocked )
...@@ -322,8 +198,3 @@ void PCB_EDIT_FRAME::LockModule( MODULE* aModule, bool aLocked ) ...@@ -322,8 +198,3 @@ void PCB_EDIT_FRAME::LockModule( MODULE* aModule, bool aLocked )
} }
} }
static bool sortModulesbySize( MODULE* ref, MODULE* compare )
{
return compare->GetArea() < ref->GetArea();
}
A class that fits subrectangles into a power-of-2 rectangle
(C) Copyright 2000-2002 by Javier Arevalo
This code is free to use and modify for all purposes
You have a bunch of rectangular pieces. You need to arrange them in a
rectangular surface so that they don't overlap, keeping the total area of the
rectangle as small as possible. This is fairly common when arranging characters
in a bitmapped font, lightmaps for a 3D engine, and I guess other situations as
well.
The idea of this algorithm is that, as we add rectangles, we can pre-select
"interesting" places where we can try to add the next rectangles. For optimal
results, the rectangles should be added in order. I initially tried using area
as a sorting criteria, but it didn't work well with very tall or very flat
rectangles. I then tried using the longest dimension as a selector, and it
worked much better. So much for intuition...
These "interesting" places are just to the right and just below the currently
added rectangle. The first rectangle, obviously, goes at the top left, the next
one would go either to the right or below this one, and so on. It is a weird way
to do it, but it seems to work very nicely.
The way we search here is fairly brute-force, the fact being that for most off-
line purposes the performance seems more than adequate. I have generated a
japanese font with around 8500 characters and all the time was spent generating
the bitmaps.
Also, for all we care, we could grow the parent rectangle in a different way
than power of two. It just happens that power of 2 is very convenient for
graphics hardware textures.
I'd be interested in hearing of other approaches to this problem. Make sure
to post them on http://www.flipcode.com
See also
http://www.flipcode.com/archives/Rectangle_Placement.shtml
http://kossovsky.net/index.php/2009/07/cshar-rectangle-packing
// ----------------------------------------------------------------------------------------
// Name : rect_placement.cpp
// Description : A class that fits subrectangles into a power-of-2 rectangle
// (C) Copyright 2000-2002 by Javier Arevalo
// This code is free to use and modify for all purposes
// ----------------------------------------------------------------------------------------
/*
* You have a bunch of rectangular pieces. You need to arrange them in a
* rectangular surface so that they don't overlap, keeping the total area of the
* rectangle as small as possible. This is fairly common when arranging characters
* in a bitmapped font, lightmaps for a 3D engine, and I guess other situations as
* well.
*
* The idea of this algorithm is that, as we add rectangles, we can pre-select
* "interesting" places where we can try to add the next rectangles. For optimal
* results, the rectangles should be added in order. I initially tried using area
* as a sorting criteria, but it didn't work well with very tall or very flat
* rectangles. I then tried using the longest dimension as a selector, and it
* worked much better. So much for intuition...
*
* These "interesting" places are just to the right and just below the currently
* added rectangle. The first rectangle, obviously, goes at the top left, the next
* one would go either to the right or below this one, and so on. It is a weird way
* to do it, but it seems to work very nicely.
*
* The way we search here is fairly brute-force, the fact being that for most off-
* line purposes the performance seems more than adequate. I have generated a
* japanese font with around 8500 characters and all the time was spent generating
* the bitmaps.
*
* Also, for all we care, we could grow the parent rectangle.
*
* I'd be interested in hearing of other approaches to this problem. Make sure
* to post them on http://www.flipcode.com
*/
#include "rect_placement.h"
// --------------------------------------------------------------------------------
// Name :
// Description :
// --------------------------------------------------------------------------------
void CRectPlacement::Init( int w, int h )
{
End();
m_size = TRect( 0, 0, w, h );
m_vPositions.push_back( TPos( 0, 0 ) );
m_area = 0;
}
// --------------------------------------------------------------------------------
// Name :
// Description :
// --------------------------------------------------------------------------------
void CRectPlacement::End()
{
m_vPositions.clear();
m_vRects.clear();
m_size.w = 0;
}
// --------------------------------------------------------------------------------
// Name : IsFree
// Description : Check if the given rectangle is partially or totally used
// --------------------------------------------------------------------------------
bool CRectPlacement::IsFree( const TRect& r ) const
{
if( !m_size.Contains( r ) )
return false;
for( CRectArray::const_iterator it = m_vRects.begin();
it != m_vRects.end(); ++it )
{
if( it->Intersects( r ) )
return false;
}
return true;
}
// --------------------------------------------------------------------------------
// Name : AddPosition
// Description : Add new anchor point
// --------------------------------------------------------------------------------
void CRectPlacement::AddPosition( const TPos& p )
{
// Try to insert anchor as close as possible to the top left corner
// So it will be tried first
bool bFound = false;
CPosArray::iterator it;
for( it = m_vPositions.begin();
!bFound && it != m_vPositions.end();
++it )
{
if( p.x + p.y < it->x + it->y )
bFound = true;
}
if( bFound )
m_vPositions.insert( it, p );
else
m_vPositions.push_back( p );
}
// --------------------------------------------------------------------------------
// Name : AddRect
// Description : Add the given rect and updates anchor points
// --------------------------------------------------------------------------------
void CRectPlacement::AddRect( const TRect& r )
{
m_vRects.push_back( r );
m_area += r.w * r.h;
// Add two new anchor points
AddPosition( TPos( r.x, r.y + r.h ) );
AddPosition( TPos( r.x + r.w, r.y ) );
}
// --------------------------------------------------------------------------------
// Name : AddAtEmptySpot
// Description : Add the given rectangle
// --------------------------------------------------------------------------------
bool CRectPlacement::AddAtEmptySpot( TRect& r )
{
// Find a valid spot among available anchors.
bool bFound = false;
CPosArray::iterator it;
for( it = m_vPositions.begin();
!bFound && it != m_vPositions.end();
++it )
{
TRect Rect( it->x, it->y, r.w, r.h );
if( IsFree( Rect ) )
{
r = Rect;
bFound = true;
break; // Don't let the loop increase the iterator.
}
}
if( bFound )
{
int x, y;
// Remove the used anchor point
m_vPositions.erase( it );
// Sometimes, anchors end up displaced from the optimal position
// due to irregular sizes of the subrects.
// So, try to adjut it up & left as much as possible.
for( x = 1; x <= r.x; x++ )
{
if( !IsFree( TRect( r.x - x, r.y, r.w, r.h ) ) )
break;
}
for( y = 1; y <= r.y; y++ )
{
if( !IsFree( TRect( r.x, r.y - y, r.w, r.h ) ) )
break;
}
if( y > x )
r.y -= y - 1;
else
r.x -= x - 1;
AddRect( r );
}
return bFound;
}
#include <stdio.h>
// --------------------------------------------------------------------------------
// Name : AddAtEmptySpotAutoGrow
// Description : Add a rectangle of the given size, growing our area if needed
// Area grows only until the max given.
// Returns the placement of the rect in the rect's x,y coords
// --------------------------------------------------------------------------------
bool CRectPlacement::AddAtEmptySpotAutoGrow( TRect* pRect, int maxW, int maxH )
{
double growing_factor = 1.2; // Must be > 1.0, and event > 1.1 for fast optimization
#define GROW(x) ((x * growing_factor) + 1)
if( pRect->w <= 0 )
return true;
int orgW = m_size.w;
int orgH = m_size.h;
// Try to add it in the existing space
while( !AddAtEmptySpot( *pRect ) )
{
int pw = m_size.w;
int ph = m_size.h;
// Sanity check - if area is complete.
if( pw >= maxW && ph >= maxH )
{
m_size.w = orgW;
m_size.h = orgH;
return false;
}
// Try growing the smallest dim
if( pw < maxW && ( pw < ph || ( (pw == ph) && (pRect->w >= pRect->h) ) ) )
m_size.w = GROW( pw );
else
m_size.h = GROW( ph );
if( AddAtEmptySpot( *pRect ) )
break;
// Try growing the other dim instead
if( pw != m_size.w )
{
m_size.w = pw;
if( ph < maxW )
m_size.h = GROW( ph );
}
else
{
m_size.h = ph;
if( pw < maxW )
m_size.w = GROW( pw );
}
if( pw != m_size.w || ph != m_size.h )
if( AddAtEmptySpot( *pRect ) )
break;
// Grow both if possible, and reloop.
m_size.w = pw;
m_size.h = ph;
if( pw < maxW )
m_size.w = GROW( pw );
if( ph < maxH )
m_size.h = GROW( ph );
}
return true;
}
// --------------------------------------------------------------------------------
// Name : rect_placement.h
// Description : A class that allocates subrectangles into power-of-2 rectangles
// (C) Copyright 2000-2002 by Javier Arevalo
// This code is free to use and modify for all purposes
// --------------------------------------------------------------------------------
/**
* @file rect_placement.h
*/
#ifndef _RECT_PLACEMENT_H_
#define _RECT_PLACEMENT_H_
#include <vector>
// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
class CRectPlacement
{
public:
// Helper classes
struct TPos
{
int x, y;
TPos() { }
TPos( int _x, int _y ) : x( _x ), y( _y ) { }
bool operator ==( const TPos& p ) const { return x == p.x && y == p.y; }
};
struct TRect : public TPos
{
int w, h;
TRect() { }
TRect( int _x, int _y, int _w, int _h ) : TPos( _x, _y ), w( _w > 0 ? _w : 0 ), h(
_h > 0 ? _h : 0 ) { }
bool Contains( const TPos& p ) const
{
return p.x >= x && p.y >= y && p.x < (x + w) && p.y < (y + h);
}
bool Contains( const TRect& r ) const
{
return r.x >= x && r.y >= y &&
(r.x + r.w) <= (x + w) && (r.y + r.h) <= (y + h);
}
bool Intersects( const TRect& r ) const
{
return w > 0 && h > 0 && r.w > 0 && r.h > 0
&& ( (r.x + r.w) > x && r.x < (x + w) && (r.y + r.h) > y && r.y < (y + h) );
}
// static bool Greater(const TRect &a, const TRect &b)
// { return a.w*a.h > b.w*b.h; }
// Greater rect area. Not as good as the next heuristic:
// Greater size in at least one dim.
static bool Greater( const TRect& a, const TRect& b )
{
return (a.w > b.w && a.w > b.h) || (a.h > b.w && a.h > b.h);
}
};
// ---------------------
typedef std::vector<TPos> CPosArray;
typedef std::vector<TRect> CRectArray;
// ---------------------
CRectPlacement() { Init(); }
~CRectPlacement() { End(); }
void Init( int w = 1, int h = 1 );
void End();
bool IsOk() const { return m_size.w > 0; }
int GetW() const { return m_size.w; }
int GetH() const { return m_size.h; }
double GetArea() const { return m_area; }
double GetTotalArea() const { return (double)m_size.w * m_size.h; }
bool AddAtEmptySpotAutoGrow( TRect* pRect, int maxW, int maxH );
private:
TRect m_size;
CRectArray m_vRects;
CPosArray m_vPositions;
double m_area;
// ---------------------
bool IsFree( const TRect& r ) const;
void AddPosition( const TPos& p );
void AddRect( const TRect& r );
bool AddAtEmptySpot( TRect& r );
};
#endif // _RECT_PLACEMENT_H_
...@@ -324,7 +324,6 @@ int PCB_EDIT_FRAME::Solve( wxDC* DC, int aLayersCount ) ...@@ -324,7 +324,6 @@ int PCB_EDIT_FRAME::Solve( wxDC* DC, int aLayersCount )
AppendMsgPanel( wxT( "Activity" ), msg, BROWN ); AppendMsgPanel( wxT( "Activity" ), msg, BROWN );
} }
pt_cur_ch = pt_cur_ch;
segm_oX = GetBoard()->GetBoundingBox().GetX() + (RoutingMatrix.m_GridRouting * col_source); segm_oX = GetBoard()->GetBoundingBox().GetX() + (RoutingMatrix.m_GridRouting * col_source);
segm_oY = GetBoard()->GetBoundingBox().GetY() + (RoutingMatrix.m_GridRouting * row_source); segm_oY = GetBoard()->GetBoundingBox().GetY() + (RoutingMatrix.m_GridRouting * row_source);
segm_fX = GetBoard()->GetBoundingBox().GetX() + (RoutingMatrix.m_GridRouting * col_target); segm_fX = GetBoard()->GetBoundingBox().GetX() + (RoutingMatrix.m_GridRouting * col_target);
......
This diff is collapsed.
...@@ -386,25 +386,26 @@ bool PCB_EDIT_FRAME::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu ) ...@@ -386,25 +386,26 @@ bool PCB_EDIT_FRAME::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
{ {
wxMenu* commands = new wxMenu; wxMenu* commands = new wxMenu;
AddMenuItem( aPopMenu, commands, ID_POPUP_PCB_AUTOPLACE_COMMANDS, AddMenuItem( aPopMenu, commands, ID_POPUP_PCB_AUTOPLACE_COMMANDS,
_( "Global Move and Place" ), KiBitmap( move_xpm ) ); _( "Global Spread and Place" ), KiBitmap( move_xpm ) );
AddMenuItem( commands, ID_POPUP_PCB_AUTOPLACE_FREE_ALL_MODULES, AddMenuItem( commands, ID_POPUP_PCB_AUTOPLACE_FREE_ALL_MODULES,
_( "Unlock All Modules" ), KiBitmap( unlocked_xpm ) ); _( "Unlock All Footprints" ), KiBitmap( unlocked_xpm ) );
AddMenuItem( commands, ID_POPUP_PCB_AUTOPLACE_FIXE_ALL_MODULES, AddMenuItem( commands, ID_POPUP_PCB_AUTOPLACE_FIXE_ALL_MODULES,
_( "Lock All Modules" ), KiBitmap( locked_xpm ) ); _( "Lock All Footprints" ), KiBitmap( locked_xpm ) );
commands->AppendSeparator(); commands->AppendSeparator();
AddMenuItem( commands, ID_POPUP_PCB_AUTOMOVE_ALL_MODULES, AddMenuItem( commands, ID_POPUP_PCB_SPREAD_ALL_MODULES,
_( "Move All Modules" ), KiBitmap( move_xpm ) ); _( "Spread out All Footprints" ), KiBitmap( move_xpm ) );
commands->Append( ID_POPUP_PCB_AUTOMOVE_NEW_MODULES, _( "Move New Modules" ) ); commands->Append( ID_POPUP_PCB_SPREAD_NEW_MODULES,
_( "Spread out Footprints not Already on Board" ) );
commands->AppendSeparator(); commands->AppendSeparator();
commands->Append( ID_POPUP_PCB_AUTOPLACE_ALL_MODULES, commands->Append( ID_POPUP_PCB_AUTOPLACE_ALL_MODULES,
_( "Automatically Place All Modules" ) ); _( "Automatically Place All Footprints" ) );
commands->Append( ID_POPUP_PCB_AUTOPLACE_NEW_MODULES, commands->Append( ID_POPUP_PCB_AUTOPLACE_NEW_MODULES,
_( "Automatically Place New Modules" ) ); _( "Automatically Place New Footprints" ) );
commands->Append( ID_POPUP_PCB_AUTOPLACE_NEXT_MODULE, commands->Append( ID_POPUP_PCB_AUTOPLACE_NEXT_MODULE,
_( "Automatically Place Next Module" ) ); _( "Automatically Place Next Footprints" ) );
commands->AppendSeparator(); commands->AppendSeparator();
AddMenuItem( commands, ID_POPUP_PCB_REORIENT_ALL_MODULES, AddMenuItem( commands, ID_POPUP_PCB_REORIENT_ALL_MODULES,
_( "Orient All Modules" ), KiBitmap( rotate_module_pos_xpm ) ); _( "Orient All Footprints" ), KiBitmap( rotate_module_pos_xpm ) );
aPopMenu->AppendSeparator(); aPopMenu->AppendSeparator();
} }
......
/* /*
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 2004-2010 Jean-Pierre Charras, jean-pierre.charras@gpisa-lab.inpg.fr * Copyright (C) 2013 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2010 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com> * Copyright (C) 2013 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@verizon.net> * Copyright (C) 2013 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 2010 KiCad Developers, see change_log.txt for contributors. * Copyright (C) 2013 KiCad Developers, see change_log.txt for contributors.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
...@@ -237,7 +237,7 @@ BEGIN_EVENT_TABLE( PCB_EDIT_FRAME, PCB_BASE_FRAME ) ...@@ -237,7 +237,7 @@ BEGIN_EVENT_TABLE( PCB_EDIT_FRAME, PCB_BASE_FRAME )
PCB_EDIT_FRAME::ProcessMuWaveFunctions ) PCB_EDIT_FRAME::ProcessMuWaveFunctions )
EVT_MENU_RANGE( ID_POPUP_PCB_AUTOPLACE_START_RANGE, ID_POPUP_PCB_AUTOPLACE_END_RANGE, EVT_MENU_RANGE( ID_POPUP_PCB_AUTOPLACE_START_RANGE, ID_POPUP_PCB_AUTOPLACE_END_RANGE,
PCB_EDIT_FRAME::AutoPlace ) PCB_EDIT_FRAME::OnPlaceOrRouteFootprints )
EVT_MENU( ID_POPUP_PCB_REORIENT_ALL_MODULES, PCB_EDIT_FRAME::OnOrientFootprints ) EVT_MENU( ID_POPUP_PCB_REORIENT_ALL_MODULES, PCB_EDIT_FRAME::OnOrientFootprints )
......
...@@ -216,8 +216,8 @@ enum pcbnew_ids ...@@ -216,8 +216,8 @@ enum pcbnew_ids
ID_POPUP_PCB_AUTOPLACE_FREE_ALL_MODULES, ID_POPUP_PCB_AUTOPLACE_FREE_ALL_MODULES,
ID_POPUP_PCB_AUTOPLACE_FIXE_ALL_MODULES, ID_POPUP_PCB_AUTOPLACE_FIXE_ALL_MODULES,
ID_POPUP_PCB_AUTOPLACE_CURRENT_MODULE, ID_POPUP_PCB_AUTOPLACE_CURRENT_MODULE,
ID_POPUP_PCB_AUTOMOVE_ALL_MODULES, ID_POPUP_PCB_SPREAD_ALL_MODULES,
ID_POPUP_PCB_AUTOMOVE_NEW_MODULES, ID_POPUP_PCB_SPREAD_NEW_MODULES,
ID_POPUP_PCB_AUTOPLACE_COMMANDS, ID_POPUP_PCB_AUTOPLACE_COMMANDS,
ID_POPUP_PCB_AUTOPLACE_ALL_MODULES, ID_POPUP_PCB_AUTOPLACE_ALL_MODULES,
ID_POPUP_PCB_AUTOPLACE_NEW_MODULES, ID_POPUP_PCB_AUTOPLACE_NEW_MODULES,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment