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
c29ee59c
Commit
c29ee59c
authored
Oct 08, 2014
by
Mark Roszko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Centralize error count update logic, clear the count on marker deletion.
parent
1d80fb74
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
22 deletions
+19
-22
dialog_erc.cpp
eeschema/dialogs/dialog_erc.cpp
+18
-22
dialog_erc.h
eeschema/dialogs/dialog_erc.h
+1
-0
No files found.
eeschema/dialogs/dialog_erc.cpp
View file @
c29ee59c
...
...
@@ -88,8 +88,21 @@ void DIALOG_ERC::Init()
m_WriteResultOpt
->
SetValue
(
m_writeErcFile
);
SCH_SCREENS
screens
;
int
markers
=
screens
.
GetMarkerCount
();
int
warnings
=
screens
.
GetMarkerCount
(
WAR
);
updateMarkerCounts
(
&
screens
);
DisplayERC_MarkersList
();
// Init Panel Matrix
ReBuildMatrixPanel
();
// Set the run ERC button as the default button.
m_buttonERC
->
SetDefault
();
}
void
DIALOG_ERC
::
updateMarkerCounts
(
SCH_SCREENS
*
screens
)
{
int
markers
=
screens
->
GetMarkerCount
();
int
warnings
=
screens
->
GetMarkerCount
(
WAR
);
wxString
num
;
num
.
Printf
(
wxT
(
"%d"
),
markers
);
...
...
@@ -100,14 +113,6 @@ void DIALOG_ERC::Init()
num
.
Printf
(
wxT
(
"%d"
),
warnings
);
m_LastWarningCount
->
SetValue
(
num
);
DisplayERC_MarkersList
();
// Init Panel Matrix
ReBuildMatrixPanel
();
// Set the run ERC button as the default button.
m_buttonERC
->
SetDefault
();
}
/* Delete the old ERC markers, over the whole hierarchy
...
...
@@ -117,6 +122,8 @@ void DIALOG_ERC::OnEraseDrcMarkersClick( wxCommandEvent& event )
SCH_SCREENS
ScreenList
;
ScreenList
.
DeleteAllMarkers
(
MARK_ERC
);
updateMarkerCounts
(
&
ScreenList
);
m_MarkersList
->
ClearList
();
m_parent
->
GetCanvas
()
->
Refresh
();
}
...
...
@@ -521,18 +528,7 @@ void DIALOG_ERC::TestErc( wxArrayString* aMessagesList )
}
// Displays global results:
wxString
num
;
int
markers
=
screens
.
GetMarkerCount
();
int
warnings
=
screens
.
GetMarkerCount
(
WAR
);
num
.
Printf
(
wxT
(
"%d"
),
markers
);
m_TotalErrCount
->
SetValue
(
num
);
num
.
Printf
(
wxT
(
"%d"
),
markers
-
warnings
);
m_LastErrCount
->
SetValue
(
num
);
num
.
Printf
(
wxT
(
"%d"
),
warnings
);
m_LastWarningCount
->
SetValue
(
num
);
updateMarkerCounts
(
&
screens
);
// Display diags:
DisplayERC_MarkersList
();
...
...
eeschema/dialogs/dialog_erc.h
View file @
c29ee59c
...
...
@@ -62,6 +62,7 @@ private:
void
ChangeErrorLevel
(
wxCommandEvent
&
event
);
void
ReBuildMatrixPanel
();
void
setDRCMatrixButtonState
(
wxBitmapButton
*
aButton
,
int
aState
);
void
updateMarkerCounts
(
SCH_SCREENS
*
screens
);
};
...
...
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