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
7988f2ca
Commit
7988f2ca
authored
May 05, 2009
by
charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
code cleanup
parent
b49c2d2b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
74 additions
and
101 deletions
+74
-101
class_drawsheet.h
eeschema/class_drawsheet.h
+7
-0
class_hierarchical_PIN_sheet.cpp
eeschema/class_hierarchical_PIN_sheet.cpp
+47
-43
plot.cpp
eeschema/plot.cpp
+20
-58
No files found.
eeschema/class_drawsheet.h
View file @
7988f2ca
...
@@ -58,6 +58,13 @@ public:
...
@@ -58,6 +58,13 @@ public:
void
Show
(
int
nestLevel
,
std
::
ostream
&
os
);
void
Show
(
int
nestLevel
,
std
::
ostream
&
os
);
#endif
#endif
/** function CreateGraphicShape
* Calculates the graphic shape (a polygon) associated to the text
* @param aCorner_list = list to fill with polygon corners coordinates
* @param Pos = Position of the shape
*/
void
CreateGraphicShape
(
std
::
vector
<
wxPoint
>&
aCorner_list
,
const
wxPoint
&
Pos
);
};
};
...
...
eeschema/class_hierarchical_PIN_sheet.cpp
View file @
7988f2ca
...
@@ -65,14 +65,11 @@ void Hierarchical_PIN_Sheet_Struct::Draw( WinEDA_DrawPanel* panel, wxDC* DC, con
...
@@ -65,14 +65,11 @@ void Hierarchical_PIN_Sheet_Struct::Draw( WinEDA_DrawPanel* panel, wxDC* DC, con
{
{
GRTextHorizJustifyType
side
;
GRTextHorizJustifyType
side
;
EDA_Colors
txtcolor
;
EDA_Colors
txtcolor
;
int
posx
,
tposx
,
posy
,
size2
;
int
posx
,
tposx
,
posy
;
wxSize
size
;
int
NbSegm
;
// @todo use wxPoints here
static
std
::
vector
<
wxPoint
>
Poly
;
int
coord
[
20
];
int
LineWidth
=
g_DrawMinimunLineWidth
;
int
LineWidth
=
g_DrawMinimunLineWidth
;
if
(
Color
>=
0
)
if
(
Color
>=
0
)
txtcolor
=
(
EDA_Colors
)
Color
;
txtcolor
=
(
EDA_Colors
)
Color
;
...
@@ -80,9 +77,9 @@ void Hierarchical_PIN_Sheet_Struct::Draw( WinEDA_DrawPanel* panel, wxDC* DC, con
...
@@ -80,9 +77,9 @@ void Hierarchical_PIN_Sheet_Struct::Draw( WinEDA_DrawPanel* panel, wxDC* DC, con
txtcolor
=
ReturnLayerColor
(
m_Layer
);
txtcolor
=
ReturnLayerColor
(
m_Layer
);
GRSetDrawMode
(
DC
,
DrawMode
);
GRSetDrawMode
(
DC
,
DrawMode
);
posx
=
m_Pos
.
x
+
offset
.
x
;
posx
=
m_Pos
.
x
+
offset
.
x
;
posy
=
m_Pos
.
y
+
offset
.
y
;
posy
=
m_Pos
.
y
+
offset
.
y
;
size
=
m_Size
;
wxSize
size
=
m_Size
;
if
(
!
m_Text
.
IsEmpty
()
)
if
(
!
m_Text
.
IsEmpty
()
)
{
{
...
@@ -100,63 +97,70 @@ void Hierarchical_PIN_Sheet_Struct::Draw( WinEDA_DrawPanel* panel, wxDC* DC, con
...
@@ -100,63 +97,70 @@ void Hierarchical_PIN_Sheet_Struct::Draw( WinEDA_DrawPanel* panel, wxDC* DC, con
m_Text
,
TEXT_ORIENT_HORIZ
,
size
,
m_Text
,
TEXT_ORIENT_HORIZ
,
size
,
side
,
GR_TEXT_VJUSTIFY_CENTER
,
LineWidth
,
false
,
true
);
side
,
GR_TEXT_VJUSTIFY_CENTER
,
LineWidth
,
false
,
true
);
}
}
/* dessin du symbole de connexion */
/* Draw the graphic symbol */
CreateGraphicShape
(
Poly
,
m_Pos
+
offset
);
int
FillShape
=
false
;
GRPoly
(
&
panel
->
m_ClipBox
,
DC
,
Poly
.
size
(),
&
Poly
[
0
],
FillShape
,
LineWidth
,
txtcolor
,
txtcolor
);
/* Poly Non rempli */
}
/** function CreateGraphicShape
* Calculates the graphic shape (a polygon) associated to the text
* @param aCorner_list = list to fill with polygon corners coordinates
* @param Pos = Position of the shape
*/
void
Hierarchical_PIN_Sheet_Struct
::
CreateGraphicShape
(
std
::
vector
<
wxPoint
>&
aCorner_list
,
const
wxPoint
&
Pos
)
{
wxSize
size
=
m_Size
;
aCorner_list
.
clear
();
if
(
m_Edge
)
if
(
m_Edge
)
{
{
size
.
x
=
-
size
.
x
;
size
.
x
=
-
size
.
x
;
size
.
y
=
-
size
.
y
;
size
.
y
=
-
size
.
y
;
}
}
coord
[
0
]
=
posx
;
int
size2
=
size
.
x
/
2
;
coord
[
1
]
=
posy
;
size2
=
size
.
x
/
2
;
NbSegm
=
0
;
aCorner_list
.
push_back
(
Pos
);
switch
(
m_Shape
)
switch
(
m_Shape
)
{
{
case
0
:
/* input |> */
case
0
:
/* input |> */
coord
[
2
]
=
posx
;
coord
[
3
]
=
posy
-
size2
;
aCorner_list
.
push_back
(
wxPoint
(
Pos
.
x
,
Pos
.
y
-
size2
)
);
coord
[
4
]
=
posx
+
size2
;
coord
[
5
]
=
posy
-
size2
;
aCorner_list
.
push_back
(
wxPoint
(
Pos
.
x
+
size2
,
Pos
.
y
-
size2
)
);
coord
[
6
]
=
posx
+
size
.
x
;
coord
[
7
]
=
posy
;
aCorner_list
.
push_back
(
wxPoint
(
Pos
.
x
+
size
.
x
,
Pos
.
y
)
);
coord
[
8
]
=
posx
+
size2
;
coord
[
9
]
=
posy
+
size2
;
aCorner_list
.
push_back
(
wxPoint
(
Pos
.
x
+
size2
,
Pos
.
y
+
size2
)
);
coord
[
10
]
=
posx
;
coord
[
11
]
=
posy
+
size2
;
aCorner_list
.
push_back
(
wxPoint
(
Pos
.
x
,
Pos
.
y
+
size2
)
);
coord
[
12
]
=
coord
[
0
];
coord
[
13
]
=
coord
[
1
];
aCorner_list
.
push_back
(
Pos
);
NbSegm
=
7
;
break
;
break
;
case
1
:
/* output <| */
case
1
:
/* output <| */
coord
[
2
]
=
posx
+
size2
;
coord
[
3
]
=
posy
-
size2
;
aCorner_list
.
push_back
(
wxPoint
(
Pos
.
x
+
size2
,
Pos
.
y
-
size2
)
);
coord
[
4
]
=
posx
+
size
.
x
;
coord
[
5
]
=
posy
-
size2
;
aCorner_list
.
push_back
(
wxPoint
(
Pos
.
x
+
size
.
x
,
Pos
.
y
-
size2
)
);
coord
[
6
]
=
posx
+
size
.
x
;
coord
[
7
]
=
posy
+
size2
;
aCorner_list
.
push_back
(
wxPoint
(
Pos
.
x
+
size
.
x
,
Pos
.
y
+
size2
)
);
coord
[
8
]
=
posx
+
size2
;
coord
[
9
]
=
posy
+
size2
;
aCorner_list
.
push_back
(
wxPoint
(
Pos
.
x
+
size2
,
Pos
.
y
+
size2
)
);
coord
[
10
]
=
coord
[
0
];
coord
[
11
]
=
coord
[
1
];
aCorner_list
.
push_back
(
Pos
);
NbSegm
=
6
;
break
;
break
;
case
2
:
/* bidi <> */
case
2
:
/* bidi <> */
case
3
:
/* TriSt <> */
case
3
:
/* TriSt <> */
coord
[
2
]
=
posx
+
size2
;
coord
[
3
]
=
posy
-
size2
;
aCorner_list
.
push_back
(
wxPoint
(
Pos
.
x
+
size2
,
Pos
.
y
-
size2
)
);
coord
[
4
]
=
posx
+
size
.
x
;
coord
[
5
]
=
posy
;
aCorner_list
.
push_back
(
wxPoint
(
Pos
.
x
+
size
.
x
,
Pos
.
y
)
);
coord
[
6
]
=
posx
+
size2
;
coord
[
7
]
=
posy
+
size2
;
aCorner_list
.
push_back
(
wxPoint
(
Pos
.
x
+
size2
,
Pos
.
y
+
size2
)
);
coord
[
8
]
=
coord
[
0
];
coord
[
9
]
=
coord
[
1
];
aCorner_list
.
push_back
(
Pos
);
NbSegm
=
5
;
break
;
break
;
default
:
/* unsp []*/
default
:
/* unsp []*/
coord
[
2
]
=
posx
;
coord
[
3
]
=
posy
-
size2
;
aCorner_list
.
push_back
(
wxPoint
(
Pos
.
x
,
Pos
.
y
-
size2
)
);
coord
[
4
]
=
posx
+
size
.
x
;
coord
[
5
]
=
posy
-
size2
;
aCorner_list
.
push_back
(
wxPoint
(
Pos
.
x
+
size
.
x
,
Pos
.
y
-
size2
)
);
coord
[
6
]
=
posx
+
size
.
x
;
coord
[
7
]
=
posy
+
size2
;
aCorner_list
.
push_back
(
wxPoint
(
Pos
.
x
+
size
.
x
,
Pos
.
y
+
size2
)
);
coord
[
8
]
=
posx
;
coord
[
9
]
=
posy
+
size2
;
aCorner_list
.
push_back
(
wxPoint
(
Pos
.
x
,
Pos
.
y
+
size2
)
);
coord
[
10
]
=
coord
[
0
];
coord
[
11
]
=
coord
[
1
];
aCorner_list
.
push_back
(
Pos
);
NbSegm
=
6
;
break
;
break
;
}
}
int
FillShape
=
FALSE
;
GRPoly
(
&
panel
->
m_ClipBox
,
DC
,
NbSegm
,
(
wxPoint
*
)
coord
,
FillShape
,
LineWidth
,
txtcolor
,
txtcolor
);
/* Poly Non rempli */
}
}
...
...
eeschema/plot.cpp
View file @
7988f2ca
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
#include "protos.h"
#include "protos.h"
/* Local Variables : */
/* Local Variables : */
static
void
Plot
SheetLabelStruc
t
(
Hierarchical_PIN_Sheet_Struct
*
Struct
);
static
void
Plot
_Hierarchical_PIN_Shee
t
(
Hierarchical_PIN_Sheet_Struct
*
Struct
);
static
void
PlotTextField
(
SCH_COMPONENT
*
DrawLibItem
,
static
void
PlotTextField
(
SCH_COMPONENT
*
DrawLibItem
,
int
FieldNumber
,
int
IsMulti
,
int
DrawMode
);
int
FieldNumber
,
int
IsMulti
,
int
DrawMode
);
static
void
PlotPinSymbol
(
const
wxPoint
&
pos
,
int
len
,
int
orient
,
int
Shape
);
static
void
PlotPinSymbol
(
const
wxPoint
&
pos
,
int
len
,
int
orient
,
int
Shape
);
...
@@ -747,21 +747,24 @@ void PlotTextStruct( EDA_BaseStruct* Struct )
...
@@ -747,21 +747,24 @@ void PlotTextStruct( EDA_BaseStruct* Struct )
}
}
/***********************************************************************/
/*****************************************************************************************/
static
void
PlotSheetLabelStruct
(
Hierarchical_PIN_Sheet_Struct
*
Struct
)
static
void
Plot_Hierarchical_PIN_Sheet
(
Hierarchical_PIN_Sheet_Struct
*
aHierarchical_PIN
)
/***********************************************************************/
/****************************************************************************************/
/* Routine de dessin des Sheet Labels type hierarchie */
/* Plot a Hierarchical_PIN_Sheet
*/
{
{
EDA_Colors
txtcolor
=
UNSPECIFIED_COLOR
;
EDA_Colors
txtcolor
=
UNSPECIFIED_COLOR
;
int
posx
,
tposx
,
posy
,
size
,
size2
;
int
posx
,
tposx
,
posy
,
size
;
int
coord
[
16
]
;
static
std
::
vector
<
wxPoint
>
Poly
;
if
(
(
g_PlotFormat
==
PLOT_FORMAT_POST
)
&&
g_PlotPSColorOpt
)
if
(
(
g_PlotFormat
==
PLOT_FORMAT_POST
)
&&
g_PlotPSColorOpt
)
txtcolor
=
ReturnLayerColor
(
Struct
->
GetLayer
()
);
txtcolor
=
ReturnLayerColor
(
aHierarchical_PIN
->
GetLayer
()
);
posx
=
Struct
->
m_Pos
.
x
;
posy
=
Struct
->
m_Pos
.
y
;
size
=
Struct
->
m_Size
.
x
;
posx
=
aHierarchical_PIN
->
m_Pos
.
x
;
posy
=
aHierarchical_PIN
->
m_Pos
.
y
;
size
=
aHierarchical_PIN
->
m_Size
.
x
;
GRTextHorizJustifyType
side
;
GRTextHorizJustifyType
side
;
if
(
Struct
->
m_Edge
)
if
(
aHierarchical_PIN
->
m_Edge
)
{
{
tposx
=
posx
-
size
;
tposx
=
posx
-
size
;
side
=
GR_TEXT_HJUSTIFY_RIGHT
;
side
=
GR_TEXT_HJUSTIFY_RIGHT
;
...
@@ -771,61 +774,20 @@ static void PlotSheetLabelStruct( Hierarchical_PIN_Sheet_Struct* Struct )
...
@@ -771,61 +774,20 @@ static void PlotSheetLabelStruct( Hierarchical_PIN_Sheet_Struct* Struct )
tposx
=
posx
+
size
+
(
size
/
8
);
tposx
=
posx
+
size
+
(
size
/
8
);
side
=
GR_TEXT_HJUSTIFY_LEFT
;
side
=
GR_TEXT_HJUSTIFY_LEFT
;
}
}
int
thickness
=
Struct
->
m_Width
;
int
thickness
=
aHierarchical_PIN
->
m_Width
;
if
(
thickness
==
0
)
if
(
thickness
==
0
)
thickness
=
MAX
(
g_PlotLine_Width
,
g_DrawMinimunLineWidth
);
thickness
=
MAX
(
g_PlotLine_Width
,
g_DrawMinimunLineWidth
);
SetCurrentLineWidth
(
thickness
);
SetCurrentLineWidth
(
thickness
);
bool
italic
=
Struct
->
m_Italic
;
PlotGraphicText
(
g_PlotFormat
,
wxPoint
(
tposx
,
posy
),
txtcolor
,
PlotGraphicText
(
g_PlotFormat
,
wxPoint
(
tposx
,
posy
),
txtcolor
,
Struct
->
m_Text
,
TEXT_ORIENT_HORIZ
,
wxSize
(
size
,
size
),
aHierarchical_PIN
->
m_Text
,
TEXT_ORIENT_HORIZ
,
wxSize
(
size
,
size
),
side
,
GR_TEXT_VJUSTIFY_CENTER
,
side
,
GR_TEXT_VJUSTIFY_CENTER
,
thickness
,
italic
,
true
);
thickness
,
aHierarchical_PIN
->
m_Italic
,
true
);
/* dessin du symbole de connexion */
if
(
Struct
->
m_Edge
)
size
=
-
size
;
coord
[
0
]
=
posx
;
coord
[
1
]
=
posy
;
size2
=
size
/
2
;
switch
(
Struct
->
m_Shape
)
{
case
0
:
/* input |> */
coord
[
2
]
=
posx
;
coord
[
3
]
=
posy
-
size2
;
coord
[
4
]
=
posx
+
size2
;
coord
[
5
]
=
posy
-
size2
;
coord
[
6
]
=
posx
+
size
;
coord
[
7
]
=
posy
;
coord
[
8
]
=
posx
+
size2
;
coord
[
9
]
=
posy
+
size2
;
coord
[
10
]
=
posx
;
coord
[
11
]
=
posy
+
size2
;
coord
[
12
]
=
posx
;
coord
[
13
]
=
posy
;
PlotPoly
(
7
,
coord
,
NOFILL
);
break
;
case
1
:
/* output <| */
/* Draw the associated graphic symbol */
coord
[
2
]
=
posx
+
size2
;
coord
[
3
]
=
posy
-
size2
;
aHierarchical_PIN
->
CreateGraphicShape
(
Poly
,
aHierarchical_PIN
->
m_Pos
);
coord
[
4
]
=
posx
+
size
;
coord
[
5
]
=
posy
-
size2
;
coord
[
6
]
=
posx
+
size
;
coord
[
7
]
=
posy
+
size2
;
coord
[
8
]
=
posx
+
size2
;
coord
[
9
]
=
posy
+
size2
;
coord
[
10
]
=
posx
;
coord
[
11
]
=
posy
;
PlotPoly
(
6
,
coord
,
NOFILL
);
break
;
case
2
:
/* bidi <> */
case
3
:
/* TriSt <> */
coord
[
2
]
=
posx
+
size2
;
coord
[
3
]
=
posy
-
size2
;
coord
[
4
]
=
posx
+
size
;
coord
[
5
]
=
posy
;
coord
[
6
]
=
posx
+
size2
;
coord
[
7
]
=
posy
+
size2
;
coord
[
8
]
=
posx
;
coord
[
9
]
=
posy
;
PlotPoly
(
5
,
coord
,
NOFILL
);
break
;
default
:
/* unsp []*/
PlotPoly
(
Poly
.
size
(),
&
Poly
[
0
].
x
,
NOFILL
);
coord
[
2
]
=
posx
;
coord
[
3
]
=
posy
-
size2
;
coord
[
4
]
=
posx
+
size
;
coord
[
5
]
=
posy
-
size2
;
coord
[
6
]
=
posx
+
size
;
coord
[
7
]
=
posy
+
size2
;
coord
[
8
]
=
posx
;
coord
[
9
]
=
posy
+
size2
;
coord
[
10
]
=
posx
;
coord
[
11
]
=
posy
;
PlotPoly
(
6
,
coord
,
NOFILL
);
break
;
}
}
}
...
@@ -895,7 +857,7 @@ void PlotSheetStruct( DrawSheetStruct* Struct )
...
@@ -895,7 +857,7 @@ void PlotSheetStruct( DrawSheetStruct* Struct )
while
(
SheetLabelStruct
!=
NULL
)
while
(
SheetLabelStruct
!=
NULL
)
{
{
Plot
SheetLabelStruc
t
(
SheetLabelStruct
);
Plot
_Hierarchical_PIN_Shee
t
(
SheetLabelStruct
);
SheetLabelStruct
=
SheetLabelStruct
->
Next
();
SheetLabelStruct
=
SheetLabelStruct
->
Next
();
}
}
}
}
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