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
8a5179fc
Commit
8a5179fc
authored
Jun 11, 2009
by
charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pcbnew: fixed serious bug in clean pcb function
some cleanup.
parent
f43d1aaa
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
44 deletions
+19
-44
drawframe.cpp
common/drawframe.cpp
+0
-5
edaappl.cpp
common/edaappl.cpp
+3
-17
projet_config.cpp
common/projet_config.cpp
+4
-4
clean.cpp
pcbnew/clean.cpp
+12
-13
pcbcfg.cpp
pcbnew/pcbcfg.cpp
+0
-5
No files found.
common/drawframe.cpp
View file @
8a5179fc
...
@@ -576,11 +576,6 @@ void WinEDA_DrawFrame::AdjustScrollBars()
...
@@ -576,11 +576,6 @@ void WinEDA_DrawFrame::AdjustScrollBars()
screen
->
m_ScrollbarPos
=
scrollbar_pos
;
screen
->
m_ScrollbarPos
=
scrollbar_pos
;
screen
->
m_ScrollbarNumber
=
scrollbar_number
;
screen
->
m_ScrollbarNumber
=
scrollbar_number
;
wxLogDebug
(
wxT
(
"SetScrollbars(%d, %d, %d, %d, %d, %d)"
),
screen
->
m_ZoomScalar
,
screen
->
m_ZoomScalar
,
screen
->
m_ScrollbarNumber
.
x
,
screen
->
m_ScrollbarNumber
.
y
,
screen
->
m_ScrollbarPos
.
x
,
screen
->
m_ScrollbarPos
.
y
);
DrawPanel
->
SetScrollbars
(
screen
->
m_ZoomScalar
,
DrawPanel
->
SetScrollbars
(
screen
->
m_ZoomScalar
,
screen
->
m_ZoomScalar
,
screen
->
m_ZoomScalar
,
screen
->
m_ScrollbarNumber
.
x
,
screen
->
m_ScrollbarNumber
.
x
,
...
...
common/edaappl.cpp
View file @
8a5179fc
...
@@ -527,8 +527,6 @@ void WinEDA_App::SetDefaultSearchPaths( void )
...
@@ -527,8 +527,6 @@ void WinEDA_App::SetDefaultSearchPaths( void )
{
{
if
(
!
wxFileName
::
IsDirReadable
(
m_searchPaths
[
i
]
)
)
if
(
!
wxFileName
::
IsDirReadable
(
m_searchPaths
[
i
]
)
)
{
{
wxLogDebug
(
wxT
(
"Removing <"
)
+
m_searchPaths
[
i
]
+
wxT
(
"> from search path list."
)
);
m_searchPaths
.
RemoveAt
(
i
);
m_searchPaths
.
RemoveAt
(
i
);
i
-=
1
;
i
-=
1
;
}
}
...
@@ -545,17 +543,13 @@ void WinEDA_App::SetDefaultSearchPaths( void )
...
@@ -545,17 +543,13 @@ void WinEDA_App::SetDefaultSearchPaths( void )
fn
.
AppendDir
(
wxT
(
"library"
)
);
fn
.
AppendDir
(
wxT
(
"library"
)
);
if
(
fn
.
IsDirReadable
()
)
if
(
fn
.
IsDirReadable
()
)
{
{
wxLogDebug
(
wxT
(
"Adding <%s> to search path list"
),
m_libSearchPaths
.
Add
(
fn
.
GetPath
()
);
fn
.
GetPath
().
c_str
()
);
m_libSearchPaths
.
Add
(
fn
.
GetPath
()
);
}
}
/* Add schematic doc file path (library/doc)to search path list. */
/* Add schematic doc file path (library/doc)to search path list. */
fn
.
AppendDir
(
wxT
(
"doc"
)
);
fn
.
AppendDir
(
wxT
(
"doc"
)
);
if
(
fn
.
IsDirReadable
()
)
if
(
fn
.
IsDirReadable
()
)
{
{
wxLogDebug
(
wxT
(
"Adding <%s> to search path list"
),
fn
.
GetPath
().
c_str
()
);
m_libSearchPaths
.
Add
(
fn
.
GetPath
()
);
m_libSearchPaths
.
Add
(
fn
.
GetPath
()
);
}
}
fn
.
RemoveLastDir
();
fn
.
RemoveLastDir
();
...
@@ -569,9 +563,7 @@ void WinEDA_App::SetDefaultSearchPaths( void )
...
@@ -569,9 +563,7 @@ void WinEDA_App::SetDefaultSearchPaths( void )
if
(
fn
.
IsDirReadable
()
)
if
(
fn
.
IsDirReadable
()
)
{
{
wxLogDebug
(
wxT
(
"Adding <%s> to library search path list"
),
m_libSearchPaths
.
Add
(
fn
.
GetPath
()
);
fn
.
GetPath
().
c_str
()
);
m_libSearchPaths
.
Add
(
fn
.
GetPath
()
);
}
}
/* Add 3D module library file path to search path list. */
/* Add 3D module library file path to search path list. */
...
@@ -579,8 +571,6 @@ void WinEDA_App::SetDefaultSearchPaths( void )
...
@@ -579,8 +571,6 @@ void WinEDA_App::SetDefaultSearchPaths( void )
if
(
fn
.
IsDirReadable
()
)
if
(
fn
.
IsDirReadable
()
)
{
{
wxLogDebug
(
wxT
(
"Adding <%s> to search path list"
),
fn
.
GetPath
().
c_str
()
);
m_libSearchPaths
.
Add
(
fn
.
GetPath
()
);
m_libSearchPaths
.
Add
(
fn
.
GetPath
()
);
}
}
fn
.
RemoveLastDir
();
fn
.
RemoveLastDir
();
...
@@ -591,9 +581,7 @@ void WinEDA_App::SetDefaultSearchPaths( void )
...
@@ -591,9 +581,7 @@ void WinEDA_App::SetDefaultSearchPaths( void )
if
(
fn
.
IsDirReadable
()
)
if
(
fn
.
IsDirReadable
()
)
{
{
wxLogDebug
(
wxT
(
"Adding <%s> to search path list"
),
m_libSearchPaths
.
Add
(
fn
.
GetPath
()
);
fn
.
GetPath
().
c_str
()
);
m_libSearchPaths
.
Add
(
fn
.
GetPath
()
);
}
}
fn
.
RemoveLastDir
();
fn
.
RemoveLastDir
();
}
}
...
@@ -839,8 +827,6 @@ wxString WinEDA_App::FindFileInSearchPaths( const wxString& filename,
...
@@ -839,8 +827,6 @@ wxString WinEDA_App::FindFileInSearchPaths( const wxString& filename,
if
(
fn
.
DirExists
()
)
if
(
fn
.
DirExists
()
)
{
{
wxLogDebug
(
_T
(
"Adding <"
)
+
fn
.
GetPath
()
+
_T
(
"> to "
)
+
_T
(
"file
\"
"
)
+
filename
+
_T
(
"
\"
search path."
)
);
paths
.
Add
(
fn
.
GetPath
()
);
paths
.
Add
(
fn
.
GetPath
()
);
}
}
}
}
...
...
common/projet_config.cpp
View file @
8a5179fc
...
@@ -46,12 +46,12 @@ bool WinEDA_App::ReCreatePrjConfig( const wxString& fileName,
...
@@ -46,12 +46,12 @@ bool WinEDA_App::ReCreatePrjConfig( const wxString& fileName,
m_ProjectConfig
=
NULL
;
m_ProjectConfig
=
NULL
;
}
}
/* Check just in case the file name does not a kicad project extension. */
/* Check the file name does not a kicad project extension.
* This allows the user to enter a filename without extension
* or use an existing name to create te project file
*/
if
(
fn
.
GetExt
()
!=
ProjectFileExtension
)
if
(
fn
.
GetExt
()
!=
ProjectFileExtension
)
{
{
wxLogDebug
(
wxT
(
"ReCreatePrjConfig() called with project file <%s> \
which does not have the correct file extension."
),
fn
.
GetFullPath
().
c_str
()
);
fn
.
SetExt
(
ProjectFileExtension
);
fn
.
SetExt
(
ProjectFileExtension
);
}
}
...
...
pcbnew/clean.cpp
View file @
8a5179fc
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
#define POS_AFF_NUMSEGM 70
#define POS_AFF_NUMSEGM 70
/* local functions : */
/* local functions : */
static
int
clean_segments
(
WinEDA_PcbFrame
*
frame
,
wxDC
*
DC
);
static
int
clean_segments
(
WinEDA_PcbFrame
*
frame
);
static
void
DeleteUnconnectedTracks
(
WinEDA_PcbFrame
*
frame
,
wxDC
*
DC
);
static
void
DeleteUnconnectedTracks
(
WinEDA_PcbFrame
*
frame
,
wxDC
*
DC
);
static
TRACK
*
AlignSegment
(
BOARD
*
Pcb
,
TRACK
*
pt_ref
,
TRACK
*
pt_segm
,
int
extremite
);
static
TRACK
*
AlignSegment
(
BOARD
*
Pcb
,
TRACK
*
pt_ref
,
TRACK
*
pt_segm
,
int
extremite
);
static
void
Clean_Pcb_Items
(
WinEDA_PcbFrame
*
frame
,
wxDC
*
DC
);
static
void
Clean_Pcb_Items
(
WinEDA_PcbFrame
*
frame
,
wxDC
*
DC
);
...
@@ -142,7 +142,7 @@ void Clean_Pcb_Items( WinEDA_PcbFrame* frame, wxDC* DC )
...
@@ -142,7 +142,7 @@ void Clean_Pcb_Items( WinEDA_PcbFrame* frame, wxDC* DC )
/* Remove null segments and intermediate points on aligned segments */
/* Remove null segments and intermediate points on aligned segments */
if
(
s_MergeSegments
)
if
(
s_MergeSegments
)
clean_segments
(
frame
,
DC
);
clean_segments
(
frame
);
/* Delete dangling tracks */
/* Delete dangling tracks */
if
(
s_DeleteUnconnectedSegm
)
if
(
s_DeleteUnconnectedSegm
)
...
@@ -388,11 +388,11 @@ static void DeleteUnconnectedTracks( WinEDA_PcbFrame* frame, wxDC* DC )
...
@@ -388,11 +388,11 @@ static void DeleteUnconnectedTracks( WinEDA_PcbFrame* frame, wxDC* DC )
/************************************************************/
/************************************************************/
static
int
clean_segments
(
WinEDA_PcbFrame
*
frame
,
wxDC
*
DC
)
static
int
clean_segments
(
WinEDA_PcbFrame
*
frame
)
/************************************************************/
/************************************************************/
/* Delete null lenght segments, and intermediate points .. */
/* Delete null lenght segments, and intermediate points .. */
{
{
TRACK
*
segment
;
TRACK
*
segment
,
*
nextsegment
;
TRACK
*
other
;
TRACK
*
other
;
int
ii
,
nbpoints_supprimes
=
0
;
int
ii
,
nbpoints_supprimes
=
0
;
int
flag
,
no_inc
,
percent
,
oldpercent
;
int
flag
,
no_inc
,
percent
,
oldpercent
;
...
@@ -414,13 +414,13 @@ static int clean_segments( WinEDA_PcbFrame* frame, wxDC* DC )
...
@@ -414,13 +414,13 @@ static int clean_segments( WinEDA_PcbFrame* frame, wxDC* DC )
Affiche_1_Parametre
(
frame
,
POS_AFF_VAR
,
wxT
(
"NullSeg"
),
wxT
(
"0"
),
a_color
);
Affiche_1_Parametre
(
frame
,
POS_AFF_VAR
,
wxT
(
"NullSeg"
),
wxT
(
"0"
),
a_color
);
for
(
segment
=
frame
->
GetBoard
()
->
m_Track
;
segment
;
segment
=
segment
->
Next
()
)
for
(
segment
=
frame
->
GetBoard
()
->
m_Track
;
segment
;
segment
=
nextsegment
)
{
{
nextsegment
=
segment
->
Next
();
if
(
!
segment
->
IsNull
()
)
if
(
!
segment
->
IsNull
()
)
continue
;
continue
;
/* Length segment = 0; delete it */
/* Length segment = 0; delete it */
segment
->
Draw
(
frame
->
DrawPanel
,
DC
,
GR_XOR
);
segment
->
DeleteStructure
();
segment
->
DeleteStructure
();
nbpoints_supprimes
++
;
nbpoints_supprimes
++
;
...
@@ -456,8 +456,9 @@ static int clean_segments( WinEDA_PcbFrame* frame, wxDC* DC )
...
@@ -456,8 +456,9 @@ static int clean_segments( WinEDA_PcbFrame* frame, wxDC* DC )
return
-
1
;
return
-
1
;
}
}
for
(
other
=
segment
->
Next
();
other
;
other
=
other
->
Next
()
)
for
(
other
=
segment
->
Next
();
other
;
other
=
nextsegment
)
{
{
nextsegment
=
other
->
Next
();
int
erase
=
0
;
int
erase
=
0
;
if
(
segment
->
Type
()
!=
other
->
Type
()
)
if
(
segment
->
Type
()
!=
other
->
Type
()
)
...
@@ -485,7 +486,6 @@ static int clean_segments( WinEDA_PcbFrame* frame, wxDC* DC )
...
@@ -485,7 +486,6 @@ static int clean_segments( WinEDA_PcbFrame* frame, wxDC* DC )
if
(
erase
)
if
(
erase
)
{
{
ii
--
;
ii
--
;
other
->
Draw
(
frame
->
DrawPanel
,
DC
,
GR_OR
);
other
->
DeleteStructure
();
other
->
DeleteStructure
();
nbpoints_supprimes
++
;
nbpoints_supprimes
++
;
...
@@ -507,14 +507,13 @@ static int clean_segments( WinEDA_PcbFrame* frame, wxDC* DC )
...
@@ -507,14 +507,13 @@ static int clean_segments( WinEDA_PcbFrame* frame, wxDC* DC )
Affiche_1_Parametre
(
frame
,
POS_AFF_VAR
,
_
(
"Merge"
),
_
(
"0"
),
a_color
);
Affiche_1_Parametre
(
frame
,
POS_AFF_VAR
,
_
(
"Merge"
),
_
(
"0"
),
a_color
);
ii
=
0
;
ii
=
0
;
TRACK
*
next
;
for
(
segment
=
frame
->
GetBoard
()
->
m_Track
;
segment
;
segment
=
nextsegment
)
for
(
segment
=
frame
->
GetBoard
()
->
m_Track
;
segment
;
segment
=
next
)
{
{
TRACK
*
segStart
;
TRACK
*
segStart
;
TRACK
*
segEnd
;
TRACK
*
segEnd
;
TRACK
*
segDelete
;
TRACK
*
segDelete
;
next
=
segment
->
Next
();
next
segment
=
segment
->
Next
();
ii
++
;
ii
++
;
percent
=
(
100
*
ii
)
/
frame
->
GetBoard
()
->
m_Track
.
GetCount
();
percent
=
(
100
*
ii
)
/
frame
->
GetBoard
()
->
m_Track
.
GetCount
();
...
@@ -620,11 +619,11 @@ static int clean_segments( WinEDA_PcbFrame* frame, wxDC* DC )
...
@@ -620,11 +619,11 @@ static int clean_segments( WinEDA_PcbFrame* frame, wxDC* DC )
msg
.
Printf
(
wxT
(
"%d "
),
nbpoints_supprimes
);
msg
.
Printf
(
wxT
(
"%d "
),
nbpoints_supprimes
);
Affiche_1_Parametre
(
frame
,
POS_AFF_VAR
,
wxEmptyString
,
msg
,
a_color
);
Affiche_1_Parametre
(
frame
,
POS_AFF_VAR
,
wxEmptyString
,
msg
,
a_color
);
next
=
segment
->
Next
();
next
segment
=
segment
->
Next
();
}
}
}
}
return
0
;
return
0
;
}
}
...
...
pcbnew/pcbcfg.cpp
View file @
8a5179fc
...
@@ -164,12 +164,7 @@ bool Read_Config( const wxString& projectFileName )
...
@@ -164,12 +164,7 @@ bool Read_Config( const wxString& projectFileName )
int
ii
;
int
ii
;
if
(
fn
.
GetExt
()
!=
ProjectFileExtension
)
if
(
fn
.
GetExt
()
!=
ProjectFileExtension
)
{
wxLogDebug
(
wxT
(
"Attempting to open project file <%s>. Changing \
file extension to a Kicad project file extension (.pro)."
),
fn
.
GetFullPath
().
c_str
()
);
fn
.
SetExt
(
ProjectFileExtension
);
fn
.
SetExt
(
ProjectFileExtension
);
}
wxGetApp
().
RemoveLibraryPath
(
g_UserLibDirBuffer
);
wxGetApp
().
RemoveLibraryPath
(
g_UserLibDirBuffer
);
...
...
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