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
638ab254
Commit
638ab254
authored
Jan 06, 2008
by
CHARRAS
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more about zones.
parent
0120f07d
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
123 additions
and
55 deletions
+123
-55
build_version.h
include/build_version.h
+1
-1
class_board.cpp
pcbnew/class_board.cpp
+25
-0
class_board.h
pcbnew/class_board.h
+23
-1
class_board_item.cpp
pcbnew/class_board_item.cpp
+13
-5
class_zone.cpp
pcbnew/class_zone.cpp
+25
-7
ioascii.cpp
pcbnew/ioascii.cpp
+1
-1
ratsnest.cpp
pcbnew/ratsnest.cpp
+2
-0
zones_by_polygon.cpp
pcbnew/zones_by_polygon.cpp
+31
-0
PolyLine.cpp
polygon/PolyLine.cpp
+1
-7
PolyLine.h
polygon/PolyLine.h
+1
-19
PolyLine2Kicad.h
polygon/PolyLine2Kicad.h
+0
-14
No files found.
include/build_version.h
View file @
638ab254
...
...
@@ -5,7 +5,7 @@
COMMON_GLOBL
wxString
g_BuildVersion
#ifdef EDA_BASE
(
wxT
(
"(2008-01-0
1
)"
))
(
wxT
(
"(2008-01-0
6
)"
))
#endif
;
...
...
pcbnew/class_board.cpp
View file @
638ab254
...
...
@@ -688,6 +688,31 @@ EQUIPOT* BOARD::FindNet( int anetcode ) const
}
/**
* Function FindNet overlayed
* searches for a net with the given name.
* @param aNetname A Netname to search for.
* @return EQUIPOT* - the net or NULL if not found.
*/
EQUIPOT
*
BOARD
::
FindNet
(
const
wxString
&
aNetname
)
const
{
// the first valid netcode is 1.
// zero is reserved for "no connection" and is not used.
if
(
!
aNetname
.
IsEmpty
()
)
{
for
(
EQUIPOT
*
net
=
m_Equipots
;
net
;
net
=
net
->
Next
()
)
{
if
(
net
->
m_Netname
==
aNetname
)
return
net
;
}
}
return
NULL
;
}
/* Two sort functions used in BOARD::ReturnSortedNetnamesList */
// Sort nets by name
int
s_SortByNames
(
const
void
*
ptr1
,
const
void
*
ptr2
)
...
...
pcbnew/class_board.h
View file @
638ab254
...
...
@@ -177,6 +177,14 @@ public:
*/
EQUIPOT
*
FindNet
(
int
aNetcode
)
const
;
/**
* Function FindNet overlayed
* searches for a net with the given name.
* @param aNetname A Netname to search for.
* @return EQUIPOT* - the net or NULL if not found.
*/
EQUIPOT
*
FindNet
(
const
wxString
&
aNetname
)
const
;
/**
* Function ReturnSortedNetnamesList
* searches for a net with the given netcode.
...
...
@@ -223,8 +231,22 @@ public:
#endif
/*************************/
/* Copper Areas handling */
/**
/*************************/
/**
* Function SetAreasNetCodesFromNetNames
* Set the .m_NetCode member of all copper areas, according to the area Net Name
* The SetNetCodesFromNetNames is an equivalent to net name, for fas comparisons.
* However the Netcode is an arbitrary equyivalence, it must be set after each netlist read
* or net change
* Must be called after pad netcodes are calculated
* @return : error count
*/
int
SetAreasNetCodesFromNetNames
(
void
);
/**
* Function GetArea
* returns the Area (Zone Container) at a given index.
* @param index The array type index into a collection of ZONE_CONTAINER *.
...
...
pcbnew/class_board_item.cpp
View file @
638ab254
...
...
@@ -161,11 +161,19 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const
TimeStampText
.
Printf
(
wxT
(
"(%8.8X)"
),
item
->
m_TimeStamp
);
text
<<
TimeStampText
;
}
net
=
aPcb
->
FindNet
(
(
(
ZONE_CONTAINER
*
)
item
)
->
GetNet
()
);
if
(
net
)
{
text
<<
wxT
(
" ["
)
<<
net
->
m_Netname
<<
wxT
(
"]"
);
}
if
(
((
ZONE_CONTAINER
*
)
item
)
->
GetNet
()
>=
0
)
{
net
=
aPcb
->
FindNet
(
(
(
ZONE_CONTAINER
*
)
item
)
->
GetNet
()
);
if
(
net
)
{
text
<<
wxT
(
" ["
)
<<
net
->
m_Netname
<<
wxT
(
"]"
);
}
}
else
// A netcode < 0 is an error flag (Netname not found or area not initialised)
{
text
<<
wxT
(
" ["
)
<<
(
(
ZONE_CONTAINER
*
)
item
)
->
m_Netname
<<
wxT
(
"]"
);
text
<<
wxT
(
" <"
)
<<
_
(
"Not Found"
)
<<
wxT
(
">"
);
}
text
<<
_
(
" on "
)
<<
ReturnPcbLayerName
(
item
->
GetLayer
()
).
Trim
();
break
;
...
...
pcbnew/class_zone.cpp
View file @
638ab254
...
...
@@ -67,16 +67,24 @@ ZONE_CONTAINER::~ZONE_CONTAINER()
/*******************************************/
void
ZONE_CONTAINER
::
SetNet
(
int
anet_code
)
/*******************************************/
/**
* Set the netcode and the netname
* if netcode >= 0, set the netname
* if netcode < 0: keep old netname (used to set an necode error flag)
*/
{
m_NetCode
=
anet_code
;
if
(
anet_code
<
0
)
return
;
if
(
m_Parent
)
{
EQUIPOT
*
net
=
((
BOARD
*
)
m_Parent
)
->
FindNet
(
g_HightLigth_NetC
ode
);
EQUIPOT
*
net
=
((
BOARD
*
)
m_Parent
)
->
FindNet
(
anet_c
ode
);
if
(
net
)
m_Netname
=
net
->
m_Netname
;
else
m_Netname
.
Empty
();
}
else
m_Netname
.
Empty
();
else
m_Netname
.
Empty
();
}
...
...
@@ -446,12 +454,22 @@ void ZONE_CONTAINER::Display_Infos( WinEDA_DrawFrame* frame )
Affiche_1_Parametre
(
frame
,
text_pos
,
_
(
"Type"
),
msg
,
DARKCYAN
);
text_pos
+=
15
;
EQUIPOT
*
equipot
=
(
(
WinEDA_PcbFrame
*
)
frame
)
->
m_Pcb
->
FindNet
(
GetNet
()
);
if
(
GetNet
()
>=
0
)
{
EQUIPOT
*
equipot
=
(
(
WinEDA_PcbFrame
*
)
frame
)
->
m_Pcb
->
FindNet
(
GetNet
()
);
if
(
equipot
)
msg
=
equipot
->
m_Netname
;
else
msg
=
wxT
(
"<noname>"
);
if
(
equipot
)
msg
=
equipot
->
m_Netname
;
else
msg
=
wxT
(
"<noname>"
);
}
else
// a netcode < is an error
{
msg
=
wxT
(
" ["
);
msg
<<
m_Netname
+
wxT
(
"]"
);
msg
<<
wxT
(
" <"
)
<<
_
(
"Not Found"
)
<<
wxT
(
">"
);
}
Affiche_1_Parametre
(
frame
,
text_pos
,
_
(
"NetName"
),
msg
,
RED
);
...
...
pcbnew/ioascii.cpp
View file @
638ab254
...
...
@@ -819,7 +819,7 @@ int WinEDA_PcbFrame::ReadPcbFile( wxDC* DC, FILE* File, bool Append )
{
ZONE_CONTAINER
*
zone_descr
=
new
ZONE_CONTAINER
(
m_Pcb
);
zone_descr
->
ReadDescr
(
File
,
&
LineNum
);
m_Pcb
->
m_ZoneDescriptorList
.
push_back
(
zone_descr
);
m_Pcb
->
Add
(
zone_descr
);
}
if
(
strnicmp
(
Line
,
"$MODULE"
,
7
)
==
0
)
...
...
pcbnew/ratsnest.cpp
View file @
638ab254
...
...
@@ -956,6 +956,8 @@ void WinEDA_BasePcbFrame::recalcule_pad_net_code()
MyFree
(
BufPtEquipot
);
m_Pcb
->
m_Status_Pcb
|=
NET_CODES_OK
;
m_Pcb
->
SetAreasNetCodesFromNetNames
();
}
...
...
pcbnew/zones_by_polygon.cpp
View file @
638ab254
...
...
@@ -878,3 +878,34 @@ int WinEDA_PcbFrame::Fill_All_Zones( wxDC* DC, bool verbose )
DrawPanel
->
Refresh
(
true
);
return
error_level
;
}
/**
* Function SetAreasNetCodesFromNetNames
* Set the .m_NetCode member of all copper areas, according to the area Net Name
* The SetNetCodesFromNetNames is an equivalent to net name, for fas comparisons.
* However the Netcode is an arbitrary equyivalence, it must be set after each netlist read
* or net change
* Must be called after pad netcodes are calculated
* @return : error count
*/
int
BOARD
::
SetAreasNetCodesFromNetNames
(
void
)
{
int
error_count
=
0
;
for
(
int
ii
=
0
;
ii
<
GetAreaCount
();
ii
++
)
{
const
EQUIPOT
*
net
=
FindNet
(
GetArea
(
ii
)
->
m_Netname
);
if
(
net
)
{
GetArea
(
ii
)
->
SetNet
(
net
->
GetNet
());
}
else
{
error_count
++
;
GetArea
(
ii
)
->
SetNet
(
-
1
);
//keep Net Name ane set m_NetCode to -1 : error flag
}
}
return
error_count
;
}
polygon/PolyLine.cpp
View file @
638ab254
// PolyLine.cpp ... implementation of CPolyLine class from FreePCB.
//
//
Adap
tation for kicad
//
implemen
tation for kicad
//
using
namespace
std
;
...
...
@@ -879,11 +879,6 @@ int CPolyLine::GetNumSides()
return
corner
.
size
()
-
1
;
}
int
CPolyLine
::
GetW
()
{
return
m_Width
;
}
int
CPolyLine
::
GetNumContours
()
{
int
ncont
=
0
;
...
...
@@ -1011,7 +1006,6 @@ void CPolyLine::Hatch()
{
enum
{
MAXPTS
=
100
,
MAXLINES
=
1000
};
int
xx
[
MAXPTS
],
yy
[
MAXPTS
];
...
...
polygon/PolyLine.h
View file @
638ab254
...
...
@@ -63,10 +63,8 @@ class CPolyLine
public
:
enum
{
STRAIGHT
,
ARC_CW
,
ARC_CCW
};
// side styles
enum
{
NO_HATCH
,
DIAGONAL_FULL
,
DIAGONAL_EDGE
};
// hatch styles
enum
{
DEF_SIZE
=
50
,
DEF_ADD
=
50
};
// number of array elements to add at a time
// constructors/destructor
// CPolyLine( CDisplayList * dl = NULL );
CPolyLine
();
~
CPolyLine
();
...
...
@@ -82,16 +80,9 @@ public:
void
RemoveAllContours
(
void
);
// drawing functions
/* void HighlightSide( int is );
void HighlightCorner( int ic );
void StartDraggingToInsertCorner( CDC * pDC, int ic, int x, int y);
void StartDraggingToMoveCorner( CDC * pDC, int ic, int x, int y);
void CancelDraggingToInsertCorner( int ic );
void CancelDraggingToMoveCorner( int ic );
*/
void
Undraw
();
void
Undraw
();
void
Draw
(
);
void
Hatch
();
// void MakeVisible( bool visible = TRUE );
void
MoveOrigin
(
int
x_off
,
int
y_off
);
// misc. functions
...
...
@@ -121,15 +112,12 @@ public:
int
GetEndContour
(
int
ic
);
int
GetUtility
(
int
ic
){
return
corner
[
ic
].
utility
;
};
void
SetUtility
(
int
ic
,
int
utility
){
corner
[
ic
].
utility
=
utility
;
};
int
GetW
();
int
GetSideStyle
(
int
is
);
int
GetHatchStyle
(){
return
m_HatchStyle
;
}
void
SetHatch
(
int
hatch
){
Undraw
();
m_HatchStyle
=
hatch
;
Draw
();
};
void
SetX
(
int
ic
,
int
x
);
void
SetY
(
int
ic
,
int
y
);
void
SetEndContour
(
int
ic
,
bool
end_contour
);
// void SetLayer( int layer );
void
SetW
(
int
w
);
void
SetSideStyle
(
int
is
,
int
style
);
// GPC functions
...
...
@@ -150,7 +138,6 @@ public:
void
ClipPhpPolygon
(
int
php_op
,
CPolyLine
*
poly
);
private
:
// CDisplayList * m_dlist; // display list
int
m_layer
;
// layer to draw on
int
m_Width
;
// line width
int
m_sel_box
;
// corner selection box width/2
...
...
@@ -158,11 +145,6 @@ private:
public
:
std
::
vector
<
CPolyPt
>
corner
;
// array of points for corners
std
::
vector
<
int
>
side_style
;
// array of styles for sides
private
:
// std::vector <dl_element*> dl_side; // graphic elements
// std::vector <dl_element*> dl_side_sel;
// std::vector <dl_element*> dl_corner_sel;
public
:
int
m_HatchStyle
;
// hatch style, see enum above
std
::
vector
<
CSegment
>
m_HatchLines
;
// hatch lines
private
:
...
...
polygon/PolyLine2Kicad.h
View file @
638ab254
...
...
@@ -30,20 +30,6 @@
#define CDC wxDC
class
wxDC
;
#if 0
class dl_element;
class CDisplayList {
public:
void Set_visible(void*, int) {};
int Get_x(void) { return 0;};
int Get_y(void) { return 0;};
void StopDragging(void) {};
void CancelHighLight(void) {};
void StartDraggingLineVertex(...) {};
void Add() {};
};
#endif
class
CRect
{
public
:
...
...
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