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
142565c3
Commit
142565c3
authored
May 15, 2008
by
charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eeschema: minors changes
parent
4999a844
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
108 additions
and
96 deletions
+108
-96
backanno.cpp
eeschema/backanno.cpp
+44
-29
build_BOM.cpp
eeschema/build_BOM.cpp
+50
-48
dialog_build_BOM.cpp
eeschema/dialog_build_BOM.cpp
+5
-4
dialog_build_BOM.h
eeschema/dialog_build_BOM.h
+2
-2
libarch.cpp
eeschema/libarch.cpp
+6
-7
protos.h
eeschema/protos.h
+0
-6
schframe.cpp
eeschema/schframe.cpp
+1
-0
No files found.
eeschema/backanno.cpp
View file @
142565c3
...
@@ -15,40 +15,51 @@
...
@@ -15,40 +15,51 @@
#include "dialog_backanno.cpp"
#include "dialog_backanno.cpp"
/**************************************************************/
/**************************************************************/
SCH_COMPONENT
*
WinEDA_SchematicFrame
::
FindComponentByRef
(
SCH_COMPONENT
*
WinEDA_SchematicFrame
::
FindComponentByRef
(
const
wxString
&
reference
)
const
wxString
&
reference
)
/**************************************************************/
/**************************************************************/
{
{
DrawSheetPath
*
sheet
;
DrawSheetPath
*
sheet
;
SCH_ITEM
*
DrawList
=
NULL
;
SCH_ITEM
*
DrawList
=
NULL
;
EDA_SheetList
SheetList
(
NULL
);
EDA_SheetList
SheetList
(
NULL
);
for
(
sheet
=
SheetList
.
GetFirst
();
sheet
!=
NULL
;
sheet
=
SheetList
.
GetNext
()
)
for
(
sheet
=
SheetList
.
GetFirst
();
sheet
!=
NULL
;
sheet
=
SheetList
.
GetNext
()
)
{
{
DrawList
=
(
SCH_ITEM
*
)
sheet
->
LastDrawList
();
DrawList
=
(
SCH_ITEM
*
)
sheet
->
LastDrawList
();
for
(
;
(
DrawList
!=
NULL
);
DrawList
=
DrawList
->
Next
()
)
for
(
;
(
DrawList
!=
NULL
);
DrawList
=
DrawList
->
Next
()
)
{
{
if
(
DrawList
->
Type
()
==
TYPE_SCH_COMPONENT
)
if
(
DrawList
->
Type
()
==
TYPE_SCH_COMPONENT
)
{
{
SCH_COMPONENT
*
pSch
;
SCH_COMPONENT
*
pSch
;
pSch
=
(
SCH_COMPONENT
*
)
DrawList
;
pSch
=
(
SCH_COMPONENT
*
)
DrawList
;
if
(
reference
.
CmpNoCase
(
pSch
->
GetRef
(
sheet
)
)
==
0
)
if
(
reference
.
CmpNoCase
(
pSch
->
GetRef
(
sheet
)
)
==
0
)
return
pSch
;
return
pSch
;
}
}
}
}
}
}
return
NULL
;
return
NULL
;
}
}
/**************************************************************/
/**************************************************************/
bool
WinEDA_SchematicFrame
::
ProcessStuffFile
(
FILE
*
StuffFile
)
bool
WinEDA_SchematicFrame
::
ProcessStuffFile
(
FILE
*
StuffFile
)
/**************************************************************/
/**************************************************************/
/* Read a "stuff" file created by cvpcb.
* That file has lines like:
* comp = "C1" module = "CP6"
* comp = "C2" module = "C1"
* comp = "C3" module = "C1"
* "comp =" gives the component reference
* "module =" gives the footprint name
*
*/
{
{
int
LineNum
=
0
;
int
LineNum
=
0
;
char
*
cp
,
Ref
[
256
],
FootPrint
[
256
],
Line
[
1024
];
char
*
cp
,
Ref
[
256
],
FootPrint
[
256
],
Line
[
1024
];
SCH_COMPONENT
*
Cmp
;
SCH_COMPONENT
*
Cmp
;
PartTextStruct
*
TextField
;
while
(
GetLine
(
StuffFile
,
Line
,
&
LineNum
,
sizeof
(
Line
)
)
)
while
(
GetLine
(
StuffFile
,
Line
,
&
LineNum
,
sizeof
(
Line
)
)
)
{
{
...
@@ -62,18 +73,22 @@ bool WinEDA_SchematicFrame::ProcessStuffFile( FILE* StuffFile )
...
@@ -62,18 +73,22 @@ bool WinEDA_SchematicFrame::ProcessStuffFile( FILE* StuffFile )
if
(
*
cp
==
'"'
)
if
(
*
cp
==
'"'
)
*
cp
=
0
;
*
cp
=
0
;
wxString
reference
=
CONV_FROM_UTF8
(
Ref
);
wxString
reference
=
CONV_FROM_UTF8
(
Ref
);
Cmp
=
WinEDA_SchematicFrame
::
FindComponentByRef
(
reference
);
Cmp
=
WinEDA_SchematicFrame
::
FindComponentByRef
(
reference
);
if
(
Cmp
==
NULL
)
if
(
Cmp
==
NULL
)
continue
;
continue
;
#if defined(DEBUG)
/* Give a reasonnable value to the fied position, if
printf
(
" %s %s
\n
"
,
CONV_TO_UTF8
(
Cmp
->
m_Field
[
REFERENCE
].
m_Text
),
* the text is empty at position 0, because it is probably not yet initialised
CONV_TO_UTF8
(
Cmp
->
m_Field
[
VALUE
].
m_Text
)
);
*/
#endif
if
(
Cmp
->
m_Field
[
FOOTPRINT
].
m_Text
.
IsEmpty
()
&&
TextField
=
&
Cmp
->
m_Field
[
FOOTPRINT
];
(
Cmp
->
m_Field
[
FOOTPRINT
].
m_Pos
==
wxPoint
(
0
,
0
)
)
)
TextField
->
m_Text
=
CONV_FROM_UTF8
(
FootPrint
);
{
Cmp
->
m_Field
[
FOOTPRINT
].
m_Pos
=
Cmp
->
m_Field
[
VALUE
].
m_Pos
;
Cmp
->
m_Field
[
FOOTPRINT
].
m_Pos
.
y
-=
100
;
}
Cmp
->
m_Field
[
FOOTPRINT
].
m_Text
=
CONV_FROM_UTF8
(
FootPrint
);
}
}
}
}
...
@@ -100,7 +115,7 @@ bool WinEDA_SchematicFrame::ReadInputStuffFile()
...
@@ -100,7 +115,7 @@ bool WinEDA_SchematicFrame::ReadInputStuffFile()
this
,
this
,
wxFD_OPEN
,
wxFD_OPEN
,
FALSE
FALSE
);
);
if
(
filename
.
IsEmpty
()
)
if
(
filename
.
IsEmpty
()
)
return
FALSE
;
return
FALSE
;
...
...
eeschema/build_BOM.cpp
View file @
142565c3
This diff is collapsed.
Click to expand it.
eeschema/dialog_build_BOM.cpp
View file @
142565c3
...
@@ -152,7 +152,7 @@ WinEDA_Build_BOM_Frame::WinEDA_Build_BOM_Frame( WinEDA_DrawFrame* parent,
...
@@ -152,7 +152,7 @@ WinEDA_Build_BOM_Frame::WinEDA_Build_BOM_Frame( WinEDA_DrawFrame* parent,
m_OutputFormCtrl
->
SetSelection
(
s_OutputFormOpt
);
m_OutputFormCtrl
->
SetSelection
(
s_OutputFormOpt
);
m_OutputSeparatorCtrl
->
SetSelection
(
s_OutputSeparatorOpt
);
m_OutputSeparatorCtrl
->
SetSelection
(
s_OutputSeparatorOpt
);
// Enable/disable options:
// Enable/disable options:
if
(
s_OutputFormOpt
==
1
)
if
(
s_OutputFormOpt
==
1
)
{
{
...
@@ -448,7 +448,7 @@ void WinEDA_Build_BOM_Frame::OnCreateListClick( wxCommandEvent& event )
...
@@ -448,7 +448,7 @@ void WinEDA_Build_BOM_Frame::OnCreateListClick( wxCommandEvent& event )
ExportSeparatorSymbol
=
s_ExportSeparator
[
m_OutputSeparatorCtrl
->
GetSelection
()];
ExportSeparatorSymbol
=
s_ExportSeparator
[
m_OutputSeparatorCtrl
->
GetSelection
()];
bool
ExportFileType
=
m_OutputFormCtrl
->
GetSelection
()
==
0
?
false
:
true
;
bool
ExportFileType
=
m_OutputFormCtrl
->
GetSelection
()
==
0
?
false
:
true
;
SavePreferences
();
SavePreferences
();
Create_BOM_Lists
(
ExportFileType
,
m_ListSubCmpItems
->
GetValue
(),
Create_BOM_Lists
(
ExportFileType
,
m_ListSubCmpItems
->
GetValue
(),
...
@@ -507,7 +507,8 @@ void WinEDA_Build_BOM_Frame::SavePreferences()
...
@@ -507,7 +507,8 @@ void WinEDA_Build_BOM_Frame::SavePreferences()
if
(
s_OutputSeparatorOpt
<
0
)
if
(
s_OutputSeparatorOpt
<
0
)
s_OutputSeparatorOpt
=
0
;
s_OutputSeparatorOpt
=
0
;
// Determine current settings of all 8 "Fields to add" checkboxes
// Determine current settings of all "Fields to add" checkboxes
s_Add_FpField_state
=
m_AddFootprintField
->
GetValue
();
s_Add_F1_state
=
m_AddField1
->
GetValue
();
s_Add_F1_state
=
m_AddField1
->
GetValue
();
s_Add_F2_state
=
m_AddField2
->
GetValue
();
s_Add_F2_state
=
m_AddField2
->
GetValue
();
s_Add_F3_state
=
m_AddField3
->
GetValue
();
s_Add_F3_state
=
m_AddField3
->
GetValue
();
...
@@ -521,7 +522,7 @@ void WinEDA_Build_BOM_Frame::SavePreferences()
...
@@ -521,7 +522,7 @@ void WinEDA_Build_BOM_Frame::SavePreferences()
m_Parent
->
m_Parent
->
m_EDA_Config
->
Write
(
OPTION_BOM_FORMAT
,
(
long
)
s_OutputFormOpt
);
m_Parent
->
m_Parent
->
m_EDA_Config
->
Write
(
OPTION_BOM_FORMAT
,
(
long
)
s_OutputFormOpt
);
m_Parent
->
m_Parent
->
m_EDA_Config
->
Write
(
OPTION_BOM_SEPARATOR
,
(
long
)
s_OutputSeparatorOpt
);
m_Parent
->
m_Parent
->
m_EDA_Config
->
Write
(
OPTION_BOM_SEPARATOR
,
(
long
)
s_OutputSeparatorOpt
);
// Now save current settings of all
8
"Fields to add" checkboxes
// Now save current settings of all "Fields to add" checkboxes
long
addfields
=
0
;
long
addfields
=
0
;
for
(
int
ii
=
0
,
bitmask
=
1
;
s_AddFieldList
[
ii
]
!=
NULL
;
ii
++
)
for
(
int
ii
=
0
,
bitmask
=
1
;
s_AddFieldList
[
ii
]
!=
NULL
;
ii
++
)
{
{
...
...
eeschema/dialog_build_BOM.h
View file @
142565c3
...
@@ -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
Print
ListeCmp
ByRef
(
FILE
*
f
,
ListComponent
*
List
,
int
NbItems
,
int
Print
ComponentsList
ByRef
(
FILE
*
f
,
ListComponent
*
List
,
int
NbItems
,
bool
CompactForm
,
bool
aIncludeSubComponents
);
bool
CompactForm
,
bool
aIncludeSubComponents
);
int
Print
ListeCmp
ByVal
(
FILE
*
f
,
ListComponent
*
List
,
int
NbItems
,
int
Print
ComponentsList
ByVal
(
FILE
*
f
,
ListComponent
*
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/libarch.cpp
View file @
142565c3
...
@@ -14,13 +14,12 @@
...
@@ -14,13 +14,12 @@
#include "protos.h"
#include "protos.h"
/* fonctions exportees */
/* Imported functions */
int
BuildComponentsListFromSchematic
(
ListComponent
*
List
);
/* fonctions locales */
/* Local functions*/
static
int
TriListEntry
(
EDA_LibComponentStruct
**
Objet1
,
static
int
TriListEntry
(
EDA_LibComponentStruct
**
Objet1
,
EDA_LibComponentStruct
**
Objet2
);
EDA_LibComponentStruct
**
Objet2
);
/* Variable locales */
/*******************************************************************/
/*******************************************************************/
...
@@ -42,14 +41,14 @@ const wxChar * Text;
...
@@ -42,14 +41,14 @@ const wxChar * Text;
/* Creation de la liste des elements */
/* Creation de la liste des elements */
NbItems
=
GenListeCmp
(
NULL
);
// Comptage des composants
NbItems
=
BuildComponentsListFromSchematic
(
NULL
);
// Comptage des composants
if
(
NbItems
==
0
)
return
FALSE
;
if
(
NbItems
==
0
)
return
FALSE
;
List
=
(
ListComponent
*
)
MyZMalloc
(
NbItems
*
sizeof
(
ListComponent
)
);
List
=
(
ListComponent
*
)
MyZMalloc
(
NbItems
*
sizeof
(
ListComponent
)
);
if
(
List
==
NULL
)
return
FALSE
;
if
(
List
==
NULL
)
return
FALSE
;
/* Calcul de la liste des composants */
/* Calcul de la liste des composants */
GenListeCmp
(
List
);
BuildComponentsListFromSchematic
(
List
);
/* Calcul de la liste des Entrees de librairie
/* Calcul de la liste des Entrees de librairie
et Remplacement des alias par les composants "Root" */
et Remplacement des alias par les composants "Root" */
...
...
eeschema/protos.h
View file @
142565c3
...
@@ -376,12 +376,6 @@ int GetNameOfPartToLoad(WinEDA_DrawFrame * frame, LibraryStruct * Lib,
...
@@ -376,12 +376,6 @@ int GetNameOfPartToLoad(WinEDA_DrawFrame * frame, LibraryStruct * Lib,
bool
LibArchive
(
wxWindow
*
frame
,
const
wxString
&
ArchFullFileName
);
bool
LibArchive
(
wxWindow
*
frame
,
const
wxString
&
ArchFullFileName
);
/***************/
/* GENLISTE.CPP */
/***************/
struct
ListComponent
;
int
GenListeCmp
(
ListComponent
*
List
);
/**************/
/**************/
/* CLEANUP.CPP */
/* CLEANUP.CPP */
/**************/
/**************/
...
...
eeschema/schframe.cpp
View file @
142565c3
...
@@ -509,6 +509,7 @@ void WinEDA_SchematicFrame::OnLoadFile( wxCommandEvent& event )
...
@@ -509,6 +509,7 @@ void WinEDA_SchematicFrame::OnLoadFile( wxCommandEvent& event )
void
WinEDA_SchematicFrame
::
OnLoadStuffFile
(
wxCommandEvent
&
event
)
void
WinEDA_SchematicFrame
::
OnLoadStuffFile
(
wxCommandEvent
&
event
)
{
{
ReadInputStuffFile
(
);
ReadInputStuffFile
(
);
DrawPanel
->
Refresh
();
}
}
void
WinEDA_SchematicFrame
::
OnNewProject
(
wxCommandEvent
&
event
)
void
WinEDA_SchematicFrame
::
OnNewProject
(
wxCommandEvent
&
event
)
...
...
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