Commit 39497b10 authored by jean-pierre charras's avatar jean-pierre charras

Pcbnew: fix Bug #1422093 (pcbnew crashes after editing a footprint cominng...

Pcbnew: fix  Bug #1422093 (pcbnew crashes after editing a footprint cominng from the board  with the fp editor and saving it on a librray and trying to load it to the board)
Some other very minor fixes.
parent dcdaee4c
...@@ -84,7 +84,6 @@ void S3D_MASTER::ObjectCoordsTo3DUnits( std::vector< S3D_VERTEX >& aVertices ) ...@@ -84,7 +84,6 @@ void S3D_MASTER::ObjectCoordsTo3DUnits( std::vector< S3D_VERTEX >& aVertices )
} }
/* adjust offset position (offset is given in UNIT 3D (0.1 inch) */ /* adjust offset position (offset is given in UNIT 3D (0.1 inch) */
#define SCALE_3D_CONV ((IU_PER_MILS * 1000) / UNITS3D_TO_UNITSPCB)
aVertices[ii].x += m_MatPosition.x * SCALE_3D_CONV; aVertices[ii].x += m_MatPosition.x * SCALE_3D_CONV;
aVertices[ii].y += m_MatPosition.y * SCALE_3D_CONV; aVertices[ii].y += m_MatPosition.y * SCALE_3D_CONV;
aVertices[ii].z += m_MatPosition.z * SCALE_3D_CONV; aVertices[ii].z += m_MatPosition.z * SCALE_3D_CONV;
......
...@@ -42,6 +42,14 @@ ...@@ -42,6 +42,14 @@
*/ */
#define UNITS3D_TO_UNITSPCB (IU_PER_MILS * 100) #define UNITS3D_TO_UNITSPCB (IU_PER_MILS * 100)
/**
* scaling factor for 3D shape offset ( S3D_MASTER::m_MatPosition member )
* Was in inches in legacy version, and, due to a mistake, still in inches
* in .kicad_pcb files (which are using mm)
* so this scaling convert file units (inch) to 3D units (0.1 inch), only
* for S3D_MASTER::m_MatPosition parameter
*/
#define SCALE_3D_CONV 10
class S3D_MASTER; class S3D_MASTER;
class STRUCT_3D_SHAPE; class STRUCT_3D_SHAPE;
......
...@@ -75,9 +75,6 @@ void VRML1_MODEL_PARSER::Load( const wxString& aFilename, double aVrmlunits_to_3 ...@@ -75,9 +75,6 @@ void VRML1_MODEL_PARSER::Load( const wxString& aFilename, double aVrmlunits_to_3
glm::vec3 matPos( GetMaster()->m_MatPosition.x, GetMaster()->m_MatPosition.y, glm::vec3 matPos( GetMaster()->m_MatPosition.x, GetMaster()->m_MatPosition.y,
GetMaster()->m_MatPosition.z ); GetMaster()->m_MatPosition.z );
#define SCALE_3D_CONV ( (IU_PER_MILS * 1000.0f) / UNITS3D_TO_UNITSPCB )
// glPushMatrix(); // glPushMatrix();
glTranslatef( matPos.x * SCALE_3D_CONV, matPos.y * SCALE_3D_CONV, matPos.z * SCALE_3D_CONV ); glTranslatef( matPos.x * SCALE_3D_CONV, matPos.y * SCALE_3D_CONV, matPos.z * SCALE_3D_CONV );
......
...@@ -79,10 +79,6 @@ void X3D_MODEL_PARSER::Load( const wxString& aFilename, double aVrmlunits_to_3Du ...@@ -79,10 +79,6 @@ void X3D_MODEL_PARSER::Load( const wxString& aFilename, double aVrmlunits_to_3Du
glm::vec3 matPos( GetMaster()->m_MatPosition.x, GetMaster()->m_MatPosition.y, glm::vec3 matPos( GetMaster()->m_MatPosition.x, GetMaster()->m_MatPosition.y,
GetMaster()->m_MatPosition.z ); GetMaster()->m_MatPosition.z );
#define SCALE_3D_CONV ( (IU_PER_MILS * 1000.0f) / UNITS3D_TO_UNITSPCB )
glTranslatef( matPos.x * SCALE_3D_CONV, matPos.y * SCALE_3D_CONV, matPos.z * SCALE_3D_CONV ); glTranslatef( matPos.x * SCALE_3D_CONV, matPos.y * SCALE_3D_CONV, matPos.z * SCALE_3D_CONV );
glRotatef( -matRot.z, 0.0f, 0.0f, 1.0f ); glRotatef( -matRot.z, 0.0f, 0.0f, 1.0f );
......
...@@ -489,9 +489,7 @@ void HPGL_PLOTTER::FlashPadCircle( const wxPoint& pos, int diametre, ...@@ -489,9 +489,7 @@ void HPGL_PLOTTER::FlashPadCircle( const wxPoint& pos, int diametre,
DPOINT pos_dev = userToDeviceCoordinates( pos ); DPOINT pos_dev = userToDeviceCoordinates( pos );
int delta = KiROUND( penDiameter - penOverlap ); int delta = KiROUND( penDiameter - penOverlap );
int radius = diametre / 2; int radius = ( diametre - KiROUND( penDiameter ) ) / 2;
radius = ( diametre - KiROUND( penDiameter ) ) / 2;
if( radius < 0 ) if( radius < 0 )
radius = 0; radius = 0;
......
...@@ -489,7 +489,7 @@ void OPENGL_GAL::DrawPolygon( const std::deque<VECTOR2D>& aPointList ) ...@@ -489,7 +489,7 @@ void OPENGL_GAL::DrawPolygon( const std::deque<VECTOR2D>& aPointList )
boost::shared_array<GLdouble> points( new GLdouble[3 * aPointList.size()] ); boost::shared_array<GLdouble> points( new GLdouble[3 * aPointList.size()] );
int v = 0; int v = 0;
for( std::deque<VECTOR2D>::const_iterator it = aPointList.begin(); it != aPointList.end(); it++ ) for( std::deque<VECTOR2D>::const_iterator it = aPointList.begin(); it != aPointList.end(); ++it )
{ {
points[v] = it->x; points[v] = it->x;
points[v + 1] = it->y; points[v + 1] = it->y;
......
...@@ -55,7 +55,7 @@ SHADER::~SHADER() ...@@ -55,7 +55,7 @@ SHADER::~SHADER()
{ {
// Delete the shaders and the program // Delete the shaders and the program
for( std::deque<GLuint>::iterator it = shaderNumbers.begin(); it != shaderNumbers.end(); for( std::deque<GLuint>::iterator it = shaderNumbers.begin(); it != shaderNumbers.end();
it++ ) ++it )
{ {
glDeleteShader( *it ); glDeleteShader( *it );
} }
......
...@@ -231,13 +231,13 @@ int StrNumCmp( const wxString& aString1, const wxString& aString2, int aLength, ...@@ -231,13 +231,13 @@ int StrNumCmp( const wxString& aString1, const wxString& aString2, int aLength,
while( isdigit( *str1 ) ) while( isdigit( *str1 ) )
{ {
nb1 = nb1 * 10 + (int) *str1 - '0'; nb1 = nb1 * 10 + (int) *str1 - '0';
str1++; ++str1;
} }
while( isdigit( *str2 ) ) while( isdigit( *str2 ) )
{ {
nb2 = nb2 * 10 + (int) *str2 - '0'; nb2 = nb2 * 10 + (int) *str2 - '0';
str2++; ++str2;
} }
if( nb1 < nb2 ) if( nb1 < nb2 )
...@@ -270,8 +270,8 @@ int StrNumCmp( const wxString& aString1, const wxString& aString2, int aLength, ...@@ -270,8 +270,8 @@ int StrNumCmp( const wxString& aString1, const wxString& aString2, int aLength,
return 0; return 0;
} }
str1++; ++str1;
str2++; ++str2;
} }
return 0; return 0;
......
...@@ -142,6 +142,8 @@ GBR_TO_PCB_EXPORTER::GBR_TO_PCB_EXPORTER( GERBVIEW_FRAME* aFrame, const wxString ...@@ -142,6 +142,8 @@ GBR_TO_PCB_EXPORTER::GBR_TO_PCB_EXPORTER( GERBVIEW_FRAME* aFrame, const wxString
{ {
m_gerbview_frame = aFrame; m_gerbview_frame = aFrame;
m_pcb_file_name = aFileName; m_pcb_file_name = aFileName;
m_fp = NULL;
m_pcbCopperLayersCount = 2;
} }
......
...@@ -358,7 +358,7 @@ void RECTWAVEGUIDE::show_results() ...@@ -358,7 +358,7 @@ void RECTWAVEGUIDE::show_results()
continue; continue;
if( f >= ( fc( m, n ) ) ) if( f >= ( fc( m, n ) ) )
{ {
sprintf( txt, "H(%u,%u) ", m, n ); sprintf( txt, "H(%d,%d) ", m, n );
if( (strlen( text ) + strlen( txt ) + 5) < MAXSTRLEN ) if( (strlen( text ) + strlen( txt ) + 5) < MAXSTRLEN )
strcat( text, txt ); strcat( text, txt );
else else
...@@ -384,7 +384,7 @@ void RECTWAVEGUIDE::show_results() ...@@ -384,7 +384,7 @@ void RECTWAVEGUIDE::show_results()
{ {
if( f >= fc( m, n ) ) if( f >= fc( m, n ) )
{ {
sprintf( txt, "E(%u,%u) ", m, n ); sprintf( txt, "E(%d,%d) ", m, n );
if( (strlen( text ) + strlen( txt ) + 5) < MAXSTRLEN ) if( (strlen( text ) + strlen( txt ) + 5) < MAXSTRLEN )
strcat( text, txt ); strcat( text, txt );
else else
......
...@@ -2403,8 +2403,6 @@ void BOARD::ReplaceNetlist( NETLIST& aNetlist, bool aDeleteSinglePadNets, ...@@ -2403,8 +2403,6 @@ void BOARD::ReplaceNetlist( NETLIST& aNetlist, bool aDeleteSinglePadNets,
net = component->GetNet( pad->GetPadName() ); net = component->GetNet( pad->GetPadName() );
if( !net.IsValid() ) // Footprint pad had no net. if( !net.IsValid() ) // Footprint pad had no net.
{
if( !pad->GetNetname().IsEmpty() )
{ {
if( aReporter && aReporter->ReportAll() ) if( aReporter && aReporter->ReportAll() )
{ {
...@@ -2418,7 +2416,6 @@ void BOARD::ReplaceNetlist( NETLIST& aNetlist, bool aDeleteSinglePadNets, ...@@ -2418,7 +2416,6 @@ void BOARD::ReplaceNetlist( NETLIST& aNetlist, bool aDeleteSinglePadNets,
if( !aNetlist.IsDryRun() ) if( !aNetlist.IsDryRun() )
pad->SetNetCode( NETINFO_LIST::UNCONNECTED ); pad->SetNetCode( NETINFO_LIST::UNCONNECTED );
} }
}
else // Footprint pad has a net. else // Footprint pad has a net.
{ {
if( net.GetNetName() != pad->GetNetname() ) if( net.GetNetName() != pad->GetNetname() )
......
...@@ -50,7 +50,10 @@ BOARD_CONNECTED_ITEM::BOARD_CONNECTED_ITEM( const BOARD_CONNECTED_ITEM& aItem ) ...@@ -50,7 +50,10 @@ BOARD_CONNECTED_ITEM::BOARD_CONNECTED_ITEM( const BOARD_CONNECTED_ITEM& aItem )
void BOARD_CONNECTED_ITEM::SetNetCode( int aNetCode ) void BOARD_CONNECTED_ITEM::SetNetCode( int aNetCode )
{ {
// assert( aNetCode >= 0 ); // if aNetCode < 0 ( typically NETINFO_LIST::FORCE_ORPHANED )
// or no parent board,
// set the m_netinfo to the dummy NETINFO_LIST::ORPHANED
BOARD* board = GetBoard(); BOARD* board = GetBoard();
if( ( aNetCode >= 0 ) && board ) if( ( aNetCode >= 0 ) && board )
......
...@@ -529,8 +529,11 @@ bool DRAWSEGMENT::HitTest( const wxPoint& aPosition ) const ...@@ -529,8 +529,11 @@ bool DRAWSEGMENT::HitTest( const wxPoint& aPosition ) const
return true; return true;
break; break;
case S_POLYGON: // not yet handled
break;
default: default:
wxASSERT( 0 ); wxASSERT_MSG( 0, wxString::Format( "unknown DRAWSEGMENT shape: %d", m_Shape ) );
break; break;
} }
...@@ -582,9 +585,15 @@ bool DRAWSEGMENT::HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy ...@@ -582,9 +585,15 @@ bool DRAWSEGMENT::HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy
break; break;
case S_CURVE:
case S_POLYGON: // not yet handled
break;
default: default:
; wxASSERT_MSG( 0, wxString::Format( "unknown DRAWSEGMENT shape: %d", m_Shape ) );
break;
} }
return false; return false;
} }
......
...@@ -112,8 +112,6 @@ MODULE::MODULE( const MODULE& aModule ) : ...@@ -112,8 +112,6 @@ MODULE::MODULE( const MODULE& aModule ) :
m_Value->SetParent( this ); m_Value->SetParent( this );
// Copy auxiliary data: Pads // Copy auxiliary data: Pads
// m_Pads.DeleteAll();
for( D_PAD* pad = aModule.m_Pads; pad; pad = pad->Next() ) for( D_PAD* pad = aModule.m_Pads; pad; pad = pad->Next() )
{ {
D_PAD* newpad = new D_PAD( *pad ); D_PAD* newpad = new D_PAD( *pad );
......
...@@ -320,9 +320,14 @@ public: ...@@ -320,9 +320,14 @@ public:
return NULL; return NULL;
} }
///> Constant that holds the unconnected net number (typically 0) ///> Constant that holds the "unconnected net" number (typically 0)
///> all items "connected" to this net are actually not connected items
static const int UNCONNECTED; static const int UNCONNECTED;
///> Constant that forces initialization of a netinfo item to the NETINFO_ITEM ORPHANED
///> (typically -1) when calling SetNetCode od board connected items
static const int FORCE_ORPHANED;
///> NETINFO_ITEM meaning that there was no net assigned for an item, as there was no ///> NETINFO_ITEM meaning that there was no net assigned for an item, as there was no
///> board storing net list available. ///> board storing net list available.
static NETINFO_ITEM ORPHANED; static NETINFO_ITEM ORPHANED;
......
...@@ -292,4 +292,6 @@ NETINFO_ITEM* NETINFO_MAPPING::iterator::operator->() const ...@@ -292,4 +292,6 @@ NETINFO_ITEM* NETINFO_MAPPING::iterator::operator->() const
const int NETINFO_LIST::UNCONNECTED = 0; const int NETINFO_LIST::UNCONNECTED = 0;
const int NETINFO_LIST::FORCE_ORPHANED = -1;
NETINFO_ITEM NETINFO_LIST::ORPHANED = NETINFO_ITEM( NULL, wxEmptyString, NETINFO_LIST::UNCONNECTED ); NETINFO_ITEM NETINFO_LIST::ORPHANED = NETINFO_ITEM( NULL, wxEmptyString, NETINFO_LIST::UNCONNECTED );
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<wxFormBuilder_Project> <wxFormBuilder_Project>
<FileVersion major="1" minor="11" /> <FileVersion major="1" minor="13" />
<object class="Project" expanded="1"> <object class="Project" expanded="1">
<property name="class_decoration"></property> <property name="class_decoration"></property>
<property name="code_generation">C++</property> <property name="code_generation">C++</property>
...@@ -20,8 +20,10 @@ ...@@ -20,8 +20,10 @@
<property name="path">.</property> <property name="path">.</property>
<property name="precompiled_header"></property> <property name="precompiled_header"></property>
<property name="relative_path">1</property> <property name="relative_path">1</property>
<property name="skip_lua_events">1</property>
<property name="skip_php_events">1</property> <property name="skip_php_events">1</property>
<property name="skip_python_events">1</property> <property name="skip_python_events">1</property>
<property name="ui_table">UI</property>
<property name="use_enum">0</property> <property name="use_enum">0</property>
<property name="use_microsoft_bom">0</property> <property name="use_microsoft_bom">0</property>
<object class="Dialog" expanded="1"> <object class="Dialog" expanded="1">
...@@ -236,7 +238,88 @@ ...@@ -236,7 +238,88 @@
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxEXPAND</property> <property name="flag">wxEXPAND | wxALL</property>
<property name="proportion">0</property>
<object class="wxStaticLine" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_staticline1</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style">wxLI_HORIZONTAL</property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxALL</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxStdDialogButtonSizer" expanded="1"> <object class="wxStdDialogButtonSizer" expanded="1">
<property name="Apply">0</property> <property name="Apply">0</property>
......
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Oct 8 2012) // C++ code generated with wxFormBuilder (version Jun 5 2014)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO "NOT" EDIT THIS FILE! // PLEASE DO "NOT" EDIT THIS FILE!
...@@ -51,6 +51,9 @@ DIALOG_FOOTPRINT_WIZARD_LIST_BASE::DIALOG_FOOTPRINT_WIZARD_LIST_BASE( wxWindow* ...@@ -51,6 +51,9 @@ DIALOG_FOOTPRINT_WIZARD_LIST_BASE::DIALOG_FOOTPRINT_WIZARD_LIST_BASE( wxWindow*
bSizerMain->Add( m_footprintWizardsGrid, 1, wxALL|wxEXPAND, 5 ); bSizerMain->Add( m_footprintWizardsGrid, 1, wxALL|wxEXPAND, 5 );
m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
bSizerMain->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 );
m_sdbSizer = new wxStdDialogButtonSizer(); m_sdbSizer = new wxStdDialogButtonSizer();
m_sdbSizerOK = new wxButton( this, wxID_OK ); m_sdbSizerOK = new wxButton( this, wxID_OK );
m_sdbSizer->AddButton( m_sdbSizerOK ); m_sdbSizer->AddButton( m_sdbSizerOK );
...@@ -58,7 +61,7 @@ DIALOG_FOOTPRINT_WIZARD_LIST_BASE::DIALOG_FOOTPRINT_WIZARD_LIST_BASE( wxWindow* ...@@ -58,7 +61,7 @@ DIALOG_FOOTPRINT_WIZARD_LIST_BASE::DIALOG_FOOTPRINT_WIZARD_LIST_BASE( wxWindow*
m_sdbSizer->AddButton( m_sdbSizerCancel ); m_sdbSizer->AddButton( m_sdbSizerCancel );
m_sdbSizer->Realize(); m_sdbSizer->Realize();
bSizerMain->Add( m_sdbSizer, 0, wxEXPAND, 5 ); bSizerMain->Add( m_sdbSizer, 0, wxEXPAND|wxALL, 5 );
this->SetSizer( bSizerMain ); this->SetSizer( bSizerMain );
......
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Oct 8 2012) // C++ code generated with wxFormBuilder (version Jun 5 2014)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO "NOT" EDIT THIS FILE! // PLEASE DO "NOT" EDIT THIS FILE!
...@@ -20,6 +20,7 @@ class DIALOG_SHIM; ...@@ -20,6 +20,7 @@ class DIALOG_SHIM;
#include <wx/font.h> #include <wx/font.h>
#include <wx/grid.h> #include <wx/grid.h>
#include <wx/gdicmn.h> #include <wx/gdicmn.h>
#include <wx/statline.h>
#include <wx/sizer.h> #include <wx/sizer.h>
#include <wx/button.h> #include <wx/button.h>
#include <wx/dialog.h> #include <wx/dialog.h>
...@@ -36,6 +37,7 @@ class DIALOG_FOOTPRINT_WIZARD_LIST_BASE : public DIALOG_SHIM ...@@ -36,6 +37,7 @@ class DIALOG_FOOTPRINT_WIZARD_LIST_BASE : public DIALOG_SHIM
protected: protected:
wxGrid* m_footprintWizardsGrid; wxGrid* m_footprintWizardsGrid;
wxStaticLine* m_staticline1;
wxStdDialogButtonSizer* m_sdbSizer; wxStdDialogButtonSizer* m_sdbSizer;
wxButton* m_sdbSizerOK; wxButton* m_sdbSizerOK;
wxButton* m_sdbSizerCancel; wxButton* m_sdbSizerCancel;
......
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<wxFormBuilder_Project> <wxFormBuilder_Project>
<FileVersion major="1" minor="11" /> <FileVersion major="1" minor="13" />
<object class="Project" expanded="1"> <object class="Project" expanded="1">
<property name="class_decoration"></property> <property name="class_decoration"></property>
<property name="code_generation">C++</property> <property name="code_generation">C++</property>
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">DIALOG_FP_PLUGIN_OPTIONS_BASE</property> <property name="name">DIALOG_FP_PLUGIN_OPTIONS_BASE</property>
<property name="pos"></property> <property name="pos"></property>
<property name="size">-1,-1</property> <property name="size">678,342</property>
<property name="style">wxCAPTION|wxCLOSE_BOX|wxDEFAULT_DIALOG_STYLE|wxMAXIMIZE_BOX|wxRESIZE_BORDER</property> <property name="style">wxCAPTION|wxCLOSE_BOX|wxDEFAULT_DIALOG_STYLE|wxMAXIMIZE_BOX|wxRESIZE_BORDER</property>
<property name="subclass">DIALOG_SHIM; dialog_shim.h</property> <property name="subclass">DIALOG_SHIM; dialog_shim.h</property>
<property name="title"></property> <property name="title"></property>
......
...@@ -96,12 +96,13 @@ bool FOOTPRINT_EDIT_FRAME::Load_Module_From_BOARD( MODULE* aModule ) ...@@ -96,12 +96,13 @@ bool FOOTPRINT_EDIT_FRAME::Load_Module_From_BOARD( MODULE* aModule )
newModule->ClearFlags(); newModule->ClearFlags();
// Clear references to net info, because the footprint editor // Clear references to any net info, because the footprint editor
// does know any thing about nets handled by the current edited board. // does know any thing about nets handled by the current edited board.
// Morever the main board can change or the net info relative to this main board // Morever we do not want to save any reference to an unknown net when
// can change while editing this footprint in the footprint editor // saving the footprint in lib cache
// so we force the ORPHANED dummy net info for all pads
for( D_PAD* pad = newModule->Pads(); pad; pad = pad->Next() ) for( D_PAD* pad = newModule->Pads(); pad; pad = pad->Next() )
pad->SetNetCode( NETINFO_LIST::UNCONNECTED ); pad->SetNetCode( NETINFO_LIST::FORCE_ORPHANED );
SetCrossHairPosition( wxPoint( 0, 0 ) ); SetCrossHairPosition( wxPoint( 0, 0 ) );
PlaceModule( newModule, NULL ); PlaceModule( newModule, NULL );
...@@ -269,6 +270,7 @@ MODULE* PCB_BASE_FRAME::LoadModuleFromLibrary( const wxString& aLibrary, ...@@ -269,6 +270,7 @@ MODULE* PCB_BASE_FRAME::LoadModuleFromLibrary( const wxString& aLibrary,
if( module ) if( module )
{ {
GetBoard()->Add( module, ADD_APPEND ); GetBoard()->Add( module, ADD_APPEND );
lastComponentName = moduleName; lastComponentName = moduleName;
AddHistoryComponentName( HistoryList, moduleName ); AddHistoryComponentName( HistoryList, moduleName );
...@@ -328,7 +330,14 @@ MODULE* PCB_BASE_FRAME::loadFootprint( const FPID& aFootprintId ) ...@@ -328,7 +330,14 @@ MODULE* PCB_BASE_FRAME::loadFootprint( const FPID& aFootprintId )
wxCHECK_MSG( fptbl, NULL, wxT( "Cannot look up FPID in NULL FP_LIB_TABLE." ) ); wxCHECK_MSG( fptbl, NULL, wxT( "Cannot look up FPID in NULL FP_LIB_TABLE." ) );
return fptbl->FootprintLoadWithOptionalNickname( aFootprintId ); MODULE* module = fptbl->FootprintLoadWithOptionalNickname( aFootprintId );
// Clear all references to any net info, to be sure there is no broken links
// to any netinfo list (This should be the case, but...)
for( D_PAD* pad = module->Pads(); pad; pad = pad->Next() )
pad->SetNetCode( NETINFO_LIST::FORCE_ORPHANED );
return module;
} }
......
...@@ -426,14 +426,13 @@ void make_vcyl( bool inch, bool axial, double dia, double length, ...@@ -426,14 +426,13 @@ void make_vcyl( bool inch, bool axial, double dia, double length,
void make_hcyl( bool inch, bool axial, double dia, double length, void make_hcyl( bool inch, bool axial, double dia, double length,
double z, double wireDia ) double z, double wireDia )
{ {
bool ok = false;
stringstream tstr; stringstream tstr;
string line; string line;
double pitch = 0.0; double pitch = 0.0;
double lead = 0.0; // lead length for radial leads double lead = 0.0; // lead length for radial leads
ok = false; bool ok = false;
while( !ok ) while( !ok )
{ {
if( axial ) if( axial )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment