Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
63d3c835
Commit
63d3c835
authored
Feb 18, 2015
by
jean-pierre charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pcbnew: refinement to Bug #1422093 fix.
parent
6312f838
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
17 deletions
+40
-17
class_module.cpp
pcbnew/class_module.cpp
+21
-6
class_module.h
pcbnew/class_module.h
+12
-3
loadcmp.cpp
pcbnew/loadcmp.cpp
+7
-8
No files found.
pcbnew/class_module.cpp
View file @
63d3c835
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 201
2
Jean-Pierre Charras, jean-pierre.charras@ujf-grenoble.fr
* Copyright (C) 201
2
SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 201
2
Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 1992-201
2
KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 201
5
Jean-Pierre Charras, jean-pierre.charras@ujf-grenoble.fr
* Copyright (C) 201
5
SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 201
5
Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 1992-201
5
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
...
...
@@ -68,8 +68,8 @@ MODULE::MODULE( BOARD* parent ) :
m_LocalSolderPasteMargin
=
0
;
m_LocalSolderPasteMarginRatio
=
0.0
;
m_ZoneConnection
=
UNDEFINED_CONNECTION
;
// Use zone setting by default
m_ThermalWidth
=
0
;
// Use zone setting by default
m_ThermalGap
=
0
;
// Use zone setting by default
m_ThermalWidth
=
0
;
// Use zone setting by default
m_ThermalGap
=
0
;
// Use zone setting by default
// These are special and mandatory text fields
m_Reference
=
new
TEXTE_MODULE
(
this
,
TEXTE_MODULE
::
TEXT_is_REFERENCE
);
...
...
@@ -174,6 +174,21 @@ MODULE::~MODULE()
delete
m_initial_comments
;
}
/**
* Function ClearAllNets
* Clear (i.e. force the ORPHANED dummy net info) the net info which
* depends on a given board for all pads of the footprint.
* This is needed when a footprint is copied between the fp editor and
* the board editor for instance, because net info become fully broken
*/
void
MODULE
::
ClearAllNets
()
{
// Force the ORPHANED dummy net info for all pads.
// ORPHANED dummy net does not depend on a board
for
(
D_PAD
*
pad
=
Pads
();
pad
;
pad
=
pad
->
Next
()
)
pad
->
SetNetCode
(
NETINFO_LIST
::
FORCE_ORPHANED
);
}
/* Draw the anchor cross (vertical)
* Must be done after the pads, because drawing the hole will erase overwrite
...
...
pcbnew/class_module.h
View file @
63d3c835
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 201
3
Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 1992-201
3
KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 201
5
Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 1992-201
5
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 @@ public:
void
Copy
(
MODULE
*
Module
);
// Copy structure
/*
/*
*
* Function Add
* adds the given item to this MODULE and takes ownership of its memory.
* @param aBoardItem The item to add to this board.
...
...
@@ -123,6 +123,15 @@ public:
*/
BOARD_ITEM
*
Remove
(
BOARD_ITEM
*
aBoardItem
);
/**
* Function ClearAllNets
* Clear (i.e. force the ORPHANED dummy net info) the net info which
* depends on a given board for all pads of the footprint.
* This is needed when a footprint is copied between the fp editor and
* the board editor for instance, because net info become fully broken
*/
void
ClearAllNets
();
/**
* Function CalculateBoundingBox
* calculates the bounding box in board coordinates.
...
...
pcbnew/loadcmp.cpp
View file @
63d3c835
...
...
@@ -101,8 +101,7 @@ bool FOOTPRINT_EDIT_FRAME::Load_Module_From_BOARD( MODULE* aModule )
// Morever we do not want to save any reference to an unknown net when
// 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
()
)
pad
->
SetNetCode
(
NETINFO_LIST
::
FORCE_ORPHANED
);
newModule
->
ClearAllNets
();
SetCrossHairPosition
(
wxPoint
(
0
,
0
)
);
PlaceModule
(
newModule
,
NULL
);
...
...
@@ -332,12 +331,12 @@ MODULE* PCB_BASE_FRAME::loadFootprint( const FPID& 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 (should be not needed, but...)
#if 0 // FIXME : currently crashes Pcbnew. should not.
for( D_PAD* pad = module->Pads(); pad; pad = pad->Next()
)
pad->SetNetCode( NETINFO_LIST::FORCE_ORPHANED );
#endif
//
If the module is found, clear all net info,
// to
be sure there is no broken links
// to any netinfo list (should be not needed, but it can be edited from
// the footprint editor
)
if
(
module
)
module
->
ClearAllNets
();
return
module
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment