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
6c01c554
Commit
6c01c554
authored
Dec 10, 2008
by
charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
code cleanup, better comments and comments translation
parent
589873f3
Changes
12
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
633 additions
and
754 deletions
+633
-754
string.cpp
common/string.cpp
+6
-6
annotate.cpp
eeschema/annotate.cpp
+256
-353
build_BOM.cpp
eeschema/build_BOM.cpp
+203
-209
class_drawsheet.cpp
eeschema/class_drawsheet.cpp
+1
-4
class_drawsheet.h
eeschema/class_drawsheet.h
+5
-5
dialog_build_BOM.h
eeschema/dialog_build_BOM.h
+2
-2
erc.cpp
eeschema/erc.cpp
+2
-2
libarch.cpp
eeschema/libarch.cpp
+91
-120
netform.cpp
eeschema/netform.cpp
+12
-12
netlist.cpp
eeschema/netlist.cpp
+3
-3
netlist.h
eeschema/netlist.h
+51
-37
protos.h
eeschema/protos.h
+1
-1
No files found.
common/string.cpp
View file @
6c01c554
/*********************************************
*******************************
/
/*********************************************/
/* string.cpp */
/* string.cpp */
/*
ROLE: fonctions complementaires de traitement de chaines de caractere
s */
/*
some useful functions to handle string
s */
/*********************************************
*******************************
/
/*********************************************/
#include "fctsys.h"
#include "fctsys.h"
#include <time.h>
#include <time.h>
...
@@ -13,9 +13,9 @@
...
@@ -13,9 +13,9 @@
int
ReadDelimitedText
(
char
*
dest
,
char
*
source
,
int
NbMaxChar
)
int
ReadDelimitedText
(
char
*
dest
,
char
*
source
,
int
NbMaxChar
)
/*********************************************************************/
/*********************************************************************/
/* read a double-qu
te delimited text in source and pu
t in in dest,
/* read a double-qu
ote delimited text from source and put i
t in in dest,
* read NbMaxChar bytes max
* read NbMaxChar bytes max
* return the
byte count read in
source
* return the
char count read from
source
*/
*/
{
{
int
ii
,
jj
,
flag
=
0
;
int
ii
,
jj
,
flag
=
0
;
...
...
eeschema/annotate.cpp
View file @
6c01c554
This diff is collapsed.
Click to expand it.
eeschema/build_BOM.cpp
View file @
6c01c554
This diff is collapsed.
Click to expand it.
eeschema/class_drawsheet.cpp
View file @
6c01c554
...
@@ -371,9 +371,6 @@ int DrawSheetStruct::ComponentCount()
...
@@ -371,9 +371,6 @@ int DrawSheetStruct::ComponentCount()
/*******************************************************************/
/*******************************************************************/
{
{
//count our own components, without the power components.
//count our own components, without the power components.
/* Routine retournant le nombre de composants dans le schema,
* powers non comprises */
int
n
=
0
;
int
n
=
0
;
if
(
m_AssociatedScreen
)
if
(
m_AssociatedScreen
)
...
@@ -678,7 +675,7 @@ DrawSheetPath::DrawSheetPath()
...
@@ -678,7 +675,7 @@ DrawSheetPath::DrawSheetPath()
}
}
int
DrawSheetPath
::
Cmp
(
DrawSheetPath
&
d
)
int
DrawSheetPath
::
Cmp
(
const
DrawSheetPath
&
d
)
const
{
{
if
(
m_numSheets
>
d
.
m_numSheets
)
if
(
m_numSheets
>
d
.
m_numSheets
)
return
1
;
return
1
;
...
...
eeschema/class_drawsheet.h
View file @
6c01c554
...
@@ -66,7 +66,7 @@ public:
...
@@ -66,7 +66,7 @@ public:
*/
*/
WX_DEFINE_ARRAY
(
DrawSheetStruct
*
,
SheetGrowArray
);
WX_DEFINE_ARRAY
(
DrawSheetStruct
*
,
SheetGrowArray
);
class
DrawSheetStruct
:
public
SCH_ITEM
/* Gestion de la hierarchie */
class
DrawSheetStruct
:
public
SCH_ITEM
{
{
public
:
public
:
wxString
m_SheetName
;
/*this is equivalent to C101 for components:
wxString
m_SheetName
;
/*this is equivalent to C101 for components:
...
@@ -76,13 +76,13 @@ private:
...
@@ -76,13 +76,13 @@ private:
* but need it here for loading after
* but need it here for loading after
* reading the sheet description from file. */
* reading the sheet description from file. */
public
:
public
:
int
m_SheetNameSize
;
/* Size (height) of the text, used to draw the name */
int
m_SheetNameSize
;
/* Size (height) of the text, used to draw the
sheet
name */
int
m_FileNameSize
;
/* Size (height) of the text, used to draw the name */
int
m_FileNameSize
;
/* Size (height) of the text, used to draw the
file
name */
wxPoint
m_Pos
;
wxPoint
m_Pos
;
wxSize
m_Size
;
/* Position and Size of sheet symbol */
wxSize
m_Size
;
/* Position and Size of sheet symbol */
int
m_Layer
;
int
m_Layer
;
Hierarchical_PIN_Sheet_Struct
*
m_Label
;
/* Points de connection, linked list.*/
Hierarchical_PIN_Sheet_Struct
*
m_Label
;
/* Points de connection, linked list.*/
int
m_NbLabel
;
/*
Nombre de points de connexion
*/
int
m_NbLabel
;
/*
Pins sheet (corresponding to hierarchical labels) count
*/
SCH_SCREEN
*
m_AssociatedScreen
;
/* Associated Screen which handle the physical data
SCH_SCREEN
*
m_AssociatedScreen
;
/* Associated Screen which handle the physical data
* In complex hierarchies we can have many DrawSheetStruct using the same data
* In complex hierarchies we can have many DrawSheetStruct using the same data
*/
*/
...
@@ -149,7 +149,7 @@ public:
...
@@ -149,7 +149,7 @@ public:
DrawSheetPath
();
DrawSheetPath
();
~
DrawSheetPath
()
{
};
~
DrawSheetPath
()
{
};
void
Clear
()
{
m_numSheets
=
0
;
}
void
Clear
()
{
m_numSheets
=
0
;
}
int
Cmp
(
DrawSheetPath
&
d
)
;
int
Cmp
(
const
DrawSheetPath
&
d
)
const
;
DrawSheetStruct
*
Last
();
DrawSheetStruct
*
Last
();
SCH_SCREEN
*
LastScreen
();
SCH_SCREEN
*
LastScreen
();
EDA_BaseStruct
*
LastDrawList
();
EDA_BaseStruct
*
LastDrawList
();
...
...
eeschema/dialog_build_BOM.h
View file @
6c01c554
...
@@ -134,9 +134,9 @@ public:
...
@@ -134,9 +134,9 @@ public:
bool
aRunBrowser
);
bool
aRunBrowser
);
void
GenereListeOfItems
(
const
wxString
&
FullFileName
,
bool
aIncludeSubComponents
);
void
GenereListeOfItems
(
const
wxString
&
FullFileName
,
bool
aIncludeSubComponents
);
void
CreateExportList
(
const
wxString
&
FullFileName
,
bool
aIncludeSubComponents
);
void
CreateExportList
(
const
wxString
&
FullFileName
,
bool
aIncludeSubComponents
);
int
PrintComponentsListByRef
(
FILE
*
f
,
ListComponent
*
List
,
int
NbItems
,
int
PrintComponentsListByRef
(
FILE
*
f
,
OBJ_CMP_TO_LIST
*
List
,
int
NbItems
,
bool
CompactForm
,
bool
aIncludeSubComponents
);
bool
CompactForm
,
bool
aIncludeSubComponents
);
int
PrintComponentsListByVal
(
FILE
*
f
,
ListComponent
*
List
,
int
NbItems
,
int
PrintComponentsListByVal
(
FILE
*
f
,
OBJ_CMP_TO_LIST
*
List
,
int
NbItems
,
bool
aIncludeSubComponents
);
bool
aIncludeSubComponents
);
void
PrintFieldData
(
FILE
*
f
,
SCH_COMPONENT
*
DrawLibItem
,
bool
CompactForm
=
FALSE
);
void
PrintFieldData
(
FILE
*
f
,
SCH_COMPONENT
*
DrawLibItem
,
bool
CompactForm
=
FALSE
);
void
SavePreferences
();
void
SavePreferences
();
...
...
eeschema/erc.cpp
View file @
6c01c554
...
@@ -319,7 +319,7 @@ void WinEDA_ErcFrame::TestErc( wxCommandEvent& event )
...
@@ -319,7 +319,7 @@ void WinEDA_ErcFrame::TestErc( wxCommandEvent& event )
/* Reset du flag m_FlagOfConnection, utilise par la suite */
/* Reset du flag m_FlagOfConnection, utilise par la suite */
for
(
NetItemRef
=
g_TabObjNet
;
NetItemRef
<
Lim
;
NetItemRef
++
)
for
(
NetItemRef
=
g_TabObjNet
;
NetItemRef
<
Lim
;
NetItemRef
++
)
NetItemRef
->
m_FlagOfConnection
=
(
IsConnectType
)
0
;
NetItemRef
->
m_FlagOfConnection
=
UNCONNECTED
;
NetNbItems
=
0
;
NetNbItems
=
0
;
MinConn
=
NOC
;
MinConn
=
NOC
;
...
@@ -692,7 +692,7 @@ static void TestOthersItems( WinEDA_DrawPanel* panel, wxDC* DC,
...
@@ -692,7 +692,7 @@ static void TestOthersItems( WinEDA_DrawPanel* panel, wxDC* DC,
if
(
NetItemTst
->
m_FlagOfConnection
==
0
)
if
(
NetItemTst
->
m_FlagOfConnection
==
0
)
{
{
Diagnose
(
panel
,
DC
,
NetItemRef
,
NetItemTst
,
0
,
erc
);
Diagnose
(
panel
,
DC
,
NetItemRef
,
NetItemTst
,
0
,
erc
);
NetItemTst
->
m_FlagOfConnection
=
(
IsConnectType
)
1
;
NetItemTst
->
m_FlagOfConnection
=
NOCONNECT
;
}
}
}
}
}
}
...
...
eeschema/libarch.cpp
View file @
6c01c554
/**************************************************************/
/**************************************************************/
/* libarch.cc */
/* libarch.cc */
/* Module de generation du fichier d'archivage des composants */
/* Module de generation du fichier d'archivage des composants */
/**************************************************************/
/**************************************************************/
#include <algorithm> // to use sort vector
#include <vector>
#include "fctsys.h"
#include "fctsys.h"
#include "gr_basic.h"
#include "common.h"
#include "common.h"
#include "program.h"
#include "program.h"
...
@@ -14,132 +15,102 @@
...
@@ -14,132 +15,102 @@
#include "protos.h"
#include "protos.h"
/* Imported functions */
int
BuildComponentsListFromSchematic
(
ListComponent
*
List
);
/* Local functions*/
/* Local functions*/
static
int
TriListEntry
(
EDA_LibComponentStruct
**
Objet1
,
EDA_LibComponentStruct
**
Objet2
);
static
bool
TriListEntry
(
const
EDA_LibComponentStruct
*
Objet1
,
const
EDA_LibComponentStruct
*
Objet2
);
/*******************************************************************/
/*******************************************************************/
bool
LibArchive
(
wxWindow
*
frame
,
const
wxString
&
ArchFullFileName
)
bool
LibArchive
(
wxWindow
*
frame
,
const
wxString
&
ArchFullFileName
)
/*******************************************************************/
/*******************************************************************/
/*
/*
Creation du fichier librairie contenant tous les composants utilis�s dans
* Creates a library that contains all components used in the whole hierarchy
le projet en cours
* return true if success
retourne TRUE si fichier cr��
*/
*/
{
{
wxString
DocFileName
,
msg
;
wxString
DocFileName
,
msg
;
char
Line
[
256
];
char
Line
[
256
];
FILE
*
ArchiveFile
,
*
DocFile
;
FILE
*
ArchiveFile
,
*
DocFile
;
ListComponent
*
List
;
EDA_LibComponentStruct
*
Entry
;
EDA_LibComponentStruct
**
ListEntry
,
*
Entry
;
int
ii
,
NbItems
;
const
wxChar
*
Text
;
/* Creation de la liste des elements */
NbItems
=
BuildComponentsListFromSchematic
(
NULL
);
// Comptage des composants
if
(
NbItems
==
0
)
return
FALSE
;
List
=
(
ListComponent
*
)
MyZMalloc
(
NbItems
*
sizeof
(
ListComponent
)
);
std
::
vector
<
EDA_LibComponentStruct
*>
ListEntry
;
if
(
List
==
NULL
)
return
FALSE
;
/* Calcul de la liste des composants */
EDA_ScreenList
s_list
;
BuildComponentsListFromSchematic
(
List
);
/* Calcul de la liste des Entrees de librairie
// examine all screens used and build the list of components found in lib
et Remplacement des alias par les composants "Root" */
for
(
SCH_SCREEN
*
screen
=
s_list
.
GetFirst
();
screen
!=
NULL
;
screen
=
s_list
.
GetNext
()
)
ListEntry
=
(
EDA_LibComponentStruct
**
)
MyZMalloc
(
NbItems
*
sizeof
(
EDA_LibComponentStruct
*
)
);
if
(
ListEntry
==
NULL
)
return
FALSE
;
for
(
ii
=
0
;
ii
<
NbItems
;
ii
++
)
{
{
Text
=
List
[
ii
].
m_Comp
->
m_ChipName
.
GetData
();
for
(
SCH_ITEM
*
SchItem
=
screen
->
EEDrawList
;
SchItem
;
SchItem
=
SchItem
->
Next
()
)
Entry
=
FindLibPart
(
Text
,
wxEmptyString
,
FIND_ROOT
);
{
ListEntry
[
ii
]
=
Entry
;
// = NULL component not found
if
(
SchItem
->
Type
()
!=
TYPE_SCH_COMPONENT
)
}
continue
;
MyFree
(
List
);
SCH_COMPONENT
*
DrawLibItem
=
(
SCH_COMPONENT
*
)
SchItem
;
Entry
=
FindLibPart
(
DrawLibItem
->
m_ChipName
.
GetData
(),
wxEmptyString
,
FIND_ROOT
);
if
(
Entry
)
// if NULL : component not found
ListEntry
.
push_back
(
Entry
);
}
}
qsort
(
ListEntry
,
NbItems
,
sizeof
(
EDA_LibComponentStruct
*
),
sort
(
ListEntry
.
begin
(),
ListEntry
.
end
(),
TriListEntry
);
(
int
(
*
)(
const
void
*
,
const
void
*
))
TriListEntry
);
/* mise a jour extension fichier doc associ
e */
/* calculate the file name for the associated doc fil
e */
DocFileName
=
ArchFullFileName
;
DocFileName
=
ArchFullFileName
;
ChangeFileNameExt
(
DocFileName
,
wxT
(
".bck"
)
);
ChangeFileNameExt
(
DocFileName
,
DOC_EXT
);
if
((
ArchiveFile
=
wxFopen
(
ArchFullFileName
,
wxT
(
"wt"
)))
==
NULL
)
if
(
(
ArchiveFile
=
wxFopen
(
ArchFullFileName
,
wxT
(
"wt"
)
)
)
==
NULL
)
{
{
MyFree
(
ListEntry
);
msg
=
_
(
"Failed to create archive lib file "
)
+
ArchFullFileName
;
msg
=
_
(
"Failed to create archive lib file "
)
+
ArchFullFileName
;
DisplayError
(
frame
,
msg
);
DisplayError
(
frame
,
msg
);
return
FALSE
;
return
FALSE
;
}
}
if
((
DocFile
=
wxFopen
(
DocFileName
,
wxT
(
"wt"
)))
==
NULL
)
if
(
(
DocFile
=
wxFopen
(
DocFileName
,
wxT
(
"wt"
)
)
)
==
NULL
)
{
{
msg
=
_
(
"Failed to create doc lib file "
)
+
DocFileName
;
msg
=
_
(
"Failed to create doc lib file "
)
+
DocFileName
;
DisplayError
(
frame
,
msg
);
DisplayError
(
frame
,
msg
);
}
}
fprintf
(
ArchiveFile
,
"%s %s
\n
#
\n
"
,
LIBFILE_IDENT
,
DateAndTime
(
Line
)
);
fprintf
(
ArchiveFile
,
"%s %s
\n
#
\n
"
,
LIBFILE_IDENT
,
DateAndTime
(
Line
)
);
if
(
DocFile
)
if
(
DocFile
)
fprintf
(
DocFile
,
"%s %s
\n
"
,
DOCFILE_IDENT
,
DateAndTime
(
Line
)
);
fprintf
(
DocFile
,
"%s %s
\n
"
,
DOCFILE_IDENT
,
DateAndTime
(
Line
)
);
/* Save components in file */
/* Save components in file */
for
(
ii
=
0
;
ii
<
NbItems
;
ii
++
)
for
(
unsigned
ii
=
0
;
ii
<
ListEntry
.
size
();
ii
++
)
{
if
(
ListEntry
[
ii
]
==
NULL
)
// Not found in lib
{
{
continue
;
if
(
(
ii
==
0
)
||
(
ListEntry
[
ii
-
1
]
!=
ListEntry
[
ii
]
)
)
}
if
(
(
ii
==
0
)
||
(
ListEntry
[
ii
-
1
]
!=
ListEntry
[
ii
]
)
)
{
{
if
(
ListEntry
[
ii
]
->
Type
==
ROOT
)
// Must be always true, but just in case
if
(
ListEntry
[
ii
]
->
Type
==
ROOT
)
// Must be always true, but just in case
ListEntry
[
ii
]
->
Save
(
ArchiveFile
);
ListEntry
[
ii
]
->
Save
(
ArchiveFile
);
if
(
DocFile
)
if
(
DocFile
)
ListEntry
[
ii
]
->
SaveDoc
(
DocFile
);
ListEntry
[
ii
]
->
SaveDoc
(
DocFile
);
}
}
}
}
fprintf
(
ArchiveFile
,
"#
\n
#EndLibrary
\n
"
);
fprintf
(
ArchiveFile
,
"#
\n
#EndLibrary
\n
"
);
fclose
(
ArchiveFile
);
fclose
(
ArchiveFile
);
if
(
DocFile
)
if
(
DocFile
)
{
{
fprintf
(
DocFile
,
"#
\n
#End Doc Library
\n
"
);
fprintf
(
DocFile
,
"#
\n
#End Doc Library
\n
"
);
fclose
(
DocFile
);
fclose
(
DocFile
);
}
}
MyFree
(
ListEntry
);
return
TRUE
;
return
TRUE
;
}
}
/***********************************************************/
static
int
TriListEntry
(
EDA_LibComponentStruct
**
Objet1
,
EDA_LibComponentStruct
**
Objet2
)
/***********************************************************/
/* Routine de comparaison pour le tri du Tableau par qsort()
Les composants sont tries par LibName
*/
{
int
ii
;
const
wxString
*
Text1
,
*
Text2
;
if
(
(
*
Objet1
==
NULL
)
&&
(
*
Objet2
==
NULL
)
)
return
(
0
);
/***********************************************************************************************/
if
(
*
Objet1
==
NULL
)
return
(
-
1
);
bool
TriListEntry
(
const
EDA_LibComponentStruct
*
Objet1
,
const
EDA_LibComponentStruct
*
Objet2
)
if
(
*
Objet2
==
NULL
)
return
(
1
);
/***********************************************************************************************/
Text1
=
&
(
*
Objet1
)
->
m_Name
.
m_Text
;
/* Compare function for sort()
Text2
=
&
(
*
Objet2
)
->
m_Name
.
m_Text
;
* lib components are sorted by name
*/
{
int
ii
;
ii
=
Text1
->
CmpNoCase
(
*
Text2
);
ii
=
Objet1
->
m_Name
.
m_Text
.
CmpNoCase
(
Objet2
->
m_Name
.
m_Text
);
return
(
ii
)
;
return
ii
<
0
;
}
}
eeschema/netform.cpp
View file @
6c01c554
...
@@ -539,7 +539,7 @@ static void WriteNetListPCBNEW( WinEDA_SchematicFrame* frame, FILE* f, bool with
...
@@ -539,7 +539,7 @@ static void WriteNetListPCBNEW( WinEDA_SchematicFrame* frame, FILE* f, bool with
EDA_BaseStruct
*
DrawList
;
EDA_BaseStruct
*
DrawList
;
SCH_COMPONENT
*
Component
;
SCH_COMPONENT
*
Component
;
int
ii
;
int
ii
;
ListComponent
*
CmpList
=
NULL
;
OBJ_CMP_TO_LIST
*
CmpList
=
NULL
;
int
CmpListCount
=
0
,
CmpListSize
=
1000
;
int
CmpListCount
=
0
,
CmpListSize
=
1000
;
DateAndTime
(
Buf
);
DateAndTime
(
Buf
);
...
@@ -571,18 +571,18 @@ static void WriteNetListPCBNEW( WinEDA_SchematicFrame* frame, FILE* f, bool with
...
@@ -571,18 +571,18 @@ static void WriteNetListPCBNEW( WinEDA_SchematicFrame* frame, FILE* f, bool with
{
{
if
(
CmpList
==
NULL
)
if
(
CmpList
==
NULL
)
{
{
CmpList
=
(
ListComponent
*
)
CmpList
=
(
OBJ_CMP_TO_LIST
*
)
MyZMalloc
(
sizeof
(
ListComponent
)
*
CmpListSize
);
MyZMalloc
(
sizeof
(
OBJ_CMP_TO_LIST
)
*
CmpListSize
);
}
}
if
(
CmpListCount
>=
CmpListSize
)
if
(
CmpListCount
>=
CmpListSize
)
{
{
CmpListSize
+=
1000
;
CmpListSize
+=
1000
;
CmpList
=
(
ListComponent
*
)
realloc
(
CmpList
=
(
OBJ_CMP_TO_LIST
*
)
realloc
(
CmpList
,
CmpList
,
sizeof
(
ListComponent
)
*
CmpListSize
);
sizeof
(
OBJ_CMP_TO_LIST
)
*
CmpListSize
);
}
}
CmpList
[
CmpListCount
].
m_
Co
mp
=
Component
;
CmpList
[
CmpListCount
].
m_
RootC
mp
=
Component
;
strcpy
(
CmpList
[
CmpListCount
].
m_Ref
,
Component
->
GetRef
(
sheet
).
mb_str
()
);
strcpy
(
CmpList
[
CmpListCount
].
m_Ref
erence
,
Component
->
GetRef
(
sheet
).
mb_str
()
);
CmpListCount
++
;
CmpListCount
++
;
}
}
}
}
...
@@ -643,19 +643,19 @@ static void WriteNetListPCBNEW( WinEDA_SchematicFrame* frame, FILE* f, bool with
...
@@ -643,19 +643,19 @@ static void WriteNetListPCBNEW( WinEDA_SchematicFrame* frame, FILE* f, bool with
EDA_LibComponentStruct
*
Entry
;
EDA_LibComponentStruct
*
Entry
;
for
(
ii
=
0
;
ii
<
CmpListCount
;
ii
++
)
for
(
ii
=
0
;
ii
<
CmpListCount
;
ii
++
)
{
{
Component
=
CmpList
[
ii
].
m_
Co
mp
;
Component
=
CmpList
[
ii
].
m_
RootC
mp
;
Entry
=
FindLibPart
(
Component
->
m_ChipName
.
GetData
(),
wxEmptyString
,
FIND_ROOT
);
Entry
=
FindLibPart
(
Component
->
m_ChipName
.
GetData
(),
wxEmptyString
,
FIND_ROOT
);
//Line.Printf(_("%s"), CmpList[ii].m_Ref);
//Line.Printf(_("%s"), CmpList[ii].m_Ref);
//Line.Replace( wxT( " " ), wxT( "_" ) );
//Line.Replace( wxT( " " ), wxT( "_" ) );
unsigned
int
i
;
unsigned
int
i
;
for
(
i
=
0
;
i
<
sizeof
(
CmpList
[
ii
].
m_Ref
)
&&
CmpList
[
ii
].
m_Ref
[
i
];
i
++
)
for
(
i
=
0
;
i
<
sizeof
(
CmpList
[
ii
].
m_Ref
erence
)
&&
CmpList
[
ii
].
m_Reference
[
i
];
i
++
)
{
{
if
(
CmpList
[
ii
].
m_Ref
[
i
]
==
' '
)
if
(
CmpList
[
ii
].
m_Ref
erence
[
i
]
==
' '
)
CmpList
[
ii
].
m_Ref
[
i
]
=
'_'
;
CmpList
[
ii
].
m_Ref
erence
[
i
]
=
'_'
;
}
}
fprintf
(
f
,
"$component %s
\n
"
,
CmpList
[
ii
].
m_Ref
);
fprintf
(
f
,
"$component %s
\n
"
,
CmpList
[
ii
].
m_Ref
erence
);
/* Write the footprint list */
/* Write the footprint list */
for
(
unsigned
int
jj
=
0
;
jj
<
Entry
->
m_FootprintList
.
GetCount
();
jj
++
)
for
(
unsigned
int
jj
=
0
;
jj
<
Entry
->
m_FootprintList
.
GetCount
();
jj
++
)
{
{
...
...
eeschema/netlist.cpp
View file @
6c01c554
...
@@ -1200,13 +1200,13 @@ static void SetUnconnectedFlag( ObjetNetListStruct* ListObj, int NbItems )
...
@@ -1200,13 +1200,13 @@ static void SetUnconnectedFlag( ObjetNetListStruct* ListObj, int NbItems )
ObjetNetListStruct
*
NetItemRef
,
*
NetItemTst
,
*
ItemPtr
;
ObjetNetListStruct
*
NetItemRef
,
*
NetItemTst
,
*
ItemPtr
;
ObjetNetListStruct
*
NetStart
,
*
NetEnd
,
*
Lim
;
ObjetNetListStruct
*
NetStart
,
*
NetEnd
,
*
Lim
;
int
Nb
;
int
Nb
;
Is
ConnectType
StateFlag
;
ConnectType
StateFlag
;
NetStart
=
NetEnd
=
ListObj
;
NetStart
=
NetEnd
=
ListObj
;
NetItemRef
=
NetStart
;
NetItemRef
=
NetStart
;
Nb
=
0
;
Nb
=
0
;
StateFlag
=
UNCONNECT
;
StateFlag
=
UNCONNECT
ED
;
Lim
=
ListObj
+
NbItems
;
Lim
=
ListObj
+
NbItems
;
for
(
;
NetItemRef
<
Lim
;
NetItemRef
++
)
for
(
;
NetItemRef
<
Lim
;
NetItemRef
++
)
...
@@ -1233,7 +1233,7 @@ static void SetUnconnectedFlag( ObjetNetListStruct* ListObj, int NbItems )
...
@@ -1233,7 +1233,7 @@ static void SetUnconnectedFlag( ObjetNetListStruct* ListObj, int NbItems )
return
;
return
;
/* Start Analyse Nouveau Net */
/* Start Analyse Nouveau Net */
StateFlag
=
UNCONNECT
;
StateFlag
=
UNCONNECT
ED
;
NetStart
=
NetItemTst
;
NetStart
=
NetItemTst
;
continue
;
continue
;
}
}
...
...
eeschema/netlist.h
View file @
6c01c554
...
@@ -52,8 +52,8 @@ enum NetObjetType { /* Type des objets de Net */
...
@@ -52,8 +52,8 @@ enum NetObjetType { /* Type des objets de Net */
};
};
enum
IsConnectType
{
/* Valeur du Flag de connection */
enum
ConnectType
{
/* Valeur du Flag de connection */
UNCONNECT
,
/* Pin ou Label non connecte */
UNCONNECT
ED
=
0
,
/* Pin ou Label non connecte */
NOCONNECT
,
/* Pin volontairement non connectee (Symb. NoConnect utilise) */
NOCONNECT
,
/* Pin volontairement non connectee (Symb. NoConnect utilise) */
PAD_CONNECT
/* connexion normale */
PAD_CONNECT
/* connexion normale */
};
};
...
@@ -76,7 +76,7 @@ public:
...
@@ -76,7 +76,7 @@ public:
int
m_BusNetCode
;
/* pour connexions type bus */
int
m_BusNetCode
;
/* pour connexions type bus */
int
m_Member
;
/* pour les labels type BUSWIRE ( labels de bus eclate )
int
m_Member
;
/* pour les labels type BUSWIRE ( labels de bus eclate )
* numero de membre */
* numero de membre */
IsConnectType
m_FlagOfConnection
;
ConnectType
m_FlagOfConnection
;
DrawSheetPath
m_SheetListInclude
;
/* sheet that the hierarchal label connects to.*/
DrawSheetPath
m_SheetListInclude
;
/* sheet that the hierarchal label connects to.*/
long
m_PinNum
;
/* numero de pin( 4 octets -> 4 codes ascii) */
long
m_PinNum
;
/* numero de pin( 4 octets -> 4 codes ascii) */
const
wxString
*
m_Label
;
/* Tous types Labels:pointeur sur la wxString definissant le label */
const
wxString
*
m_Label
;
/* Tous types Labels:pointeur sur la wxString definissant le label */
...
@@ -92,45 +92,59 @@ public:
...
@@ -92,45 +92,59 @@ public:
};
};
/* Structures pour memo et liste des elements */
/* object used in annotation to handle a list of components in schematic
struct
ListLabel
* because in a complex hierarchy, a component is used more than once,
* and its reference is depending on the sheet path
* for the same component, we must create a flat list of components
* used in nelist generation, BOM generation and annotation
*/
class
OBJ_CMP_TO_LIST
{
{
int
m_LabelType
;
public
:
void
*
m_Label
;
SCH_COMPONENT
*
m_RootCmp
;
// the component in schematic
char
m_SheetPath
[
256
];
EDA_LibComponentStruct
*
m_Entry
;
// the source component in library
};
int
m_Unit
;
/* Selected part (For multi parts per package) depending on sheet path */
DrawSheetPath
m_SheetPath
;
/* the sheet path for this component */
unsigned
long
m_TimeStamp
;
/* unique identification number depending on sheet path */
bool
m_IsNew
;
/* true for not yet annotated components */
wxString
*
m_Value
;
/* Component value (same for all instances) */
char
m_Reference
[
32
];
/* Component reference prefix, without number (for IC1, this is IC) ) */
int
m_NumRef
;
/* Reference number (for IC1, this is 1) ) depending on sheet path*/
int
m_Flag
;
/* flag for computations */
public
:
// Used to create lists of components BOM, netlist generation)
OBJ_CMP_TO_LIST
()
struct
ListComponent
{
{
m_RootCmp
=
NULL
;
SCH_COMPONENT
*
m_Comp
;
// pointer on the component in schematic
m_Entry
=
NULL
;
char
m_Ref
[
32
];
// component reference
m_Unit
=
0
;
int
m_Unit
;
// Unit value, for multiple parts per package
m_TimeStamp
=
0
;
//have to store it here since the object references will be duplicated.
m_IsNew
=
false
;
DrawSheetPath
m_SheetList
;
//composed of UIDs
m_Value
=
NULL
;
m_Reference
[
0
]
=
0
;
m_NumRef
=
0
;
m_Flag
=
0
;
}
int
CompareValue
(
const
OBJ_CMP_TO_LIST
&
item
)
const
{
return
m_Value
->
CmpNoCase
(
*
item
.
m_Value
);
}
int
CompareRef
(
const
OBJ_CMP_TO_LIST
&
item
)
const
{
return
strnicmp
(
m_Reference
,
item
.
m_Reference
,
32
);
}
bool
IsPartsLocked
(
)
{
return
m_Entry
->
m_UnitSelectionLocked
;
}
};
};
/* Structure decrivant 1 composant de la schematique (for annotation ) */
struct
CmpListStruct
{
public
:
SCH_COMPONENT
*
m_Cmp
;
/* Pointeur sur le composant */
int
m_NbParts
;
/* Nombre de parts par boitier */
bool
m_PartsLocked
;
// For multi part components: True if the part cannot be changed
int
m_Unit
;
/* Numero de part */
DrawSheetPath
m_SheetList
;
unsigned
long
m_TimeStamp
;
/* unique identification number */
int
m_IsNew
;
/* != 0 pour composants non annotes */
char
m_TextValue
[
32
];
/* Valeur */
char
m_TextRef
[
32
];
/* Reference ( hors numero ) */
int
m_NumRef
;
/* Numero de reference */
int
m_Flag
;
/* flag pour calculs internes */
wxPoint
m_Pos
;
/* position components */
char
m_Path
[
256
];
// the 'path' of the object in the sheet hierarchy.
};
/* Global Variables */
/* Global Variables */
eda_global
int
g_NbrObjNet
;
eda_global
int
g_NbrObjNet
;
...
...
eeschema/protos.h
View file @
6c01c554
...
@@ -40,7 +40,7 @@ void InstallCmpeditFrame(WinEDA_SchematicFrame * parent, wxPoint & pos,
...
@@ -40,7 +40,7 @@ void InstallCmpeditFrame(WinEDA_SchematicFrame * parent, wxPoint & pos,
/******************************/
/******************************/
int
LibraryEntryCompare
(
EDA_LibComponentStruct
*
LE1
,
EDA_LibComponentStruct
*
LE2
);
int
LibraryEntryCompare
(
EDA_LibComponentStruct
*
LE1
,
EDA_LibComponentStruct
*
LE2
);
int
NumOfLibraries
();
int
NumOfLibraries
();
EDA_LibComponentStruct
*
FindLibPart
(
const
wxChar
*
Name
,
const
wxString
&
LibName
,
int
Alias
);
EDA_LibComponentStruct
*
FindLibPart
(
const
wxChar
*
Name
,
const
wxString
&
LibName
,
int
Alias
=
FIND_ROOT
);
void
DrawingLibInGhost
(
WinEDA_DrawPanel
*
panel
,
wxDC
*
DC
,
EDA_LibComponentStruct
*
LibEntry
,
void
DrawingLibInGhost
(
WinEDA_DrawPanel
*
panel
,
wxDC
*
DC
,
EDA_LibComponentStruct
*
LibEntry
,
SCH_COMPONENT
*
DrawLibItem
,
int
PartX
,
int
PartY
,
SCH_COMPONENT
*
DrawLibItem
,
int
PartX
,
int
PartY
,
...
...
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