Merge trunk @ 5386
This commit is contained in:
commit
cf01c580af
|
@ -2,7 +2,7 @@
|
|||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2014 Mario Luzeiro <mrluzeiro@gmail.com>
|
||||
* Copyright (C) 1992-2014 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 1992-2015 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
|
||||
|
@ -28,9 +28,13 @@
|
|||
|
||||
#include "vrml_aux.h"
|
||||
|
||||
char SkipGetChar( FILE* File )
|
||||
|
||||
static int SkipGetChar ( FILE* File );
|
||||
|
||||
|
||||
static int SkipGetChar( FILE* File )
|
||||
{
|
||||
char c;
|
||||
int c;
|
||||
bool re_parse;
|
||||
|
||||
if( ( c = fgetc( File ) ) == EOF )
|
||||
|
@ -92,7 +96,7 @@ char SkipGetChar( FILE* File )
|
|||
|
||||
char* GetNextTag( FILE* File, char* tag )
|
||||
{
|
||||
char c = SkipGetChar( File );
|
||||
int c = SkipGetChar( File );
|
||||
|
||||
if( c == EOF )
|
||||
{
|
||||
|
@ -136,7 +140,7 @@ char* GetNextTag( FILE* File, char* tag )
|
|||
|
||||
int read_NotImplemented( FILE* File, char closeChar )
|
||||
{
|
||||
char c;
|
||||
int c;
|
||||
|
||||
// DBG( printf( "look for %c\n", closeChar) );
|
||||
while( ( c = fgetc( File ) ) != EOF )
|
||||
|
@ -189,7 +193,7 @@ int parseVertex( FILE* File, glm::vec3& dst_vertex )
|
|||
dst_vertex.y = b;
|
||||
dst_vertex.z = c;
|
||||
|
||||
char s = SkipGetChar( File );
|
||||
int s = SkipGetChar( File );
|
||||
|
||||
if( s != EOF )
|
||||
{
|
||||
|
|
|
@ -49,7 +49,6 @@
|
|||
#include <wx/glcanvas.h>
|
||||
|
||||
int read_NotImplemented( FILE* File, char closeChar);
|
||||
char SkipGetChar ( FILE* File );
|
||||
int parseVertexList( FILE* File, std::vector< glm::vec3 > &dst_vector);
|
||||
int parseVertex( FILE* File, glm::vec3 &dst_vertex );
|
||||
int parseFloat( FILE* File, float *dst_float );
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2014 Mario Luzeiro <mrluzeiro@gmail.com>
|
||||
* Copyright (C) 1992-2014 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 1992-2015 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
|
||||
|
@ -93,7 +93,7 @@ void VRML1_MODEL_PARSER::Load( const wxString& aFilename, double aVrmlunits_to_3
|
|||
|
||||
while( GetNextTag( m_file, text ) )
|
||||
{
|
||||
if( ( text == NULL ) || ( *text == '}' ) || ( *text == ']' ) )
|
||||
if( ( *text == '}' ) || ( *text == ']' ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
@ -187,7 +187,7 @@ int VRML1_MODEL_PARSER::readMaterial()
|
|||
|
||||
while( GetNextTag( m_file, text ) )
|
||||
{
|
||||
if( ( text == NULL ) || ( *text == ']' ) )
|
||||
if( *text == ']' )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
@ -235,7 +235,7 @@ int VRML1_MODEL_PARSER::readCoordinate3()
|
|||
|
||||
while( GetNextTag( m_file, text ) )
|
||||
{
|
||||
if( ( text == NULL ) || ( *text == ']' ) )
|
||||
if( *text == ']' )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
@ -263,7 +263,7 @@ int VRML1_MODEL_PARSER::readIndexedFaceSet()
|
|||
|
||||
while( GetNextTag( m_file, text ) )
|
||||
{
|
||||
if( ( text == NULL ) || ( *text == ']' ) )
|
||||
if( *text == ']' )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -88,14 +88,13 @@ void VRML2_MODEL_PARSER::Load( const wxString& aFilename, double aVrmlunits_to_3
|
|||
|
||||
glScalef( matScale.x, matScale.y, matScale.z );
|
||||
|
||||
// Switch the locale to standard C (needed to print floating point numbers like 1.3)
|
||||
SetLocaleTo_C_standard();
|
||||
LOCALE_IO toggle; // Temporary switch the locale to standard C to r/w floats
|
||||
|
||||
childs.clear();
|
||||
|
||||
while( GetNextTag( m_file, text ) )
|
||||
{
|
||||
if( ( text == NULL ) || ( *text == '}' ) || ( *text == ']' ) )
|
||||
if( ( *text == '}' ) || ( *text == ']' ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
@ -117,7 +116,6 @@ void VRML2_MODEL_PARSER::Load( const wxString& aFilename, double aVrmlunits_to_3
|
|||
}
|
||||
|
||||
fclose( m_file );
|
||||
SetLocaleTo_Default(); // revert to the current locale
|
||||
|
||||
|
||||
// DBG( printf( "chils size:%lu\n", childs.size() ) );
|
||||
|
@ -140,7 +138,7 @@ int VRML2_MODEL_PARSER::read_Transform()
|
|||
|
||||
while( GetNextTag( m_file, text ) )
|
||||
{
|
||||
if( ( text == NULL ) || ( *text == ']' ) )
|
||||
if( *text == ']' )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
@ -259,7 +257,7 @@ int VRML2_MODEL_PARSER::read_DEF()
|
|||
|
||||
while( GetNextTag( m_file, text ) )
|
||||
{
|
||||
if( ( text == NULL ) || ( *text == ']' ) )
|
||||
if( *text == ']' )
|
||||
{
|
||||
// DBG( printf( " skiping %c\n", *text) );
|
||||
continue;
|
||||
|
@ -316,7 +314,7 @@ int VRML2_MODEL_PARSER::read_Shape()
|
|||
|
||||
while( GetNextTag( m_file, text ) )
|
||||
{
|
||||
if( ( text == NULL ) || ( *text == ']' ) )
|
||||
if( *text == ']' )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
@ -363,7 +361,7 @@ int VRML2_MODEL_PARSER::read_Appearance()
|
|||
|
||||
while( GetNextTag( m_file, text ) )
|
||||
{
|
||||
if( ( text == NULL ) || ( *text == ']' ) )
|
||||
if( *text == ']' )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
@ -468,7 +466,7 @@ int VRML2_MODEL_PARSER::read_Material()
|
|||
|
||||
while( GetNextTag( m_file, text ) )
|
||||
{
|
||||
if( ( text == NULL ) || ( *text == ']' ) )
|
||||
if( *text == ']' )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
@ -561,7 +559,7 @@ int VRML2_MODEL_PARSER::read_IndexedFaceSet()
|
|||
|
||||
while( GetNextTag( m_file, text ) )
|
||||
{
|
||||
if( ( text == NULL ) || ( *text == ']' ) )
|
||||
if( *text == ']' )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
@ -744,7 +742,7 @@ int VRML2_MODEL_PARSER::read_Color()
|
|||
|
||||
while( GetNextTag( m_file, text ) )
|
||||
{
|
||||
if( ( text == NULL ) || ( *text == ']' ) )
|
||||
if( *text == ']' )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
@ -774,7 +772,7 @@ int VRML2_MODEL_PARSER::read_Normal()
|
|||
|
||||
while( GetNextTag( m_file, text ) )
|
||||
{
|
||||
if( ( text == NULL ) || ( *text == ']' ) )
|
||||
if( *text == ']' )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
@ -812,7 +810,7 @@ int VRML2_MODEL_PARSER::read_Coordinate()
|
|||
|
||||
while( GetNextTag( m_file, text ) )
|
||||
{
|
||||
if( ( text == NULL ) || ( *text == ']' ) )
|
||||
if( *text == ']' )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -425,6 +425,7 @@ set( wxWidgets_CONFIG_OPTIONS --static=no )
|
|||
|
||||
if( KICAD_USE_WEBKIT AND BUILD_GITHUB_PLUGIN )
|
||||
set( webkitlib "webview" )
|
||||
add_definitions( -DKICAD_USE_WEBKIT )
|
||||
else()
|
||||
set( webkitlib "" )
|
||||
endif()
|
||||
|
|
|
@ -37,6 +37,7 @@
|
|||
#include <layers_id_colors_and_visibility.h>
|
||||
#include <potracelib.h>
|
||||
#include <auxiliary.h>
|
||||
#include <common.h>
|
||||
|
||||
#include <bitmap2component.h>
|
||||
|
||||
|
@ -158,6 +159,12 @@ int bitmap2component( potrace_bitmap_t* aPotrace_bitmap, FILE* aOutfile,
|
|||
st = potrace_trace( param, aPotrace_bitmap );
|
||||
if( !st || st->status != POTRACE_STATUS_OK )
|
||||
{
|
||||
if( st )
|
||||
{
|
||||
potrace_state_free( st );
|
||||
}
|
||||
potrace_param_free( param );
|
||||
|
||||
fprintf( stderr, "Error tracing bitmap: %s\n", strerror( errno ) );
|
||||
return 1;
|
||||
}
|
||||
|
@ -431,7 +438,7 @@ void BITMAPCONV_INFO::CreateOutputFile( BMP2CMP_MOD_LAYER aModLayer )
|
|||
|
||||
potrace_dpoint_t( *c )[3];
|
||||
|
||||
setlocale( LC_NUMERIC, "C" ); // Switch the locale to standard C
|
||||
LOCALE_IO toggle; // Temporary switch the locale to standard C to r/w floats
|
||||
|
||||
// The layer name has meaning only for .kicad_mod files.
|
||||
// For these files the header creates 2 invisible texts: value and ref
|
||||
|
@ -524,8 +531,6 @@ void BITMAPCONV_INFO::CreateOutputFile( BMP2CMP_MOD_LAYER aModLayer )
|
|||
}
|
||||
|
||||
OuputFileEnd();
|
||||
|
||||
setlocale( LC_NUMERIC, "" ); // revert to the current locale
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@ enum textbox {
|
|||
|
||||
EDA_ITEM::EDA_ITEM( EDA_ITEM* parent, KICAD_T idType )
|
||||
{
|
||||
InitVars();
|
||||
initVars();
|
||||
m_StructType = idType;
|
||||
m_Parent = parent;
|
||||
}
|
||||
|
@ -57,14 +57,14 @@ EDA_ITEM::EDA_ITEM( EDA_ITEM* parent, KICAD_T idType )
|
|||
|
||||
EDA_ITEM::EDA_ITEM( KICAD_T idType )
|
||||
{
|
||||
InitVars();
|
||||
initVars();
|
||||
m_StructType = idType;
|
||||
}
|
||||
|
||||
|
||||
EDA_ITEM::EDA_ITEM( const EDA_ITEM& base )
|
||||
{
|
||||
InitVars();
|
||||
initVars();
|
||||
m_StructType = base.m_StructType;
|
||||
m_Parent = base.m_Parent;
|
||||
m_Flags = base.m_Flags;
|
||||
|
@ -75,7 +75,7 @@ EDA_ITEM::EDA_ITEM( const EDA_ITEM& base )
|
|||
}
|
||||
|
||||
|
||||
void EDA_ITEM::InitVars()
|
||||
void EDA_ITEM::initVars()
|
||||
{
|
||||
m_StructType = TYPE_NOT_INIT;
|
||||
Pnext = NULL; // Linked list: Link (next struct)
|
||||
|
|
|
@ -83,7 +83,7 @@ std::string Double2Str( double aValue )
|
|||
len = sprintf( buf, "%.16g", aValue );
|
||||
}
|
||||
|
||||
return std::string( buf, len );;
|
||||
return std::string( buf, len );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||
* Copyright (C) 2013 Wayne Stambaugh <stambaughw@verizon.net>
|
||||
* Copyright (C) 2013-2015 Wayne Stambaugh <stambaughw@verizon.net>
|
||||
* Copyright (C) 1992-2015 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
|
@ -72,7 +72,6 @@ EDA_BASE_FRAME::EDA_BASE_FRAME( wxWindow* aParent, FRAME_T aFrameType,
|
|||
|
||||
m_Ident = aFrameType;
|
||||
m_mainToolBar = NULL;
|
||||
m_FrameIsActive = true;
|
||||
m_hasAutoSave = false;
|
||||
m_autoSaveState = false;
|
||||
m_autoSaveInterval = -1;
|
||||
|
|
|
@ -197,7 +197,7 @@ bool BITMAP_BASE::LoadData( LINE_READER& aLine, wxString& aErrorMsg )
|
|||
}
|
||||
|
||||
|
||||
EDA_RECT BITMAP_BASE::GetBoundingBox() const
|
||||
const EDA_RECT BITMAP_BASE::GetBoundingBox() const
|
||||
{
|
||||
EDA_RECT rect;
|
||||
|
||||
|
|
|
@ -411,14 +411,14 @@ public:
|
|||
// wxModalEventLoop depends on this (so we can't just use ON_BLOCK_EXIT or
|
||||
// something similar here)
|
||||
#if wxUSE_EXCEPTIONS
|
||||
for ( ;; )
|
||||
for( ; ; )
|
||||
{
|
||||
try
|
||||
{
|
||||
#endif // wxUSE_EXCEPTIONS
|
||||
|
||||
// this is the event loop itself
|
||||
for ( ;; )
|
||||
for( ; ; )
|
||||
{
|
||||
// generate and process idle events for as long as we don't
|
||||
// have anything else to do
|
||||
|
@ -446,7 +446,7 @@ public:
|
|||
// handlers endlessly generate new events but they shouldn't do
|
||||
// this in a well-behaved program and we shouldn't just discard the
|
||||
// events we already have, they might be important.
|
||||
for ( ;; )
|
||||
for( ; ; )
|
||||
{
|
||||
bool hasMoreEvents = false;
|
||||
if ( wxTheApp && wxTheApp->HasPendingEvents() )
|
||||
|
|
|
@ -41,7 +41,7 @@ DIALOG_IMAGE_EDITOR::DIALOG_IMAGE_EDITOR( wxWindow* aParent, BITMAP_BASE* aItem
|
|||
m_buttonUndoLast->Enable( false );
|
||||
wxString msg;
|
||||
msg.Printf( wxT("%f"), m_workingImage->m_Scale );
|
||||
m_textCtrlScale->SetValue( msg );;
|
||||
m_textCtrlScale->SetValue( msg );
|
||||
|
||||
GetSizer()->SetSizeHints( this );
|
||||
Layout();
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2004 Jean-Pierre Charras, jean-pierre.charras@gipsa-lab.inpg.fr
|
||||
* Copyright (C) 2008-2011 Wayne Stambaugh <stambaughw@verizon.net>
|
||||
* Copyright (C) 2004-2011 KiCad Developers, see change_log.txt for contributors.
|
||||
* Copyright (C) 2004-2015 Jean-Pierre Charras, jean-pierre.charras@gipsa-lab.inpg.fr
|
||||
* Copyright (C) 2008-2015 Wayne Stambaugh <stambaughw@verizon.net>
|
||||
* Copyright (C) 2004-2015 KiCad Developers, see change_log.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
|
||||
|
@ -226,8 +226,6 @@ void EDA_DRAW_FRAME::EraseMsgBox()
|
|||
|
||||
void EDA_DRAW_FRAME::OnActivate( wxActivateEvent& event )
|
||||
{
|
||||
m_FrameIsActive = event.GetActive();
|
||||
|
||||
if( m_canvas )
|
||||
m_canvas->SetCanStartBlock( -1 );
|
||||
|
||||
|
|
|
@ -815,10 +815,11 @@ void OPENGL_GAL::drawLineQuad( const VECTOR2D& aStartPoint, const VECTOR2D& aEnd
|
|||
|
||||
VECTOR2D startEndVector = aEndPoint - aStartPoint;
|
||||
double lineLength = startEndVector.EuclideanNorm();
|
||||
double scale = 0.5 * lineWidth / lineLength;
|
||||
|
||||
if( lineLength <= 0.0 )
|
||||
return;
|
||||
|
||||
double scale = 0.5 * lineWidth / lineLength;
|
||||
|
||||
// The perpendicular vector also needs transformations
|
||||
glm::vec4 vector = currentManager->GetTransformation() *
|
||||
|
|
|
@ -65,7 +65,7 @@ void GRID_TRICKS::getSelectedArea()
|
|||
wxArrayInt cols = m_grid->GetSelectedCols();
|
||||
wxArrayInt rows = m_grid->GetSelectedRows();
|
||||
|
||||
DBG(printf("topLeft.Count():%zd botRight:Count():%zd\n", topLeft.Count(), botRight.Count() );)
|
||||
DBG(printf("topLeft.Count():%d botRight:Count():%d\n", int( topLeft.Count() ), int( botRight.Count() ) );)
|
||||
|
||||
if( topLeft.Count() && botRight.Count() )
|
||||
{
|
||||
|
|
|
@ -125,7 +125,7 @@ struct APP_SINGLE_TOP : public wxApp
|
|||
{
|
||||
wxLogError( wxT( "Unhandled exception class: %s what: %s" ),
|
||||
GetChars( FROM_UTF8( typeid(e).name() )),
|
||||
GetChars( FROM_UTF8( e.what() ) ) );;
|
||||
GetChars( FROM_UTF8( e.what() ) ) );
|
||||
}
|
||||
catch( const IO_ERROR& ioe )
|
||||
{
|
||||
|
@ -158,7 +158,7 @@ struct APP_SINGLE_TOP : public wxApp
|
|||
{
|
||||
wxLogError( wxT( "Unhandled exception class: %s what: %s" ),
|
||||
GetChars( FROM_UTF8( typeid(e).name() )),
|
||||
GetChars( FROM_UTF8( e.what() ) ) );;
|
||||
GetChars( FROM_UTF8( e.what() ) ) );
|
||||
}
|
||||
catch( const IO_ERROR& ioe )
|
||||
{
|
||||
|
|
|
@ -10,7 +10,6 @@ add_definitions( -DCVPCB )
|
|||
|
||||
if( KICAD_USE_WEBKIT AND BUILD_GITHUB_PLUGIN )
|
||||
set( WEBVIEWER_WXLIB "webviewer" )
|
||||
add_definitions( -DKICAD_USE_WEBKIT )
|
||||
endif()
|
||||
|
||||
|
||||
|
|
|
@ -218,7 +218,7 @@ void CVPCB_MAINFRAME::AutomaticFootprintMatching( wxCommandEvent& event )
|
|||
|
||||
bool equ_is_unique = true;
|
||||
unsigned next = idx+1;
|
||||
unsigned previous = idx-1;
|
||||
int previous = idx-1;
|
||||
|
||||
if( next < equiv_List.size() &&
|
||||
equivItem.m_ComponentValue == equiv_List[next].m_ComponentValue )
|
||||
|
|
|
@ -306,7 +306,7 @@ bool CVPCB_MAINFRAME::ReadNetListAndLinkFiles()
|
|||
if( component->GetFPID().IsLegacy() || component->GetAltFPID().IsLegacy())
|
||||
continue;
|
||||
|
||||
m_indexes.push_back( ii );;
|
||||
m_indexes.push_back( ii );
|
||||
}
|
||||
|
||||
// If a n assignment conflict is found,
|
||||
|
|
|
@ -1055,7 +1055,7 @@ bool LIB_PART::LoadFootprints( LINE_READER& aLineReader, wxString& aErrorMsg )
|
|||
}
|
||||
|
||||
|
||||
EDA_RECT LIB_PART::GetBoundingBox( int aUnit, int aConvert ) const
|
||||
const EDA_RECT LIB_PART::GetBoundingBox( int aUnit, int aConvert ) const
|
||||
{
|
||||
EDA_RECT bBox( wxPoint( 0, 0 ), wxSize( 0, 0 ) );
|
||||
|
||||
|
@ -1080,7 +1080,7 @@ EDA_RECT LIB_PART::GetBoundingBox( int aUnit, int aConvert ) const
|
|||
}
|
||||
|
||||
|
||||
EDA_RECT LIB_PART::GetBodyBoundingBox( int aUnit, int aConvert ) const
|
||||
const EDA_RECT LIB_PART::GetBodyBoundingBox( int aUnit, int aConvert ) const
|
||||
{
|
||||
EDA_RECT bBox( wxPoint( 0, 0 ), wxSize( 0, 0 ) );
|
||||
|
||||
|
|
|
@ -296,7 +296,7 @@ public:
|
|||
* if aConvert == 0 Convert is non used
|
||||
* Invisible fields are not taken in account
|
||||
**/
|
||||
EDA_RECT GetBoundingBox( int aUnit, int aConvert ) const;
|
||||
const EDA_RECT GetBoundingBox( int aUnit, int aConvert ) const;
|
||||
|
||||
/**
|
||||
* Function GetBodyBoundingBox
|
||||
|
@ -307,7 +307,7 @@ public:
|
|||
* if aConvert == 0 Convert is non used
|
||||
* Fields are not taken in account
|
||||
**/
|
||||
EDA_RECT GetBodyBoundingBox( int aUnit, int aConvert ) const;
|
||||
const EDA_RECT GetBodyBoundingBox( int aUnit, int aConvert ) const;
|
||||
|
||||
/**
|
||||
* Function SaveDateAndTime
|
||||
|
|
|
@ -550,7 +550,7 @@ void DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::initBuffers()
|
|||
if( !it->m_Visible )
|
||||
fld.SetVisible( false );
|
||||
else
|
||||
fld.SetVisible( true );;
|
||||
fld.SetVisible( true );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -118,14 +118,14 @@ void DIALOG_LIB_EDIT_PIN::OnPropertiesChange( wxCommandEvent& event )
|
|||
if( ! IsShown() ) // do nothing at init time
|
||||
return;
|
||||
|
||||
int pinNameSize = ValueFromString( g_UserUnit, GetNameTextSize() );
|
||||
int pinNameSize = ValueFromString( g_UserUnit, GetPinNameTextSize() );
|
||||
int pinNumSize = ValueFromString( g_UserUnit, GetPadNameTextSize());
|
||||
int pinOrient = LIB_PIN::GetOrientationCode( GetOrientation() );
|
||||
int pinLength = ValueFromString( g_UserUnit, GetLength() );
|
||||
int pinShape = LIB_PIN::GetStyleCode( GetStyle() );
|
||||
int pinType = GetElectricalType();
|
||||
|
||||
m_dummyPin->SetName( GetName() );
|
||||
m_dummyPin->SetName( GetPinName() );
|
||||
m_dummyPin->SetNameTextSize( pinNameSize );
|
||||
m_dummyPin->SetNumber( GetPadName() );
|
||||
m_dummyPin->SetNumberTextSize( pinNumSize );
|
||||
|
|
|
@ -71,19 +71,19 @@ public:
|
|||
void SetStyle( int style ) { m_choiceStyle->SetSelection( style ); }
|
||||
int GetStyle( void ) { return m_choiceStyle->GetSelection(); }
|
||||
|
||||
void SetName( const wxString& name ) { m_textPinName->SetValue( name ); }
|
||||
wxString GetName( void ) { return m_textPinName->GetValue(); }
|
||||
void SetPinName( const wxString& name ) { m_textPinName->SetValue( name ); }
|
||||
wxString GetPinName( void ) { return m_textPinName->GetValue(); }
|
||||
|
||||
void SetNameTextSize( const wxString& size )
|
||||
void SetPinNameTextSize( const wxString& size )
|
||||
{
|
||||
m_textPinNameTextSize->SetValue( size );
|
||||
}
|
||||
wxString GetNameTextSize( void )
|
||||
wxString GetPinNameTextSize( void )
|
||||
{
|
||||
return m_textPinNameTextSize->GetValue();
|
||||
}
|
||||
|
||||
void SetNameTextSizeUnits( const wxString& units )
|
||||
void SetPinNameTextSizeUnits( const wxString& units )
|
||||
{
|
||||
m_staticNameTextSizeUnits->SetLabel( units );
|
||||
}
|
||||
|
|
|
@ -1919,38 +1919,44 @@ void LIB_PIN::SetWidth( int aWidth )
|
|||
|
||||
void LIB_PIN::GetMsgPanelInfo( MSG_PANEL_ITEMS& aList )
|
||||
{
|
||||
wxString Text;
|
||||
wxString text;
|
||||
|
||||
LIB_ITEM::GetMsgPanelInfo( aList );
|
||||
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Name" ), m_name, DARKCYAN ) );
|
||||
|
||||
if( m_number == 0 )
|
||||
Text = wxT( "?" );
|
||||
text = wxT( "?" );
|
||||
else
|
||||
PinStringNum( Text );
|
||||
PinStringNum( text );
|
||||
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Number" ), Text, DARKCYAN ) );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Number" ), text, DARKCYAN ) );
|
||||
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Type" ),
|
||||
wxGetTranslation( pin_electrical_type_names[ m_type ] ),
|
||||
RED ) );
|
||||
Text = wxGetTranslation( pin_style_names[ GetStyleCodeIndex( m_shape ) ] );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Style" ), Text, BLUE ) );
|
||||
|
||||
int styleCodeIndex = GetStyleCodeIndex( m_shape );
|
||||
if( styleCodeIndex >= 0 )
|
||||
text = wxGetTranslation( pin_style_names[ styleCodeIndex ] );
|
||||
else
|
||||
text = wxT( "?" );
|
||||
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Style" ), text, BLUE ) );
|
||||
|
||||
if( IsVisible() )
|
||||
Text = _( "Yes" );
|
||||
text = _( "Yes" );
|
||||
else
|
||||
Text = _( "No" );
|
||||
text = _( "No" );
|
||||
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Visible" ), Text, DARKGREEN ) );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Visible" ), text, DARKGREEN ) );
|
||||
|
||||
// Display pin length
|
||||
Text = StringFromValue( g_UserUnit, m_length, true );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Length" ), Text, MAGENTA ) );
|
||||
text = StringFromValue( g_UserUnit, m_length, true );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Length" ), text, MAGENTA ) );
|
||||
|
||||
Text = wxGetTranslation( pin_orientation_names[ GetOrientationCodeIndex( m_orientation ) ] );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Orientation" ), Text, DARKMAGENTA ) );
|
||||
text = wxGetTranslation( pin_orientation_names[ GetOrientationCodeIndex( m_orientation ) ] );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Orientation" ), text, DARKMAGENTA ) );
|
||||
}
|
||||
|
||||
|
||||
|
@ -2201,11 +2207,18 @@ BITMAP_DEF LIB_PIN::GetMenuImage() const
|
|||
wxString LIB_PIN::GetSelectMenuText() const
|
||||
{
|
||||
wxString tmp;
|
||||
wxString style;
|
||||
|
||||
int styleCode = GetStyleCodeIndex( m_shape );
|
||||
if( styleCode >= 0 )
|
||||
style = wxGetTranslation( pin_style_names[ styleCode ] );
|
||||
else
|
||||
style = wxT( "?" );
|
||||
|
||||
tmp.Printf( _( "Pin %s, %s, %s" ),
|
||||
GetChars( GetNumberString() ),
|
||||
GetChars( GetTypeString() ),
|
||||
GetChars( wxGetTranslation( pin_style_names[ GetStyleCodeIndex( m_shape ) ] ) )
|
||||
GetChars( style )
|
||||
);
|
||||
return tmp;
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
|
||||
* Copyright (C) 2004 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||
* Copyright (C) 2008-2011 Wayne Stambaugh <stambaughw@verizon.net>
|
||||
* Copyright (C) 2004-2011 KiCad Developers, see change_log.txt for contributors.
|
||||
*
|
||||
|
@ -110,9 +110,9 @@ void LIB_EDIT_FRAME::OnEditPin( wxCommandEvent& event )
|
|||
dlg.SetElectricalTypeList( LIB_PIN::GetElectricalTypeNames(),
|
||||
LIB_PIN::GetElectricalTypeSymbols() );
|
||||
dlg.SetElectricalType( pin->GetType() );
|
||||
dlg.SetName( pin->GetName() );
|
||||
dlg.SetNameTextSize( StringFromValue( g_UserUnit, pin->GetNameTextSize() ) );
|
||||
dlg.SetNameTextSizeUnits( units );
|
||||
dlg.SetPinName( pin->GetName() );
|
||||
dlg.SetPinNameTextSize( StringFromValue( g_UserUnit, pin->GetNameTextSize() ) );
|
||||
dlg.SetPinNameTextSizeUnits( units );
|
||||
dlg.SetPadName( pin->GetNumberString() );
|
||||
dlg.SetPadNameTextSize( StringFromValue( g_UserUnit, pin->GetNumberTextSize() ) );
|
||||
|
||||
|
@ -132,7 +132,6 @@ void LIB_EDIT_FRAME::OnEditPin( wxCommandEvent& event )
|
|||
dlg.Layout();
|
||||
dlg.Fit();
|
||||
dlg.SetMinSize( dlg.GetSize() );
|
||||
// dlg.SetLastSizeAndPosition(); // done in DIALOG_SHIM::Show()
|
||||
|
||||
if( dlg.ShowModal() == wxID_CANCEL )
|
||||
{
|
||||
|
@ -145,7 +144,7 @@ void LIB_EDIT_FRAME::OnEditPin( wxCommandEvent& event )
|
|||
}
|
||||
|
||||
// Save the pin properties to use for the next new pin.
|
||||
LastPinNameSize = ValueFromString( g_UserUnit, dlg.GetNameTextSize() );
|
||||
LastPinNameSize = ValueFromString( g_UserUnit, dlg.GetPinNameTextSize() );
|
||||
LastPinNumSize = ValueFromString( g_UserUnit, dlg.GetPadNameTextSize() );
|
||||
LastPinOrient = LIB_PIN::GetOrientationCode( dlg.GetOrientation() );
|
||||
LastPinLength = ValueFromString( g_UserUnit, dlg.GetLength() );
|
||||
|
@ -156,7 +155,7 @@ void LIB_EDIT_FRAME::OnEditPin( wxCommandEvent& event )
|
|||
LastPinVisible = dlg.GetVisible();
|
||||
|
||||
pin->EnableEditMode( true, m_editPinsPerPartOrConvert );
|
||||
pin->SetName( dlg.GetName() );
|
||||
pin->SetName( dlg.GetPinName() );
|
||||
pin->SetNameTextSize( GetLastPinNameSize() );
|
||||
pin->SetNumber( dlg.GetPadName() );
|
||||
pin->SetNumberTextSize( GetLastPinNumSize() );
|
||||
|
|
|
@ -125,22 +125,20 @@ void SCH_MARKER::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC,
|
|||
}
|
||||
|
||||
|
||||
bool SCH_MARKER::Matches( wxFindReplaceData& aSearchData, wxPoint * aFindLocation )
|
||||
bool SCH_MARKER::Matches( wxFindReplaceData& aSearchData, void* aAuxData,
|
||||
wxPoint * aFindLocation )
|
||||
{
|
||||
if( !SCH_ITEM::Matches( m_drc.GetMainText(), aSearchData ) )
|
||||
if( SCH_ITEM::Matches( m_drc.GetErrorText(), aSearchData ) ||
|
||||
SCH_ITEM::Matches( m_drc.GetMainText(), aSearchData ) ||
|
||||
SCH_ITEM::Matches( m_drc.GetAuxiliaryText(), aSearchData ) )
|
||||
{
|
||||
if( SCH_ITEM::Matches( m_drc.GetAuxiliaryText(), aSearchData ) )
|
||||
{
|
||||
if( aFindLocation )
|
||||
*aFindLocation = m_Pos;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
if( aFindLocation )
|
||||
*aFindLocation = m_Pos;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
if( aFindLocation )
|
||||
*aFindLocation = m_Pos;
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
|
||||
* Copyright (C) 2004-2011 KiCad Developers, see change_log.txt for contributors.
|
||||
* Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||
* Copyright (C) 2004-2015 KiCad Developers, see change_log.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
|
||||
|
@ -89,13 +89,16 @@ public:
|
|||
void Rotate( wxPoint aPosition );
|
||||
|
||||
/**
|
||||
* Function Matches, virtual from the base class EDA_ITEM
|
||||
* Compare DRC marker main and auxiliary text against search string.
|
||||
*
|
||||
* @param aSearchData - Criteria to search against.
|
||||
* @param aAuxData A pointer to optional data required for the search or NULL
|
||||
* if not used.
|
||||
* @param aFindLocation - a wxPoint where to put the location of matched item. can be NULL.
|
||||
* @return True if the DRC main or auxiliary text matches the search criteria.
|
||||
*/
|
||||
bool Matches( wxFindReplaceData& aSearchData, wxPoint* aFindLocation );
|
||||
bool Matches( wxFindReplaceData& aSearchData, void* aAuxData, wxPoint* aFindLocation );
|
||||
|
||||
void GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList );
|
||||
|
||||
|
|
|
@ -172,7 +172,7 @@ void GERBER_LAYER_WIDGET::onPopupSelection( wxCommandEvent& event )
|
|||
{
|
||||
int rowCount;
|
||||
int menuId = event.GetId();
|
||||
bool visible = (menuId == ID_SHOW_ALL_LAYERS) ? true : false;;
|
||||
bool visible = (menuId == ID_SHOW_ALL_LAYERS) ? true : false;
|
||||
long visibleLayers = 0;
|
||||
bool force_active_layer_visible;
|
||||
|
||||
|
|
|
@ -172,7 +172,7 @@ void GERBVIEW_FRAME::ExportDataInPcbnewFormat( wxCommandEvent& event )
|
|||
}
|
||||
|
||||
wxString fileName;
|
||||
wxString path = wxGetCwd();;
|
||||
wxString path = wxGetCwd();
|
||||
|
||||
wxFileDialog filedlg( this, _( "Board file name:" ),
|
||||
path, fileName, PcbFileWildcard,
|
||||
|
|
|
@ -269,11 +269,6 @@ void GERBVIEW_FRAME::LoadSettings( wxConfigBase* aCfg )
|
|||
aCfg->SetPath( wxT( "drl_files" ) );
|
||||
m_drillFileHistory.Load( *aCfg );
|
||||
aCfg->SetPath( wxT( ".." ) );
|
||||
|
||||
// WxWidgets 2.9.1 seems call setlocale( LC_NUMERIC, "" )
|
||||
// when reading doubles in config,
|
||||
// but forget to back to current locale. So we call SetLocaleTo_Default
|
||||
SetLocaleTo_Default();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -186,7 +186,7 @@ protected:
|
|||
|
||||
private:
|
||||
|
||||
void InitVars();
|
||||
void initVars();
|
||||
|
||||
public:
|
||||
|
||||
|
@ -428,6 +428,7 @@ public:
|
|||
/**
|
||||
* Function Matches
|
||||
* compares \a aText against search criteria in \a aSearchData.
|
||||
* Helper function used in search and replace dialog
|
||||
*
|
||||
* @param aText A reference to a wxString object containing the string to test.
|
||||
* @param aSearchData The criteria to search against.
|
||||
|
|
|
@ -140,9 +140,9 @@ public: BITMAP_BASE( const wxPoint& pos = wxPoint( 0, 0 ) );
|
|||
* schematic coordinate system. It is OK to overestimate the size
|
||||
* by a few counts.
|
||||
*/
|
||||
EDA_RECT GetBoundingBox() const;
|
||||
const EDA_RECT GetBoundingBox() const;
|
||||
|
||||
void DrawBitmap( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aPos );
|
||||
void DrawBitmap( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aPos );
|
||||
|
||||
/**
|
||||
* Function ReadImageFile
|
||||
|
|
|
@ -64,7 +64,7 @@ public:
|
|||
|
||||
const wxString& GetTitle() const
|
||||
{
|
||||
return getTbText( titleIdx );;
|
||||
return getTbText( titleIdx );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2009 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
|
||||
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@verizon.net>
|
||||
* Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2009-2015 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
|
||||
* Copyright (C) 2011-2015 Wayne Stambaugh <stambaughw@verizon.net>
|
||||
* Copyright (C) 1992-2015 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
|
||||
|
@ -118,7 +118,6 @@ protected:
|
|||
wxSize m_FrameSize;
|
||||
|
||||
wxAuiToolBar* m_mainToolBar; ///< Standard horizontal Toolbar
|
||||
bool m_FrameIsActive;
|
||||
wxString m_FrameName; ///< name used for writing and reading setup
|
||||
///< It is "SchematicFrame", "PcbFrame" ....
|
||||
wxString m_AboutTitle; ///< Name of program displayed in About.
|
||||
|
@ -200,8 +199,6 @@ public:
|
|||
|
||||
wxString GetName() const { return m_FrameName; }
|
||||
|
||||
bool IsActive() const { return m_FrameIsActive; }
|
||||
|
||||
bool IsType( FRAME_T aType ) const { return m_Ident == aType; }
|
||||
|
||||
void GetKicadHelp( wxCommandEvent& event );
|
||||
|
|
|
@ -271,7 +271,7 @@ struct APP_KICAD : public wxApp
|
|||
{
|
||||
wxLogError( wxT( "Unhandled exception class: %s what: %s" ),
|
||||
GetChars( FROM_UTF8( typeid(e).name() )),
|
||||
GetChars( FROM_UTF8( e.what() ) ) );;
|
||||
GetChars( FROM_UTF8( e.what() ) ) );
|
||||
}
|
||||
catch( const IO_ERROR& ioe )
|
||||
{
|
||||
|
|
|
@ -84,7 +84,7 @@ public:
|
|||
* may be called soon after ComputeBoundingBox() to return the same EDA_RECT,
|
||||
* as long as the CLASS_PL_EDITOR_LAYOUT has not changed.
|
||||
*/
|
||||
EDA_RECT GetBoundingBox() const { return m_BoundingBox; } // override
|
||||
const EDA_RECT GetBoundingBox() const { return m_BoundingBox; } // override
|
||||
|
||||
void SetBoundingBox( const EDA_RECT& aBox ) { m_BoundingBox = aBox; }
|
||||
|
||||
|
|
|
@ -198,7 +198,7 @@ void PROPERTIES_FRAME::CopyPrmsFromItemToPanel( WORKSHEET_DATAITEM* aItem )
|
|||
WORKSHEET_DATAITEM_TEXT* item = (WORKSHEET_DATAITEM_TEXT*) aItem;
|
||||
item->m_FullText = item->m_TextBase;
|
||||
// Replace our '\' 'n' sequence by the EOL char
|
||||
item->ReplaceAntiSlashSequence();;
|
||||
item->ReplaceAntiSlashSequence();
|
||||
m_textCtrlText->SetValue( item->m_FullText );
|
||||
|
||||
msg.Printf( wxT("%d"), item->m_IncrementLabel );
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
/*
|
||||
* This program source code file is part of KICAD, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 12011 jean-pierre.charras
|
||||
* Copyright (C) 2011 jean-pierre.charras
|
||||
* Copyright (C) 2011 Kicad Developers, see change_log.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
|
@ -83,10 +83,12 @@ void PCB_CALCULATOR_FRAME::TransfAttenuatorDataToPanel()
|
|||
m_AttValueCtrl->Enable( m_currAttenuator->m_Attenuation_Enable );
|
||||
|
||||
m_ZinValueCtrl->Enable( m_currAttenuator->m_Zin_Enable );
|
||||
|
||||
if( m_currAttenuator->m_Zin_Enable )
|
||||
msg.Printf( wxT( "%g" ), m_currAttenuator->m_Zin );
|
||||
else
|
||||
msg.Clear();;
|
||||
msg.Clear();
|
||||
|
||||
m_ZinValueCtrl->SetValue( msg );
|
||||
|
||||
msg.Printf( wxT( "%g" ), m_currAttenuator->m_Zout );
|
||||
|
|
|
@ -373,7 +373,6 @@ endif()
|
|||
|
||||
if( KICAD_USE_WEBKIT AND BUILD_GITHUB_PLUGIN )
|
||||
set( WEBVIEWER_WXLIB "webviewer" )
|
||||
add_definitions( -DKICAD_USE_WEBKIT )
|
||||
endif()
|
||||
|
||||
|
||||
|
|
|
@ -652,8 +652,7 @@ int getOptimalModulePlacement( PCB_EDIT_FRAME* aFrame, MODULE* aModule, wxDC* aD
|
|||
CurrPosition = initialPos;
|
||||
|
||||
// Undraw the current footprint
|
||||
g_Offset_Module = wxPoint( 0, 0 );
|
||||
DrawModuleOutlines( aFrame->GetCanvas(), aDC, aModule );
|
||||
aModule->DrawOutlinesWhenMoving( aFrame->GetCanvas(), aDC, wxPoint( 0, 0 ) );
|
||||
|
||||
g_Offset_Module = mod_pos - CurrPosition;
|
||||
|
||||
|
|
|
@ -767,11 +767,6 @@ void PCB_BASE_FRAME::LoadSettings( wxConfigBase* aCfg )
|
|||
|
||||
if( m_DisplayOptions.m_DisplayModText < LINE || m_DisplayOptions.m_DisplayModText > SKETCH )
|
||||
m_DisplayOptions.m_DisplayModText = FILLED;
|
||||
|
||||
// WxWidgets 2.9.1 seems call setlocale( LC_NUMERIC, "" )
|
||||
// when reading doubles in config,
|
||||
// but forget to back to current locale. So we call SetLocaleTo_Default
|
||||
SetLocaleTo_Default( );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -532,7 +532,7 @@ static void drawPickedItems( EDA_DRAW_PANEL* aPanel, wxDC* aDC, wxPoint aOffset
|
|||
{
|
||||
case PCB_MODULE_T:
|
||||
frame->GetBoard()->m_Status_Pcb &= ~RATSNEST_ITEM_LOCAL_OK;
|
||||
DrawModuleOutlines( aPanel, aDC, (MODULE*) item );
|
||||
((MODULE*) item)->DrawOutlinesWhenMoving( aPanel, aDC, g_Offset_Module );
|
||||
break;
|
||||
|
||||
case PCB_LINE_T:
|
||||
|
|
|
@ -6,11 +6,11 @@
|
|||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2012 Jean-Pierre Charras, jean-pierre.charras@ujf-grenoble.fr
|
||||
* Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||
* Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
||||
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@verizon.net>
|
||||
*
|
||||
* Copyright (C) 1992-2012 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 1992-2015 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
|
||||
|
@ -1212,10 +1212,12 @@ SEARCH_RESULT BOARD::Visit( INSPECTOR* inspector, const void* testData,
|
|||
NETINFO_ITEM* BOARD::FindNet( int aNetcode ) const
|
||||
{
|
||||
// the first valid netcode is 1 and the last is m_NetInfo.GetCount()-1.
|
||||
// zero is reserved for "no connection" and is not used.
|
||||
// zero is reserved for "no connection" and is not actually a net.
|
||||
// NULL is returned for non valid netcodes
|
||||
|
||||
if( aNetcode == NETINFO_LIST::UNCONNECTED )
|
||||
wxASSERT( m_NetInfo.GetNetCount() > 0 ); // net zero should exist
|
||||
|
||||
if( aNetcode == NETINFO_LIST::UNCONNECTED && m_NetInfo.GetNetCount() == 0 )
|
||||
return &NETINFO_LIST::ORPHANED;
|
||||
else
|
||||
return m_NetInfo.GetNetItem( aNetcode );
|
||||
|
@ -2459,14 +2461,14 @@ void BOARD::ReplaceNetlist( NETLIST& aNetlist, bool aDeleteSinglePadNets,
|
|||
}
|
||||
}
|
||||
|
||||
// We need the pad list, for next tests.
|
||||
// padlist is the list of pads, sorted by netname.
|
||||
BuildListOfNets();
|
||||
std::vector<D_PAD*> padlist = GetPads();
|
||||
|
||||
// If needed, remove the single pad nets:
|
||||
if( aDeleteSinglePadNets && !aNetlist.IsDryRun() )
|
||||
{
|
||||
BuildListOfNets();
|
||||
|
||||
std::vector<D_PAD*> padlist = GetPads();
|
||||
|
||||
// padlist is the list of pads, sorted by netname.
|
||||
int count = 0;
|
||||
wxString netname;
|
||||
D_PAD* pad = NULL;
|
||||
|
@ -2483,17 +2485,41 @@ void BOARD::ReplaceNetlist( NETLIST& aNetlist, bool aDeleteSinglePadNets,
|
|||
{
|
||||
if( previouspad && count == 1 )
|
||||
{
|
||||
if( aReporter && aReporter->ReportAll() )
|
||||
// First, see if we have a copper zone attached to this pad.
|
||||
// If so, this is not really a single pad net
|
||||
|
||||
for( int ii = 0; ii < GetAreaCount(); ii++ )
|
||||
{
|
||||
msg.Printf( _( "Remove single pad net \"%s\" on \"%s\" pad '%s'\n" ),
|
||||
GetChars( previouspad->GetNetname() ),
|
||||
GetChars( previouspad->GetParent()->GetReference() ),
|
||||
GetChars( previouspad->GetPadName() ) );
|
||||
aReporter->Report( msg );
|
||||
ZONE_CONTAINER* zone = GetArea( ii );
|
||||
|
||||
if( !zone->IsOnCopperLayer() )
|
||||
continue;
|
||||
|
||||
if( zone->GetIsKeepout() )
|
||||
continue;
|
||||
|
||||
if( zone->GetNet() == previouspad->GetNet() )
|
||||
{
|
||||
count++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
previouspad->SetNetCode( NETINFO_LIST::UNCONNECTED );
|
||||
if( count == 1 ) // Really one pad, and nothing else
|
||||
{
|
||||
if( aReporter && aReporter->ReportAll() )
|
||||
{
|
||||
msg.Printf( _( "Remove single pad net \"%s\" on \"%s\" pad '%s'\n" ),
|
||||
GetChars( previouspad->GetNetname() ),
|
||||
GetChars( previouspad->GetParent()->GetReference() ),
|
||||
GetChars( previouspad->GetPadName() ) );
|
||||
aReporter->Report( msg );
|
||||
}
|
||||
|
||||
previouspad->SetNetCode( NETINFO_LIST::UNCONNECTED );
|
||||
}
|
||||
}
|
||||
|
||||
netname = pad->GetNetname();
|
||||
count = 1;
|
||||
}
|
||||
|
@ -2515,6 +2541,10 @@ void BOARD::ReplaceNetlist( NETLIST& aNetlist, bool aDeleteSinglePadNets,
|
|||
// They should exist in footprints, otherwise the footprint is wrong
|
||||
// note also references or time stamps are updated, so we use only
|
||||
// the reference to find a footprint
|
||||
//
|
||||
// Also verify if zones have acceptable nets, i.e. nets with pads.
|
||||
// Zone with no pad belongs to a "dead" net which happens after changes in schematic
|
||||
// when no more pad use this net name.
|
||||
if( aReporter && aReporter->ReportErrors() )
|
||||
{
|
||||
wxString padname;
|
||||
|
@ -2543,6 +2573,22 @@ void BOARD::ReplaceNetlist( NETLIST& aNetlist, bool aDeleteSinglePadNets,
|
|||
aReporter->Report( msg );
|
||||
}
|
||||
}
|
||||
|
||||
// Test copper zones to detect "dead" nets (nets without any pad):
|
||||
for( int ii = 0; ii < GetAreaCount(); ii++ )
|
||||
{
|
||||
ZONE_CONTAINER* zone = GetArea( ii );
|
||||
|
||||
if( !zone->IsOnCopperLayer() || zone->GetIsKeepout() )
|
||||
continue;
|
||||
|
||||
if( zone->GetNet()->GetNodesCount() == 0 )
|
||||
{
|
||||
msg.Printf( _( "* Warning: copper zone (net name '%s'): net has no pad*\n" ),
|
||||
GetChars( zone->GetNet()->GetNetname() ) );
|
||||
aReporter->Report( msg );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2012 Jean-Pierre Charras, jean-pierre.charras@ujf-grenoble.fr
|
||||
* Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||
* Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
||||
* Copyright (C) 1992-2012 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 1992-2015 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
|
||||
|
@ -50,10 +50,10 @@ BOARD_CONNECTED_ITEM::BOARD_CONNECTED_ITEM( const BOARD_CONNECTED_ITEM& aItem )
|
|||
|
||||
void BOARD_CONNECTED_ITEM::SetNetCode( int aNetCode )
|
||||
{
|
||||
assert( aNetCode >= 0 );
|
||||
// assert( aNetCode >= 0 );
|
||||
BOARD* board = GetBoard();
|
||||
|
||||
if( board )
|
||||
if( ( aNetCode >= 0 ) && board )
|
||||
m_netinfo = board->FindNet( aNetCode );
|
||||
else
|
||||
m_netinfo = &NETINFO_LIST::ORPHANED;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2007 Dick Hollenbeck, dick@softplc.com
|
||||
* Copyright (C) 2007 KiCad Developers, see change_log.txt for contributors.
|
||||
* Copyright (C) 2015 KiCad Developers, see change_log.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
|
||||
|
@ -75,8 +75,10 @@ wxString DRC_ITEM::GetErrorText() const
|
|||
return wxString( _( "Copper area inside copper area" ) );
|
||||
case COPPERAREA_CLOSE_TO_COPPERAREA:
|
||||
return wxString( _( "Copper areas intersect or are too close" ) );
|
||||
case DRCE_NON_EXISTANT_NET_FOR_ZONE_OUTLINE:
|
||||
return wxString( _( "Copper area has a nonexistent net name" ) );
|
||||
|
||||
case DRCE_SUSPICIOUS_NET_FOR_ZONE_OUTLINE:
|
||||
return wxString( _( "Copper area belongs a net which has no pads. This is strange" ) );
|
||||
|
||||
case DRCE_HOLE_NEAR_PAD:
|
||||
return wxString( _( "Hole near pad" ) );
|
||||
case DRCE_HOLE_NEAR_TRACK:
|
||||
|
|
|
@ -45,7 +45,6 @@
|
|||
#include <3d_struct.h>
|
||||
#include <msgpanel.h>
|
||||
|
||||
#include <drag.h>
|
||||
#include <class_board.h>
|
||||
#include <class_edge_mod.h>
|
||||
#include <class_module.h>
|
||||
|
|
|
@ -280,6 +280,18 @@ public:
|
|||
GR_DRAWMODE aDrawMode,
|
||||
const wxPoint& aOffset = ZeroOffset );
|
||||
|
||||
/**
|
||||
* Function DrawOutlinesWhenMoving
|
||||
* draws in XOR mode the footprint when moving it to the \a aDC.
|
||||
* To speed up the drawing, only a simplified shape is drawn
|
||||
* @param aPanel = draw panel, Used to know the clip box
|
||||
* @param aDC = Current Device Context
|
||||
* @param aMoveVector = the offset between the curr position and
|
||||
* the draw position.
|
||||
*/
|
||||
void DrawOutlinesWhenMoving( EDA_DRAW_PANEL* aPanel,
|
||||
wxDC* aDC, const wxPoint& aMoveVector );
|
||||
|
||||
/**
|
||||
* function ReadandInsert3DComponentShape
|
||||
* read the 3D component shape(s) of the footprint (physical shape)
|
||||
|
|
|
@ -320,7 +320,7 @@ public:
|
|||
return NULL;
|
||||
}
|
||||
|
||||
///> Constant that holds the unconnected net number
|
||||
///> Constant that holds the unconnected net number (typically 0)
|
||||
static const int UNCONNECTED;
|
||||
|
||||
///> NETINFO_ITEM meaning that there was no net assigned for an item, as there was no
|
||||
|
|
|
@ -80,10 +80,7 @@ void NETINFO_ITEM::Draw( EDA_DRAW_PANEL* panel,
|
|||
|
||||
void NETINFO_ITEM::GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList )
|
||||
{
|
||||
int count;
|
||||
wxString txt;
|
||||
MODULE* module;
|
||||
D_PAD* pad;
|
||||
double lengthnet = 0.0; // This is the lenght of tracks on pcb
|
||||
double lengthPadToDie = 0.0; // this is the lenght of internal ICs connections
|
||||
|
||||
|
@ -92,12 +89,17 @@ void NETINFO_ITEM::GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList )
|
|||
txt.Printf( wxT( "%d" ), GetNet() );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Net Code" ), txt, RED ) );
|
||||
|
||||
count = 0;
|
||||
module = m_parent->GetBoard()->m_Modules;
|
||||
// Warning: for netcode == NETINFO_LIST::ORPHANED, the parent or the board
|
||||
// can be NULL
|
||||
BOARD * board = m_parent ? m_parent->GetBoard() : NULL;
|
||||
|
||||
for( ; module != 0; module = module->Next() )
|
||||
if( board == NULL )
|
||||
return;
|
||||
|
||||
int count = 0;
|
||||
for( MODULE* module = board->m_Modules; module != NULL; module = module->Next() )
|
||||
{
|
||||
for( pad = module->Pads(); pad != 0; pad = pad->Next() )
|
||||
for( D_PAD* pad = module->Pads(); pad != 0; pad = pad->Next() )
|
||||
{
|
||||
if( pad->GetNetCode() == GetNet() )
|
||||
{
|
||||
|
@ -112,7 +114,7 @@ void NETINFO_ITEM::GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList )
|
|||
|
||||
count = 0;
|
||||
|
||||
for( const TRACK *track = m_parent->GetBoard()->m_Track; track != NULL; track = track->Next() )
|
||||
for( const TRACK *track = board->m_Track; track != NULL; track = track->Next() )
|
||||
{
|
||||
if( track->Type() == PCB_VIA_T )
|
||||
{
|
||||
|
|
|
@ -678,7 +678,7 @@ void D_PAD::GetOblongDrillGeometry( wxPoint& aStartPoint,
|
|||
// of an equivalent segment which have the same position and width as the hole
|
||||
int delta_cx, delta_cy;
|
||||
|
||||
wxSize halfsize = GetDrillSize();;
|
||||
wxSize halfsize = GetDrillSize();
|
||||
halfsize.x /= 2;
|
||||
halfsize.y /= 2;
|
||||
|
||||
|
|
|
@ -207,7 +207,7 @@ public:
|
|||
void TransformShapeWithClearanceToPolygon( CPOLYGONS_LIST& aCornerBuffer,
|
||||
int aClearanceValue,
|
||||
int aCircleToSegmentsCount,
|
||||
double aCorrectionFactor ) const;;
|
||||
double aCorrectionFactor ) const;
|
||||
|
||||
/**
|
||||
* Function GetClearance
|
||||
|
|
|
@ -257,7 +257,7 @@ void PCB_LAYER_WIDGET::ReFillRender()
|
|||
{
|
||||
LAYER_WIDGET::ROW renderRow = s_render_rows[row];
|
||||
|
||||
if( !isAllowedInFpMode( renderRow.id ) )
|
||||
if( m_fp_editor_mode && !isAllowedInFpMode( renderRow.id ) )
|
||||
continue;
|
||||
|
||||
renderRow.tooltip = wxGetTranslation( s_render_rows[row].tooltip );
|
||||
|
@ -284,7 +284,7 @@ void PCB_LAYER_WIDGET::SyncRenderStates()
|
|||
{
|
||||
int rowId = s_render_rows[row].id;
|
||||
|
||||
if( !isAllowedInFpMode( rowId ) )
|
||||
if( m_fp_editor_mode && !isAllowedInFpMode( rowId ) )
|
||||
continue;
|
||||
|
||||
// this does not fire a UI event
|
||||
|
|
|
@ -74,7 +74,7 @@ void TEXTE_PCB::Copy( TEXTE_PCB* source )
|
|||
m_Bold = source->m_Bold;
|
||||
m_HJustify = source->m_HJustify;
|
||||
m_VJustify = source->m_VJustify;
|
||||
m_MultilineAllowed = m_MultilineAllowed;
|
||||
m_MultilineAllowed = source->m_MultilineAllowed;
|
||||
|
||||
m_Text = source->m_Text;
|
||||
}
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2012 Jean-Pierre Charras, jean-pierre.charras@ujf-grenoble.fr
|
||||
* Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||
* Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
||||
* Copyright (C) 1992-2012 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 1992-2015 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
|
||||
|
@ -625,27 +625,21 @@ void ZONE_CONTAINER::GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList )
|
|||
{
|
||||
if( GetNetCode() >= 0 )
|
||||
{
|
||||
NETINFO_ITEM* equipot = GetNet();
|
||||
NETINFO_ITEM* net = GetNet();
|
||||
|
||||
if( equipot )
|
||||
msg = equipot->GetNetname();
|
||||
else
|
||||
msg = wxT( "<noname>" );
|
||||
}
|
||||
else // a netcode < 0 is an error
|
||||
{
|
||||
msg = wxT( " [" );
|
||||
msg << GetNetname() + wxT( "]" );
|
||||
msg << wxT( " <" ) << _( "Not Found" ) << wxT( ">" );
|
||||
if( net )
|
||||
msg = net->GetNetname();
|
||||
else // Should not occur
|
||||
msg = _( "<unknown>" );
|
||||
}
|
||||
else // a netcode < 0 is an error
|
||||
msg = wxT( "<error>" );
|
||||
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "NetName" ), msg, RED ) );
|
||||
|
||||
#if 1
|
||||
// Display net code : (useful in test or debug)
|
||||
msg.Printf( wxT( "%d" ), GetNetCode() );
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "NetCode" ), msg, RED ) );
|
||||
#endif
|
||||
|
||||
// Display priority level
|
||||
msg.Printf( wxT( "%d" ), GetPriority() );
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
|
||||
* Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||
* Copyright (C) 1992-2015 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
|
||||
|
@ -578,7 +578,6 @@ public:
|
|||
void SetDoNotAllowVias( bool aEnable ) { m_doNotAllowVias = aEnable; }
|
||||
void SetDoNotAllowTracks( bool aEnable ) { m_doNotAllowTracks = aEnable; }
|
||||
|
||||
|
||||
#if defined(DEBUG)
|
||||
virtual void Show( int nestLevel, std::ostream& os ) const { ShowDummy( os ); } // override
|
||||
#endif
|
||||
|
@ -632,8 +631,8 @@ private:
|
|||
/// The index of the corner being moved or -1 if no corner is selected.
|
||||
int m_CornerSelection;
|
||||
|
||||
int m_localFlgs; ///< Flags used in polygon calculations.
|
||||
|
||||
/// Variable used in polygon calculations.
|
||||
int m_localFlgs;
|
||||
|
||||
/** Segments used to fill the zone (#m_FillMode ==1 ), when fill zone by segment is used.
|
||||
* In this case the segments have #m_ZoneMinThickness width.
|
||||
|
|
|
@ -45,6 +45,7 @@ void PCB_EDIT_FRAME::ExecuteRemoteCommand( const char* cmdline )
|
|||
wxPoint pos;
|
||||
|
||||
strncpy( line, cmdline, sizeof(line) - 1 );
|
||||
line[sizeof(line) - 1] = 0;
|
||||
|
||||
idcmd = strtok( line, " \n\r" );
|
||||
text = strtok( NULL, " \n\r" );
|
||||
|
|
|
@ -431,7 +431,7 @@ void DIALOG_DESIGN_RULES::InitializeRulesSelectionBoxes()
|
|||
m_leftClassChoice->Select( 0 );
|
||||
|
||||
m_buttonRightToLeft->Enable( false );
|
||||
m_buttonLeftToRight->Enable( false );;
|
||||
m_buttonLeftToRight->Enable( false );
|
||||
|
||||
FillListBoxWithNetNames( m_leftListCtrl, m_leftClassChoice->GetStringSelection() );
|
||||
FillListBoxWithNetNames( m_rightListCtrl, m_rightClassChoice->GetStringSelection() );
|
||||
|
@ -821,7 +821,7 @@ void DIALOG_DESIGN_RULES::OnRightCBSelection( wxCommandEvent& event )
|
|||
if( m_leftClassChoice->GetStringSelection() == m_rightClassChoice->GetStringSelection() )
|
||||
{
|
||||
m_buttonRightToLeft->Enable( false );
|
||||
m_buttonLeftToRight->Enable( false );;
|
||||
m_buttonLeftToRight->Enable( false );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -188,7 +188,7 @@ void DIALOG_FREEROUTE::OnLaunchButtonClick( wxCommandEvent& event )
|
|||
command = value + wxFileName::GetPathSeparator();
|
||||
command << wxT("bin\\java");
|
||||
#else // __WINDOWS__
|
||||
command = wxT( "java" );;
|
||||
command = wxT( "java" );
|
||||
#endif
|
||||
|
||||
command << wxT(" -jar ");
|
||||
|
|
|
@ -49,10 +49,10 @@ class CONNECTIONS;
|
|||
|
||||
/*
|
||||
* a DRAG_LIST manages the list of track segments to modify
|
||||
* when the pad or the module is moving
|
||||
* when the pad or the module is moving in drag mode
|
||||
*/
|
||||
|
||||
/*
|
||||
/**
|
||||
* a DRAG_SEGM_PICKER manage one track segment or a via
|
||||
*/
|
||||
class DRAG_SEGM_PICKER
|
||||
|
@ -65,7 +65,7 @@ public:
|
|||
D_PAD* m_Pad_End; // pointer to the moving pad
|
||||
// if the end point should follow this pad
|
||||
// or NULL
|
||||
bool m_Flag; // flag used in drag vias and drag track segment functions
|
||||
int m_TempFlags; // flag used in drag vias and drag track segment functions
|
||||
|
||||
private:
|
||||
double m_RotationOffset; // initial orientation of the parent module
|
||||
|
|
|
@ -56,7 +56,7 @@ DRAG_SEGM_PICKER::DRAG_SEGM_PICKER( TRACK* aTrack )
|
|||
m_endInitialValue = m_Track->GetEnd();
|
||||
m_Pad_Start = m_Track->GetState( START_ON_PAD ) ? (D_PAD*)m_Track->start : NULL;
|
||||
m_Pad_End = m_Track->GetState( END_ON_PAD ) ? (D_PAD*)m_Track->end : NULL;
|
||||
m_Flag = 0;
|
||||
m_TempFlags = 0;
|
||||
m_RotationOffset = 0.0;
|
||||
m_Flipped = false;
|
||||
}
|
||||
|
@ -320,16 +320,16 @@ void AddSegmentToDragList( int flag, TRACK* aTrack )
|
|||
DRAG_SEGM_PICKER wrapper( aTrack );
|
||||
|
||||
if( flag & STARTPOINT )
|
||||
wrapper.m_Flag |= 1;
|
||||
|
||||
if( flag & ENDPOINT )
|
||||
wrapper.m_Flag |= 2;
|
||||
|
||||
if( flag & STARTPOINT )
|
||||
{
|
||||
wrapper.m_TempFlags |= STARTPOINT;
|
||||
aTrack->SetFlags( STARTPOINT );
|
||||
}
|
||||
|
||||
if( flag & ENDPOINT )
|
||||
{
|
||||
wrapper.m_TempFlags |= ENDPOINT;
|
||||
aTrack->SetFlags( ENDPOINT );
|
||||
}
|
||||
|
||||
g_DragSegmentList.push_back( wrapper );
|
||||
}
|
||||
|
@ -411,10 +411,10 @@ void UndrawAndMarkSegmentsToDrag( EDA_DRAW_PANEL* aCanvas, wxDC* aDC )
|
|||
track->SetState( IN_EDIT, false );
|
||||
track->SetFlags( IS_DRAGGED );
|
||||
|
||||
if( g_DragSegmentList[ii].m_Flag & STARTPOINT )
|
||||
if( g_DragSegmentList[ii].m_TempFlags & STARTPOINT )
|
||||
track->SetFlags( STARTPOINT );
|
||||
|
||||
if( g_DragSegmentList[ii].m_Flag & ENDPOINT )
|
||||
if( g_DragSegmentList[ii].m_TempFlags & ENDPOINT )
|
||||
track->SetFlags( ENDPOINT );
|
||||
|
||||
track->Draw( aCanvas, aDC, GR_XOR );
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2004-2014 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||
* Copyright (C) 2004-2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||
* Copyright (C) 2014 Dick Hollenbeck, dick@softplc.com
|
||||
* Copyright (C) 2014 KiCad Developers, see change_log.txt for contributors.
|
||||
* Copyright (C) 2015 KiCad Developers, see change_log.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
|
||||
|
@ -564,6 +564,10 @@ void DRC::testZones()
|
|||
// if a netcode is < 0 the netname was not found when reading a netlist
|
||||
// if a netcode is == 0 the netname is void, and the zone is not connected.
|
||||
// This is allowed, but i am not sure this is a good idea
|
||||
//
|
||||
// In recent Pcbnew versions, the netcode is always >= 0, but an internal net name
|
||||
// is stored, and initalized from the file or the zone properpies editor.
|
||||
// if it differs from the net name from net code, there is a DRC issue
|
||||
for( int ii = 0; ii < m_pcb->GetAreaCount(); ii++ )
|
||||
{
|
||||
ZONE_CONTAINER* test_area = m_pcb->GetArea( ii );
|
||||
|
@ -571,13 +575,21 @@ void DRC::testZones()
|
|||
if( !test_area->IsOnCopperLayer() )
|
||||
continue;
|
||||
|
||||
if( test_area->GetNetCode() < 0 )
|
||||
int netcode = test_area->GetNetCode();
|
||||
|
||||
// a netcode < 0 or > 0 and no pad in net is a error or strange
|
||||
// perhaps a "dead" net, which happens when all pads in this net were removed
|
||||
// Remark: a netcode < 0 should not happen (this is more a bug somewhere)
|
||||
int pads_in_net = (test_area->GetNetCode() > 0) ?
|
||||
test_area->GetNet()->GetNodesCount() : 1;
|
||||
|
||||
if( ( netcode < 0 ) || pads_in_net == 0 )
|
||||
{
|
||||
m_currentMarker = fillMarker( test_area,
|
||||
DRCE_NON_EXISTANT_NET_FOR_ZONE_OUTLINE, m_currentMarker );
|
||||
DRCE_SUSPICIOUS_NET_FOR_ZONE_OUTLINE, m_currentMarker );
|
||||
m_pcb->Add( m_currentMarker );
|
||||
m_mainWindow->GetGalCanvas()->GetView()->Add( m_currentMarker );
|
||||
m_currentMarker = 0;
|
||||
m_currentMarker = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2007 Dick Hollenbeck, dick@softplc.com
|
||||
* Copyright (C) 2007 KiCad Developers, see change_log.txt for contributors.
|
||||
* Copyright (C) 2015 KiCad Developers, see change_log.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
|
||||
|
@ -60,7 +60,7 @@
|
|||
#define DRCE_MICRO_VIA_INCORRECT_LAYER_PAIR 21 ///< micro via's layer pair incorrect (layers must be adjacent)
|
||||
#define COPPERAREA_INSIDE_COPPERAREA 22 ///< copper area outlines intersect
|
||||
#define COPPERAREA_CLOSE_TO_COPPERAREA 23 ///< copper area outlines are too close
|
||||
#define DRCE_NON_EXISTANT_NET_FOR_ZONE_OUTLINE 24 ///< copper area outline has an incorrect netcode due to a netname not found
|
||||
#define DRCE_SUSPICIOUS_NET_FOR_ZONE_OUTLINE 24 ///< copper area has a net but no pads in nets, which is suspicious
|
||||
#define DRCE_HOLE_NEAR_PAD 25 ///< hole too close to pad
|
||||
#define DRCE_HOLE_NEAR_TRACK 26 ///< hole too close to track
|
||||
#define DRCE_TOO_SMALL_TRACK_WIDTH 27 ///< Too small track width
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2012 Miguel Angel Ajo Pelayo <miguelangel@nbee.es>
|
||||
* Copyright (C) 2012 Jean-Pierre Charras, jaen-pierre.charras
|
||||
* Copyright (C) 2008-2011 Wayne Stambaugh <stambaughw@verizon.net>
|
||||
* Copyright (C) 2004-2011 KiCad Developers, see change_log.txt for contributors.
|
||||
* Copyright (C) 2012-2015 Miguel Angel Ajo Pelayo <miguelangel@nbee.es>
|
||||
* Copyright (C) 2012-2015 Jean-Pierre Charras, jaen-pierre.charras
|
||||
* Copyright (C) 2008-2015 Wayne Stambaugh <stambaughw@verizon.net>
|
||||
* Copyright (C) 2004-2015 KiCad Developers, see change_log.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
|
||||
|
@ -440,7 +440,7 @@ void FOOTPRINT_WIZARD_FRAME::OnActivate( wxActivateEvent& event )
|
|||
EDA_DRAW_FRAME::OnActivate( event );
|
||||
|
||||
// Ensure we do not have old selection:
|
||||
if( !m_FrameIsActive )
|
||||
if( !event.GetActive() )
|
||||
return;
|
||||
|
||||
bool footprintWizardsChanged = false;
|
||||
|
|
|
@ -101,7 +101,7 @@ bool GITHUB_GETLIBLIST::GetLibraryList( wxArrayString& aList )
|
|||
// The URL lib names are relative to the server name.
|
||||
// so add the server name to them.
|
||||
wxURI repo( m_repoURL );
|
||||
wxString urlPrefix = wxT( "https://" ) + repo.GetServer() + wxT( "/" );;
|
||||
wxString urlPrefix = wxT( "https://" ) + repo.GetServer() + wxT( "/" );
|
||||
|
||||
wxString errorMsg;
|
||||
const char sep = ','; // Separator fields, in json returned file
|
||||
|
|
|
@ -185,6 +185,7 @@ void LEGACY_NETLIST_READER::loadNet( char* aText, COMPONENT* aComponent ) throw(
|
|||
char line[256];
|
||||
|
||||
strncpy( line, aText, sizeof( line ) );
|
||||
line[ sizeof(line) - 1 ] = '\0';
|
||||
|
||||
if( ( p = strtok( line, " ()\t\n" ) ) == NULL )
|
||||
{
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
/*
|
||||
/**
|
||||
* @file modules.cpp
|
||||
*/
|
||||
|
||||
|
@ -40,7 +40,6 @@
|
|||
#include <class_module.h>
|
||||
|
||||
#include <pcbnew.h>
|
||||
#include <protos.h>
|
||||
#include <drag.h>
|
||||
|
||||
|
||||
|
@ -166,7 +165,7 @@ void Abort_MoveOrCopyModule( EDA_DRAW_PANEL* Panel, wxDC* DC )
|
|||
if( module )
|
||||
{
|
||||
// Erase the current footprint on screen
|
||||
DrawModuleOutlines( Panel, DC, module );
|
||||
module->DrawOutlinesWhenMoving( Panel, DC, g_Offset_Module );
|
||||
|
||||
/* If a move command: return to old position
|
||||
* If a copy command, delete the new footprint
|
||||
|
@ -239,12 +238,12 @@ void MoveFootprint( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aPosition,
|
|||
/* Erase current footprint. */
|
||||
if( aErase )
|
||||
{
|
||||
DrawModuleOutlines( aPanel, aDC, module );
|
||||
module->DrawOutlinesWhenMoving( aPanel, aDC, g_Offset_Module );
|
||||
}
|
||||
|
||||
/* Redraw the module at the new position. */
|
||||
g_Offset_Module = module->GetPosition() - aPanel->GetParent()->GetCrossHairPosition();
|
||||
DrawModuleOutlines( aPanel, aDC, module );
|
||||
module->DrawOutlinesWhenMoving( aPanel, aDC, g_Offset_Module );
|
||||
|
||||
DrawSegmentWhileMovingFootprint( aPanel, aDC );
|
||||
}
|
||||
|
@ -323,7 +322,7 @@ void PCB_EDIT_FRAME::Change_Side_Module( MODULE* Module, wxDC* DC )
|
|||
/* Erase footprint and draw outline if it has been already drawn. */
|
||||
if( DC )
|
||||
{
|
||||
DrawModuleOutlines( m_canvas, DC, Module );
|
||||
Module->DrawOutlinesWhenMoving( m_canvas, DC, g_Offset_Module );
|
||||
DrawSegmentWhileMovingFootprint( m_canvas, DC );
|
||||
}
|
||||
}
|
||||
|
@ -347,7 +346,7 @@ void PCB_EDIT_FRAME::Change_Side_Module( MODULE* Module, wxDC* DC )
|
|||
{
|
||||
if( DC )
|
||||
{
|
||||
DrawModuleOutlines( m_canvas, DC, Module );
|
||||
Module->DrawOutlinesWhenMoving( m_canvas, DC, g_Offset_Module );
|
||||
DrawSegmentWhileMovingFootprint( m_canvas, DC );
|
||||
}
|
||||
|
||||
|
@ -459,7 +458,7 @@ void PCB_BASE_FRAME::Rotate_Module( wxDC* DC, MODULE* module, double angle, bool
|
|||
{
|
||||
if( DC )
|
||||
{
|
||||
DrawModuleOutlines( m_canvas, DC, module );
|
||||
module->DrawOutlinesWhenMoving( m_canvas, DC, g_Offset_Module );
|
||||
DrawSegmentWhileMovingFootprint( m_canvas, DC );
|
||||
}
|
||||
}
|
||||
|
@ -486,7 +485,7 @@ void PCB_BASE_FRAME::Rotate_Module( wxDC* DC, MODULE* module, double angle, bool
|
|||
else
|
||||
{
|
||||
// Beiing moved: just redraw it
|
||||
DrawModuleOutlines( m_canvas, DC, module );
|
||||
module->DrawOutlinesWhenMoving( m_canvas, DC, g_Offset_Module );
|
||||
DrawSegmentWhileMovingFootprint( m_canvas, DC );
|
||||
}
|
||||
|
||||
|
@ -496,35 +495,31 @@ void PCB_BASE_FRAME::Rotate_Module( wxDC* DC, MODULE* module, double angle, bool
|
|||
}
|
||||
|
||||
|
||||
/*************************************************/
|
||||
/* Redraw in XOR mode the outlines of a module. */
|
||||
/*************************************************/
|
||||
void DrawModuleOutlines( EDA_DRAW_PANEL* panel, wxDC* DC, MODULE* module )
|
||||
// Redraw in XOR mode the outlines of the module.
|
||||
void MODULE::DrawOutlinesWhenMoving( EDA_DRAW_PANEL* panel, wxDC* DC,
|
||||
const wxPoint& aMoveVector )
|
||||
{
|
||||
int pad_fill_tmp;
|
||||
D_PAD* pt_pad;
|
||||
|
||||
if( module == NULL )
|
||||
return;
|
||||
|
||||
module->DrawEdgesOnly( panel, DC, g_Offset_Module, GR_XOR );
|
||||
DrawEdgesOnly( panel, DC, aMoveVector, GR_XOR );
|
||||
DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)panel->GetDisplayOptions();
|
||||
|
||||
// Show pads in sketch mode to speedu up drawings
|
||||
pad_fill_tmp = displ_opts->m_DisplayPadFill;
|
||||
displ_opts->m_DisplayPadFill = true;
|
||||
|
||||
pt_pad = module->Pads();
|
||||
pt_pad = Pads();
|
||||
|
||||
for( ; pt_pad != NULL; pt_pad = pt_pad->Next() )
|
||||
pt_pad->Draw( panel, DC, GR_XOR, g_Offset_Module );
|
||||
pt_pad->Draw( panel, DC, GR_XOR, aMoveVector );
|
||||
|
||||
displ_opts->m_DisplayPadFill = pad_fill_tmp;
|
||||
|
||||
if( displ_opts->m_Show_Module_Ratsnest && panel )
|
||||
if( displ_opts->m_Show_Module_Ratsnest )
|
||||
{
|
||||
PCB_BASE_FRAME* frame = (PCB_BASE_FRAME*) panel->GetParent();
|
||||
frame->build_ratsnest_module( module );
|
||||
frame->build_ratsnest_module( this );
|
||||
frame->TraceModuleRatsNest( DC );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2012 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||
* Copyright (C) 2008-2011 Wayne Stambaugh <stambaughw@verizon.net>
|
||||
* Copyright (C) 2004-2012 KiCad Developers, see change_log.txt for contributors.
|
||||
* Copyright (C) 2012-2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||
* Copyright (C) 2008-2015 Wayne Stambaugh <stambaughw@verizon.net>
|
||||
* Copyright (C) 2004-2015 KiCad Developers, see change_log.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
|
||||
|
@ -551,7 +551,7 @@ void FOOTPRINT_VIEWER_FRAME::OnActivate( wxActivateEvent& event )
|
|||
EDA_DRAW_FRAME::OnActivate( event );
|
||||
|
||||
// Ensure we do not have old selection:
|
||||
if( ! m_FrameIsActive )
|
||||
if( !event.GetActive() )
|
||||
return;
|
||||
|
||||
// Ensure we have the right library list:
|
||||
|
|
|
@ -112,6 +112,17 @@ void PCB_PARSER::init()
|
|||
}
|
||||
|
||||
|
||||
void PCB_PARSER::pushValueIntoMap( int aIndex, int aValue )
|
||||
{
|
||||
// Add aValue in netcode mapping (m_netCodes) at index aNetCode
|
||||
// ensure there is room in m_netCodes for that, and add room if needed.
|
||||
|
||||
if( (int)m_netCodes.size() <= aIndex )
|
||||
m_netCodes.resize( aIndex+1 );
|
||||
|
||||
m_netCodes[aIndex] = aValue;
|
||||
}
|
||||
|
||||
double PCB_PARSER::parseDouble() throw( IO_ERROR )
|
||||
{
|
||||
char* tmp;
|
||||
|
@ -1194,7 +1205,7 @@ void PCB_PARSER::parseNETINFO_ITEM() throw( IO_ERROR, PARSE_ERROR )
|
|||
m_board->AppendNet( net );
|
||||
|
||||
// Store the new code mapping
|
||||
m_netCodes[netCode] = net->GetNet();
|
||||
pushValueIntoMap( netCode, net->GetNet() );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2526,6 +2537,8 @@ ZONE_CONTAINER* PCB_PARSER::parseZONE_CONTAINER() throw( IO_ERROR, PARSE_ERROR )
|
|||
int hatchPitch = Mils2iu( CPolyLine::GetDefaultHatchPitchMils() );
|
||||
wxPoint pt;
|
||||
T token;
|
||||
int tmp;
|
||||
wxString netnameFromfile; // the zone net name find in file
|
||||
|
||||
// bigger scope since each filled_polygon is concatenated in here
|
||||
CPOLYGONS_LIST pts;
|
||||
|
@ -2545,20 +2558,19 @@ ZONE_CONTAINER* PCB_PARSER::parseZONE_CONTAINER() throw( IO_ERROR, PARSE_ERROR )
|
|||
// Init the net code only, not the netname, to be sure
|
||||
// the zone net name is the name read in file.
|
||||
// (When mismatch, the user will be prompted in DRC, to fix the actual name)
|
||||
zone->SetNetCode( getNetCode( parseInt( "net number" ) ) );
|
||||
tmp = getNetCode( parseInt( "net number" ) );
|
||||
|
||||
if( tmp < 0 )
|
||||
tmp = 0;
|
||||
|
||||
zone->SetNetCode( tmp );
|
||||
|
||||
NeedRIGHT();
|
||||
break;
|
||||
|
||||
case T_net_name:
|
||||
NeedSYMBOLorNUMBER();
|
||||
if( zone->GetNet()->GetNetname() != FromUTF8() )
|
||||
{
|
||||
wxString msg;
|
||||
msg.Printf( _( "There is a zone that belongs to a not existing net"
|
||||
"(%s), you should verify it." ), GetChars( FromUTF8() ) );
|
||||
DisplayError( NULL, msg );
|
||||
zone->SetNetCode( NETINFO_LIST::UNCONNECTED );
|
||||
}
|
||||
netnameFromfile = FromUTF8();
|
||||
NeedRIGHT();
|
||||
break;
|
||||
|
||||
|
@ -2829,10 +2841,45 @@ ZONE_CONTAINER* PCB_PARSER::parseZONE_CONTAINER() throw( IO_ERROR, PARSE_ERROR )
|
|||
if( pts.GetCornersCount() )
|
||||
zone->AddFilledPolysList( pts );
|
||||
|
||||
// Ensure keepout does not have a net (which have no sense for a keepout zone)
|
||||
if( zone->GetIsKeepout() )
|
||||
// Ensure keepout and non copper zones do not have a net
|
||||
// (which have no sense for these zones)
|
||||
// the netcode 0 is used for these zones
|
||||
bool zone_has_net = zone->IsOnCopperLayer() && !zone->GetIsKeepout();
|
||||
|
||||
if( !zone_has_net )
|
||||
zone->SetNetCode( NETINFO_LIST::UNCONNECTED );
|
||||
|
||||
// Ensure the zone net name is valid, and matches the net code, for copper zones
|
||||
if( zone_has_net && ( zone->GetNet()->GetNetname() != netnameFromfile ) )
|
||||
{
|
||||
// Can happens which old boards, with nonexistent nets ...
|
||||
// or after being edited by hand
|
||||
// We try to fix the mismatch.
|
||||
NETINFO_ITEM* net = m_board->FindNet( netnameFromfile );
|
||||
|
||||
if( net ) // An existing net has the same net name. use it for the zone
|
||||
zone->SetNetCode( net->GetNet() );
|
||||
else // Not existing net: add a new net to keep trace of the zone netname
|
||||
{
|
||||
int newnetcode = m_board->GetNetCount();
|
||||
net = new NETINFO_ITEM( m_board, netnameFromfile, newnetcode );
|
||||
m_board->AppendNet( net );
|
||||
|
||||
// Store the new code mapping
|
||||
pushValueIntoMap( newnetcode, net->GetNet() );
|
||||
// and update the zone netcode
|
||||
zone->SetNetCode( net->GetNet() );
|
||||
|
||||
// Prompt the user
|
||||
wxString msg;
|
||||
msg.Printf( _( "There is a zone that belongs to a not existing net\n"
|
||||
"\"%s\"\n"
|
||||
"you should verify and edit it (run DRC test)." ),
|
||||
GetChars( netnameFromfile ) );
|
||||
DisplayError( NULL, msg );
|
||||
}
|
||||
}
|
||||
|
||||
return zone.release();
|
||||
}
|
||||
|
||||
|
|
|
@ -69,15 +69,24 @@ class PCB_PARSER : public PCB_LEXER
|
|||
std::vector<int> m_netCodes; ///< net codes mapping for boards being loaded
|
||||
|
||||
///> Converts net code using the mapping table if available,
|
||||
///> otherwise returns unchanged net code
|
||||
///> otherwise returns unchanged net code if < 0 or if is is out of range
|
||||
inline int getNetCode( int aNetCode )
|
||||
{
|
||||
if( aNetCode < (int) m_netCodes.size() )
|
||||
if( ( aNetCode >= 0 ) && ( aNetCode < (int) m_netCodes.size() ) )
|
||||
return m_netCodes[aNetCode];
|
||||
|
||||
return aNetCode;
|
||||
}
|
||||
|
||||
/**
|
||||
* function pushValueIntoMap
|
||||
* Add aValue value in netcode mapping (m_netCodes) at index aIndex
|
||||
* ensure there is room in m_netCodes for that, and add room if needed.
|
||||
* @param aIndex = the index ( expected >=0 )of the location to use in m_netCodes
|
||||
* @param aValue = the netcode value to map
|
||||
*/
|
||||
void pushValueIntoMap( int aIndex, int aValue );
|
||||
|
||||
/**
|
||||
* Function init
|
||||
* clears and re-establishes m_layerMap with the default layer names.
|
||||
|
|
|
@ -754,11 +754,6 @@ void PCB_EDIT_FRAME::LoadSettings( wxConfigBase* aCfg )
|
|||
aCfg->Read( PCB_MAGNETIC_TRACKS_OPT, &g_MagneticTrackOption );
|
||||
aCfg->Read( SHOW_MICROWAVE_TOOLS, &m_show_microwave_tools );
|
||||
aCfg->Read( SHOW_LAYER_MANAGER_TOOLS, &m_show_layer_manager_tools );
|
||||
|
||||
// WxWidgets 2.9.1 seems call setlocale( LC_NUMERIC, "" )
|
||||
// when reading doubles in cfg,
|
||||
// but forget to back to current locale. So we call SetLocaleTo_Default
|
||||
SetLocaleTo_Default( );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -61,8 +61,6 @@ void DrawTraces( EDA_DRAW_PANEL* panel,
|
|||
int nbsegment,
|
||||
GR_DRAWMODE mode_color );
|
||||
|
||||
void DrawModuleOutlines( EDA_DRAW_PANEL* panel, wxDC* DC, MODULE* module );
|
||||
|
||||
void ShowNewTrackWhenMovingCursor( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aPosition,
|
||||
bool aErase );
|
||||
|
||||
|
|
|
@ -883,7 +883,7 @@ void PCB_BASE_FRAME::BuildAirWiresTargetsList( BOARD_CONNECTED_ITEM* aItemRef,
|
|||
if( track->GetNetCode() < net_code )
|
||||
continue;
|
||||
if( track->GetNetCode() > net_code )
|
||||
break;;
|
||||
break;
|
||||
|
||||
if( !track->GetSubNet() || (track->GetSubNet() != subnet) )
|
||||
{
|
||||
|
|
|
@ -51,7 +51,7 @@ int main( int argc, char** argv )
|
|||
SPECCTRA_DB db;
|
||||
bool failed = false;
|
||||
|
||||
SetLocaleTo_C_standard( ); // Switch the locale to standard C
|
||||
LOCALE_IO toggle; // Temporary switch the locale to standard C to r/w floats
|
||||
|
||||
if( argc == 2 )
|
||||
{
|
||||
|
@ -87,8 +87,6 @@ int main( int argc, char** argv )
|
|||
DSN::SESSION* ses = db.GetSESSION();
|
||||
ses->Format( &db, 0 );
|
||||
#endif
|
||||
|
||||
SetLocaleTo_Default( ); // revert to the current locale
|
||||
}
|
||||
|
||||
//-----<dummy code>---------------------------------------------------
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2012 Jean-Pierre Charras, jean-pierre.charras@ujf-grenoble.fr
|
||||
* Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||
* Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
||||
* Copyright (C) 2012 Wayne Stambaugh <stambaughw@verizon.net>
|
||||
* Copyright (C) 1992-2012 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 1992-2015 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
|
||||
|
|
|
@ -611,7 +611,7 @@ int CPolyLine::GetEndContour( int ic )
|
|||
}
|
||||
|
||||
|
||||
EDA_RECT CPolyLine::GetBoundingBox()
|
||||
const EDA_RECT CPolyLine::GetBoundingBox()
|
||||
{
|
||||
int xmin = INT_MAX;
|
||||
int ymin = INT_MAX;
|
||||
|
@ -634,7 +634,7 @@ EDA_RECT CPolyLine::GetBoundingBox()
|
|||
}
|
||||
|
||||
|
||||
EDA_RECT CPolyLine::GetBoundingBox( int icont )
|
||||
const EDA_RECT CPolyLine::GetBoundingBox( int icont )
|
||||
{
|
||||
int xmin = INT_MAX;
|
||||
int ymin = INT_MAX;
|
||||
|
|
|
@ -355,14 +355,14 @@ public:
|
|||
/**
|
||||
* @return the full bounding box of polygons
|
||||
*/
|
||||
EDA_RECT GetBoundingBox();
|
||||
const EDA_RECT GetBoundingBox();
|
||||
|
||||
/**
|
||||
* @return the bounding box of a given polygon
|
||||
* @param icont = the index of the polygon contour
|
||||
* (0 = main contour, 1 ... n = other contours, usually holes)
|
||||
*/
|
||||
EDA_RECT GetBoundingBox( int icont );
|
||||
const EDA_RECT GetBoundingBox( int icont );
|
||||
|
||||
void Copy( const CPolyLine* src );
|
||||
bool TestPointInside( int x, int y );
|
||||
|
|
|
@ -186,6 +186,7 @@ PyObject* wx2PyString( const wxString& src )
|
|||
void wxSetDefaultPyEncoding( const char* encoding )
|
||||
{
|
||||
strncpy( wxPythonEncoding, encoding, WX_DEFAULTENCODING_SIZE );
|
||||
wxPythonEncoding[ WX_DEFAULTENCODING_SIZE - 1 ] = '\0';
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue