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
08f3c56d
Commit
08f3c56d
authored
Feb 25, 2011
by
Marco Mattila
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show progress dialog when filling all zones in pcbnew.
parent
858401d2
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
29 deletions
+43
-29
class_zone.h
pcbnew/class_zone.h
+8
-1
zones_by_polygon_fill_functions.cpp
pcbnew/zones_by_polygon_fill_functions.cpp
+35
-28
No files found.
pcbnew/class_zone.h
View file @
08f3c56d
...
...
@@ -168,11 +168,18 @@ public:
/**
* Function SetNetNameFromNetCode
* Fin
the na
t name corresponding to the net code.
* Fin
d the ne
t name corresponding to the net code.
* @return bool - true if net found, else false
*/
bool
SetNetNameFromNetCode
(
void
);
/**
* Function GetNetName
* returns the net name.
* @return wxString - The net name.
*/
wxString
GetNetName
()
const
{
return
m_Netname
;
};
/**
* Function HitTest
* tests if the given wxPoint is within the bounds of this object.
...
...
pcbnew/zones_by_polygon_fill_functions.cpp
View file @
08f3c56d
...
...
@@ -25,6 +25,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <wx/progdlg.h>
#include "fctsys.h"
#include "appl_wxstruct.h"
#include "common.h"
...
...
@@ -110,25 +111,14 @@ int WinEDA_PcbFrame::Fill_Zone( ZONE_CONTAINER* zone_container, bool verbose )
return
-
1
;
}
/
* Shows the Net */
/
/ Shows the net
g_Zone_Default_Setting
.
m_NetcodeSelection
=
zone_container
->
GetNet
();
msg
=
zone_container
->
GetNetName
();
if
(
zone_container
->
GetNet
()
>
0
)
{
NETINFO_ITEM
*
net
=
GetBoard
()
->
FindNet
(
zone_container
->
GetNet
()
);
if
(
net
==
NULL
)
{
if
(
verbose
)
wxMessageBox
(
wxT
(
"Unable to find Net name"
)
);
return
-
2
;
}
else
msg
=
net
->
GetNetname
();
}
else
msg
=
_
(
"No Net"
);
if
(
msg
.
IsEmpty
()
)
msg
=
wxT
(
"No net"
);
Affiche_1_Parametre
(
this
,
22
,
_
(
"NetName"
),
msg
,
RED
);
wxBusyCursor
dummy
;
// Shows an hourglass cursor (removed by its destructor)
zone_container
->
m_FilledPolysList
.
clear
();
...
...
@@ -141,10 +131,7 @@ int WinEDA_PcbFrame::Fill_Zone( ZONE_CONTAINER* zone_container, bool verbose )
}
/************************************************************/
int
WinEDA_PcbFrame
::
Fill_All_Zones
(
bool
verbose
)
/************************************************************/
/**
* Function Fill_All_Zones
* Fill all zones on the board
...
...
@@ -153,23 +140,43 @@ int WinEDA_PcbFrame::Fill_All_Zones( bool verbose )
* @return error level (0 = no error)
*/
{
ZONE_CONTAINER
*
zone_container
;
int
error_level
=
0
;
int
errorLevel
=
0
;
int
areaCount
=
GetBoard
()
->
GetAreaCount
();
wxBusyCursor
dummyCursor
;
wxProgressDialog
progressDialog
(
wxT
(
"Fill All Zones"
),
wxT
(
"Starting zone fill..."
),
areaCount
+
2
,
this
,
wxPD_AUTO_HIDE
|
wxPD_APP_MODAL
|
wxPD_CAN_ABORT
);
progressDialog
.
SetMinSize
(
wxSize
(
400
,
100
)
);
// Remove
all zones :
// Remove
segment zones
GetBoard
()
->
m_Zone
.
DeleteAll
();
for
(
int
ii
=
0
;
ii
<
GetBoard
()
->
GetAreaCount
();
ii
++
)
int
ii
;
for
(
ii
=
0
;
ii
<
areaCount
;
ii
++
)
{
zone_container
=
GetBoard
()
->
GetArea
(
ii
);
error_level
=
Fill_Zone
(
zone_container
,
verbose
);
if
(
error_level
&&
!
verbose
)
ZONE_CONTAINER
*
zoneContainer
=
GetBoard
()
->
GetArea
(
ii
);
wxString
str
;
str
.
Printf
(
wxT
(
"Filling zone %d out of %d (net %s)..."
),
ii
+
1
,
areaCount
,
GetChars
(
zoneContainer
->
GetNetName
()
)
);
if
(
!
progressDialog
.
Update
(
ii
+
1
,
str
)
)
break
;
errorLevel
=
Fill_Zone
(
zoneContainer
,
verbose
);
if
(
errorLevel
&&
!
verbose
)
break
;
}
progressDialog
.
Update
(
ii
+
2
,
wxT
(
"Updating ratsnest..."
)
);
test_connexions
(
NULL
);
Tst_Ratsnest
(
NULL
,
0
);
// Recalculate the active ratsnest, i.e. the unconnected links */
// Recalculate the active ratsnest, i.e. the unconnected links
Tst_Ratsnest
(
NULL
,
0
);
DrawPanel
->
Refresh
(
true
);
return
error_level
;
return
errorLevel
;
}
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