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
c586d973
Commit
c586d973
authored
Mar 10, 2015
by
jean-pierre charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Eeschema: fix bug #142970 (broken append sheet function)
Fix a few minor coverity warnings.
parent
035b231b
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
63 additions
and
21 deletions
+63
-21
files-io.cpp
eeschema/files-io.cpp
+47
-6
libeditframe.cpp
eeschema/libeditframe.cpp
+0
-3
load_one_schematic_file.cpp
eeschema/load_one_schematic_file.cpp
+1
-1
onleftclick.cpp
eeschema/onleftclick.cpp
+3
-6
sch_component.cpp
eeschema/sch_component.cpp
+4
-3
plot_common.h
include/plot_common.h
+1
-0
dialog_netlist.cpp
pcbnew/dialogs/dialog_netlist.cpp
+5
-0
netlist.cpp
pcbnew/netlist.cpp
+2
-2
No files found.
eeschema/files-io.cpp
View file @
c586d973
...
...
@@ -359,19 +359,60 @@ bool SCH_EDIT_FRAME::AppendOneEEProject()
wxLogDebug
(
wxT
(
"Importing schematic "
)
+
fullFileName
);
// Keep trace of the last item in list.
// New items will be loaded after this one.
SCH_ITEM
*
bs
=
screen
->
GetDrawItems
();
if
(
bs
)
while
(
bs
->
Next
()
)
bs
=
bs
->
Next
();
// load the project
bool
success
=
LoadOneEEFile
(
screen
,
fullFileName
,
true
);
if
(
success
)
{
// load sub-sheets
EDA_ITEM
*
bs
=
screen
->
GetDrawItems
();
// the new loaded items need cleaning to avoid duplicate parameters
// which should be unique (ref and time stamp).
// Clear ref and set a new time stamp for new items
if
(
bs
==
NULL
)
bs
=
screen
->
GetDrawItems
();
else
bs
=
bs
->
Next
();
while
(
bs
)
{
// do not append hierarchical sheets
SCH_ITEM
*
nextbs
=
bs
->
Next
();
// To avoid issues with the current hieratchy,
// do not load included sheets files and give new filenames
// and new sheet names.
// There are many tricky cases (loops, creation of complex hierarchies
// with duplicate file names, duplicate sheet names...)
// So the included sheets names are renamed if existing,
// and filenames are just renamed to avoid loops and
// creation of complex hierarchies.
// If someone want to change it for a better append function, remember
// these cases need work to avoid issues.
if
(
bs
->
Type
()
==
SCH_SHEET_T
)
{
screen
->
Remove
(
(
SCH_SHEET
*
)
bs
);
SCH_SHEET
*
sheet
=
(
SCH_SHEET
*
)
bs
;
time_t
newtimestamp
=
GetNewTimeStamp
();
sheet
->
SetTimeStamp
(
newtimestamp
);
// Check for existing subsheet name in the current sheet
wxString
tmp
=
sheet
->
GetName
();
sheet
->
SetName
(
wxEmptyString
);
const
SCH_SHEET
*
subsheet
=
GetScreen
()
->
GetSheet
(
tmp
);
if
(
subsheet
)
sheet
->
SetName
(
wxString
::
Format
(
wxT
(
"Sheet%8.8lX"
),
(
long
)
newtimestamp
)
);
else
sheet
->
SetName
(
tmp
);
sheet
->
SetFileName
(
wxString
::
Format
(
wxT
(
"file%8.8lX.sch"
),
(
long
)
newtimestamp
)
);
sheet
->
SetScreen
(
new
SCH_SCREEN
(
&
Kiway
()
)
);
sheet
->
GetScreen
()
->
SetFileName
(
sheet
->
GetFileName
()
);
}
// clear annotation and init new time stamp for the new components
else
if
(
bs
->
Type
()
==
SCH_COMPONENT_T
)
...
...
@@ -383,7 +424,7 @@ bool SCH_EDIT_FRAME::AppendOneEEProject()
bs
->
ClearFlags
();
}
bs
=
bs
->
Next
()
;
bs
=
nextbs
;
}
}
...
...
eeschema/libeditframe.cpp
View file @
c586d973
...
...
@@ -1191,9 +1191,6 @@ LIB_ITEM* LIB_EDIT_FRAME::LocateItemUsingCursor( const wxPoint& aPosition,
LIB_ITEM
*
item
=
locateItem
(
aPosition
,
aFilterList
);
if
(
item
==
NULL
)
return
NULL
;
wxPoint
pos
=
GetNearestGridPosition
(
aPosition
);
if
(
item
==
NULL
&&
aPosition
!=
pos
)
...
...
eeschema/load_one_schematic_file.cpp
View file @
c586d973
...
...
@@ -148,7 +148,7 @@ again." );
// EELAYER i j
// and the last line is
// EELAYER END
// Skip all lines until
end end of header EELAYER END
is found
// Skip all lines until
the end of header "EELAYER END"
is found
while
(
reader
.
ReadLine
()
)
{
line
=
reader
.
Line
();
...
...
eeschema/onleftclick.cpp
View file @
c586d973
...
...
@@ -112,16 +112,13 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
item
=
LocateAndShowItem
(
aPosition
,
SCH_COLLECTOR
::
SheetsOnly
);
if
(
item
)
if
(
item
)
// The user has clicked on a sheet: this is an enter sheet command
{
m_CurrentSheet
->
Push
(
(
SCH_SHEET
*
)
item
);
DisplayCurrentSheet
();
}
else
{
wxCHECK_RET
(
m_CurrentSheet
->
Last
()
!=
g_RootSheet
,
wxT
(
"Cannot leave root sheet. Bad Programmer!"
)
);
else
if
(
m_CurrentSheet
->
Last
()
!=
g_RootSheet
)
{
// The user has clicked ouside a sheet:this is an leave sheet command
m_CurrentSheet
->
Pop
();
DisplayCurrentSheet
();
}
...
...
eeschema/sch_component.cpp
View file @
c586d973
...
...
@@ -276,10 +276,11 @@ void SCH_COMPONENT::ResolveAll(
{
for
(
int
i
=
0
;
i
<
aComponents
.
GetCount
();
++
i
)
{
SCH_COMPONENT
*
c
=
dynamic_cast
<
SCH_COMPONENT
*>
(
aComponents
[
i
]
);
wxASSERT
(
c
);
SCH_COMPONENT
*
c
mp
=
dynamic_cast
<
SCH_COMPONENT
*>
(
aComponents
[
i
]
);
wxASSERT
(
c
mp
);
c
->
Resolve
(
aLibs
);
if
(
cmp
)
// cmp == NULL should not occur.
cmp
->
Resolve
(
aLibs
);
}
}
...
...
include/plot_common.h
View file @
c586d973
...
...
@@ -673,6 +673,7 @@ public:
{
// Avoid non initialized variables:
pageStreamHandle
=
streamLengthHandle
=
fontResDictHandle
=
0
;
pageTreeHandle
=
0
;
}
virtual
PlotFormat
GetPlotterType
()
const
...
...
pcbnew/dialogs/dialog_netlist.cpp
View file @
c586d973
...
...
@@ -43,6 +43,7 @@
#include <class_board_design_settings.h>
#include <class_board.h>
#include <class_module.h>
#include <ratsnest_data.h>
#include <wildcards_and_files_ext.h>
#include <dialog_netlist.h>
...
...
@@ -331,6 +332,10 @@ void DIALOG_NETLIST::OnTestFootprintsClick( wxCommandEvent& event )
void
DIALOG_NETLIST
::
OnCompileRatsnestClick
(
wxCommandEvent
&
event
)
{
// Rebuild the board connectivity:
if
(
m_parent
->
IsGalCanvasActive
()
)
m_parent
->
GetBoard
()
->
GetRatsnest
()
->
ProcessBoard
();
m_parent
->
Compile_Ratsnest
(
m_dc
,
true
);
}
...
...
pcbnew/netlist.cpp
View file @
c586d973
...
...
@@ -136,7 +136,7 @@ void PCB_EDIT_FRAME::ReadPcbNetlist( const wxString& aNetlistFileName,
// Rebuild the board connectivity:
if
(
IsGalCanvasActive
()
)
board
->
GetRatsnest
()
->
ProcessBoard
();
else
Compile_Ratsnest
(
NULL
,
true
);
SetMsgPanel
(
board
);
...
...
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