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
b6508af0
Commit
b6508af0
authored
Nov 30, 2011
by
Dick Hollenbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
KICAD_PLUGIN and nanometer intermediate checkin, work in progress...
parent
3a887850
Changes
22
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
759 additions
and
246 deletions
+759
-246
wxwineda.cpp
common/wxwineda.cpp
+1
-1
sch_field.cpp
eeschema/sch_field.cpp
+1
-1
sch_field.h
eeschema/sch_field.h
+2
-2
base_struct.h
include/base_struct.h
+13
-12
dialog_helpers.h
include/dialog_helpers.h
+1
-1
class_dimension.cpp
pcbnew/class_dimension.cpp
+12
-5
class_dimension.h
pcbnew/class_dimension.h
+8
-7
class_netclass.cpp
pcbnew/class_netclass.cpp
+27
-29
class_netclass.h
pcbnew/class_netclass.h
+0
-10
class_zone.cpp
pcbnew/class_zone.cpp
+5
-5
class_zone.h
pcbnew/class_zone.h
+38
-18
class_zone_setting.cpp
pcbnew/class_zone_setting.cpp
+6
-6
class_zone_setting.h
pcbnew/class_zone_setting.h
+2
-2
dialog_copper_zones.cpp
pcbnew/dialogs/dialog_copper_zones.cpp
+7
-7
ioascii.cpp
pcbnew/ioascii.cpp
+1
-1
kicad_plugin.cpp
pcbnew/kicad_plugin.cpp
+608
-121
kicad_plugin.h
pcbnew/kicad_plugin.h
+12
-4
zones_by_polygon.cpp
pcbnew/zones_by_polygon.cpp
+2
-2
zones_convert_brd_items_to_polygons_with_Boost.cpp
pcbnew/zones_convert_brd_items_to_polygons_with_Boost.cpp
+3
-3
zones_convert_to_polygons_aux_functions.cpp
pcbnew/zones_convert_to_polygons_aux_functions.cpp
+5
-5
zones_functions_for_undo_redo.cpp
pcbnew/zones_functions_for_undo_redo.cpp
+2
-2
PolyLine.h
polygon/PolyLine.h
+3
-2
No files found.
common/wxwineda.cpp
View file @
b6508af0
...
...
@@ -97,7 +97,7 @@ void EDA_GRAPHIC_TEXT_CTRL::SetValue( int textSize )
}
wxString
EDA_GRAPHIC_TEXT_CTRL
::
GetText
()
const
wxString
EDA_GRAPHIC_TEXT_CTRL
::
GetText
()
const
{
wxString
text
=
m_FrameText
->
GetValue
();
return
text
;
...
...
eeschema/sch_field.cpp
View file @
b6508af0
...
...
@@ -87,7 +87,7 @@ EDA_ITEM* SCH_FIELD::doClone() const
}
wxString
SCH_FIELD
::
GetText
()
const
const
wxString
SCH_FIELD
::
GetText
()
const
{
wxString
text
=
m_Text
;
...
...
eeschema/sch_field.h
View file @
b6508af0
...
...
@@ -88,9 +88,9 @@ public:
* overrides the default implementation to allow for the part suffix to be added
* to the reference designator field if the component has multiple parts.
*
* @return a wxString object containing the field's string.
* @return a
const
wxString object containing the field's string.
*/
virtual
wxString
GetText
()
const
;
virtual
const
wxString
GetText
()
const
;
void
Place
(
SCH_EDIT_FRAME
*
frame
,
wxDC
*
DC
);
...
...
include/base_struct.h
View file @
b6508af0
...
...
@@ -3,8 +3,8 @@
* @brief Basic classes for most KiCad items.
*/
#ifndef BASE_STRUCT_H
#define BASE_STRUCT_H
#ifndef BASE_STRUCT_H
_
#define BASE_STRUCT_H
_
#include "colors.h"
#include "bitmaps.h"
...
...
@@ -725,8 +725,8 @@ enum FILL_T {
/**
* Class EDA_TEXT
* is a basic class to handle texts (labels, texts on components or footprints
* ..) not used directly.
*
The text classes are derived from EDA_ITEM and EDA_TEXT
* ..) not used directly.
The "used" text classes are derived from EDA_ITEM and
*
EDA_TEXT using multiple inheritance.
*/
class
EDA_TEXT
{
...
...
@@ -772,24 +772,25 @@ public:
int
GetOrientation
()
const
{
return
m_Orient
;
}
void
SetItalic
(
bool
isItalic
)
{
m_Italic
=
isItalic
;
}
bool
Get
Italic
()
const
{
return
m_Italic
;
}
bool
Is
Italic
()
const
{
return
m_Italic
;
}
/**
* Function SetSize
* sets text size.
* @param aNewSize is the new text size.
*/
void
SetSize
(
wxSize
aNewSize
)
{
m_Size
=
aNewSize
;
};
void
SetSize
(
const
wxSize
&
aNewSize
)
{
m_Size
=
aNewSize
;
};
/**
* Function GetSize
* returns text size.
* @return wxSize - text size.
*/
wxSize
GetSize
()
const
{
return
m_Size
;
};
const
wxSize
GetSize
()
const
{
return
m_Size
;
};
//void SetPosition( const wxPoint& aPoint ) { m_Pos = aPoint; }
//wxPoint GetPosition() const { return m_Pos; }
/// named differently than the ones using multiple inheritance and including this class
void
SetPos
(
const
wxPoint
&
aPoint
)
{
m_Pos
=
aPoint
;
}
const
wxPoint
GetPos
()
const
{
return
m_Pos
;
}
int
GetLength
()
const
{
return
m_Text
.
Length
();
};
...
...
@@ -904,9 +905,9 @@ public:
* string to provide a way for modifying the base string by adding a suffix or
* prefix to the base string.
* </p>
* @return a wxString object containing the string of the item.
* @return a
const
wxString object containing the string of the item.
*/
virtual
wxString
GetText
()
const
{
return
m_Text
;
}
virtual
const
wxString
GetText
()
const
{
return
m_Text
;
}
GRTextHorizJustifyType
GetHorizJustify
()
const
{
return
m_HJustify
;
};
GRTextVertJustifyType
GetVertJustify
()
const
{
return
m_VJustify
;
};
...
...
@@ -914,4 +915,4 @@ public:
void
SetVertJustify
(
GRTextVertJustifyType
aType
)
{
m_VJustify
=
aType
;
};
};
#endif
/
* BASE_STRUCT_H */
#endif /
/ BASE_STRUCT_H_
include/dialog_helpers.h
View file @
b6508af0
...
...
@@ -81,7 +81,7 @@ public:
~
EDA_GRAPHIC_TEXT_CTRL
();
wxString
GetText
()
;
const
wxString
GetText
()
const
;
int
GetTextSize
();
void
Enable
(
bool
state
);
void
SetTitle
(
const
wxString
&
title
);
...
...
pcbnew/class_dimension.cpp
View file @
b6508af0
...
...
@@ -37,15 +37,22 @@ DIMENSION::~DIMENSION()
}
void
DIMENSION
::
Set
Text
(
const
wxString
&
NewText
)
void
DIMENSION
::
Set
Position
(
const
wxPoint
&
aPos
)
{
m_Text
->
m_Text
=
NewText
;
m_Pos
=
aPos
;
m_Text
->
SetPos
(
aPos
);
}
wxString
DIMENSION
::
GetText
(
void
)
const
void
DIMENSION
::
SetText
(
const
wxString
&
aNewText
)
{
return
m_Text
->
m_Text
;
m_Text
->
SetText
(
aNewText
);
}
const
wxString
DIMENSION
::
GetText
()
const
{
return
m_Text
->
GetText
();
}
...
...
pcbnew/class_dimension.h
View file @
b6508af0
...
...
@@ -37,13 +37,15 @@ public:
DIMENSION
(
BOARD_ITEM
*
aParent
);
~
DIMENSION
();
const
wxPoint
GetPosition
()
const
const
wxPoint
GetPosition
()
const
{
return
m_Pos
;
}
void
SetPosition
(
const
wxPoint
&
aPos
);
// override, sets m_Text's position too
void
SetTextSize
(
const
wxSize
&
aTextSize
)
{
return
m_Pos
;
m_Text
->
SetSize
(
aTextSize
)
;
}
void
SetPosition
(
const
wxPoint
&
aPos
)
{
m_Pos
=
aPos
;
}
/**
* Function SetLayer
* sets the layer this item is on.
...
...
@@ -69,7 +71,7 @@ public:
bool
Save
(
FILE
*
aFile
)
const
;
void
SetText
(
const
wxString
&
NewText
);
wxString
GetText
(
void
)
const
;
const
wxString
GetText
(
)
const
;
void
Copy
(
DIMENSION
*
source
);
...
...
@@ -80,7 +82,7 @@ public:
* Function Move
* @param offset : moving vector
*/
void
Move
(
const
wxPoint
&
offset
);
void
Move
(
const
wxPoint
&
offset
);
/**
* Function Rotate
...
...
@@ -132,7 +134,6 @@ public:
*/
bool
HitTest
(
EDA_RECT
&
refArea
);
/**
* Function GetClass
* returns the class name.
...
...
pcbnew/class_netclass.cpp
View file @
b6508af0
...
...
@@ -288,7 +288,7 @@ bool NETCLASS::Save( FILE* aFile ) const
{
bool
result
=
true
;
fprintf
(
aFile
,
"$
"
BRD_NETCLASS
"
\n
"
);
fprintf
(
aFile
,
"$
NCLASS
\n
"
);
fprintf
(
aFile
,
"Name %s
\n
"
,
EscapedUTF8
(
m_Name
).
c_str
()
);
fprintf
(
aFile
,
"Desc %s
\n
"
,
EscapedUTF8
(
GetDescription
()
).
c_str
()
);
...
...
@@ -307,7 +307,7 @@ bool NETCLASS::Save( FILE* aFile ) const
for
(
const_iterator
i
=
begin
();
i
!=
end
();
++
i
)
fprintf
(
aFile
,
"AddNet %s
\n
"
,
EscapedUTF8
(
*
i
).
c_str
()
);
fprintf
(
aFile
,
"$End
"
BRD_NETCLASS
"
\n
"
);
fprintf
(
aFile
,
"$End
NCLASS
\n
"
);
return
result
;
}
...
...
@@ -334,74 +334,72 @@ void NETCLASS::Show( int nestLevel, std::ostream& os )
#endif
bool
NETCLASS
::
ReadDescr
(
LINE_READER
*
aReader
)
{
bool
result
=
false
;
char
*
L
ine
;
char
Buffer
[
1024
];
char
*
l
ine
;
char
buf
[
1024
];
wxString
netname
;
while
(
aReader
->
ReadLine
()
)
{
L
ine
=
aReader
->
Line
();
if
(
strnicmp
(
L
ine
,
"AddNet"
,
6
)
==
0
)
l
ine
=
aReader
->
Line
();
if
(
strnicmp
(
l
ine
,
"AddNet"
,
6
)
==
0
)
{
ReadDelimitedText
(
Buffer
,
Line
+
6
,
sizeof
(
Buffer
)
);
netname
=
FROM_UTF8
(
Buffer
);
ReadDelimitedText
(
buf
,
line
+
6
,
sizeof
(
buf
)
);
netname
=
FROM_UTF8
(
buf
);
Add
(
netname
);
continue
;
}
if
(
strnicmp
(
Line
,
"$end"
BRD_NETCLASS
,
sizeof
(
"$end"
BRD_NETCLASS
)
-
1
)
==
0
)
if
(
strnicmp
(
line
,
"$endNCLASS"
,
sizeof
(
"$endNCLASS"
)
-
1
)
==
0
)
{
result
=
true
;
break
;
}
if
(
strnicmp
(
L
ine
,
"Clearance"
,
9
)
==
0
)
if
(
strnicmp
(
l
ine
,
"Clearance"
,
9
)
==
0
)
{
SetClearance
(
atoi
(
L
ine
+
9
)
);
SetClearance
(
atoi
(
l
ine
+
9
)
);
continue
;
}
if
(
strnicmp
(
L
ine
,
"TrackWidth"
,
10
)
==
0
)
if
(
strnicmp
(
l
ine
,
"TrackWidth"
,
10
)
==
0
)
{
SetTrackWidth
(
atoi
(
L
ine
+
10
)
);
SetTrackWidth
(
atoi
(
l
ine
+
10
)
);
continue
;
}
if
(
strnicmp
(
L
ine
,
"ViaDia"
,
6
)
==
0
)
if
(
strnicmp
(
l
ine
,
"ViaDia"
,
6
)
==
0
)
{
SetViaDiameter
(
atoi
(
L
ine
+
6
)
);
SetViaDiameter
(
atoi
(
l
ine
+
6
)
);
continue
;
}
if
(
strnicmp
(
L
ine
,
"ViaDrill"
,
8
)
==
0
)
if
(
strnicmp
(
l
ine
,
"ViaDrill"
,
8
)
==
0
)
{
SetViaDrill
(
atoi
(
L
ine
+
8
)
);
SetViaDrill
(
atoi
(
l
ine
+
8
)
);
continue
;
}
if
(
strnicmp
(
L
ine
,
"uViaDia"
,
7
)
==
0
)
if
(
strnicmp
(
l
ine
,
"uViaDia"
,
7
)
==
0
)
{
SetuViaDiameter
(
atoi
(
L
ine
+
7
)
);
SetuViaDiameter
(
atoi
(
l
ine
+
7
)
);
continue
;
}
if
(
strnicmp
(
L
ine
,
"uViaDrill"
,
9
)
==
0
)
if
(
strnicmp
(
l
ine
,
"uViaDrill"
,
9
)
==
0
)
{
SetuViaDrill
(
atoi
(
L
ine
+
9
)
);
SetuViaDrill
(
atoi
(
l
ine
+
9
)
);
continue
;
}
if
(
strnicmp
(
L
ine
,
"Name"
,
4
)
==
0
)
if
(
strnicmp
(
l
ine
,
"Name"
,
4
)
==
0
)
{
ReadDelimitedText
(
Buffer
,
Line
+
4
,
sizeof
(
Buffer
)
);
m_Name
=
FROM_UTF8
(
Buffer
);
ReadDelimitedText
(
buf
,
line
+
4
,
sizeof
(
buf
)
);
m_Name
=
FROM_UTF8
(
buf
);
continue
;
}
if
(
strnicmp
(
L
ine
,
"Desc"
,
4
)
==
0
)
if
(
strnicmp
(
l
ine
,
"Desc"
,
4
)
==
0
)
{
ReadDelimitedText
(
Buffer
,
Line
+
4
,
sizeof
(
Buffer
)
);
SetDescription
(
FROM_UTF8
(
Buffer
)
);
ReadDelimitedText
(
buf
,
line
+
4
,
sizeof
(
buf
)
);
SetDescription
(
FROM_UTF8
(
buf
)
);
continue
;
}
}
...
...
pcbnew/class_netclass.h
View file @
b6508af0
...
...
@@ -80,16 +80,6 @@ public:
static
const
wxString
Default
;
///< the name of the default NETCLASS
/**
* Name of identifier within BOARD file.
* 08-Sept-2009: changed the name from "NETCLASS" to this so we can
* toss any previous NETCLASSes in migratory BOARD files which will not have
* the proper parameters in the default netclass
* (from m_Parent->m_designSettings) in them.
* Spare the user from having to enter those defaults manually.
*/
#define BRD_NETCLASS "NCLASS"
/**
* Constructor
* stuffs a NETCLASS instance with aParent, aName, and optionally the initialParameters
...
...
pcbnew/class_zone.cpp
View file @
b6508af0
...
...
@@ -196,8 +196,8 @@ bool ZONE_CONTAINER::Save( FILE* aFile ) const
m_FillMode
,
m_ArcToSegmentsCount
,
m_IsFilled
?
'S'
:
'F'
,
m_ThermalReliefGap
Value
,
m_ThermalReliefCopperBridge
Value
);
m_ThermalReliefGap
,
m_ThermalReliefCopperBridge
);
if
(
ret
<
3
)
return
false
;
...
...
@@ -398,7 +398,7 @@ int ZONE_CONTAINER::ReadDescr( LINE_READER* aReader )
char
fillstate
=
'F'
;
text
=
Line
+
8
;
ret
=
sscanf
(
text
,
"%d %d %c %d %d"
,
&
fillmode
,
&
arcsegmentcount
,
&
fillstate
,
&
m_ThermalReliefGap
Value
,
&
m_ThermalReliefCopperBridgeValu
e
);
&
m_ThermalReliefGap
,
&
m_ThermalReliefCopperBridg
e
);
if
(
ret
<
1
)
// Must find 1 or more args.
return
false
;
...
...
@@ -1213,8 +1213,8 @@ void ZONE_CONTAINER::Copy( ZONE_CONTAINER* src )
m_FillMode
=
src
->
m_FillMode
;
// Filling mode (segments/polygons)
m_ArcToSegmentsCount
=
src
->
m_ArcToSegmentsCount
;
m_PadOption
=
src
->
m_PadOption
;
m_ThermalReliefGap
Value
=
src
->
m_ThermalReliefGapValue
;
m_ThermalReliefCopperBridge
Value
=
src
->
m_ThermalReliefCopperBridgeValu
e
;
m_ThermalReliefGap
=
src
->
m_ThermalReliefGap
;
m_ThermalReliefCopperBridge
=
src
->
m_ThermalReliefCopperBridg
e
;
m_Poly
->
m_HatchStyle
=
src
->
m_Poly
->
GetHatchStyle
();
m_Poly
->
m_HatchLines
=
src
->
m_Poly
->
m_HatchLines
;
// Copy vector <CSegment>
m_FilledPolysList
.
clear
();
...
...
pcbnew/class_zone.h
View file @
b6508af0
...
...
@@ -24,17 +24,18 @@ class BOARD;
class
ZONE_CONTAINER
;
/* a small class used when filling areas with segments */
class
SEGMENT
/**
* Struct SEGMENT
* is a simple container used when filling areas with segments
*/
struct
SEGMENT
{
public
:
wxPoint
m_Start
;
// starting point of a segment
wxPoint
m_End
;
// ending point of a segment
public
:
SEGMENT
()
{}
SEGMENT
(
const
wxPoint
&
aStart
,
const
wxPoint
&
aEnd
)
SEGMENT
(
const
wxPoint
&
aStart
,
const
wxPoint
&
aEnd
)
{
m_Start
=
aStart
;
m_End
=
aEnd
;
...
...
@@ -69,10 +70,10 @@ public:
int
m_PadOption
;
// thickness of the gap in thermal reliefs.
int
m_ThermalReliefGap
Value
;
int
m_ThermalReliefGap
;
// thickness of the copper bridge in thermal reliefs
int
m_ThermalReliefCopperBridge
Value
;
int
m_ThermalReliefCopperBridge
;
int
utility
,
utility2
;
// flags used in polygon calculations
// true when a zone was filled, false after deleting the filled areas
...
...
@@ -167,7 +168,6 @@ public:
*/
void
DrawWhileCreateOutline
(
EDA_DRAW_PANEL
*
panel
,
wxDC
*
DC
,
int
draw_mode
=
GR_OR
);
/* Function GetBoundingBox
* @return an EDA_RECT that is the bounding box of the zone outline
*/
...
...
@@ -204,8 +204,8 @@ public:
}
/**
* Functio SetNet
* set the netcode and the netname.
* Functio
n
SetNet
* set
s
the netcode and the netname.
*
* @param aNetCode The net code of the zone container if greater than or equal to
* zero. Otherwise the current net code is kept and set the net
...
...
@@ -226,6 +226,31 @@ public:
* @return wxString - The net name.
*/
wxString
GetNetName
()
const
{
return
m_Netname
;
};
void
SetNetName
(
const
wxString
&
aName
)
{
m_Netname
=
aName
;
}
void
SetFillMode
(
int
aFillMode
)
{
m_FillMode
=
aFillMode
;
}
int
GetFillMode
()
const
{
return
m_FillMode
;
}
void
SetThermalReliefGap
(
int
aThermalReliefGap
)
{
m_ThermalReliefGap
=
aThermalReliefGap
;
}
int
GetThermalReliefGap
()
const
{
return
m_ThermalReliefGap
;
}
void
SetThermalReliefCopperBridge
(
int
aThermalReliefCopperBridge
)
{
m_ThermalReliefCopperBridge
=
aThermalReliefCopperBridge
;
}
int
GetThermalReliefCopperBridge
()
const
{
return
m_ThermalReliefCopperBridge
;
}
void
SetArcSegCount
(
int
aArcSegCount
)
{
m_ArcToSegmentsCount
=
aArcSegCount
;
}
int
GetArcSegCount
()
const
{
return
m_ArcToSegmentsCount
;
}
bool
IsFilled
()
const
{
return
m_IsFilled
;
}
void
SetIsFilled
(
bool
isFilled
)
{
m_IsFilled
=
isFilled
;
}
int
GetZoneClearance
()
const
{
return
m_ZoneClearance
;
}
void
SetZoneClearance
(
int
aZoneClearance
)
{
m_ZoneClearance
=
aZoneClearance
;
}
int
GetPadOption
()
const
{
return
m_PadOption
;
}
void
SetPadOption
(
int
aPadOption
)
{
m_PadOption
=
aPadOption
;
}
int
GetMinThickness
()
const
{
return
m_ZoneMinThickness
;
}
void
SetMinThickness
(
int
aMinThickness
)
{
m_ZoneMinThickness
=
aMinThickness
;
}
/**
* Function HitTest
...
...
@@ -403,32 +428,27 @@ public:
return
m_Poly
->
GetNumCorners
();
}
void
RemoveAllContours
(
void
)
{
m_Poly
->
RemoveAllContours
();
}
wxPoint
GetCornerPosition
(
int
aCornerIndex
)
const
{
return
wxPoint
(
m_Poly
->
GetX
(
aCornerIndex
),
m_Poly
->
GetY
(
aCornerIndex
)
);
}
void
SetCornerPosition
(
int
aCornerIndex
,
wxPoint
new_pos
)
{
m_Poly
->
SetX
(
aCornerIndex
,
new_pos
.
x
);
m_Poly
->
SetY
(
aCornerIndex
,
new_pos
.
y
);
}
void
AppendCorner
(
wxPoint
position
)
{
m_Poly
->
AppendCorner
(
position
.
x
,
position
.
y
);
}
int
GetHatchStyle
()
const
{
return
m_Poly
->
GetHatchStyle
();
...
...
@@ -436,12 +456,12 @@ public:
/**
* Function IsSame
* test
is
2 zones are equivalent:
* test
s if
2 zones are equivalent:
* 2 zones are equivalent if they have same parameters and same outlines
* info
relative to filling is not take in
account
* info
, filling is not taken into
account
* @param aZoneToCompare = zone to compare with "this"
*/
bool
IsSame
(
const
ZONE_CONTAINER
&
aZoneToCompare
);
bool
IsSame
(
const
ZONE_CONTAINER
&
aZoneToCompare
);
/**
* Function GetSmoothedPoly
...
...
pcbnew/class_zone_setting.cpp
View file @
b6508af0
...
...
@@ -33,8 +33,8 @@ ZONE_SETTING::ZONE_SETTING( void )
m_ArcToSegmentsCount
=
ARC_APPROX_SEGMENTS_COUNT_LOW_DEF
;
/* Option to select number of segments to approximate a circle
* ARC_APPROX_SEGMENTS_COUNT_LOW_DEF
* or ARC_APPROX_SEGMENTS_COUNT_HIGHT_DEF segments */
m_ThermalReliefGap
Value
=
200
;
// tickness of the gap in thermal reliefs
m_ThermalReliefCopperBridge
Value
=
200
;
// tickness of the copper bridge in thermal reliefs
m_ThermalReliefGap
=
200
;
// tickness of the gap in thermal reliefs
m_ThermalReliefCopperBridge
=
200
;
// tickness of the copper bridge in thermal reliefs
m_Zone_Pad_Options
=
THERMAL_PAD
;
// How pads are covered by copper in zone
...
...
@@ -57,8 +57,8 @@ void ZONE_SETTING::ImportSetting( const ZONE_CONTAINER& aSource )
m_CurrentZone_Layer
=
aSource
.
GetLayer
();
m_Zone_HatchingStyle
=
aSource
.
GetHatchStyle
();
m_ArcToSegmentsCount
=
aSource
.
m_ArcToSegmentsCount
;
m_ThermalReliefGap
Value
=
aSource
.
m_ThermalReliefGapValue
;
m_ThermalReliefCopperBridge
Value
=
aSource
.
m_ThermalReliefCopperBridgeValu
e
;
m_ThermalReliefGap
=
aSource
.
m_ThermalReliefGap
;
m_ThermalReliefCopperBridge
=
aSource
.
m_ThermalReliefCopperBridg
e
;
m_Zone_Pad_Options
=
aSource
.
m_PadOption
;
cornerSmoothingType
=
aSource
.
GetCornerSmoothingType
();
cornerRadius
=
aSource
.
GetCornerRadius
();
...
...
@@ -81,8 +81,8 @@ void ZONE_SETTING::ExportSetting( ZONE_CONTAINER& aTarget, bool aFullExport )
aTarget
.
m_ZoneMinThickness
=
m_ZoneMinThickness
;
aTarget
.
m_Poly
->
SetHatch
(
m_Zone_HatchingStyle
);
aTarget
.
m_ArcToSegmentsCount
=
m_ArcToSegmentsCount
;
aTarget
.
m_ThermalReliefGap
Value
=
m_ThermalReliefGapValue
;
aTarget
.
m_ThermalReliefCopperBridge
Value
=
m_ThermalReliefCopperBridgeValu
e
;
aTarget
.
m_ThermalReliefGap
=
m_ThermalReliefGap
;
aTarget
.
m_ThermalReliefCopperBridge
=
m_ThermalReliefCopperBridg
e
;
aTarget
.
m_PadOption
=
m_Zone_Pad_Options
;
aTarget
.
SetCornerSmoothingType
(
cornerSmoothingType
);
aTarget
.
SetCornerRadius
(
cornerRadius
);
...
...
pcbnew/class_zone_setting.h
View file @
b6508af0
...
...
@@ -41,8 +41,8 @@ public:
// Option to select number of segments to approximate a circle 16 or 32 segments.
int
m_ArcToSegmentsCount
;
long
m_ThermalReliefGap
Value
;
// thickness of the gap in thermal reliefs
long
m_ThermalReliefCopperBridge
Value
;
// thickness of the copper bridge in thermal reliefs
long
m_ThermalReliefGap
;
// thickness of the gap in thermal reliefs
long
m_ThermalReliefCopperBridge
;
// thickness of the copper bridge in thermal reliefs
int
m_Zone_Pad_Options
;
// How pads are covered by copper in zone
private
:
...
...
pcbnew/dialogs/dialog_copper_zones.cpp
View file @
b6508af0
...
...
@@ -122,10 +122,10 @@ void DIALOG_COPPER_ZONE::initDialog()
AddUnitSymbol
(
*
m_AntipadSizeText
,
g_UserUnit
);
AddUnitSymbol
(
*
m_CopperBridgeWidthText
,
g_UserUnit
);
PutValueInLocalUnits
(
*
m_AntipadSizeValue
,
m_Zone_Setting
->
m_ThermalReliefGap
Value
,
m_Zone_Setting
->
m_ThermalReliefGap
,
PCB_INTERNAL_UNIT
);
PutValueInLocalUnits
(
*
m_CopperWidthValue
,
m_Zone_Setting
->
m_ThermalReliefCopperBridge
Value
,
m_Zone_Setting
->
m_ThermalReliefCopperBridge
,
PCB_INTERNAL_UNIT
);
m_cornerSmoothingChoice
->
SetSelection
(
m_Zone_Setting
->
GetCornerSmoothingType
()
);
...
...
@@ -328,19 +328,19 @@ bool DIALOG_COPPER_ZONE::AcceptOptions( bool aPromptForErrors, bool aUseExportab
else
g_Zone_45_Only
=
TRUE
;
m_Zone_Setting
->
m_ThermalReliefGap
Value
=
ReturnValueFromTextCtrl
(
*
m_AntipadSizeValue
,
m_Zone_Setting
->
m_ThermalReliefGap
=
ReturnValueFromTextCtrl
(
*
m_AntipadSizeValue
,
PCB_INTERNAL_UNIT
);
m_Zone_Setting
->
m_ThermalReliefCopperBridge
Value
=
ReturnValueFromTextCtrl
(
m_Zone_Setting
->
m_ThermalReliefCopperBridge
=
ReturnValueFromTextCtrl
(
*
m_CopperWidthValue
,
PCB_INTERNAL_UNIT
);
m_Config
->
Write
(
ZONE_THERMAL_RELIEF_GAP_STRING_KEY
,
(
long
)
m_Zone_Setting
->
m_ThermalReliefGap
Value
);
(
long
)
m_Zone_Setting
->
m_ThermalReliefGap
);
m_Config
->
Write
(
ZONE_THERMAL_RELIEF_COPPER_WIDTH_STRING_KEY
,
(
long
)
m_Zone_Setting
->
m_ThermalReliefCopperBridge
Value
);
(
long
)
m_Zone_Setting
->
m_ThermalReliefCopperBridge
);
if
(
m_Zone_Setting
->
m_ThermalReliefCopperBridge
Value
<=
m_Zone_Setting
->
m_ZoneMinThickness
)
if
(
m_Zone_Setting
->
m_ThermalReliefCopperBridge
<=
m_Zone_Setting
->
m_ZoneMinThickness
)
{
DisplayError
(
this
,
_
(
"Thermal relief spoke width is larger than the minimum width."
)
);
...
...
pcbnew/ioascii.cpp
View file @
b6508af0
...
...
@@ -1030,7 +1030,7 @@ int PCB_EDIT_FRAME::ReadPcbFile( LINE_READER* aReader, bool Append )
continue
;
}
if
(
TESTLINE
(
BRD_NETCLASS
)
)
if
(
TESTLINE
(
"NCLASS"
)
)
{
// create an empty NETCLASS without a name.
NETCLASS
*
netclass
=
new
NETCLASS
(
board
,
wxEmptyString
);
...
...
pcbnew/kicad_plugin.cpp
View file @
b6508af0
This diff is collapsed.
Click to expand it.
pcbnew/kicad_plugin.h
View file @
b6508af0
...
...
@@ -112,17 +112,25 @@ protected:
/**
* Function loadTrackList
* reads a list of segments (Tracks and Vias)
* reads a list of segments (Tracks and Vias, or Segzones)
*
* @param aInsertBeforeMe may be either NULL indicating append, or it may
* be an insertion point before which all the segments are inserted.
*
* @param aStructType is either PCB_TRACE_T to indicate tracks and vias, or
* PCB_ZONE_T to indicate oldschool zone segments (before polygons came to be).
*/
void
loadTrackList
(
TRACK
*
aInsertBeforeMe
,
int
aStructType
,
int
aSegCount
);
void
loadTrackList
(
TRACK
*
aInsertBeforeMe
,
int
aStructType
);
void
loadZONE_CONTAINER
();
// "$CZONE_OUTLINE"
void
loadDIMENSION
();
// "$COTATION"
/* @todo
void load( PCB_TARGET* me );
void load( NETINFO* me );
void load( TRACK* me );
void load( ZONE_CONTAINER* me );
void load( DIMENSION* me );
*/
// void load( SEGZONE* me );
...
...
pcbnew/zones_by_polygon.cpp
View file @
b6508af0
...
...
@@ -480,9 +480,9 @@ int PCB_EDIT_FRAME::Begin_Zone( wxDC* DC )
}
wxGetApp
().
m_EDA_Config
->
Read
(
ZONE_THERMAL_RELIEF_GAP_STRING_KEY
,
&
g_Zone_Default_Setting
.
m_ThermalReliefGap
Value
);
&
g_Zone_Default_Setting
.
m_ThermalReliefGap
);
wxGetApp
().
m_EDA_Config
->
Read
(
ZONE_THERMAL_RELIEF_COPPER_WIDTH_STRING_KEY
,
&
g_Zone_Default_Setting
.
m_ThermalReliefCopperBridge
Value
);
&
g_Zone_Default_Setting
.
m_ThermalReliefCopperBridge
);
g_Zone_Default_Setting
.
m_CurrentZone_Layer
=
zone
->
GetLayer
();
DIALOG_COPPER_ZONE
*
frame
=
new
DIALOG_COPPER_ZONE
(
this
,
&
g_Zone_Default_Setting
);
...
...
pcbnew/zones_convert_brd_items_to_polygons_with_Boost.cpp
View file @
b6508af0
...
...
@@ -342,13 +342,13 @@ void ZONE_CONTAINER::AddClearanceAreasPolygonsToPolysList( BOARD* aPcb )
if
(
pad
->
GetNet
()
!=
GetNet
()
)
continue
;
item_boundingbox
=
pad
->
GetBoundingBox
();
item_boundingbox
.
Inflate
(
m_ThermalReliefGap
Value
,
m_ThermalReliefGapValue
);
item_boundingbox
.
Inflate
(
m_ThermalReliefGap
,
m_ThermalReliefGap
);
if
(
item_boundingbox
.
Intersects
(
zone_boundingbox
)
)
{
CreateThermalReliefPadPolygon
(
cornerBufferPolysToSubstract
,
*
pad
,
m_ThermalReliefGap
Value
,
m_ThermalReliefCopperBridge
Value
,
*
pad
,
m_ThermalReliefGap
,
m_ThermalReliefCopperBridge
,
m_ZoneMinThickness
,
s_CircleToSegmentsCount
,
s_Correction
,
s_thermalRot
);
...
...
pcbnew/zones_convert_to_polygons_aux_functions.cpp
View file @
b6508af0
...
...
@@ -49,7 +49,7 @@ void BuildUnconnectedThermalStubsPolygonList( std::vector<CPolyPt>& aCornerBuffe
int
pen_radius
=
aZone
->
m_ZoneMinThickness
/
2
;
// Calculate thermal bridge half width
int
thermbridgeWidth
=
aZone
->
m_ThermalReliefCopperBridge
Value
/
2
;
int
thermbridgeWidth
=
aZone
->
m_ThermalReliefCopperBridge
/
2
;
for
(
MODULE
*
module
=
aPcb
->
m_Modules
;
module
;
module
=
module
->
Next
()
)
{
for
(
D_PAD
*
pad
=
module
->
m_Pads
;
pad
!=
NULL
;
pad
=
pad
->
Next
()
)
...
...
@@ -61,17 +61,17 @@ void BuildUnconnectedThermalStubsPolygonList( std::vector<CPolyPt>& aCornerBuffe
continue
;
item_boundingbox
=
pad
->
GetBoundingBox
();
item_boundingbox
.
Inflate
(
aZone
->
m_ThermalReliefGap
Value
);
item_boundingbox
.
Inflate
(
aZone
->
m_ThermalReliefGap
);
if
(
!
(
item_boundingbox
.
Intersects
(
zone_boundingbox
)
)
)
continue
;
// Thermal bridges are like a segment from a starting point inside the pad
// to an ending point outside the pad
wxPoint
startpoint
,
endpoint
;
endpoint
.
x
=
(
pad
->
m_Size
.
x
/
2
)
+
aZone
->
m_ThermalReliefGap
Value
;
endpoint
.
y
=
(
pad
->
m_Size
.
y
/
2
)
+
aZone
->
m_ThermalReliefGap
Value
;
endpoint
.
x
=
(
pad
->
m_Size
.
x
/
2
)
+
aZone
->
m_ThermalReliefGap
;
endpoint
.
y
=
(
pad
->
m_Size
.
y
/
2
)
+
aZone
->
m_ThermalReliefGap
;
int
copperThickness
=
aZone
->
m_ThermalReliefCopperBridge
Value
-
aZone
->
m_ZoneMinThickness
;
int
copperThickness
=
aZone
->
m_ThermalReliefCopperBridge
-
aZone
->
m_ZoneMinThickness
;
if
(
copperThickness
<
0
)
copperThickness
=
0
;
...
...
pcbnew/zones_functions_for_undo_redo.cpp
View file @
b6508af0
...
...
@@ -86,10 +86,10 @@ bool ZONE_CONTAINER::IsSame( const ZONE_CONTAINER& aZoneToCompare )
if
(
m_PadOption
!=
aZoneToCompare
.
m_PadOption
)
return
false
;
if
(
m_ThermalReliefGap
Value
!=
aZoneToCompare
.
m_ThermalReliefGapValue
)
if
(
m_ThermalReliefGap
!=
aZoneToCompare
.
m_ThermalReliefGap
)
return
false
;
if
(
m_ThermalReliefCopperBridge
Value
!=
aZoneToCompare
.
m_ThermalReliefCopperBridgeValu
e
)
if
(
m_ThermalReliefCopperBridge
!=
aZoneToCompare
.
m_ThermalReliefCopperBridg
e
)
return
false
;
// Compare outlines
...
...
polygon/PolyLine.h
View file @
b6508af0
...
...
@@ -97,8 +97,9 @@ public:
class
CPolyPt
{
public
:
CPolyPt
(
int
qx
=
0
,
int
qy
=
0
,
bool
qf
=
false
)
{
x
=
qx
;
y
=
qy
;
end_contour
=
qf
;
utility
=
0
;
};
CPolyPt
(
int
qx
=
0
,
int
qy
=
0
,
bool
qf
=
false
,
int
aUtility
=
0
)
{
x
=
qx
;
y
=
qy
;
end_contour
=
qf
;
utility
=
aUtility
;
};
int
x
;
int
y
;
bool
end_contour
;
...
...
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