Fix most GCC 4.6 compiler warnings and minor bug fix.
* Remove most (not all) variables that were initialized but never used that cause GCC 4.6 to generate a warning. * Fix bug in schematic library editor best zoom calculation.
This commit is contained in:
parent
e42591af51
commit
a367dea4db
|
@ -630,7 +630,6 @@ void Pcb3D_GLCanvas::TakeScreenshot( wxCommandEvent& event )
|
||||||
wxYield();
|
wxYield();
|
||||||
}
|
}
|
||||||
|
|
||||||
wxSize image_size = GetClientSize();
|
|
||||||
struct vieport_params
|
struct vieport_params
|
||||||
{
|
{
|
||||||
GLint originx;
|
GLint originx;
|
||||||
|
|
|
@ -237,7 +237,7 @@ void HPGL_PLOTTER::flash_pad_oval( wxPoint pos, wxSize size, int orient,
|
||||||
GRTraceMode trace_mode )
|
GRTraceMode trace_mode )
|
||||||
{
|
{
|
||||||
wxASSERT( output_file );
|
wxASSERT( output_file );
|
||||||
int rayon, deltaxy, cx, cy;
|
int deltaxy, cx, cy;
|
||||||
|
|
||||||
/* The pad is reduced to an oval with size.y > size.x
|
/* The pad is reduced to an oval with size.y > size.x
|
||||||
* (Oval vertical orientation 0)
|
* (Oval vertical orientation 0)
|
||||||
|
@ -249,7 +249,6 @@ void HPGL_PLOTTER::flash_pad_oval( wxPoint pos, wxSize size, int orient,
|
||||||
orient -= 3600;
|
orient -= 3600;
|
||||||
}
|
}
|
||||||
deltaxy = size.y - size.x; /* distance between centers of the oval */
|
deltaxy = size.y - size.x; /* distance between centers of the oval */
|
||||||
rayon = size.x / 2;
|
|
||||||
|
|
||||||
if( trace_mode == FILLED )
|
if( trace_mode == FILLED )
|
||||||
{
|
{
|
||||||
|
|
|
@ -880,9 +880,6 @@ void EDA_DRAW_PANEL::OnMouseEvent( wxMouseEvent& event )
|
||||||
INSTALL_UNBUFFERED_DC( DC, this );
|
INSTALL_UNBUFFERED_DC( DC, this );
|
||||||
DC.SetBackground( *wxBLACK_BRUSH );
|
DC.SetBackground( *wxBLACK_BRUSH );
|
||||||
|
|
||||||
/* Compute the cursor position in screen (device) units. */
|
|
||||||
wxPoint pos = CalcUnscrolledPosition( event.GetPosition() );
|
|
||||||
|
|
||||||
/* Compute the cursor position in drawing (logical) units. */
|
/* Compute the cursor position in drawing (logical) units. */
|
||||||
screen->SetMousePosition( event.GetLogicalPosition( DC ) );
|
screen->SetMousePosition( event.GetLogicalPosition( DC ) );
|
||||||
|
|
||||||
|
|
|
@ -438,19 +438,17 @@ bool WinEDA_App::SetBinDir()
|
||||||
char Line[1024];
|
char Line[1024];
|
||||||
char FileName[1024];
|
char FileName[1024];
|
||||||
wxString str_arg0;
|
wxString str_arg0;
|
||||||
int ii;
|
|
||||||
char* res;
|
|
||||||
|
|
||||||
FileName[0] = 0;
|
FileName[0] = 0;
|
||||||
str_arg0 = argv[0];
|
str_arg0 = argv[0];
|
||||||
if( strchr( (const char*) argv[0], '/' ) == NULL ) // no path
|
if( strchr( (const char*) argv[0], '/' ) == NULL ) // no path
|
||||||
{
|
{
|
||||||
sprintf( FileName, "which %s > %s", TO_UTF8( str_arg0 ), TMP_FILE );
|
sprintf( FileName, "which %s > %s", TO_UTF8( str_arg0 ), TMP_FILE );
|
||||||
ii = system( FileName );
|
system( FileName );
|
||||||
|
|
||||||
if( ( ftmp = fopen( TMP_FILE, "rt" ) ) != NULL )
|
if( ( ftmp = fopen( TMP_FILE, "rt" ) ) != NULL )
|
||||||
{
|
{
|
||||||
res = fgets( Line, 1000, ftmp );
|
fgets( Line, 1000, ftmp );
|
||||||
fclose( ftmp );
|
fclose( ftmp );
|
||||||
remove( TMP_FILE );
|
remove( TMP_FILE );
|
||||||
}
|
}
|
||||||
|
|
|
@ -98,19 +98,16 @@ void SCH_EDIT_FRAME::InitBlockPasteInfos()
|
||||||
*/
|
*/
|
||||||
void SCH_EDIT_FRAME::HandleBlockPlace( wxDC* DC )
|
void SCH_EDIT_FRAME::HandleBlockPlace( wxDC* DC )
|
||||||
{
|
{
|
||||||
bool err = false;
|
|
||||||
BLOCK_SELECTOR* block = &GetScreen()->m_BlockLocate;
|
BLOCK_SELECTOR* block = &GetScreen()->m_BlockLocate;
|
||||||
|
|
||||||
if( !DrawPanel->IsMouseCaptured() )
|
if( !DrawPanel->IsMouseCaptured() )
|
||||||
{
|
{
|
||||||
err = true;
|
|
||||||
DisplayError( this, wxT( "HandleBlockPLace() : m_mouseCaptureCallback = NULL" ) );
|
DisplayError( this, wxT( "HandleBlockPLace() : m_mouseCaptureCallback = NULL" ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( block->GetCount() == 0 )
|
if( block->GetCount() == 0 )
|
||||||
{
|
{
|
||||||
wxString msg;
|
wxString msg;
|
||||||
err = true;
|
|
||||||
msg.Printf( wxT( "HandleBlockPLace() error : no items to place (cmd %d, state %d)" ),
|
msg.Printf( wxT( "HandleBlockPLace() error : no items to place (cmd %d, state %d)" ),
|
||||||
block->m_Command, block->m_State );
|
block->m_Command, block->m_State );
|
||||||
DisplayError( this, msg );
|
DisplayError( this, msg );
|
||||||
|
@ -121,7 +118,6 @@ void SCH_EDIT_FRAME::HandleBlockPlace( wxDC* DC )
|
||||||
switch( block->m_Command )
|
switch( block->m_Command )
|
||||||
{
|
{
|
||||||
case BLOCK_IDLE:
|
case BLOCK_IDLE:
|
||||||
err = true;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BLOCK_ROTATE:
|
case BLOCK_ROTATE:
|
||||||
|
|
|
@ -199,12 +199,10 @@ bool LIB_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
|
||||||
*/
|
*/
|
||||||
void LIB_EDIT_FRAME::HandleBlockPlace( wxDC* DC )
|
void LIB_EDIT_FRAME::HandleBlockPlace( wxDC* DC )
|
||||||
{
|
{
|
||||||
bool err = false;
|
|
||||||
wxPoint pt;
|
wxPoint pt;
|
||||||
|
|
||||||
if( !DrawPanel->IsMouseCaptured() )
|
if( !DrawPanel->IsMouseCaptured() )
|
||||||
{
|
{
|
||||||
err = true;
|
|
||||||
DisplayError( this, wxT( "HandleBlockPLace : m_mouseCaptureCallback = NULL" ) );
|
DisplayError( this, wxT( "HandleBlockPLace : m_mouseCaptureCallback = NULL" ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -213,7 +211,6 @@ void LIB_EDIT_FRAME::HandleBlockPlace( wxDC* DC )
|
||||||
switch( GetScreen()->m_BlockLocate.m_Command )
|
switch( GetScreen()->m_BlockLocate.m_Command )
|
||||||
{
|
{
|
||||||
case BLOCK_IDLE:
|
case BLOCK_IDLE:
|
||||||
err = true;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BLOCK_DRAG: /* Drag */
|
case BLOCK_DRAG: /* Drag */
|
||||||
|
|
|
@ -1169,11 +1169,10 @@ bool LIB_COMPONENT::SaveDateAndTime( FILE* aFile )
|
||||||
bool LIB_COMPONENT::LoadDateAndTime( char* aLine )
|
bool LIB_COMPONENT::LoadDateAndTime( char* aLine )
|
||||||
{
|
{
|
||||||
int year, mon, day, hour, min, sec;
|
int year, mon, day, hour, min, sec;
|
||||||
char* text;
|
|
||||||
|
|
||||||
year = mon = day = hour = min = sec = 0;
|
year = mon = day = hour = min = sec = 0;
|
||||||
text = strtok( aLine, " \r\t\n" );
|
strtok( aLine, " \r\t\n" );
|
||||||
text = strtok( NULL, " \r\t\n" );
|
strtok( NULL, " \r\t\n" );
|
||||||
|
|
||||||
if (sscanf( aLine, "%d/%d/%d %d:%d:%d", &year, &mon, &day, &hour, &min, &sec ) != 6 )
|
if (sscanf( aLine, "%d/%d/%d %d:%d:%d", &year, &mon, &day, &hour, &min, &sec ) != 6 )
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -99,15 +99,13 @@ void DIALOG_SVG_PRINT::PrintSVGDoc( bool aPrintAll, bool aPrint_Sheet_Ref )
|
||||||
g_DrawDefaultLineThickness =
|
g_DrawDefaultLineThickness =
|
||||||
ReturnValueFromTextCtrl( *m_DialogPenWidth, m_Parent->m_InternalUnits );
|
ReturnValueFromTextCtrl( *m_DialogPenWidth, m_Parent->m_InternalUnits );
|
||||||
|
|
||||||
SCH_SCREEN* screen = (SCH_SCREEN*) m_Parent->GetScreen();
|
SCH_SCREEN* screen = (SCH_SCREEN*) m_Parent->GetScreen();
|
||||||
SCH_SCREEN* oldscreen = screen;
|
|
||||||
|
|
||||||
if( aPrintAll && m_Parent->m_Ident == SCHEMATIC_FRAME )
|
if( aPrintAll && m_Parent->m_Ident == SCHEMATIC_FRAME )
|
||||||
{
|
{
|
||||||
SCH_EDIT_FRAME* schframe = (SCH_EDIT_FRAME*) m_Parent;
|
SCH_EDIT_FRAME* schframe = (SCH_EDIT_FRAME*) m_Parent;
|
||||||
SCH_SHEET_PATH* sheetpath, * oldsheetpath = schframe->GetSheet();
|
SCH_SHEET_PATH* sheetpath, * oldsheetpath = schframe->GetSheet();
|
||||||
SCH_SCREEN* schscreen = schframe->GetScreen();
|
SCH_SCREEN* schscreen = schframe->GetScreen();
|
||||||
oldscreen = schscreen;
|
|
||||||
SCH_SHEET_LIST SheetList( NULL );
|
SCH_SHEET_LIST SheetList( NULL );
|
||||||
sheetpath = SheetList.GetFirst();
|
sheetpath = SheetList.GetFirst();
|
||||||
SCH_SHEET_PATH list;
|
SCH_SHEET_PATH list;
|
||||||
|
|
|
@ -278,19 +278,14 @@ An alias %s already exists!\nCannot update this component" ),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************************************/
|
|
||||||
void DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::addFieldButtonHandler( wxCommandEvent& event )
|
void DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::addFieldButtonHandler( wxCommandEvent& event )
|
||||||
/**************************************************************************************/
|
|
||||||
{
|
{
|
||||||
SCH_EDIT_FRAME* frame;
|
|
||||||
frame = (SCH_EDIT_FRAME*) wxGetApp().GetTopWindow();
|
|
||||||
|
|
||||||
// in case m_FieldsBuf[REFERENCE].m_Orient has changed on screen only, grab
|
// in case m_FieldsBuf[REFERENCE].m_Orient has changed on screen only, grab
|
||||||
// screen contents.
|
// screen contents.
|
||||||
if( !copyPanelToSelectedField() )
|
if( !copyPanelToSelectedField() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
unsigned fieldNdx = m_FieldsBuf.size();
|
unsigned fieldNdx = m_FieldsBuf.size();
|
||||||
|
|
||||||
LIB_FIELD blank( fieldNdx );
|
LIB_FIELD blank( fieldNdx );
|
||||||
|
|
||||||
|
|
|
@ -592,10 +592,6 @@ void LIB_ARC::calcEdit( const wxPoint& aPosition )
|
||||||
startPos = m_ArcStart;
|
startPos = m_ArcStart;
|
||||||
endPos = m_ArcEnd;
|
endPos = m_ArcEnd;
|
||||||
|
|
||||||
wxPoint middlePoint = wxPoint( (startPos.x + endPos.x) / 2,
|
|
||||||
(startPos.y + endPos.y) / 2 );
|
|
||||||
|
|
||||||
|
|
||||||
// If the distance is too small, use the old center point
|
// If the distance is too small, use the old center point
|
||||||
// else the new center point is calculated over the three points start/end/cursor
|
// else the new center point is calculated over the three points start/end/cursor
|
||||||
if( DistanceLinePoint( startPos, endPos, aPosition ) > MINIMUM_SELECTION_DISTANCE )
|
if( DistanceLinePoint( startPos, endPos, aPosition ) > MINIMUM_SELECTION_DISTANCE )
|
||||||
|
|
|
@ -1756,7 +1756,6 @@ EDA_RECT LIB_PIN::GetBoundingBox() const
|
||||||
int nameTextOffset = 0;
|
int nameTextOffset = 0;
|
||||||
bool showName = !m_name.IsEmpty() && (m_name != wxT( "~" ));
|
bool showName = !m_name.IsEmpty() && (m_name != wxT( "~" ));
|
||||||
bool showNum = m_number != 0;
|
bool showNum = m_number != 0;
|
||||||
int symbolX = TARGET_PIN_DIAM / 2;
|
|
||||||
int symbolY = TARGET_PIN_DIAM / 2;
|
int symbolY = TARGET_PIN_DIAM / 2;
|
||||||
|
|
||||||
if( entry )
|
if( entry )
|
||||||
|
@ -1776,7 +1775,7 @@ EDA_RECT LIB_PIN::GetBoundingBox() const
|
||||||
int numberTextHeight = showNum ? wxRound( m_PinNumSize * 1.1 ) : 0;
|
int numberTextHeight = showNum ? wxRound( m_PinNumSize * 1.1 ) : 0;
|
||||||
|
|
||||||
if( m_shape & INVERT )
|
if( m_shape & INVERT )
|
||||||
symbolX = symbolY = INVERT_PIN_RADIUS;
|
symbolY = INVERT_PIN_RADIUS;
|
||||||
|
|
||||||
// calculate top left corner position
|
// calculate top left corner position
|
||||||
// for the default pin orientation (PIN_RIGHT)
|
// for the default pin orientation (PIN_RIGHT)
|
||||||
|
|
|
@ -118,8 +118,6 @@ void LIB_EDIT_FRAME::OnLeftClick( wxDC* DC, const wxPoint& aPosition )
|
||||||
*/
|
*/
|
||||||
void LIB_EDIT_FRAME::OnLeftDClick( wxDC* DC, const wxPoint& aPosition )
|
void LIB_EDIT_FRAME::OnLeftDClick( wxDC* DC, const wxPoint& aPosition )
|
||||||
{
|
{
|
||||||
wxPoint pos = GetPosition();
|
|
||||||
|
|
||||||
if( m_component == NULL )
|
if( m_component == NULL )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
@ -378,7 +378,7 @@ int LIB_EDIT_FRAME::BestZoom()
|
||||||
double margin_scale_factor = 0.8;
|
double margin_scale_factor = 0.8;
|
||||||
double zx =(double) dx / ( margin_scale_factor * (double)size.x ) *
|
double zx =(double) dx / ( margin_scale_factor * (double)size.x ) *
|
||||||
(double) GetScreen()->m_ZoomScalar;
|
(double) GetScreen()->m_ZoomScalar;
|
||||||
double zy = (double) dx / ( margin_scale_factor * (double)size.y) *
|
double zy = (double) dy / ( margin_scale_factor * (double)size.y) *
|
||||||
(double) GetScreen()->m_ZoomScalar;
|
(double) GetScreen()->m_ZoomScalar;
|
||||||
|
|
||||||
int bestzoom = wxRound( MAX( zx, zy ) );
|
int bestzoom = wxRound( MAX( zx, zy ) );
|
||||||
|
|
|
@ -85,14 +85,11 @@ void FreeNetObjectsList( NETLIST_OBJECT_LIST& aNetObjectsBuffer )
|
||||||
*/
|
*/
|
||||||
void SCH_EDIT_FRAME::BuildNetListBase()
|
void SCH_EDIT_FRAME::BuildNetListBase()
|
||||||
{
|
{
|
||||||
int NetNumber;
|
|
||||||
int NetCode;
|
int NetCode;
|
||||||
SCH_SHEET_PATH* sheet;
|
SCH_SHEET_PATH* sheet;
|
||||||
wxString msg, activity;
|
wxString msg, activity;
|
||||||
wxBusyCursor Busy;
|
wxBusyCursor Busy;
|
||||||
|
|
||||||
NetNumber = 1;
|
|
||||||
|
|
||||||
activity = _( "Building net list:" );
|
activity = _( "Building net list:" );
|
||||||
SetStatusText( activity );
|
SetStatusText( activity );
|
||||||
|
|
||||||
|
@ -104,6 +101,7 @@ void SCH_EDIT_FRAME::BuildNetListBase()
|
||||||
/* Fill g_NetObjectslist with items used in connectivity calculation */
|
/* Fill g_NetObjectslist with items used in connectivity calculation */
|
||||||
|
|
||||||
sheet = SheetListList.GetFirst();
|
sheet = SheetListList.GetFirst();
|
||||||
|
|
||||||
for( ; sheet != NULL; sheet = SheetListList.GetNext() )
|
for( ; sheet != NULL; sheet = SheetListList.GetNext() )
|
||||||
AddConnectedObjects( sheet, g_NetObjectslist );
|
AddConnectedObjects( sheet, g_NetObjectslist );
|
||||||
|
|
||||||
|
@ -788,7 +786,6 @@ int IsBusLabel( const wxString& LabelDrawList )
|
||||||
int ii;
|
int ii;
|
||||||
wxString BufLine;
|
wxString BufLine;
|
||||||
long tmp;
|
long tmp;
|
||||||
bool error = FALSE;
|
|
||||||
|
|
||||||
/* Search for '[' because a bus label is like "busname[nn..mm]" */
|
/* Search for '[' because a bus label is like "busname[nn..mm]" */
|
||||||
ii = LabelDrawList.Find( '[' );
|
ii = LabelDrawList.Find( '[' );
|
||||||
|
@ -806,10 +803,9 @@ int IsBusLabel( const wxString& LabelDrawList )
|
||||||
Num++;
|
Num++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !BufLine.ToLong( &tmp ) )
|
BufLine.ToLong( &tmp );
|
||||||
error = true;
|
|
||||||
|
|
||||||
FirstNumWireBus = tmp;
|
FirstNumWireBus = tmp;
|
||||||
|
|
||||||
while( LabelDrawList[Num] == '.' && Num < LabelDrawList.Len() )
|
while( LabelDrawList[Num] == '.' && Num < LabelDrawList.Len() )
|
||||||
Num++;
|
Num++;
|
||||||
|
|
||||||
|
@ -820,18 +816,17 @@ int IsBusLabel( const wxString& LabelDrawList )
|
||||||
Num++;
|
Num++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !BufLine.ToLong( &tmp ) )
|
BufLine.ToLong( &tmp );
|
||||||
error = true;
|
|
||||||
LastNumWireBus = tmp;
|
LastNumWireBus = tmp;
|
||||||
|
|
||||||
if( FirstNumWireBus < 0 )
|
if( FirstNumWireBus < 0 )
|
||||||
FirstNumWireBus = 0;
|
FirstNumWireBus = 0;
|
||||||
|
|
||||||
if( LastNumWireBus < 0 )
|
if( LastNumWireBus < 0 )
|
||||||
LastNumWireBus = 0;
|
LastNumWireBus = 0;
|
||||||
|
|
||||||
if( FirstNumWireBus > LastNumWireBus )
|
if( FirstNumWireBus > LastNumWireBus )
|
||||||
{
|
|
||||||
EXCHG( FirstNumWireBus, LastNumWireBus );
|
EXCHG( FirstNumWireBus, LastNumWireBus );
|
||||||
}
|
|
||||||
|
|
||||||
return LastNumWireBus - FirstNumWireBus + 1;
|
return LastNumWireBus - FirstNumWireBus + 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -312,7 +312,6 @@ void SCH_EDIT_FRAME::OnLeftDClick( wxDC* aDC, const wxPoint& aPosition )
|
||||||
|
|
||||||
{
|
{
|
||||||
EDA_ITEM* item = GetScreen()->GetCurItem();
|
EDA_ITEM* item = GetScreen()->GetCurItem();
|
||||||
wxPoint pos = aPosition;
|
|
||||||
|
|
||||||
switch( GetToolId() )
|
switch( GetToolId() )
|
||||||
{
|
{
|
||||||
|
|
|
@ -423,8 +423,6 @@ bool SCH_FIELD::Matches( wxFindReplaceData& aSearchData, void* aAuxData, wxPoint
|
||||||
|
|
||||||
if( match )
|
if( match )
|
||||||
{
|
{
|
||||||
EDA_RECT BoundaryBox = GetBoundingBox();
|
|
||||||
|
|
||||||
if( aFindLocation )
|
if( aFindLocation )
|
||||||
*aFindLocation = GetBoundingBox().Centre();
|
*aFindLocation = GetBoundingBox().Centre();
|
||||||
|
|
||||||
|
|
|
@ -233,9 +233,7 @@ void GERBVIEW_FRAME::SaveSettings()
|
||||||
|
|
||||||
wxGetApp().SaveCurrentSetupValues( GetConfigurationSettings() );
|
wxGetApp().SaveCurrentSetupValues( GetConfigurationSettings() );
|
||||||
|
|
||||||
wxRealPoint GridSize = GetScreen()->GetGridSize();
|
long pageSize_opt = 0;
|
||||||
|
|
||||||
long pageSize_opt = 0;
|
|
||||||
|
|
||||||
if( m_Draw_Sheet_Ref )
|
if( m_Draw_Sheet_Ref )
|
||||||
{
|
{
|
||||||
|
|
|
@ -17,30 +17,24 @@
|
||||||
|
|
||||||
void GERBVIEW_FRAME::ReCreateHToolbar( void )
|
void GERBVIEW_FRAME::ReCreateHToolbar( void )
|
||||||
{
|
{
|
||||||
int layer = 0;
|
|
||||||
GERBER_IMAGE* gerber = NULL;
|
|
||||||
int ii;
|
int ii;
|
||||||
wxString msg;
|
wxString msg;
|
||||||
|
|
||||||
if( m_HToolBar != NULL )
|
if( m_HToolBar != NULL )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if( GetScreen() )
|
|
||||||
{
|
|
||||||
layer = getActiveLayer();
|
|
||||||
gerber = g_GERBER_List[layer];
|
|
||||||
}
|
|
||||||
|
|
||||||
m_HToolBar = new EDA_TOOLBAR( TOOLBAR_MAIN, this, ID_H_TOOLBAR, TRUE );
|
m_HToolBar = new EDA_TOOLBAR( TOOLBAR_MAIN, this, ID_H_TOOLBAR, TRUE );
|
||||||
|
|
||||||
// Set up toolbar
|
// Set up toolbar
|
||||||
m_HToolBar->AddTool( ID_GERBVIEW_ERASE_ALL, wxEmptyString, wxBitmap( gerbview_clear_layers_xpm ),
|
m_HToolBar->AddTool( ID_GERBVIEW_ERASE_ALL, wxEmptyString,
|
||||||
|
wxBitmap( gerbview_clear_layers_xpm ),
|
||||||
_( "Erase all layers" ) );
|
_( "Erase all layers" ) );
|
||||||
|
|
||||||
m_HToolBar->AddTool( wxID_FILE, wxEmptyString, wxBitmap( gerber_file_xpm ),
|
m_HToolBar->AddTool( wxID_FILE, wxEmptyString, wxBitmap( gerber_file_xpm ),
|
||||||
_( "Load a new Gerber file on the current layer. Previous data will be deleted" ) );
|
_( "Load a new Gerber file on the current layer. Previous data will be deleted" ) );
|
||||||
|
|
||||||
m_HToolBar->AddTool( ID_GERBVIEW_LOAD_DRILL_FILE, wxEmptyString, wxBitmap( gerbview_drill_file_xpm ),
|
m_HToolBar->AddTool( ID_GERBVIEW_LOAD_DRILL_FILE, wxEmptyString,
|
||||||
|
wxBitmap( gerbview_drill_file_xpm ),
|
||||||
_( "Load an excellon drill file on the current layer. Previous data will be deleted" ) );
|
_( "Load an excellon drill file on the current layer. Previous data will be deleted" ) );
|
||||||
|
|
||||||
m_HToolBar->AddSeparator();
|
m_HToolBar->AddSeparator();
|
||||||
|
@ -63,14 +57,15 @@ void GERBVIEW_FRAME::ReCreateHToolbar( void )
|
||||||
m_HToolBar->AddSeparator();
|
m_HToolBar->AddSeparator();
|
||||||
|
|
||||||
wxArrayString choices;
|
wxArrayString choices;
|
||||||
|
|
||||||
for( ii = 0; ii < 32; ii++ )
|
for( ii = 0; ii < 32; ii++ )
|
||||||
{
|
{
|
||||||
msg.Printf( _( "Layer %d" ), ii + 1);
|
msg.Printf( _( "Layer %d" ), ii + 1 );
|
||||||
choices.Add( msg );
|
choices.Add( msg );
|
||||||
}
|
}
|
||||||
|
|
||||||
m_SelLayerBox = new LAYER_BOX_SELECTOR( m_HToolBar, ID_TOOLBARH_GERBVIEW_SELECT_ACTIVE_LAYER,
|
m_SelLayerBox = new LAYER_BOX_SELECTOR( m_HToolBar, ID_TOOLBARH_GERBVIEW_SELECT_ACTIVE_LAYER,
|
||||||
wxDefaultPosition, wxSize( 150, -1 ), choices );
|
wxDefaultPosition, wxSize( 150, -1 ), choices );
|
||||||
m_HToolBar->AddControl( m_SelLayerBox );
|
m_HToolBar->AddControl( m_SelLayerBox );
|
||||||
|
|
||||||
m_HToolBar->AddSeparator();
|
m_HToolBar->AddSeparator();
|
||||||
|
@ -85,10 +80,9 @@ void GERBVIEW_FRAME::ReCreateHToolbar( void )
|
||||||
m_DCodesList.Add( msg );
|
m_DCodesList.Add( msg );
|
||||||
}
|
}
|
||||||
|
|
||||||
m_DCodeSelector = new DCODE_SELECTION_BOX(
|
m_DCodeSelector = new DCODE_SELECTION_BOX( m_HToolBar, ID_TOOLBARH_GERBER_SELECT_ACTIVE_DCODE,
|
||||||
m_HToolBar, ID_TOOLBARH_GERBER_SELECT_ACTIVE_DCODE,
|
wxDefaultPosition, wxSize( 150, -1 ),
|
||||||
wxDefaultPosition, wxSize( 150, -1 ),
|
m_DCodesList );
|
||||||
m_DCodesList );
|
|
||||||
m_HToolBar->AddControl( m_DCodeSelector );
|
m_HToolBar->AddControl( m_DCodeSelector );
|
||||||
|
|
||||||
m_TextInfo = new wxTextCtrl( m_HToolBar, wxID_ANY, wxEmptyString, wxDefaultPosition,
|
m_TextInfo = new wxTextCtrl( m_HToolBar, wxID_ANY, wxEmptyString, wxDefaultPosition,
|
||||||
|
|
|
@ -216,13 +216,11 @@ void TREE_PROJECT_FRAME::OnDragStart( wxTreeEvent& event )
|
||||||
|
|
||||||
m_TreeProject->SelectItem( curr_item );
|
m_TreeProject->SelectItem( curr_item );
|
||||||
TREEPROJECT_ITEM* data = GetSelectedData();
|
TREEPROJECT_ITEM* data = GetSelectedData();
|
||||||
|
|
||||||
if( data->GetFileName() == m_Parent->m_ProjectFileName.GetFullPath() )
|
if( data->GetFileName() == m_Parent->m_ProjectFileName.GetFullPath() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
wxTreeItemId id = m_TreeProject->GetSelection();
|
wxImage img = m_TreeProject->GetImageList()->GetBitmap( data->GetType() - 1 ).ConvertToImage();
|
||||||
|
|
||||||
wxImage img =
|
|
||||||
m_TreeProject->GetImageList()->GetBitmap( data->GetType() - 1 ).ConvertToImage();
|
|
||||||
m_DragCursor = wxCursor( img );
|
m_DragCursor = wxCursor( img );
|
||||||
m_Parent->wxWindow::SetCursor( (wxCursor &)m_DragCursor );
|
m_Parent->wxWindow::SetCursor( (wxCursor &)m_DragCursor );
|
||||||
event.Allow();
|
event.Allow();
|
||||||
|
@ -235,7 +233,6 @@ void TREE_PROJECT_FRAME::OnDragEnd( wxTreeEvent& event )
|
||||||
{
|
{
|
||||||
m_Parent->SetCursor( wxNullCursor );
|
m_Parent->SetCursor( wxNullCursor );
|
||||||
|
|
||||||
wxTreeItemId moved = m_TreeProject->GetSelection();
|
|
||||||
TREEPROJECT_ITEM* source_data = GetSelectedData();
|
TREEPROJECT_ITEM* source_data = GetSelectedData();
|
||||||
wxTreeItemId dest = event.GetItem();
|
wxTreeItemId dest = event.GetItem();
|
||||||
|
|
||||||
|
|
|
@ -198,11 +198,8 @@ int PCB_EDIT_FRAME::ReturnBlockCommand( int aKey )
|
||||||
*/
|
*/
|
||||||
void PCB_EDIT_FRAME::HandleBlockPlace( wxDC* DC )
|
void PCB_EDIT_FRAME::HandleBlockPlace( wxDC* DC )
|
||||||
{
|
{
|
||||||
bool err = false;
|
|
||||||
|
|
||||||
if( !DrawPanel->IsMouseCaptured() )
|
if( !DrawPanel->IsMouseCaptured() )
|
||||||
{
|
{
|
||||||
err = true;
|
|
||||||
DisplayError( this, wxT( "Error in HandleBlockPLace : m_mouseCaptureCallback = NULL" ) );
|
DisplayError( this, wxT( "Error in HandleBlockPLace : m_mouseCaptureCallback = NULL" ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -211,7 +208,6 @@ void PCB_EDIT_FRAME::HandleBlockPlace( wxDC* DC )
|
||||||
switch( GetScreen()->m_BlockLocate.m_Command )
|
switch( GetScreen()->m_BlockLocate.m_Command )
|
||||||
{
|
{
|
||||||
case BLOCK_IDLE:
|
case BLOCK_IDLE:
|
||||||
err = true;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BLOCK_DRAG: /* Drag */
|
case BLOCK_DRAG: /* Drag */
|
||||||
|
|
|
@ -212,12 +212,10 @@ void WinEDA_ModuleEditFrame::HandleBlockPlace( wxDC* DC )
|
||||||
* - block copy & paste
|
* - block copy & paste
|
||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
bool err = FALSE;
|
|
||||||
MODULE* currentModule = GetBoard()->m_Modules;
|
MODULE* currentModule = GetBoard()->m_Modules;
|
||||||
|
|
||||||
if( !DrawPanel->IsMouseCaptured() )
|
if( !DrawPanel->IsMouseCaptured() )
|
||||||
{
|
{
|
||||||
err = TRUE;
|
|
||||||
DisplayError( this, wxT( "HandleBlockPLace : m_mouseCaptureCallback = NULL" ) );
|
DisplayError( this, wxT( "HandleBlockPLace : m_mouseCaptureCallback = NULL" ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -226,7 +224,6 @@ void WinEDA_ModuleEditFrame::HandleBlockPlace( wxDC* DC )
|
||||||
switch( GetScreen()->m_BlockLocate.m_Command )
|
switch( GetScreen()->m_BlockLocate.m_Command )
|
||||||
{
|
{
|
||||||
case BLOCK_IDLE:
|
case BLOCK_IDLE:
|
||||||
err = TRUE;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BLOCK_DRAG: /* Drag */
|
case BLOCK_DRAG: /* Drag */
|
||||||
|
|
|
@ -356,7 +356,6 @@ void DRAWSEGMENT::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const wx
|
||||||
// see pcbstruct.h
|
// see pcbstruct.h
|
||||||
void DRAWSEGMENT::DisplayInfo( EDA_DRAW_FRAME* frame )
|
void DRAWSEGMENT::DisplayInfo( EDA_DRAW_FRAME* frame )
|
||||||
{
|
{
|
||||||
int itype;
|
|
||||||
wxString msg;
|
wxString msg;
|
||||||
wxString coords;
|
wxString coords;
|
||||||
|
|
||||||
|
@ -365,8 +364,6 @@ void DRAWSEGMENT::DisplayInfo( EDA_DRAW_FRAME* frame )
|
||||||
|
|
||||||
frame->ClearMsgPanel();
|
frame->ClearMsgPanel();
|
||||||
|
|
||||||
itype = m_Type & 0x0F;
|
|
||||||
|
|
||||||
msg = wxT( "DRAWING" );
|
msg = wxT( "DRAWING" );
|
||||||
|
|
||||||
frame->AppendMsgPanel( _( "Type" ), msg, DARKCYAN );
|
frame->AppendMsgPanel( _( "Type" ), msg, DARKCYAN );
|
||||||
|
|
|
@ -151,7 +151,6 @@ void EDGE_MODULE::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const wx
|
||||||
int ux0, uy0, dx, dy, rayon, StAngle, EndAngle;
|
int ux0, uy0, dx, dy, rayon, StAngle, EndAngle;
|
||||||
int color, type_trace;
|
int color, type_trace;
|
||||||
int typeaff;
|
int typeaff;
|
||||||
PCB_SCREEN* screen;
|
|
||||||
PCB_BASE_FRAME* frame;
|
PCB_BASE_FRAME* frame;
|
||||||
MODULE* module = (MODULE*) m_Parent;
|
MODULE* module = (MODULE*) m_Parent;
|
||||||
|
|
||||||
|
@ -166,8 +165,6 @@ void EDGE_MODULE::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const wx
|
||||||
|
|
||||||
frame = (PCB_BASE_FRAME*) panel->GetParent();
|
frame = (PCB_BASE_FRAME*) panel->GetParent();
|
||||||
|
|
||||||
screen = frame->GetScreen();
|
|
||||||
|
|
||||||
type_trace = m_Shape;
|
type_trace = m_Shape;
|
||||||
|
|
||||||
ux0 = m_Start.x - offset.x;
|
ux0 = m_Start.x - offset.x;
|
||||||
|
|
|
@ -50,10 +50,13 @@ void D_PAD::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, int aDraw_mode, const wxPoi
|
||||||
{
|
{
|
||||||
int color = 0;
|
int color = 0;
|
||||||
wxSize mask_margin; // margin (clearance) used for some non copper layers
|
wxSize mask_margin; // margin (clearance) used for some non copper layers
|
||||||
|
|
||||||
|
#ifdef SHOW_PADMASK_REAL_SIZE_AND_COLOR
|
||||||
int showActualMaskSize = 0; /* == layer number if the actual pad size on mask layer can be displayed
|
int showActualMaskSize = 0; /* == layer number if the actual pad size on mask layer can be displayed
|
||||||
* i.e. if only one layer is shown for this pad
|
* i.e. if only one layer is shown for this pad
|
||||||
* and this layer is a mask (solder mask or sloder paste
|
* and this layer is a mask (solder mask or sloder paste
|
||||||
*/
|
*/
|
||||||
|
#endif
|
||||||
|
|
||||||
if( m_Flags & DO_NOT_DRAW )
|
if( m_Flags & DO_NOT_DRAW )
|
||||||
return;
|
return;
|
||||||
|
@ -142,12 +145,16 @@ void D_PAD::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, int aDraw_mode, const wxPoi
|
||||||
|
|
||||||
case SOLDERPASTE_LAYER_BACK:
|
case SOLDERPASTE_LAYER_BACK:
|
||||||
color = brd->GetLayerColor( SOLDERPASTE_N_BACK );
|
color = brd->GetLayerColor( SOLDERPASTE_N_BACK );
|
||||||
|
#ifdef SHOW_PADMASK_REAL_SIZE_AND_COLOR
|
||||||
showActualMaskSize = SOLDERPASTE_N_BACK;
|
showActualMaskSize = SOLDERPASTE_N_BACK;
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SOLDERPASTE_LAYER_FRONT:
|
case SOLDERPASTE_LAYER_FRONT:
|
||||||
color = brd->GetLayerColor( SOLDERPASTE_N_FRONT );
|
color = brd->GetLayerColor( SOLDERPASTE_N_FRONT );
|
||||||
|
#ifdef SHOW_PADMASK_REAL_SIZE_AND_COLOR
|
||||||
showActualMaskSize = SOLDERPASTE_N_FRONT;
|
showActualMaskSize = SOLDERPASTE_N_FRONT;
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SILKSCREEN_LAYER_BACK:
|
case SILKSCREEN_LAYER_BACK:
|
||||||
|
@ -160,12 +167,16 @@ void D_PAD::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, int aDraw_mode, const wxPoi
|
||||||
|
|
||||||
case SOLDERMASK_LAYER_BACK:
|
case SOLDERMASK_LAYER_BACK:
|
||||||
color = brd->GetLayerColor( SOLDERMASK_N_BACK );
|
color = brd->GetLayerColor( SOLDERMASK_N_BACK );
|
||||||
|
#ifdef SHOW_PADMASK_REAL_SIZE_AND_COLOR
|
||||||
showActualMaskSize = SOLDERMASK_N_BACK;
|
showActualMaskSize = SOLDERMASK_N_BACK;
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SOLDERMASK_LAYER_FRONT:
|
case SOLDERMASK_LAYER_FRONT:
|
||||||
color = brd->GetLayerColor( SOLDERMASK_N_FRONT );
|
color = brd->GetLayerColor( SOLDERMASK_N_FRONT );
|
||||||
|
#ifdef SHOW_PADMASK_REAL_SIZE_AND_COLOR
|
||||||
showActualMaskSize = SOLDERMASK_N_FRONT;
|
showActualMaskSize = SOLDERMASK_N_FRONT;
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DRAW_LAYER:
|
case DRAW_LAYER:
|
||||||
|
|
|
@ -337,7 +337,6 @@ void TEXTE_MODULE::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const w
|
||||||
int width, color, orient;
|
int width, color, orient;
|
||||||
wxSize size;
|
wxSize size;
|
||||||
wxPoint pos; // Center of text
|
wxPoint pos; // Center of text
|
||||||
PCB_SCREEN* screen;
|
|
||||||
PCB_BASE_FRAME* frame;
|
PCB_BASE_FRAME* frame;
|
||||||
MODULE* Module = (MODULE*) m_Parent; /* parent must *not* be null
|
MODULE* Module = (MODULE*) m_Parent; /* parent must *not* be null
|
||||||
* (a module text without a footprint
|
* (a module text without a footprint
|
||||||
|
@ -347,7 +346,6 @@ void TEXTE_MODULE::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const w
|
||||||
if( panel == NULL )
|
if( panel == NULL )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
screen = (PCB_SCREEN*) panel->GetScreen();
|
|
||||||
frame = (PCB_BASE_FRAME*) panel->GetParent();
|
frame = (PCB_BASE_FRAME*) panel->GetParent();
|
||||||
|
|
||||||
pos.x = m_Pos.x - offset.x;
|
pos.x = m_Pos.x - offset.x;
|
||||||
|
|
|
@ -238,7 +238,6 @@ int ZONE_CONTAINER::ReadDescr( LINE_READER* aReader )
|
||||||
char* Line, * text;
|
char* Line, * text;
|
||||||
char netname_buffer[1024];
|
char netname_buffer[1024];
|
||||||
int ret;
|
int ret;
|
||||||
int n_corner_item = 0;
|
|
||||||
int outline_hatch = CPolyLine::NO_HATCH;
|
int outline_hatch = CPolyLine::NO_HATCH;
|
||||||
bool error = false, has_corner = false;
|
bool error = false, has_corner = false;
|
||||||
|
|
||||||
|
@ -307,8 +306,6 @@ int ZONE_CONTAINER::ReadDescr( LINE_READER* aReader )
|
||||||
error = true;
|
error = true;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
n_corner_item = x;
|
|
||||||
|
|
||||||
switch( hopt[0] )
|
switch( hopt[0] )
|
||||||
{
|
{
|
||||||
case 'n':
|
case 'n':
|
||||||
|
|
|
@ -577,8 +577,7 @@ void PCB_BASE_FRAME::RecalculateAllTracksNetcode()
|
||||||
{
|
{
|
||||||
TRACK* pt_piste;
|
TRACK* pt_piste;
|
||||||
TRACK* pt_next;
|
TRACK* pt_next;
|
||||||
int a_color;
|
char new_passe_request = 1;
|
||||||
char new_passe_request = 1, flag;
|
|
||||||
|
|
||||||
std::vector<D_PAD*> sortedPads;
|
std::vector<D_PAD*> sortedPads;
|
||||||
BOARD_ITEM* PtStruct;
|
BOARD_ITEM* PtStruct;
|
||||||
|
@ -621,7 +620,6 @@ void PCB_BASE_FRAME::RecalculateAllTracksNetcode()
|
||||||
pt_piste = m_Pcb->m_Track;
|
pt_piste = m_Pcb->m_Track;
|
||||||
for( ; pt_piste != NULL; pt_piste = pt_piste->Next() )
|
for( ; pt_piste != NULL; pt_piste = pt_piste->Next() )
|
||||||
{
|
{
|
||||||
flag = 0;
|
|
||||||
masque_layer = g_TabOneLayerMask[pt_piste->GetLayer()];
|
masque_layer = g_TabOneLayerMask[pt_piste->GetLayer()];
|
||||||
|
|
||||||
/* Search for a pad on the segment starting point */
|
/* Search for a pad on the segment starting point */
|
||||||
|
@ -676,8 +674,6 @@ void PCB_BASE_FRAME::RecalculateAllTracksNetcode()
|
||||||
/* Propagate net codes from a segment to an other segment */
|
/* Propagate net codes from a segment to an other segment */
|
||||||
/**********************************************************/
|
/**********************************************************/
|
||||||
|
|
||||||
a_color = YELLOW;
|
|
||||||
|
|
||||||
while( new_passe_request )
|
while( new_passe_request )
|
||||||
{
|
{
|
||||||
bool reset_flag = FALSE;
|
bool reset_flag = FALSE;
|
||||||
|
|
|
@ -198,22 +198,18 @@ static void Abort_EditEdge( EDA_DRAW_PANEL* Panel, wxDC* DC )
|
||||||
|
|
||||||
/* Initialize the drawing of a segment of type other than trace.
|
/* Initialize the drawing of a segment of type other than trace.
|
||||||
*/
|
*/
|
||||||
DRAWSEGMENT* PCB_EDIT_FRAME::Begin_DrawSegment( DRAWSEGMENT* Segment,
|
DRAWSEGMENT* PCB_EDIT_FRAME::Begin_DrawSegment( DRAWSEGMENT* Segment, int shape, wxDC* DC )
|
||||||
int shape, wxDC* DC )
|
|
||||||
{
|
{
|
||||||
int s_large;
|
int s_large;
|
||||||
int angle = 0;
|
|
||||||
DRAWSEGMENT* DrawItem;
|
DRAWSEGMENT* DrawItem;
|
||||||
|
|
||||||
s_large = GetBoard()->GetBoardDesignSettings()->m_DrawSegmentWidth;
|
s_large = GetBoard()->GetBoardDesignSettings()->m_DrawSegmentWidth;
|
||||||
|
|
||||||
if( getActiveLayer() == EDGE_N )
|
if( getActiveLayer() == EDGE_N )
|
||||||
{
|
{
|
||||||
s_large = GetBoard()->GetBoardDesignSettings()->m_EdgeSegmentWidth;
|
s_large = GetBoard()->GetBoardDesignSettings()->m_EdgeSegmentWidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( shape == S_ARC )
|
|
||||||
angle = 900;
|
|
||||||
|
|
||||||
if( Segment == NULL ) /* Create new trace. */
|
if( Segment == NULL ) /* Create new trace. */
|
||||||
{
|
{
|
||||||
SetCurItem( Segment = new DRAWSEGMENT( GetBoard() ) );
|
SetCurItem( Segment = new DRAWSEGMENT( GetBoard() ) );
|
||||||
|
@ -262,6 +258,7 @@ DRAWSEGMENT* PCB_EDIT_FRAME::Begin_DrawSegment( DRAWSEGMENT* Segment,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return Segment;
|
return Segment;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -298,12 +298,11 @@ void TraceSegmentPcb( BOARD* Pcb,
|
||||||
int marge,
|
int marge,
|
||||||
int op_logique )
|
int op_logique )
|
||||||
{
|
{
|
||||||
int demi_pas, demi_largeur;
|
int demi_largeur;
|
||||||
int ux0, uy0, ux1, uy1;
|
int ux0, uy0, ux1, uy1;
|
||||||
|
|
||||||
|
|
||||||
demi_pas = Board.m_GridRouting / 2;
|
|
||||||
demi_largeur = ( pt_segm->m_Width / 2 ) + marge;
|
demi_largeur = ( pt_segm->m_Width / 2 ) + marge;
|
||||||
|
|
||||||
/* Calculate the bounding rectangle of the segment (if H, V or Via) */
|
/* Calculate the bounding rectangle of the segment (if H, V or Via) */
|
||||||
ux0 = pt_segm->m_Start.x - Pcb->m_BoundaryBox.m_Pos.x;
|
ux0 = pt_segm->m_Start.x - Pcb->m_BoundaryBox.m_Pos.x;
|
||||||
uy0 = pt_segm->m_Start.y - Pcb->m_BoundaryBox.m_Pos.y;
|
uy0 = pt_segm->m_Start.y - Pcb->m_BoundaryBox.m_Pos.y;
|
||||||
|
|
|
@ -177,7 +177,6 @@ MODULE* Locate_Prefered_Module( BOARD* aPcb, const wxPoint& aPosition, int aActi
|
||||||
bool aVisibleOnly, bool aIgnoreLocked )
|
bool aVisibleOnly, bool aIgnoreLocked )
|
||||||
{
|
{
|
||||||
MODULE* pt_module;
|
MODULE* pt_module;
|
||||||
int lx, ly;
|
|
||||||
MODULE* module = NULL;
|
MODULE* module = NULL;
|
||||||
MODULE* Altmodule = NULL;
|
MODULE* Altmodule = NULL;
|
||||||
int min_dim = 0x7FFFFFFF;
|
int min_dim = 0x7FFFFFFF;
|
||||||
|
@ -220,8 +219,6 @@ MODULE* Locate_Prefered_Module( BOARD* aPcb, const wxPoint& aPosition, int aActi
|
||||||
|
|
||||||
//off x & offy point to the middle of the box.
|
//off x & offy point to the middle of the box.
|
||||||
int dist = abs( aPosition.x - offx ) + abs( aPosition.y - offy );
|
int dist = abs( aPosition.x - offx ) + abs( aPosition.y - offy );
|
||||||
lx = pt_module->m_BoundaryBox.GetWidth();
|
|
||||||
ly = pt_module->m_BoundaryBox.GetHeight();
|
|
||||||
|
|
||||||
//int dist = MIN(lx, ly); // to pick the smallest module (kinda
|
//int dist = MIN(lx, ly); // to pick the smallest module (kinda
|
||||||
// screwy with same-sized modules -- this is bad!)
|
// screwy with same-sized modules -- this is bad!)
|
||||||
|
|
|
@ -392,7 +392,6 @@ bool WinEDA_ModuleEditFrame::OnRightClick( const wxPoint& MousePos, wxMenu* PopM
|
||||||
void WinEDA_ModuleEditFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos )
|
void WinEDA_ModuleEditFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos )
|
||||||
{
|
{
|
||||||
BOARD_ITEM* item = GetCurItem();
|
BOARD_ITEM* item = GetCurItem();
|
||||||
wxPoint pos = GetPosition();
|
|
||||||
|
|
||||||
switch( GetToolId() )
|
switch( GetToolId() )
|
||||||
{
|
{
|
||||||
|
|
|
@ -102,13 +102,9 @@ static void Show_Pad_Move( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aPo
|
||||||
*/
|
*/
|
||||||
void PCB_BASE_FRAME::Export_Pad_Settings( D_PAD* pt_pad )
|
void PCB_BASE_FRAME::Export_Pad_Settings( D_PAD* pt_pad )
|
||||||
{
|
{
|
||||||
MODULE* Module;
|
|
||||||
|
|
||||||
if( pt_pad == NULL )
|
if( pt_pad == NULL )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Module = (MODULE*) pt_pad->GetParent();
|
|
||||||
|
|
||||||
pt_pad->DisplayInfo( this );
|
pt_pad->DisplayInfo( this );
|
||||||
|
|
||||||
g_Pad_Master.m_PadShape = pt_pad->m_PadShape;
|
g_Pad_Master.m_PadShape = pt_pad->m_PadShape;
|
||||||
|
@ -270,13 +266,9 @@ void PCB_BASE_FRAME::DeletePad( D_PAD* aPad, bool aQuery )
|
||||||
/* Function to initialize the "move pad" command */
|
/* Function to initialize the "move pad" command */
|
||||||
void PCB_BASE_FRAME::StartMovePad( D_PAD* Pad, wxDC* DC )
|
void PCB_BASE_FRAME::StartMovePad( D_PAD* Pad, wxDC* DC )
|
||||||
{
|
{
|
||||||
MODULE* Module;
|
|
||||||
|
|
||||||
if( Pad == NULL )
|
if( Pad == NULL )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Module = (MODULE*) Pad->GetParent();
|
|
||||||
|
|
||||||
s_CurrentSelectedPad = Pad;
|
s_CurrentSelectedPad = Pad;
|
||||||
Pad_OldPos = Pad->m_Pos;
|
Pad_OldPos = Pad->m_Pos;
|
||||||
Pad->DisplayInfo( this );
|
Pad->DisplayInfo( this );
|
||||||
|
@ -316,8 +308,6 @@ void PCB_BASE_FRAME::PlacePad( D_PAD* Pad, wxDC* DC )
|
||||||
Track = g_DragSegmentList[ii].m_Segm;
|
Track = g_DragSegmentList[ii].m_Segm;
|
||||||
|
|
||||||
// Set the old state
|
// Set the old state
|
||||||
wxPoint t_start = Track->m_Start;
|
|
||||||
wxPoint t_end = Track->m_End;
|
|
||||||
if( g_DragSegmentList[ii].m_Pad_Start )
|
if( g_DragSegmentList[ii].m_Pad_Start )
|
||||||
Track->m_Start = Pad_OldPos;
|
Track->m_Start = Pad_OldPos;
|
||||||
if( g_DragSegmentList[ii].m_Pad_End )
|
if( g_DragSegmentList[ii].m_Pad_End )
|
||||||
|
@ -331,6 +321,7 @@ void PCB_BASE_FRAME::PlacePad( D_PAD* Pad, wxDC* DC )
|
||||||
wxPoint pad_curr_position = Pad->m_Pos;
|
wxPoint pad_curr_position = Pad->m_Pos;
|
||||||
|
|
||||||
Pad->m_Pos = Pad_OldPos;
|
Pad->m_Pos = Pad_OldPos;
|
||||||
|
|
||||||
if( g_DragSegmentList.size() == 0 )
|
if( g_DragSegmentList.size() == 0 )
|
||||||
SaveCopyInUndoList( Module, UR_CHANGED );
|
SaveCopyInUndoList( Module, UR_CHANGED );
|
||||||
else
|
else
|
||||||
|
@ -355,6 +346,7 @@ void PCB_BASE_FRAME::PlacePad( D_PAD* Pad, wxDC* DC )
|
||||||
Track->m_End = Pad->m_Pos;
|
Track->m_End = Pad->m_Pos;
|
||||||
|
|
||||||
Track->SetState( IN_EDIT, OFF );
|
Track->SetState( IN_EDIT, OFF );
|
||||||
|
|
||||||
if( DC )
|
if( DC )
|
||||||
Track->Draw( DrawPanel, DC, GR_OR );
|
Track->Draw( DrawPanel, DC, GR_OR );
|
||||||
}
|
}
|
||||||
|
|
|
@ -862,7 +862,7 @@ void PCB_EDIT_FRAME::Test_Duplicate_Missing_And_Extra_Footprints(
|
||||||
* @return component count, or -1 if netlist file cannot opened
|
* @return component count, or -1 if netlist file cannot opened
|
||||||
*/
|
*/
|
||||||
int NETLIST_READER::BuildComponentsListFromNetlist( const wxString& aNetlistFilename,
|
int NETLIST_READER::BuildComponentsListFromNetlist( const wxString& aNetlistFilename,
|
||||||
wxArrayString& aBufName )
|
wxArrayString& aBufName )
|
||||||
{
|
{
|
||||||
int component_count;
|
int component_count;
|
||||||
int state;
|
int state;
|
||||||
|
@ -904,16 +904,14 @@ int NETLIST_READER::BuildComponentsListFromNetlist( const wxString& aNetlistFile
|
||||||
|
|
||||||
if( state == 2 )
|
if( state == 2 )
|
||||||
{
|
{
|
||||||
bool error = false;
|
|
||||||
// skip TimeStamp:
|
// skip TimeStamp:
|
||||||
if( strtok( Line, " ()\t\n" ) == NULL )
|
strtok( Line, " ()\t\n" );
|
||||||
error = true;
|
|
||||||
// skip footprint name:
|
// skip footprint name:
|
||||||
if( ( strtok( NULL, " ()\t\n" ) ) == NULL )
|
strtok( NULL, " ()\t\n" );
|
||||||
error = true;
|
|
||||||
// Load the reference of the component:
|
// Load the reference of the component:
|
||||||
if( ( text = strtok( NULL, " ()\t\n" ) ) == NULL )
|
text = strtok( NULL, " ()\t\n" );
|
||||||
error = true;
|
|
||||||
component_count++;
|
component_count++;
|
||||||
aBufName.Add( FROM_UTF8( text ) );
|
aBufName.Add( FROM_UTF8( text ) );
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -554,8 +554,6 @@ void PCB_EDIT_FRAME::SaveSettings()
|
||||||
|
|
||||||
PCB_BASE_FRAME::SaveSettings();
|
PCB_BASE_FRAME::SaveSettings();
|
||||||
|
|
||||||
wxRealPoint GridSize = GetScreen()->GetGridSize();
|
|
||||||
|
|
||||||
config->Write( OPTKEY_DEFAULT_LINEWIDTH_VALUE, g_DrawDefaultLineThickness );
|
config->Write( OPTKEY_DEFAULT_LINEWIDTH_VALUE, g_DrawDefaultLineThickness );
|
||||||
long tmp = GetBoard()->IsElementVisible(RATSNEST_VISIBLE);
|
long tmp = GetBoard()->IsElementVisible(RATSNEST_VISIBLE);
|
||||||
config->Write( PCB_SHOW_FULL_RATSNET_OPT, tmp );
|
config->Write( PCB_SHOW_FULL_RATSNET_OPT, tmp );
|
||||||
|
|
|
@ -375,7 +375,7 @@ static int Autoroute_One_Track( PCB_EDIT_FRAME* pcbframe,
|
||||||
long curcell, newcell, buddy, lastopen, lastclos, lastmove;
|
long curcell, newcell, buddy, lastopen, lastclos, lastmove;
|
||||||
int newdist, olddir, _self;
|
int newdist, olddir, _self;
|
||||||
int current_net_code;
|
int current_net_code;
|
||||||
int marge, via_marge;
|
int marge;
|
||||||
int pad_masque_layer_s; /* Mask layers belonging to the
|
int pad_masque_layer_s; /* Mask layers belonging to the
|
||||||
*starting pad. */
|
*starting pad. */
|
||||||
int pad_masque_layer_e; /* Mask layers belonging to the ending
|
int pad_masque_layer_e; /* Mask layers belonging to the ending
|
||||||
|
@ -396,7 +396,6 @@ static int Autoroute_One_Track( PCB_EDIT_FRAME* pcbframe,
|
||||||
|
|
||||||
marge = s_Clearance +
|
marge = s_Clearance +
|
||||||
( pcbframe->GetBoard()->GetCurrentTrackWidth() / 2 );
|
( pcbframe->GetBoard()->GetCurrentTrackWidth() / 2 );
|
||||||
via_marge = s_Clearance + ( pcbframe->GetBoard()->GetCurrentViaSize() / 2 );
|
|
||||||
|
|
||||||
/* clear direction flags */
|
/* clear direction flags */
|
||||||
i = Nrows * Ncols * sizeof(DIR_CELL);
|
i = Nrows * Ncols * sizeof(DIR_CELL);
|
||||||
|
|
|
@ -260,10 +260,8 @@ void Trace_Pads_Only( EDA_DRAW_PANEL* panel, wxDC* DC, MODULE* Module,
|
||||||
int ox, int oy, int MasqueLayer, int draw_mode )
|
int ox, int oy, int MasqueLayer, int draw_mode )
|
||||||
{
|
{
|
||||||
int tmp;
|
int tmp;
|
||||||
PCB_SCREEN* screen;
|
|
||||||
PCB_BASE_FRAME* frame;
|
PCB_BASE_FRAME* frame;
|
||||||
|
|
||||||
screen = (PCB_SCREEN*) panel->GetScreen();
|
|
||||||
frame = (PCB_BASE_FRAME*) panel->GetParent();
|
frame = (PCB_BASE_FRAME*) panel->GetParent();
|
||||||
|
|
||||||
tmp = frame->m_DisplayPadFill;
|
tmp = frame->m_DisplayPadFill;
|
||||||
|
|
Loading…
Reference in New Issue