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
700af58e
Commit
700af58e
authored
Sep 20, 2008
by
charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eeschema: code cleaning
parent
ff9036b2
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
346 additions
and
318 deletions
+346
-318
CMakeLists.txt
eeschema/CMakeLists.txt
+1
-0
class_sch_cmp_field.cpp
eeschema/class_sch_cmp_field.cpp
+253
-0
class_sch_cmp_field.h
eeschema/class_sch_cmp_field.h
+79
-0
component_class.cpp
eeschema/component_class.cpp
+7
-248
component_class.h
eeschema/component_class.h
+2
-67
makefile.include
eeschema/makefile.include
+2
-1
build_version.h
include/build_version.h
+2
-2
No files found.
eeschema/CMakeLists.txt
View file @
700af58e
...
...
@@ -16,6 +16,7 @@ set(EESCHEMA_SRCS
class_hierarchical_PIN_sheet.cpp
class_pin.cpp
class_library.cpp
class_sch_cmp_field.cpp
class_schematic_items.cpp
class_screen.cpp
class_text-label.cpp
...
...
eeschema/class_sch_cmp_field.cpp
0 → 100644
View file @
700af58e
/***********************************************************************/
/* component_class.cpp : handle the class SCH_COMPONENT */
/***********************************************************************/
#include "fctsys.h"
#include "gr_basic.h"
#include "common.h"
#include "program.h"
#include "libcmp.h"
#include "general.h"
#include "macros.h"
#include "protos.h"
/***************************************************************************/
SCH_CMP_FIELD
::
SCH_CMP_FIELD
(
const
wxPoint
&
pos
,
const
wxString
&
text
)
:
SCH_ITEM
(
NULL
,
DRAW_PART_TEXT_STRUCT_TYPE
),
EDA_TextStruct
(
text
)
/***************************************************************************/
{
m_Pos
=
pos
;
m_FieldId
=
0
;
m_AddExtraText
=
false
;
}
/************************************/
SCH_CMP_FIELD
::~
SCH_CMP_FIELD
()
/************************************/
{
}
/**************************************************************************/
void
SCH_CMP_FIELD
::
SwapData
(
SCH_CMP_FIELD
*
copyitem
)
/**************************************************************************/
/* Used if undo / redo command:
* swap data between this and copyitem
*/
{
EXCHG
(
m_Text
,
copyitem
->
m_Text
);
EXCHG
(
m_Layer
,
copyitem
->
m_Layer
);
EXCHG
(
m_Pos
,
copyitem
->
m_Pos
);
EXCHG
(
m_Size
,
copyitem
->
m_Size
);
EXCHG
(
m_Width
,
copyitem
->
m_Width
);
EXCHG
(
m_Orient
,
copyitem
->
m_Orient
);
EXCHG
(
m_Miroir
,
copyitem
->
m_Miroir
);
EXCHG
(
m_Attributs
,
copyitem
->
m_Attributs
);
EXCHG
(
m_CharType
,
copyitem
->
m_CharType
);
EXCHG
(
m_HJustify
,
copyitem
->
m_HJustify
);
EXCHG
(
m_VJustify
,
copyitem
->
m_VJustify
);
EXCHG
(
m_ZoomLevelDrawable
,
copyitem
->
m_ZoomLevelDrawable
);
EXCHG
(
m_TextDrawings
,
copyitem
->
m_TextDrawings
);
EXCHG
(
m_TextDrawingsSize
,
copyitem
->
m_TextDrawingsSize
);
}
/***********************************************************/
void
SCH_CMP_FIELD
::
PartTextCopy
(
SCH_CMP_FIELD
*
target
)
/***********************************************************/
{
target
->
m_Text
=
m_Text
;
if
(
m_FieldId
>=
FIELD1
)
target
->
m_Name
=
m_Name
;
target
->
m_Layer
=
m_Layer
;
target
->
m_Pos
=
m_Pos
;
target
->
m_Size
=
m_Size
;
target
->
m_Attributs
=
m_Attributs
;
target
->
m_FieldId
=
m_FieldId
;
target
->
m_Orient
=
m_Orient
;
target
->
m_HJustify
=
m_HJustify
;
target
->
m_VJustify
=
m_VJustify
;
target
->
m_Flags
=
m_Flags
;
}
/*********************************/
bool
SCH_CMP_FIELD
::
IsVoid
()
/*********************************/
/* return True if the field is void, i.e.:
* contains "~" or ""
*/
{
if
(
m_Text
.
IsEmpty
()
||
m_Text
==
wxT
(
"~"
)
)
return
TRUE
;
return
FALSE
;
}
/********************************************/
EDA_Rect
SCH_CMP_FIELD
::
GetBoundaryBox
()
const
/********************************************/
/** Function GetBoundaryBox()
* @return an EDA_Rect contains the real (user coordinates) boundary box for a text field,
* according to the component position, rotation, mirror ...
*
*/
{
EDA_Rect
BoundaryBox
;
int
hjustify
,
vjustify
;
int
textlen
;
int
orient
;
int
dx
,
dy
,
x1
,
y1
,
x2
,
y2
;
SCH_COMPONENT
*
DrawLibItem
=
(
SCH_COMPONENT
*
)
m_Parent
;
orient
=
m_Orient
;
wxPoint
pos
=
DrawLibItem
->
m_Pos
;
x1
=
m_Pos
.
x
-
pos
.
x
;
y1
=
m_Pos
.
y
-
pos
.
y
;
textlen
=
GetLength
();
if
(
m_FieldId
==
REFERENCE
)
// Real Text can be U1 or U1A
{
EDA_LibComponentStruct
*
Entry
=
FindLibPart
(
DrawLibItem
->
m_ChipName
.
GetData
(),
wxEmptyString
,
FIND_ROOT
);
if
(
Entry
&&
(
Entry
->
m_UnitCount
>
1
)
)
textlen
++
;
// because U1 is show as U1A or U1B ...
}
dx
=
m_Size
.
x
*
textlen
;
// Real X Size is 10/9 char size because space between 2 chars is 1/10 X Size
dx
=
(
dx
*
10
)
/
9
;
dy
=
m_Size
.
y
;
hjustify
=
m_HJustify
;
vjustify
=
m_VJustify
;
x2
=
pos
.
x
+
(
DrawLibItem
->
m_Transform
[
0
][
0
]
*
x1
)
+
(
DrawLibItem
->
m_Transform
[
0
][
1
]
*
y1
);
y2
=
pos
.
y
+
(
DrawLibItem
->
m_Transform
[
1
][
0
]
*
x1
)
+
(
DrawLibItem
->
m_Transform
[
1
][
1
]
*
y1
);
/* If the component orientation is +/- 90 deg, the text orienation must be changed */
if
(
DrawLibItem
->
m_Transform
[
0
][
1
]
)
{
if
(
orient
==
TEXT_ORIENT_HORIZ
)
orient
=
TEXT_ORIENT_VERT
;
else
orient
=
TEXT_ORIENT_HORIZ
;
/* is it mirrored (for text justify)*/
EXCHG
(
hjustify
,
vjustify
);
if
(
DrawLibItem
->
m_Transform
[
1
][
0
]
<
0
)
vjustify
=
-
vjustify
;
if
(
DrawLibItem
->
m_Transform
[
0
][
1
]
>
0
)
hjustify
=
-
hjustify
;
}
else
/* component horizontal: is it mirrored (for text justify)*/
{
if
(
DrawLibItem
->
m_Transform
[
0
][
0
]
<
0
)
hjustify
=
-
hjustify
;
if
(
DrawLibItem
->
m_Transform
[
1
][
1
]
>
0
)
vjustify
=
-
vjustify
;
}
if
(
orient
==
TEXT_ORIENT_VERT
)
EXCHG
(
dx
,
dy
);
switch
(
hjustify
)
{
case
GR_TEXT_HJUSTIFY_CENTER
:
x1
=
x2
-
(
dx
/
2
);
break
;
case
GR_TEXT_HJUSTIFY_RIGHT
:
x1
=
x2
-
dx
;
break
;
default
:
x1
=
x2
;
break
;
}
switch
(
vjustify
)
{
case
GR_TEXT_VJUSTIFY_CENTER
:
y1
=
y2
-
(
dy
/
2
);
break
;
case
GR_TEXT_VJUSTIFY_BOTTOM
:
y1
=
y2
-
dy
;
break
;
default
:
y1
=
y2
;
break
;
}
BoundaryBox
.
SetX
(
x1
);
BoundaryBox
.
SetY
(
y1
);
BoundaryBox
.
SetWidth
(
dx
);
BoundaryBox
.
SetHeight
(
dy
);
return
BoundaryBox
;
}
/**
* Function Save
* writes the data structures for this object out to a FILE in "*.brd" format.
* @param aFile The FILE to write to.
* @return bool - true if success writing else false.
*/
bool
SCH_CMP_FIELD
::
Save
(
FILE
*
aFile
)
const
{
char
hjustify
=
'C'
;
if
(
m_HJustify
==
GR_TEXT_HJUSTIFY_LEFT
)
hjustify
=
'L'
;
else
if
(
m_HJustify
==
GR_TEXT_HJUSTIFY_RIGHT
)
hjustify
=
'R'
;
char
vjustify
=
'C'
;
if
(
m_VJustify
==
GR_TEXT_VJUSTIFY_BOTTOM
)
vjustify
=
'B'
;
else
if
(
m_VJustify
==
GR_TEXT_VJUSTIFY_TOP
)
vjustify
=
'T'
;
if
(
fprintf
(
aFile
,
"F %d
\"
%s
\"
%c %-3d %-3d %-3d %4.4X %c %c"
,
m_FieldId
,
CONV_TO_UTF8
(
m_Text
),
m_Orient
==
TEXT_ORIENT_HORIZ
?
'H'
:
'V'
,
m_Pos
.
x
,
m_Pos
.
y
,
m_Size
.
x
,
m_Attributs
,
hjustify
,
vjustify
)
==
EOF
)
{
return
false
;
}
// Save field name, if necessary
if
(
m_FieldId
>=
FIELD1
&&
!
m_Name
.
IsEmpty
()
)
{
wxString
fieldname
=
ReturnDefaultFieldName
(
m_FieldId
);
if
(
fieldname
!=
m_Name
)
{
if
(
fprintf
(
aFile
,
"
\"
%s
\"
"
,
CONV_TO_UTF8
(
m_Name
)
)
==
EOF
)
{
return
false
;
}
}
}
if
(
fprintf
(
aFile
,
"
\n
"
)
==
EOF
)
{
return
false
;
}
return
true
;
}
eeschema/class_sch_cmp_field.h
0 → 100644
View file @
700af58e
/*************************************************************/
/* Definitions for the component fields classes for EESchema */
/*************************************************************/
#ifndef CLASS_SCH_CMP_FIELD_H
#define CLASS_SCH_CMP_FIELD_H
/*Fields are texts attached to a component, having a specuial meaning
* Fields 0 and 1 are very important: reference and value
* Field 2 is used as default footprint name.
* Field 3 is reserved (not currently used
* Fields 4 to 11 are user fields.
* They can be renamed and can appear in reports
*/
/* Fields identifiers */
enum
NumFieldType
{
REFERENCE
=
0
,
/* Field Reference of part, i.e. "IC21" */
VALUE
,
/* Field Value of part, i.e. "3.3K" */
FOOTPRINT
,
/* Field Name Module PCB, i.e. "16DIP300" */
SHEET_FILENAME
,
/* Field Name Schema component, i.e. "cnt16.sch" */
FIELD1
,
FIELD2
,
FIELD3
,
FIELD4
,
FIELD5
,
FIELD6
,
FIELD7
,
FIELD8
,
NUMBER_OF_FIELDS
/* used as Field count, not a field identifier */
};
/*************************************************************/
class
SCH_CMP_FIELD
:
public
SCH_ITEM
,
public
EDA_TextStruct
/*************************************************************/
{
public
:
int
m_FieldId
;
// Field indicator type (REFERENCE, VALUE or other id)
wxString
m_Name
;
/* Field name (ref, value,pcb, sheet, filed 1..
* and for fields 1 to 8 the name is editable */
bool
m_AddExtraText
;
// Mainly for REFERENCE, add extar info (for REFERENCE: add part selection text
public
:
SCH_CMP_FIELD
(
const
wxPoint
&
pos
=
wxPoint
(
0
,
0
),
const
wxString
&
text
=
wxEmptyString
);
~
SCH_CMP_FIELD
();
virtual
wxString
GetClass
()
const
{
return
wxT
(
"SCH_CMP_FIELD"
);
}
void
PartTextCopy
(
SCH_CMP_FIELD
*
target
);
void
Place
(
WinEDA_SchematicFrame
*
frame
,
wxDC
*
DC
);
EDA_Rect
GetBoundaryBox
()
const
;
bool
IsVoid
();
void
SwapData
(
SCH_CMP_FIELD
*
copyitem
);
/**
* Function Draw
*/
void
Draw
(
WinEDA_DrawPanel
*
panel
,
wxDC
*
DC
,
const
wxPoint
&
offset
,
int
draw_mode
,
int
Color
=
-
1
);
/**
* Function Save
* writes the data structures for this object out to a FILE in "*.brd" format.
* @param aFile The FILE to write to.
* @return bool - true if success writing else false.
*/
bool
Save
(
FILE
*
aFile
)
const
;
};
#endif
/* CLASS_SCH_CMP_FIELD_H */
eeschema/component_class.cpp
View file @
700af58e
...
...
@@ -10,12 +10,9 @@
#include "libcmp.h"
#include "general.h"
#include "macros.h"
#include "id.h"
#include "protos.h"
#include "macros.h"
#include <wx/arrimpl.cpp>
#include <wx/tokenzr.h>
...
...
@@ -367,31 +364,6 @@ EDA_Rect SCH_COMPONENT::GetBoundaryBox() const
}
/**************************************************************************/
void
SCH_CMP_FIELD
::
SwapData
(
SCH_CMP_FIELD
*
copyitem
)
/**************************************************************************/
/* Used if undo / redo command:
* swap data between this and copyitem
*/
{
EXCHG
(
m_Text
,
copyitem
->
m_Text
);
EXCHG
(
m_Layer
,
copyitem
->
m_Layer
);
EXCHG
(
m_Pos
,
copyitem
->
m_Pos
);
EXCHG
(
m_Size
,
copyitem
->
m_Size
);
EXCHG
(
m_Width
,
copyitem
->
m_Width
);
EXCHG
(
m_Orient
,
copyitem
->
m_Orient
);
EXCHG
(
m_Miroir
,
copyitem
->
m_Miroir
);
EXCHG
(
m_Attributs
,
copyitem
->
m_Attributs
);
EXCHG
(
m_CharType
,
copyitem
->
m_CharType
);
EXCHG
(
m_HJustify
,
copyitem
->
m_HJustify
);
EXCHG
(
m_VJustify
,
copyitem
->
m_VJustify
);
EXCHG
(
m_ZoomLevelDrawable
,
copyitem
->
m_ZoomLevelDrawable
);
EXCHG
(
m_TextDrawings
,
copyitem
->
m_TextDrawings
);
EXCHG
(
m_TextDrawingsSize
,
copyitem
->
m_TextDrawingsSize
);
}
/**************************************************************************/
void
SCH_COMPONENT
::
SwapData
(
SCH_COMPONENT
*
copyitem
)
/**************************************************************************/
...
...
@@ -467,7 +439,7 @@ void SCH_COMPONENT::ClearAnnotation( DrawSheetPath* aSheet )
defRef
.
Append
(
wxT
(
"?"
)
);
wxString
multi
=
wxT
(
"1"
);
if
(
KeepMulti
)
// We cannot remove all annotations: part selection must be kept
{
wxString
NewHref
;
...
...
@@ -799,219 +771,6 @@ void SCH_COMPONENT::Show( int nestLevel, std::ostream& os )
#endif
/***************************************************************************/
SCH_CMP_FIELD
::
SCH_CMP_FIELD
(
const
wxPoint
&
pos
,
const
wxString
&
text
)
:
SCH_ITEM
(
NULL
,
DRAW_PART_TEXT_STRUCT_TYPE
),
EDA_TextStruct
(
text
)
/***************************************************************************/
{
m_Pos
=
pos
;
m_FieldId
=
0
;
m_AddExtraText
=
false
;
}
/************************************/
SCH_CMP_FIELD
::~
SCH_CMP_FIELD
()
/************************************/
{
}
/***********************************************************/
void
SCH_CMP_FIELD
::
PartTextCopy
(
SCH_CMP_FIELD
*
target
)
/***********************************************************/
{
target
->
m_Text
=
m_Text
;
if
(
m_FieldId
>=
FIELD1
)
target
->
m_Name
=
m_Name
;
target
->
m_Layer
=
m_Layer
;
target
->
m_Pos
=
m_Pos
;
target
->
m_Size
=
m_Size
;
target
->
m_Attributs
=
m_Attributs
;
target
->
m_FieldId
=
m_FieldId
;
target
->
m_Orient
=
m_Orient
;
target
->
m_HJustify
=
m_HJustify
;
target
->
m_VJustify
=
m_VJustify
;
target
->
m_Flags
=
m_Flags
;
}
/*********************************/
bool
SCH_CMP_FIELD
::
IsVoid
()
/*********************************/
/* return True if The field is void, i.e.:
* contains wxEmptyString or "~"
*/
{
if
(
m_Text
.
IsEmpty
()
||
m_Text
==
wxT
(
"~"
)
)
return
TRUE
;
return
FALSE
;
}
/********************************************/
EDA_Rect
SCH_CMP_FIELD
::
GetBoundaryBox
()
const
/********************************************/
/* return
* EDA_Rect contains the real (user coordinates) boundary box for a text field,
* according to the component position, rotation, mirror ...
*
*/
{
EDA_Rect
BoundaryBox
;
int
hjustify
,
vjustify
;
int
textlen
;
int
orient
;
int
dx
,
dy
,
x1
,
y1
,
x2
,
y2
;
SCH_COMPONENT
*
DrawLibItem
=
(
SCH_COMPONENT
*
)
m_Parent
;
orient
=
m_Orient
;
wxPoint
pos
=
DrawLibItem
->
m_Pos
;
x1
=
m_Pos
.
x
-
pos
.
x
;
y1
=
m_Pos
.
y
-
pos
.
y
;
textlen
=
GetLength
();
if
(
m_FieldId
==
REFERENCE
)
// Real Text can be U1 or U1A
{
EDA_LibComponentStruct
*
Entry
=
FindLibPart
(
DrawLibItem
->
m_ChipName
.
GetData
(),
wxEmptyString
,
FIND_ROOT
);
if
(
Entry
&&
(
Entry
->
m_UnitCount
>
1
)
)
textlen
++
;
// because U1 is show as U1A or U1B ...
}
dx
=
m_Size
.
x
*
textlen
;
// Real X Size is 10/9 char size because space between 2 chars is 1/10 X Size
dx
=
(
dx
*
10
)
/
9
;
dy
=
m_Size
.
y
;
hjustify
=
m_HJustify
;
vjustify
=
m_VJustify
;
x2
=
pos
.
x
+
(
DrawLibItem
->
m_Transform
[
0
][
0
]
*
x1
)
+
(
DrawLibItem
->
m_Transform
[
0
][
1
]
*
y1
);
y2
=
pos
.
y
+
(
DrawLibItem
->
m_Transform
[
1
][
0
]
*
x1
)
+
(
DrawLibItem
->
m_Transform
[
1
][
1
]
*
y1
);
/* If the component orientation is +/- 90 deg, the text orienation must be changed */
if
(
DrawLibItem
->
m_Transform
[
0
][
1
]
)
{
if
(
orient
==
TEXT_ORIENT_HORIZ
)
orient
=
TEXT_ORIENT_VERT
;
else
orient
=
TEXT_ORIENT_HORIZ
;
/* is it mirrored (for text justify)*/
EXCHG
(
hjustify
,
vjustify
);
if
(
DrawLibItem
->
m_Transform
[
1
][
0
]
<
0
)
vjustify
=
-
vjustify
;
if
(
DrawLibItem
->
m_Transform
[
0
][
1
]
>
0
)
hjustify
=
-
hjustify
;
}
else
/* component horizontal: is it mirrored (for text justify)*/
{
if
(
DrawLibItem
->
m_Transform
[
0
][
0
]
<
0
)
hjustify
=
-
hjustify
;
if
(
DrawLibItem
->
m_Transform
[
1
][
1
]
>
0
)
vjustify
=
-
vjustify
;
}
if
(
orient
==
TEXT_ORIENT_VERT
)
EXCHG
(
dx
,
dy
);
switch
(
hjustify
)
{
case
GR_TEXT_HJUSTIFY_CENTER
:
x1
=
x2
-
(
dx
/
2
);
break
;
case
GR_TEXT_HJUSTIFY_RIGHT
:
x1
=
x2
-
dx
;
break
;
default
:
x1
=
x2
;
break
;
}
switch
(
vjustify
)
{
case
GR_TEXT_VJUSTIFY_CENTER
:
y1
=
y2
-
(
dy
/
2
);
break
;
case
GR_TEXT_VJUSTIFY_BOTTOM
:
y1
=
y2
-
dy
;
break
;
default
:
y1
=
y2
;
break
;
}
BoundaryBox
.
SetX
(
x1
);
BoundaryBox
.
SetY
(
y1
);
BoundaryBox
.
SetWidth
(
dx
);
BoundaryBox
.
SetHeight
(
dy
);
return
BoundaryBox
;
}
/**
* Function Save
* writes the data structures for this object out to a FILE in "*.brd" format.
* @param aFile The FILE to write to.
* @return bool - true if success writing else false.
*/
bool
SCH_CMP_FIELD
::
Save
(
FILE
*
aFile
)
const
{
char
hjustify
=
'C'
;
if
(
m_HJustify
==
GR_TEXT_HJUSTIFY_LEFT
)
hjustify
=
'L'
;
else
if
(
m_HJustify
==
GR_TEXT_HJUSTIFY_RIGHT
)
hjustify
=
'R'
;
char
vjustify
=
'C'
;
if
(
m_VJustify
==
GR_TEXT_VJUSTIFY_BOTTOM
)
vjustify
=
'B'
;
else
if
(
m_VJustify
==
GR_TEXT_VJUSTIFY_TOP
)
vjustify
=
'T'
;
if
(
fprintf
(
aFile
,
"F %d
\"
%s
\"
%c %-3d %-3d %-3d %4.4X %c %c"
,
m_FieldId
,
CONV_TO_UTF8
(
m_Text
),
m_Orient
==
TEXT_ORIENT_HORIZ
?
'H'
:
'V'
,
m_Pos
.
x
,
m_Pos
.
y
,
m_Size
.
x
,
m_Attributs
,
hjustify
,
vjustify
)
==
EOF
)
{
return
false
;
}
// Save field name, if necessary
if
(
m_FieldId
>=
FIELD1
&&
!
m_Name
.
IsEmpty
()
)
{
wxString
fieldname
=
ReturnDefaultFieldName
(
m_FieldId
);
if
(
fieldname
!=
m_Name
)
{
if
(
fprintf
(
aFile
,
"
\"
%s
\"
"
,
CONV_TO_UTF8
(
m_Name
)
)
==
EOF
)
{
return
false
;
}
}
}
if
(
fprintf
(
aFile
,
"
\n
"
)
==
EOF
)
{
return
false
;
}
return
true
;
}
/****************************************/
bool
SCH_COMPONENT
::
Save
(
FILE
*
f
)
const
...
...
@@ -1151,17 +910,17 @@ EDA_Rect SCH_COMPONENT::GetBoundingBox()
{
const
int
PADDING
=
40
;
// This gives a reasonable approximation (but some things are missing so...
EDA_Rect
ret
=
GetBoundaryBox
();
// This gives a reasonable approximation (but some things are missing so...
)
EDA_Rect
bbox
=
GetBoundaryBox
();
// Include BoundingBoxes of fields
for
(
int
i
=
REFERENCE
;
i
<
NUMBER_OF_FIELDS
;
i
++
)
for
(
int
i
i
=
REFERENCE
;
ii
<
NUMBER_OF_FIELDS
;
i
i
++
)
{
ret
.
Merge
(
m_Field
[
i
].
GetBoundaryBox
()
);
bbox
.
Merge
(
m_Field
[
i
i
].
GetBoundaryBox
()
);
}
// ... add padding
ret
.
Inflate
(
PADDING
,
PADDING
);
bbox
.
Inflate
(
PADDING
,
PADDING
);
return
ret
;
return
bbox
;
}
eeschema/component_class.h
View file @
700af58e
...
...
@@ -9,77 +9,12 @@
#define eda_global extern
#endif
#include "macros.h"
#include "base_struct.h"
#include <wx/arrstr.h>
#include "class_screen.h"
#include <wx/arrstr.h>
#include <wx/dynarray.h>
/* Definition de la representation du composant */
enum
NumFieldType
{
REFERENCE
=
0
,
/* Champ Reference of part, i.e. "IC21" */
VALUE
,
/* Champ Value of part, i.e. "3.3K" */
FOOTPRINT
,
/* Champ Name Module PCB, i.e. "16DIP300" */
SHEET_FILENAME
,
/* Champ Name Schema component, i.e. "cnt16.sch" */
FIELD1
,
FIELD2
,
FIELD3
,
FIELD4
,
FIELD5
,
FIELD6
,
FIELD7
,
FIELD8
,
NUMBER_OF_FIELDS
/* Nombre de champs de texte affectes au composant */
};
/* Class to manage component fields.
* component fields are texts attached to the component (not the graphic texts)
* There are 2 major fields : Reference and Value
*/
class
SCH_CMP_FIELD
:
public
SCH_ITEM
,
public
EDA_TextStruct
{
public
:
int
m_FieldId
;
// Field indicator type (REFERENCE, VALUE or other id)
wxString
m_Name
;
/* Field name (ref, value,pcb, sheet, filed 1..
* and for fields 1 to 8 the name is editable */
bool
m_AddExtraText
;
// Mainly for REFERENCE, add extar info (for REFERENCE: add part selection text
public
:
SCH_CMP_FIELD
(
const
wxPoint
&
pos
=
wxPoint
(
0
,
0
),
const
wxString
&
text
=
wxEmptyString
);
~
SCH_CMP_FIELD
();
virtual
wxString
GetClass
()
const
{
return
wxT
(
"SCH_CMP_FIELD"
);
}
void
PartTextCopy
(
SCH_CMP_FIELD
*
target
);
void
Place
(
WinEDA_SchematicFrame
*
frame
,
wxDC
*
DC
);
EDA_Rect
GetBoundaryBox
()
const
;
bool
IsVoid
();
void
SwapData
(
SCH_CMP_FIELD
*
copyitem
);
/**
* Function Draw
*/
void
Draw
(
WinEDA_DrawPanel
*
panel
,
wxDC
*
DC
,
const
wxPoint
&
offset
,
int
draw_mode
,
int
Color
=
-
1
);
/**
* Function Save
* writes the data structures for this object out to a FILE in "*.brd" format.
* @param aFile The FILE to write to.
* @return bool - true if success writing else false.
*/
bool
Save
(
FILE
*
aFile
)
const
;
};
#include "class_sch_cmp_field.h"
WX_DECLARE_OBJARRAY
(
DrawSheetPath
,
ArrayOfSheetLists
);
...
...
eeschema/makefile.include
View file @
700af58e
...
...
@@ -20,6 +20,7 @@ OBJECTS = eeschema.o\
cross-probing.o
\
setpage.o
\
class_schematic_items.o
\
class_sch_cmp_field.o
\
classes_body_items.o
\
class_drawsheet.o
\
class_pin.o
\
...
...
@@ -115,7 +116,7 @@ menubar.o: menubar.cpp $(DEPEND)
find.o
:
find.cpp dialog_find.cpp dialog_find.h $(DEPEND)
backanno.o
:
backanno.cpp
dialog_backanno.cpp dialog_backanno.h
$(DEPEND)
backanno.o
:
backanno.cpp $(DEPEND)
eeconfig.o
:
eeconfig.cpp eeconfig.h $(DEPEND)
...
...
include/build_version.h
View file @
700af58e
...
...
@@ -9,7 +9,7 @@ COMMON_GLOBL wxString g_BuildVersion
# include "config.h"
(
wxT
(
KICAD_SVN_VERSION
))
# else
(
wxT
(
"(200809
12
)"
))
/* main program version */
(
wxT
(
"(200809
20
)"
))
/* main program version */
# endif
#endif
;
...
...
@@ -20,7 +20,7 @@ COMMON_GLOBL wxString g_BuildAboutVersion
# include "config.h"
(
wxT
(
KICAD_ABOUT_VERSION
))
# else
(
wxT
(
"(200809
12
)"
))
/* svn date & rev (normally overridden) */
(
wxT
(
"(200809
20
)"
))
/* svn date & rev (normally overridden) */
# endif
#endif
;
...
...
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