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
edb48d46
Commit
edb48d46
authored
Jun 06, 2009
by
charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed minor bugs. Code cleaning
parent
483359b3
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
87 additions
and
68 deletions
+87
-68
sheetlab.cpp
eeschema/sheetlab.cpp
+7
-10
board.cpp
pcbnew/board.cpp
+2
-2
class_board.cpp
pcbnew/class_board.cpp
+14
-14
class_board.h
pcbnew/class_board.h
+12
-1
class_netinfo.h
pcbnew/class_netinfo.h
+5
-5
class_netinfolist.cpp
pcbnew/class_netinfolist.cpp
+6
-6
connect.cpp
pcbnew/connect.cpp
+5
-5
drc.cpp
pcbnew/drc.cpp
+1
-1
export_gencad.cpp
pcbnew/export_gencad.cpp
+4
-4
ioascii.cpp
pcbnew/ioascii.cpp
+2
-2
locate.cpp
pcbnew/locate.cpp
+1
-1
moduleframe.cpp
pcbnew/moduleframe.cpp
+11
-0
ratsnest.cpp
pcbnew/ratsnest.cpp
+7
-7
router.cpp
pcbnew/router.cpp
+2
-2
solve.cpp
pcbnew/solve.cpp
+1
-1
specctra_export.cpp
pcbnew/specctra_export.cpp
+3
-3
surbrill.cpp
pcbnew/surbrill.cpp
+4
-4
No files found.
eeschema/sheetlab.cpp
View file @
edb48d46
...
@@ -26,11 +26,6 @@ static wxSize NetSheetTextSize( DEFAULT_SIZE_TEXT, DEFAULT_SIZE_TEXT );
...
@@ -26,11 +26,6 @@ static wxSize NetSheetTextSize( DEFAULT_SIZE_TEXT, DEFAULT_SIZE_TEXT );
/* class WinEDA_PinSheetPropertiesFrame */
/* class WinEDA_PinSheetPropertiesFrame */
/****************************************/
/****************************************/
#define NBSHAPES 5
static
wxString
shape_list
[
NBSHAPES
]
=
{
wxT
(
"Input"
),
wxT
(
"Output"
),
wxT
(
"Bidi"
),
wxT
(
"TriState"
),
wxT
(
"Passive"
)
};
/*****************************************************/
/*****************************************************/
...
@@ -91,7 +86,7 @@ WinEDA_PinSheetPropertiesFrame::WinEDA_PinSheetPropertiesFrame(
...
@@ -91,7 +86,7 @@ WinEDA_PinSheetPropertiesFrame::WinEDA_PinSheetPropertiesFrame(
m_CurrentPinSheet
=
curr_pinsheet
;
m_CurrentPinSheet
=
curr_pinsheet
;
/* Creat
ion des boutons de commande
*/
/* Creat
e buttons:
*/
Button
=
new
wxButton
(
this
,
wxID_OK
,
_
(
"OK"
)
);
Button
=
new
wxButton
(
this
,
wxID_OK
,
_
(
"OK"
)
);
RightBoxSizer
->
Add
(
Button
,
0
,
wxGROW
|
wxALL
,
5
);
RightBoxSizer
->
Add
(
Button
,
0
,
wxGROW
|
wxALL
,
5
);
...
@@ -103,7 +98,12 @@ WinEDA_PinSheetPropertiesFrame::WinEDA_PinSheetPropertiesFrame(
...
@@ -103,7 +98,12 @@ WinEDA_PinSheetPropertiesFrame::WinEDA_PinSheetPropertiesFrame(
m_CurrentPinSheet
->
m_Size
.
x
,
m_CurrentPinSheet
->
m_Size
.
x
,
g_UnitMetric
,
LeftBoxSizer
,
200
);
g_UnitMetric
,
LeftBoxSizer
,
200
);
// Selection de la forme :
// Display shape selection :
#define NBSHAPES 5
wxString
shape_list
[
NBSHAPES
]
=
{
_
(
"Input"
),
_
(
"Output"
),
_
(
"Bidi"
),
_
(
"TriState"
),
_
(
"Passive"
)
};
m_PinSheetShape
=
new
wxRadioBox
(
this
,
-
1
,
_
(
"PinSheet Shape:"
),
m_PinSheetShape
=
new
wxRadioBox
(
this
,
-
1
,
_
(
"PinSheet Shape:"
),
wxDefaultPosition
,
wxSize
(
-
1
,
-
1
),
wxDefaultPosition
,
wxSize
(
-
1
,
-
1
),
NBSHAPES
,
shape_list
,
1
);
NBSHAPES
,
shape_list
,
1
);
...
@@ -138,9 +138,6 @@ void WinEDA_PinSheetPropertiesFrame::OnOkClick( wxCommandEvent& event )
...
@@ -138,9 +138,6 @@ void WinEDA_PinSheetPropertiesFrame::OnOkClick( wxCommandEvent& event )
/*****************************************************************/
/*****************************************************************/
static
void
ExitPinSheet
(
WinEDA_DrawPanel
*
Panel
,
wxDC
*
DC
)
static
void
ExitPinSheet
(
WinEDA_DrawPanel
*
Panel
,
wxDC
*
DC
)
/*****************************************************************/
/*****************************************************************/
/* Routine de sortie du Menu d'Edition Des NETS (Labels) SHEET
*/
{
{
Hierarchical_PIN_Sheet_Struct
*
SheetLabel
=
(
Hierarchical_PIN_Sheet_Struct
*
)
Hierarchical_PIN_Sheet_Struct
*
SheetLabel
=
(
Hierarchical_PIN_Sheet_Struct
*
)
Panel
->
GetScreen
()
->
GetCurItem
();
Panel
->
GetScreen
()
->
GetCurItem
();
...
...
pcbnew/board.cpp
View file @
edb48d46
...
@@ -189,7 +189,7 @@ void PlaceCells( BOARD* aPcb, int net_code, int flag )
...
@@ -189,7 +189,7 @@ void PlaceCells( BOARD* aPcb, int net_code, int flag )
// Placement des PADS sur le board //
// Placement des PADS sur le board //
/////////////////////////////////////
/////////////////////////////////////
for
(
unsigned
i
=
0
;
i
<
aPcb
->
m_Pads
.
size
();
++
i
)
for
(
unsigned
i
=
0
;
i
<
aPcb
->
GetPadsCount
();
++
i
)
{
{
D_PAD
*
pad
=
aPcb
->
m_Pads
[
i
];
D_PAD
*
pad
=
aPcb
->
m_Pads
[
i
];
...
@@ -281,7 +281,7 @@ void PlaceCells( BOARD* aPcb, int net_code, int flag )
...
@@ -281,7 +281,7 @@ void PlaceCells( BOARD* aPcb, int net_code, int flag )
if
(
PtText
->
GetLength
()
==
0
)
if
(
PtText
->
GetLength
()
==
0
)
break
;
break
;
EDA_Rect
textbox
=
PtText
->
GetTextBox
(
-
1
);
EDA_Rect
textbox
=
PtText
->
GetTextBox
(
-
1
);
ux0
=
textbox
.
GetX
();
uy0
=
textbox
.
GetY
();
ux0
=
textbox
.
GetX
();
uy0
=
textbox
.
GetY
();
dx
=
textbox
.
GetWidth
();
dx
=
textbox
.
GetWidth
();
...
...
pcbnew/class_board.cpp
View file @
edb48d46
...
@@ -522,7 +522,7 @@ void BOARD::DisplayInfo( WinEDA_DrawFrame* frame )
...
@@ -522,7 +522,7 @@ void BOARD::DisplayInfo( WinEDA_DrawFrame* frame )
viasCount
++
;
viasCount
++
;
}
}
txt
.
Printf
(
wxT
(
"%d"
),
m_Pads
.
size
()
);
txt
.
Printf
(
wxT
(
"%d"
),
GetPadsCount
()
);
Affiche_1_Parametre
(
frame
,
POS_AFF_NBPADS
,
_
(
"Pads"
),
txt
,
DARKGREEN
);
Affiche_1_Parametre
(
frame
,
POS_AFF_NBPADS
,
_
(
"Pads"
),
txt
,
DARKGREEN
);
txt
.
Printf
(
wxT
(
"%d"
),
viasCount
);
txt
.
Printf
(
wxT
(
"%d"
),
viasCount
);
...
@@ -531,7 +531,7 @@ void BOARD::DisplayInfo( WinEDA_DrawFrame* frame )
...
@@ -531,7 +531,7 @@ void BOARD::DisplayInfo( WinEDA_DrawFrame* frame )
txt
.
Printf
(
wxT
(
"%d"
),
GetNodesCount
()
);
txt
.
Printf
(
wxT
(
"%d"
),
GetNodesCount
()
);
Affiche_1_Parametre
(
frame
,
POS_AFF_NBNODES
,
_
(
"Nodes"
),
txt
,
DARKCYAN
);
Affiche_1_Parametre
(
frame
,
POS_AFF_NBNODES
,
_
(
"Nodes"
),
txt
,
DARKCYAN
);
txt
.
Printf
(
wxT
(
"%d"
),
m_NetInfo
->
GetCount
()
);
txt
.
Printf
(
wxT
(
"%d"
),
m_NetInfo
->
Get
Nets
Count
()
);
Affiche_1_Parametre
(
frame
,
POS_AFF_NBNETS
,
_
(
"Nets"
),
txt
,
RED
);
Affiche_1_Parametre
(
frame
,
POS_AFF_NBNETS
,
_
(
"Nets"
),
txt
,
RED
);
/* These parameters are known only if the full ratsnest is available,
/* These parameters are known only if the full ratsnest is available,
...
@@ -822,8 +822,8 @@ NETINFO_ITEM* BOARD::FindNet( int anetcode ) const
...
@@ -822,8 +822,8 @@ NETINFO_ITEM* BOARD::FindNet( int anetcode ) const
// zero is reserved for "no connection" and is not used.
// zero is reserved for "no connection" and is not used.
if
(
anetcode
>
0
)
if
(
anetcode
>
0
)
{
{
wxASSERT
(
anetcode
==
m_NetInfo
->
GetItem
(
anetcode
)
->
GetNet
()
);
wxASSERT
(
anetcode
==
m_NetInfo
->
Get
Net
Item
(
anetcode
)
->
GetNet
()
);
return
m_NetInfo
->
GetItem
(
anetcode
);
return
m_NetInfo
->
Get
Net
Item
(
anetcode
);
}
}
return
NULL
;
return
NULL
;
}
}
...
@@ -841,10 +841,10 @@ NETINFO_ITEM* BOARD::FindNet( const wxString& aNetname ) const
...
@@ -841,10 +841,10 @@ NETINFO_ITEM* BOARD::FindNet( const wxString& aNetname ) const
// zero is reserved for "no connection" and is not used.
// zero is reserved for "no connection" and is not used.
if
(
!
aNetname
.
IsEmpty
()
)
if
(
!
aNetname
.
IsEmpty
()
)
{
{
for
(
unsigned
ii
=
1
;
ii
<
m_NetInfo
->
GetCount
();
ii
++
)
for
(
unsigned
ii
=
1
;
ii
<
m_NetInfo
->
Get
Nets
Count
();
ii
++
)
{
{
if
(
m_NetInfo
->
GetItem
(
ii
)
->
GetNetname
()
==
aNetname
)
if
(
m_NetInfo
->
Get
Net
Item
(
ii
)
->
GetNetname
()
==
aNetname
)
return
m_NetInfo
->
GetItem
(
ii
);
return
m_NetInfo
->
Get
Net
Item
(
ii
);
}
}
}
}
return
NULL
;
return
NULL
;
...
@@ -899,16 +899,16 @@ static bool s_SortByNodes( const NETINFO_ITEM* a, const NETINFO_ITEM* b )
...
@@ -899,16 +899,16 @@ static bool s_SortByNodes( const NETINFO_ITEM* a, const NETINFO_ITEM* b )
*/
*/
int
BOARD
::
ReturnSortedNetnamesList
(
wxArrayString
&
aNames
,
bool
aSortbyPadsCount
)
int
BOARD
::
ReturnSortedNetnamesList
(
wxArrayString
&
aNames
,
bool
aSortbyPadsCount
)
{
{
if
(
m_NetInfo
->
GetCount
()
==
0
)
if
(
m_NetInfo
->
Get
Nets
Count
()
==
0
)
return
0
;
return
0
;
/* Build the list */
/* Build the list */
std
::
vector
<
NETINFO_ITEM
*>
netBuffer
;
std
::
vector
<
NETINFO_ITEM
*>
netBuffer
;
netBuffer
.
reserve
(
m_NetInfo
->
GetCount
()
);
netBuffer
.
reserve
(
m_NetInfo
->
Get
Nets
Count
()
);
for
(
unsigned
ii
=
1
;
ii
<
m_NetInfo
->
GetCount
();
ii
++
)
for
(
unsigned
ii
=
1
;
ii
<
m_NetInfo
->
Get
Nets
Count
();
ii
++
)
{
{
if
(
m_NetInfo
->
GetItem
(
ii
)
->
GetNet
()
>
0
)
if
(
m_NetInfo
->
Get
Net
Item
(
ii
)
->
GetNet
()
>
0
)
netBuffer
.
push_back
(
m_NetInfo
->
GetItem
(
ii
)
);
netBuffer
.
push_back
(
m_NetInfo
->
Get
Net
Item
(
ii
)
);
}
}
/* sort the list */
/* sort the list */
...
@@ -930,8 +930,8 @@ bool BOARD::Save( FILE* aFile ) const
...
@@ -930,8 +930,8 @@ bool BOARD::Save( FILE* aFile ) const
BOARD_ITEM
*
item
;
BOARD_ITEM
*
item
;
// save the nets
// save the nets
for
(
unsigned
ii
=
0
;
ii
<
m_NetInfo
->
GetCount
();
ii
++
)
for
(
unsigned
ii
=
0
;
ii
<
m_NetInfo
->
Get
Nets
Count
();
ii
++
)
if
(
!
m_NetInfo
->
GetItem
(
ii
)
->
Save
(
aFile
)
)
if
(
!
m_NetInfo
->
Get
Net
Item
(
ii
)
->
Save
(
aFile
)
)
goto
out
;
goto
out
;
// save the modules
// save the modules
...
...
pcbnew/class_board.h
View file @
edb48d46
...
@@ -242,7 +242,18 @@ public:
...
@@ -242,7 +242,18 @@ public:
return
m_FullRatsnest
.
size
();
return
m_FullRatsnest
.
size
();
}
}
unsigned
GetNodesCount
();
// retourne le nombre de pads a netcode > 0
/** Function GetNodesCount
* @return the number of pads members of nets (i.e. with netcode > 0)
*/
unsigned
GetNodesCount
();
/** Function GetPadsCount
* @return the number of pads in board
*/
unsigned
GetPadsCount
()
{
return
m_Pads
.
size
();
}
/** Function Build_Pads_Full_List
/** Function Build_Pads_Full_List
* Create the pad list
* Create the pad list
...
...
pcbnew/class_netinfo.h
View file @
edb48d46
...
@@ -79,19 +79,19 @@ public:
...
@@ -79,19 +79,19 @@ public:
* @param aNetcode = netcode to identify a given NETINFO_ITEM
* @param aNetcode = netcode to identify a given NETINFO_ITEM
* @return a NETINFO_ITEM pointer to the selected NETINFO_ITEM by its netcode, or NULL if not found
* @return a NETINFO_ITEM pointer to the selected NETINFO_ITEM by its netcode, or NULL if not found
*/
*/
NETINFO_ITEM
*
GetItem
(
int
aNetcode
);
NETINFO_ITEM
*
Get
Net
Item
(
int
aNetcode
);
/** Function GetCount()
/** Function GetCount()
* @return the number of nets ( always >= 1 )
* @return the number of nets ( always >= 1 )
*
the first net is the "not connected" net
*
becuse the first net is the "not connected" net and always exists
*/
*/
unsigned
GetCount
()
{
return
m_NetBuffer
.
size
();
}
unsigned
Get
Nets
Count
()
{
return
m_NetBuffer
.
size
();
}
/**
/**
* Function Append
* Function Append
* adds \a aNewElement to the end of the list.
* adds \a aNewElement to the end of the list.
*/
*/
void
Append
(
NETINFO_ITEM
*
aNewElement
);
void
Append
Net
(
NETINFO_ITEM
*
aNewElement
);
/** Function DeleteData
/** Function DeleteData
* delete the list of nets (and free memory)
* delete the list of nets (and free memory)
...
@@ -99,7 +99,7 @@ public:
...
@@ -99,7 +99,7 @@ public:
void
DeleteData
();
void
DeleteData
();
/** Function BuildListOfNets
/** Function BuildListOfNets
*
initialize
the list of NETINFO_ITEM m_NetBuffer
*
Build or rebuild
the list of NETINFO_ITEM m_NetBuffer
* The list is sorted by names.
* The list is sorted by names.
*/
*/
void
BuildListOfNets
();
void
BuildListOfNets
();
...
...
pcbnew/class_netinfolist.cpp
View file @
edb48d46
...
@@ -27,9 +27,9 @@ NETINFO_LIST::~NETINFO_LIST()
...
@@ -27,9 +27,9 @@ NETINFO_LIST::~NETINFO_LIST()
* @param aNetcode = netcode to identify a given NETINFO_ITEM
* @param aNetcode = netcode to identify a given NETINFO_ITEM
* @return a NETINFO_ITEM pointer to the selected NETINFO_ITEM by its netcode, or NULL if not found
* @return a NETINFO_ITEM pointer to the selected NETINFO_ITEM by its netcode, or NULL if not found
*/
*/
NETINFO_ITEM
*
NETINFO_LIST
::
GetItem
(
int
aNetcode
)
NETINFO_ITEM
*
NETINFO_LIST
::
Get
Net
Item
(
int
aNetcode
)
{
{
if
(
aNetcode
<
0
||
(
aNetcode
>
(
int
)
(
GetCount
()
-
1
)
)
)
if
(
aNetcode
<
0
||
(
aNetcode
>
(
int
)
(
Get
Nets
Count
()
-
1
)
)
)
return
NULL
;
return
NULL
;
return
m_NetBuffer
[
aNetcode
];
return
m_NetBuffer
[
aNetcode
];
}
}
...
@@ -40,7 +40,7 @@ NETINFO_ITEM* NETINFO_LIST::GetItem( int aNetcode )
...
@@ -40,7 +40,7 @@ NETINFO_ITEM* NETINFO_LIST::GetItem( int aNetcode )
*/
*/
void
NETINFO_LIST
::
DeleteData
()
void
NETINFO_LIST
::
DeleteData
()
{
{
for
(
unsigned
ii
=
0
;
ii
<
GetCount
();
ii
++
)
for
(
unsigned
ii
=
0
;
ii
<
Get
Nets
Count
();
ii
++
)
delete
m_NetBuffer
[
ii
];
delete
m_NetBuffer
[
ii
];
m_NetBuffer
.
clear
();
m_NetBuffer
.
clear
();
...
@@ -51,7 +51,7 @@ void NETINFO_LIST::DeleteData()
...
@@ -51,7 +51,7 @@ void NETINFO_LIST::DeleteData()
* Function Append
* Function Append
* adds \a aNewElement to the end of the list.
* adds \a aNewElement to the end of the list.
*/
*/
void
NETINFO_LIST
::
Append
(
NETINFO_ITEM
*
aNewElement
)
void
NETINFO_LIST
::
Append
Net
(
NETINFO_ITEM
*
aNewElement
)
{
{
m_NetBuffer
.
push_back
(
aNewElement
);
m_NetBuffer
.
push_back
(
aNewElement
);
}
}
...
@@ -87,7 +87,7 @@ void NETINFO_LIST::BuildListOfNets()
...
@@ -87,7 +87,7 @@ void NETINFO_LIST::BuildListOfNets()
// Create and add the "unconnected net"
// Create and add the "unconnected net"
net_item
=
new
NETINFO_ITEM
(
m_Parent
);
net_item
=
new
NETINFO_ITEM
(
m_Parent
);
Append
(
net_item
);
Append
Net
(
net_item
);
/* Build the PAD list, sorted by net */
/* Build the PAD list, sorted by net */
m_Parent
->
Build_Pads_Full_List
();
m_Parent
->
Build_Pads_Full_List
();
...
@@ -113,7 +113,7 @@ void NETINFO_LIST::BuildListOfNets()
...
@@ -113,7 +113,7 @@ void NETINFO_LIST::BuildListOfNets()
net_item
=
new
NETINFO_ITEM
(
m_Parent
);
net_item
=
new
NETINFO_ITEM
(
m_Parent
);
net_item
->
SetNet
(
netcode
);
net_item
->
SetNet
(
netcode
);
net_item
->
SetNetname
(
pad
->
GetNetname
()
);
net_item
->
SetNetname
(
pad
->
GetNetname
()
);
Append
(
net_item
);
Append
Net
(
net_item
);
}
}
pad
->
SetNet
(
netcode
);
pad
->
SetNet
(
netcode
);
...
...
pcbnew/connect.cpp
View file @
edb48d46
...
@@ -276,7 +276,7 @@ void WinEDA_BasePcbFrame::test_connexions( wxDC* DC )
...
@@ -276,7 +276,7 @@ void WinEDA_BasePcbFrame::test_connexions( wxDC* DC )
*/
*/
{
{
// Clear the cluster identifier for all pads
// Clear the cluster identifier for all pads
for
(
unsigned
i
=
0
;
i
<
m_Pcb
->
m_Pads
.
size
();
++
i
)
for
(
unsigned
i
=
0
;
i
<
m_Pcb
->
GetPadsCount
();
++
i
)
{
{
D_PAD
*
pad
=
m_Pcb
->
m_Pads
[
i
];
D_PAD
*
pad
=
m_Pcb
->
m_Pads
[
i
];
...
@@ -324,7 +324,7 @@ void WinEDA_BasePcbFrame::test_1_net_connexion( wxDC* DC, int net_code )
...
@@ -324,7 +324,7 @@ void WinEDA_BasePcbFrame::test_1_net_connexion( wxDC* DC, int net_code )
if
(
(
m_Pcb
->
m_Status_Pcb
&
LISTE_RATSNEST_ITEM_OK
)
==
0
)
if
(
(
m_Pcb
->
m_Status_Pcb
&
LISTE_RATSNEST_ITEM_OK
)
==
0
)
Compile_Ratsnest
(
DC
,
TRUE
);
Compile_Ratsnest
(
DC
,
TRUE
);
for
(
unsigned
i
=
0
;
i
<
m_Pcb
->
m_Pads
.
size
();
++
i
)
for
(
unsigned
i
=
0
;
i
<
m_Pcb
->
GetPadsCount
();
++
i
)
{
{
D_PAD
*
pad
=
m_Pcb
->
m_Pads
[
i
];
D_PAD
*
pad
=
m_Pcb
->
m_Pads
[
i
];
...
@@ -472,7 +472,7 @@ static D_PAD* SuperFast_Locate_Pad_Connecte( BOARD* aPcb, LISTE_PAD* pt_liste,
...
@@ -472,7 +472,7 @@ static D_PAD* SuperFast_Locate_Pad_Connecte( BOARD* aPcb, LISTE_PAD* pt_liste,
D_PAD
*
pad
;
D_PAD
*
pad
;
int
ii
;
int
ii
;
int
nb_pad
=
aPcb
->
m_Pads
.
size
();
int
nb_pad
=
aPcb
->
GetPadsCount
();
LISTE_PAD
*
ptr_pad
=
pt_liste
;
LISTE_PAD
*
ptr_pad
=
pt_liste
;
LISTE_PAD
*
lim
=
pt_liste
+
nb_pad
-
1
;
LISTE_PAD
*
lim
=
pt_liste
+
nb_pad
-
1
;
...
@@ -557,7 +557,7 @@ void CreateSortedPadListByXCoord( BOARD* aBoard, std::vector<D_PAD*>* aVector )
...
@@ -557,7 +557,7 @@ void CreateSortedPadListByXCoord( BOARD* aBoard, std::vector<D_PAD*>* aVector )
{
{
aVector
->
insert
(
aVector
->
end
(),
aBoard
->
m_Pads
.
begin
(),
aBoard
->
m_Pads
.
end
()
);
aVector
->
insert
(
aVector
->
end
(),
aBoard
->
m_Pads
.
begin
(),
aBoard
->
m_Pads
.
end
()
);
qsort
(
&
(
*
aVector
)[
0
],
aBoard
->
m_Pads
.
size
(),
sizeof
(
D_PAD
*
),
SortPadsByXCoord
);
qsort
(
&
(
*
aVector
)[
0
],
aBoard
->
GetPadsCount
(),
sizeof
(
D_PAD
*
),
SortPadsByXCoord
);
}
}
...
@@ -584,7 +584,7 @@ void WinEDA_BasePcbFrame::RecalculateAllTracksNetcode( )
...
@@ -584,7 +584,7 @@ void WinEDA_BasePcbFrame::RecalculateAllTracksNetcode( )
// Build the net info list
// Build the net info list
GetBoard
()
->
m_NetInfo
->
BuildListOfNets
();
GetBoard
()
->
m_NetInfo
->
BuildListOfNets
();
if
(
m_Pcb
->
m_Pads
.
size
()
==
0
)
// If no pad, reset pointers and netcode, and do nothing else
if
(
m_Pcb
->
GetPadsCount
()
==
0
)
// If no pad, reset pointers and netcode, and do nothing else
{
{
pt_piste
=
m_Pcb
->
m_Track
;
pt_piste
=
m_Pcb
->
m_Track
;
for
(
;
pt_piste
!=
NULL
;
pt_piste
=
pt_piste
->
Next
()
)
for
(
;
pt_piste
!=
NULL
;
pt_piste
=
pt_piste
->
Next
()
)
...
...
pcbnew/drc.cpp
View file @
edb48d46
...
@@ -581,7 +581,7 @@ bool DRC::doTrackDrc( TRACK* aRefSeg, TRACK* aStart, bool testPads )
...
@@ -581,7 +581,7 @@ bool DRC::doTrackDrc( TRACK* aRefSeg, TRACK* aStart, bool testPads )
if
(
testPads
)
if
(
testPads
)
{
{
for
(
unsigned
ii
=
0
;
ii
<
m_pcb
->
m_Pads
.
size
();
++
ii
)
for
(
unsigned
ii
=
0
;
ii
<
m_pcb
->
GetPadsCount
();
++
ii
)
{
{
D_PAD
*
pad
=
m_pcb
->
m_Pads
[
ii
];
D_PAD
*
pad
=
m_pcb
->
m_Pads
[
ii
];
...
...
pcbnew/export_gencad.cpp
View file @
edb48d46
...
@@ -168,10 +168,10 @@ void CreatePadsShapesSection( FILE* file, BOARD* pcb )
...
@@ -168,10 +168,10 @@ void CreatePadsShapesSection( FILE* file, BOARD* pcb )
fputs
(
"$PADS
\n
"
,
file
);
fputs
(
"$PADS
\n
"
,
file
);
if
(
pcb
->
m_Pads
.
size
()
>
0
)
if
(
pcb
->
GetPadsCount
()
>
0
)
{
{
pads
.
insert
(
pads
.
end
(),
pcb
->
m_Pads
.
begin
(),
pcb
->
m_Pads
.
end
()
);
pads
.
insert
(
pads
.
end
(),
pcb
->
m_Pads
.
begin
(),
pcb
->
m_Pads
.
end
()
);
qsort
(
&
pads
[
0
],
pcb
->
m_Pads
.
size
(),
sizeof
(
D_PAD
*
),
Pad_list_Sort_by_Shapes
);
qsort
(
&
pads
[
0
],
pcb
->
GetPadsCount
(),
sizeof
(
D_PAD
*
),
Pad_list_Sort_by_Shapes
);
}
}
D_PAD
*
old_pad
=
NULL
;
D_PAD
*
old_pad
=
NULL
;
...
@@ -440,9 +440,9 @@ void CreateSignalsSection( FILE* file, BOARD* pcb )
...
@@ -440,9 +440,9 @@ void CreateSignalsSection( FILE* file, BOARD* pcb )
fputs
(
"$SIGNALS
\n
"
,
file
);
fputs
(
"$SIGNALS
\n
"
,
file
);
for
(
unsigned
ii
=
0
;
ii
<
pcb
->
m_NetInfo
->
GetCount
()
;
ii
++
)
for
(
unsigned
ii
=
0
;
ii
<
pcb
->
m_NetInfo
->
Get
Nets
Count
()
;
ii
++
)
{
{
net
=
pcb
->
m_NetInfo
->
GetItem
(
ii
);
net
=
pcb
->
m_NetInfo
->
Get
Net
Item
(
ii
);
if
(
net
->
GetNetname
()
==
wxEmptyString
)
// dummy equipot (non connexion)
if
(
net
->
GetNetname
()
==
wxEmptyString
)
// dummy equipot (non connexion)
{
{
wxString
msg
;
msg
<<
wxT
(
"NoConnection"
)
<<
NbNoConn
++
;
wxString
msg
;
msg
<<
wxT
(
"NoConnection"
)
<<
NbNoConn
++
;
...
...
pcbnew/ioascii.cpp
View file @
edb48d46
...
@@ -594,7 +594,7 @@ bool WinEDA_PcbFrame::WriteGeneralDescrPcb( FILE* File )
...
@@ -594,7 +594,7 @@ bool WinEDA_PcbFrame::WriteGeneralDescrPcb( FILE* File )
fprintf
(
File
,
"Nzone %d
\n
"
,
GetBoard
()
->
GetNumSegmZone
()
);
fprintf
(
File
,
"Nzone %d
\n
"
,
GetBoard
()
->
GetNumSegmZone
()
);
fprintf
(
File
,
"Nmodule %d
\n
"
,
NbModules
);
fprintf
(
File
,
"Nmodule %d
\n
"
,
NbModules
);
fprintf
(
File
,
"Nnets %d
\n
"
,
GetBoard
()
->
m_NetInfo
->
GetCount
()
);
fprintf
(
File
,
"Nnets %d
\n
"
,
GetBoard
()
->
m_NetInfo
->
Get
Nets
Count
()
);
fprintf
(
File
,
"$EndGENERAL
\n\n
"
);
fprintf
(
File
,
"$EndGENERAL
\n\n
"
);
return
TRUE
;
return
TRUE
;
...
@@ -784,7 +784,7 @@ int WinEDA_PcbFrame::ReadPcbFile( FILE* File, bool Append )
...
@@ -784,7 +784,7 @@ int WinEDA_PcbFrame::ReadPcbFile( FILE* File, bool Append )
if
(
strnicmp
(
Line
,
"$EQUIPOT"
,
7
)
==
0
)
if
(
strnicmp
(
Line
,
"$EQUIPOT"
,
7
)
==
0
)
{
{
NETINFO_ITEM
*
net
=
new
NETINFO_ITEM
(
GetBoard
()
);
NETINFO_ITEM
*
net
=
new
NETINFO_ITEM
(
GetBoard
()
);
GetBoard
()
->
m_NetInfo
->
Append
(
net
);
GetBoard
()
->
m_NetInfo
->
Append
Net
(
net
);
net
->
ReadDescr
(
File
,
&
LineNum
);
net
->
ReadDescr
(
File
,
&
LineNum
);
continue
;
continue
;
}
}
...
...
pcbnew/locate.cpp
View file @
edb48d46
...
@@ -583,7 +583,7 @@ D_PAD* Fast_Locate_Pad_Connecte( BOARD* Pcb, const wxPoint& ref_pos, int masque_
...
@@ -583,7 +583,7 @@ D_PAD* Fast_Locate_Pad_Connecte( BOARD* Pcb, const wxPoint& ref_pos, int masque_
* (bonne position ET bonne couche).
* (bonne position ET bonne couche).
*/
*/
{
{
for
(
unsigned
i
=
0
;
i
<
Pcb
->
m_Pads
.
size
();
++
i
)
for
(
unsigned
i
=
0
;
i
<
Pcb
->
GetPadsCount
();
++
i
)
{
{
D_PAD
*
pad
=
Pcb
->
m_Pads
[
i
];
D_PAD
*
pad
=
Pcb
->
m_Pads
[
i
];
...
...
pcbnew/moduleframe.cpp
View file @
edb48d46
...
@@ -332,15 +332,26 @@ void WinEDA_ModuleEditFrame::SetToolbars()
...
@@ -332,15 +332,26 @@ void WinEDA_ModuleEditFrame::SetToolbars()
m_OptionsToolBar
->
ToggleTool
(
ID_TB_OPTIONS_SHOW_POLAR_COORD
,
m_OptionsToolBar
->
ToggleTool
(
ID_TB_OPTIONS_SHOW_POLAR_COORD
,
DisplayOpt
.
DisplayPolarCood
);
DisplayOpt
.
DisplayPolarCood
);
m_OptionsToolBar
->
SetToolShortHelp
(
ID_TB_OPTIONS_SHOW_POLAR_COORD
,
DisplayOpt
.
DisplayPolarCood
?
_
(
"Polar Coords not show"
)
:
_
(
"Display Polar Coords"
)
);
m_OptionsToolBar
->
ToggleTool
(
ID_TB_OPTIONS_SHOW_GRID
,
m_OptionsToolBar
->
ToggleTool
(
ID_TB_OPTIONS_SHOW_GRID
,
m_Draw_Grid
);
m_Draw_Grid
);
m_OptionsToolBar
->
SetToolShortHelp
(
ID_TB_OPTIONS_SHOW_GRID
,
m_Draw_Grid
?
_
(
"Grid not show"
)
:
_
(
"Show Grid"
)
);
m_OptionsToolBar
->
ToggleTool
(
ID_TB_OPTIONS_SELECT_CURSOR
,
m_OptionsToolBar
->
ToggleTool
(
ID_TB_OPTIONS_SELECT_CURSOR
,
m_CursorShape
);
m_CursorShape
);
m_OptionsToolBar
->
ToggleTool
(
ID_TB_OPTIONS_SHOW_PADS_SKETCH
,
m_OptionsToolBar
->
ToggleTool
(
ID_TB_OPTIONS_SHOW_PADS_SKETCH
,
!
m_DisplayPadFill
);
!
m_DisplayPadFill
);
m_OptionsToolBar
->
SetToolShortHelp
(
ID_TB_OPTIONS_SHOW_PADS_SKETCH
,
m_DisplayPadFill
?
_
(
"Show Pads Sketch mode"
)
:
_
(
"Show pads filled mode"
)
);
}
}
if
(
m_AuxiliaryToolBar
)
if
(
m_AuxiliaryToolBar
)
...
...
pcbnew/ratsnest.cpp
View file @
edb48d46
...
@@ -115,13 +115,13 @@ void WinEDA_BasePcbFrame::Compile_Ratsnest( wxDC* DC, bool display_status_pcb )
...
@@ -115,13 +115,13 @@ void WinEDA_BasePcbFrame::Compile_Ratsnest( wxDC* DC, bool display_status_pcb )
if
(
display_status_pcb
)
if
(
display_status_pcb
)
{
{
msg
.
Printf
(
wxT
(
" %d"
),
m_Pcb
->
m_Pads
.
size
()
);
msg
.
Printf
(
wxT
(
" %d"
),
m_Pcb
->
GetPadsCount
()
);
Affiche_1_Parametre
(
this
,
1
,
wxT
(
"pads"
),
msg
,
RED
);
Affiche_1_Parametre
(
this
,
1
,
wxT
(
"pads"
),
msg
,
RED
);
}
}
if
(
display_status_pcb
)
if
(
display_status_pcb
)
{
{
msg
.
Printf
(
wxT
(
" %d"
),
m_Pcb
->
m_NetInfo
->
GetCount
()
);
msg
.
Printf
(
wxT
(
" %d"
),
m_Pcb
->
m_NetInfo
->
Get
Nets
Count
()
);
Affiche_1_Parametre
(
this
,
8
,
wxT
(
"Nets"
),
msg
,
CYAN
);
Affiche_1_Parametre
(
this
,
8
,
wxT
(
"Nets"
),
msg
,
CYAN
);
}
}
...
@@ -419,14 +419,14 @@ void WinEDA_BasePcbFrame::Build_Board_Ratsnest( wxDC* DC )
...
@@ -419,14 +419,14 @@ void WinEDA_BasePcbFrame::Build_Board_Ratsnest( wxDC* DC )
m_Pcb
->
m_FullRatsnest
.
clear
();
m_Pcb
->
m_FullRatsnest
.
clear
();
if
(
m_Pcb
->
m_Pads
.
size
()
==
0
)
if
(
m_Pcb
->
GetPadsCount
()
==
0
)
return
;
return
;
/* Created pad list and the net_codes if needed */
/* Created pad list and the net_codes if needed */
if
(
(
m_Pcb
->
m_Status_Pcb
&
NET_CODES_OK
)
==
0
)
if
(
(
m_Pcb
->
m_Status_Pcb
&
NET_CODES_OK
)
==
0
)
m_Pcb
->
m_NetInfo
->
BuildListOfNets
();
m_Pcb
->
m_NetInfo
->
BuildListOfNets
();
for
(
unsigned
ii
=
0
;
ii
<
m_Pcb
->
m_Pads
.
size
();
++
ii
)
for
(
unsigned
ii
=
0
;
ii
<
m_Pcb
->
GetPadsCount
();
++
ii
)
{
{
pad
=
m_Pcb
->
m_Pads
[
ii
];
pad
=
m_Pcb
->
m_Pads
[
ii
];
pad
->
SetSubRatsnest
(
0
);
pad
->
SetSubRatsnest
(
0
);
...
@@ -441,7 +441,7 @@ void WinEDA_BasePcbFrame::Build_Board_Ratsnest( wxDC* DC )
...
@@ -441,7 +441,7 @@ void WinEDA_BasePcbFrame::Build_Board_Ratsnest( wxDC* DC )
unsigned
current_net_code
=
1
;
// 1er net_code a analyser (net_code = 0 -> no connect)
unsigned
current_net_code
=
1
;
// 1er net_code a analyser (net_code = 0 -> no connect)
noconn
=
0
;
noconn
=
0
;
for
(
;
current_net_code
<
m_Pcb
->
m_NetInfo
->
GetCount
();
current_net_code
++
)
for
(
;
current_net_code
<
m_Pcb
->
m_NetInfo
->
Get
Nets
Count
();
current_net_code
++
)
{
{
NETINFO_ITEM
*
net
=
m_Pcb
->
FindNet
(
current_net_code
);
NETINFO_ITEM
*
net
=
m_Pcb
->
FindNet
(
current_net_code
);
if
(
net
==
NULL
)
//Should not occur
if
(
net
==
NULL
)
//Should not occur
...
@@ -676,12 +676,12 @@ void WinEDA_BasePcbFrame::Tst_Ratsnest( wxDC* DC, int ref_netcode )
...
@@ -676,12 +676,12 @@ void WinEDA_BasePcbFrame::Tst_Ratsnest( wxDC* DC, int ref_netcode )
D_PAD
*
pad
;
D_PAD
*
pad
;
NETINFO_ITEM
*
net
;
NETINFO_ITEM
*
net
;
if
(
m_Pcb
->
m_Pads
.
size
()
==
0
)
if
(
m_Pcb
->
GetPadsCount
()
==
0
)
return
;
return
;
if
(
(
m_Pcb
->
m_Status_Pcb
&
LISTE_RATSNEST_ITEM_OK
)
==
0
)
if
(
(
m_Pcb
->
m_Status_Pcb
&
LISTE_RATSNEST_ITEM_OK
)
==
0
)
Build_Board_Ratsnest
(
DC
);
Build_Board_Ratsnest
(
DC
);
for
(
int
net_code
=
1
;
net_code
<
(
int
)
m_Pcb
->
m_NetInfo
->
GetCount
();
net_code
++
)
for
(
int
net_code
=
1
;
net_code
<
(
int
)
m_Pcb
->
m_NetInfo
->
Get
Nets
Count
();
net_code
++
)
{
{
net
=
m_Pcb
->
FindNet
(
net_code
);
net
=
m_Pcb
->
FindNet
(
net_code
);
if
(
net
==
NULL
)
//Should not occur
if
(
net
==
NULL
)
//Should not occur
...
...
pcbnew/router.cpp
View file @
edb48d46
...
@@ -158,11 +158,11 @@ void Out_Pads( BOARD* Pcb, FILE* outfile )
...
@@ -158,11 +158,11 @@ void Out_Pads( BOARD* Pcb, FILE* outfile )
LISTE_PAD
*
pt_liste_pad
,
*
pt_start_liste
,
LISTE_PAD
*
pt_liste_pad
,
*
pt_start_liste
,
*
pt_end_liste
,
*
pt_liste_pad_limite
;
*
pt_end_liste
,
*
pt_liste_pad_limite
;
int
pin_min_layer
,
pin_max_layer
;
int
pin_min_layer
,
pin_max_layer
;
int
no_conn
=
Pcb
->
m_Pads
.
size
()
+
1
;
/* valeur incrementee pour indiquer
int
no_conn
=
Pcb
->
GetPadsCount
()
+
1
;
/* valeur incrementee pour indiquer
* que le pad n'est pas deja connecte a une piste*/
* que le pad n'est pas deja connecte a une piste*/
pt_liste_pad
=
pt_start_liste
=
&
Pcb
->
m_Pads
[
0
];
pt_liste_pad
=
pt_start_liste
=
&
Pcb
->
m_Pads
[
0
];
pt_liste_pad_limite
=
pt_start_liste
+
Pcb
->
m_Pads
.
size
();
pt_liste_pad_limite
=
pt_start_liste
+
Pcb
->
GetPadsCount
();
if
(
pt_liste_pad
==
NULL
)
if
(
pt_liste_pad
==
NULL
)
return
;
return
;
...
...
pcbnew/solve.cpp
View file @
edb48d46
...
@@ -433,7 +433,7 @@ static int Autoroute_One_Track( WinEDA_PcbFrame* pcbframe, wxDC* DC,
...
@@ -433,7 +433,7 @@ static int Autoroute_One_Track( WinEDA_PcbFrame* pcbframe, wxDC* DC,
/* Regenere les barrieres restantes (qui peuvent empieter sur le placement
/* Regenere les barrieres restantes (qui peuvent empieter sur le placement
* des bits precedents) */
* des bits precedents) */
ptr
=
(
LISTE_PAD
*
)
&
pcbframe
->
GetBoard
()
->
m_Pads
[
0
];
ptr
=
(
LISTE_PAD
*
)
&
pcbframe
->
GetBoard
()
->
m_Pads
[
0
];
i
=
pcbframe
->
GetBoard
()
->
m_Pads
.
size
();
i
=
pcbframe
->
GetBoard
()
->
GetPadsCount
();
for
(
;
i
>
0
;
i
--
,
ptr
++
)
for
(
;
i
>
0
;
i
--
,
ptr
++
)
{
{
if
(
(
pt_cur_ch
->
m_PadStart
!=
*
ptr
)
&&
(
pt_cur_ch
->
m_PadEnd
!=
*
ptr
)
)
if
(
(
pt_cur_ch
->
m_PadStart
!=
*
ptr
)
&&
(
pt_cur_ch
->
m_PadEnd
!=
*
ptr
)
)
...
...
pcbnew/specctra_export.cpp
View file @
edb48d46
...
@@ -1114,7 +1114,7 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) throw( IOError )
...
@@ -1114,7 +1114,7 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) throw( IOError )
int
highestNetCode
=
-
1
;
int
highestNetCode
=
-
1
;
// for( EQUIPOT* equipot = aBoard->m_Equipots; equipot; equipot = equipot->Next() )
// for( EQUIPOT* equipot = aBoard->m_Equipots; equipot; equipot = equipot->Next() )
// highestNetCode = MAX( highestNetCode, equipot->GetNet() );
// highestNetCode = MAX( highestNetCode, equipot->GetNet() );
highestNetCode
=
aBoard
->
m_NetInfo
->
GetCount
()
-
1
;
highestNetCode
=
aBoard
->
m_NetInfo
->
Get
Nets
Count
()
-
1
;
deleteNETs
();
deleteNETs
();
// expand the net vector to highestNetCode+1, setting empty to NULL
// expand the net vector to highestNetCode+1, setting empty to NULL
...
@@ -1124,9 +1124,9 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) throw( IOError )
...
@@ -1124,9 +1124,9 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) throw( IOError )
for
(
unsigned
i
=
1
;
i
<
nets
.
size
();
++
i
)
for
(
unsigned
i
=
1
;
i
<
nets
.
size
();
++
i
)
nets
[
i
]
=
new
NET
(
pcb
->
network
);
nets
[
i
]
=
new
NET
(
pcb
->
network
);
for
(
unsigned
ii
=
0
;
ii
<
aBoard
->
m_NetInfo
->
GetCount
();
ii
++
)
for
(
unsigned
ii
=
0
;
ii
<
aBoard
->
m_NetInfo
->
Get
Nets
Count
();
ii
++
)
{
{
NETINFO_ITEM
*
net
=
aBoard
->
m_NetInfo
->
GetItem
(
ii
);
NETINFO_ITEM
*
net
=
aBoard
->
m_NetInfo
->
Get
Net
Item
(
ii
);
int
netcode
=
net
->
GetNet
();
int
netcode
=
net
->
GetNet
();
if
(
netcode
>
0
)
if
(
netcode
>
0
)
nets
[
netcode
]
->
net_id
=
CONV_TO_UTF8
(
net
->
GetNetname
()
);
nets
[
netcode
]
->
net_id
=
CONV_TO_UTF8
(
net
->
GetNetname
()
);
...
...
pcbnew/surbrill.cpp
View file @
edb48d46
...
@@ -37,9 +37,9 @@ void WinEDA_PcbFrame::ListNetsAndSelect( wxCommandEvent& event )
...
@@ -37,9 +37,9 @@ void WinEDA_PcbFrame::ListNetsAndSelect( wxCommandEvent& event )
WinEDA_TextFrame
List
(
this
,
_
(
"List Nets"
)
);
WinEDA_TextFrame
List
(
this
,
_
(
"List Nets"
)
);
for
(
unsigned
ii
=
0
;
ii
<
GetBoard
()
->
m_NetInfo
->
GetCount
();
ii
++
)
for
(
unsigned
ii
=
0
;
ii
<
GetBoard
()
->
m_NetInfo
->
Get
Nets
Count
();
ii
++
)
{
{
net
=
GetBoard
()
->
m_NetInfo
->
GetItem
(
ii
);
net
=
GetBoard
()
->
m_NetInfo
->
Get
Net
Item
(
ii
);
wxString
Line
;
wxString
Line
;
if
(
!
WildCompareString
(
netFilter
,
net
->
GetNetname
(),
false
)
)
if
(
!
WildCompareString
(
netFilter
,
net
->
GetNetname
(),
false
)
)
continue
;
continue
;
...
@@ -58,9 +58,9 @@ void WinEDA_PcbFrame::ListNetsAndSelect( wxCommandEvent& event )
...
@@ -58,9 +58,9 @@ void WinEDA_PcbFrame::ListNetsAndSelect( wxCommandEvent& event )
unsigned
netcode
=
(
unsigned
)
selection
;
unsigned
netcode
=
(
unsigned
)
selection
;
// Search for the net selected.
// Search for the net selected.
for
(
unsigned
ii
=
0
;
ii
<
GetBoard
()
->
m_NetInfo
->
GetCount
();
ii
++
)
for
(
unsigned
ii
=
0
;
ii
<
GetBoard
()
->
m_NetInfo
->
Get
Nets
Count
();
ii
++
)
{
{
net
=
GetBoard
()
->
m_NetInfo
->
GetItem
(
ii
);
net
=
GetBoard
()
->
m_NetInfo
->
Get
Net
Item
(
ii
);
if
(
!
WildCompareString
(
netFilter
,
net
->
GetNetname
(),
false
)
)
if
(
!
WildCompareString
(
netFilter
,
net
->
GetNetname
(),
false
)
)
continue
;
continue
;
...
...
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