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
fd486a11
Commit
fd486a11
authored
Aug 31, 2011
by
Wayne Stambaugh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prevent duplicate sheet names in schematic editor.
parent
ebaf1454
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
0 deletions
+37
-0
sch_screen.cpp
eeschema/sch_screen.cpp
+17
-0
sheet.cpp
eeschema/sheet.cpp
+10
-0
class_sch_screen.h
include/class_sch_screen.h
+10
-0
No files found.
eeschema/sch_screen.cpp
View file @
fd486a11
...
...
@@ -675,6 +675,23 @@ LIB_PIN* SCH_SCREEN::GetPin( const wxPoint& aPosition, SCH_COMPONENT** aComponen
}
SCH_SHEET
*
SCH_SCREEN
::
GetSheet
(
const
wxString
&
aName
)
{
for
(
SCH_ITEM
*
item
=
GetDrawItems
();
item
!=
NULL
;
item
=
item
->
Next
()
)
{
if
(
item
->
Type
()
!=
SCH_SHEET_T
)
continue
;
SCH_SHEET
*
sheet
=
(
SCH_SHEET
*
)
item
;
if
(
aName
.
CmpNoCase
(
sheet
->
m_SheetName
)
==
0
)
return
sheet
;
}
return
NULL
;
}
SCH_SHEET_PIN
*
SCH_SCREEN
::
GetSheetLabel
(
const
wxPoint
&
aPosition
)
{
SCH_SHEET_PIN
*
sheetPin
=
NULL
;
...
...
eeschema/sheet.cpp
View file @
fd486a11
...
...
@@ -65,6 +65,16 @@ bool SCH_EDIT_FRAME::EditSheet( SCH_SHEET* aSheet, wxDC* aDC )
return
false
;
}
// Duplicate sheet names are not valid.
const
SCH_SHEET
*
sheet
=
GetScreen
()
->
GetSheet
(
dlg
.
GetSheetName
()
);
if
(
(
sheet
!=
NULL
)
&&
(
sheet
!=
aSheet
)
)
{
DisplayError
(
this
,
wxString
::
Format
(
_
(
"A sheet named
\"
%s
\"
already exists."
),
GetChars
(
dlg
.
GetSheetName
()
)
)
);
return
false
;
}
wxString
msg
;
wxString
tmp
;
bool
loadFromFile
=
false
;
...
...
include/class_sch_screen.h
View file @
fd486a11
...
...
@@ -305,6 +305,16 @@ public:
LIB_PIN
*
GetPin
(
const
wxPoint
&
aPosition
,
SCH_COMPONENT
**
aComponent
=
NULL
,
bool
aEndPointOnly
=
false
)
const
;
/**
* Function GetSheet
* returns a sheet object pointer that is named \a aName.
*
* @note The screen hierarchy is not descened.
* @param aName is the case insensitive name of the sheet.
* @return A pointer to the SCH_SHEET object found or NULL.
*/
SCH_SHEET
*
GetSheet
(
const
wxString
&
aName
);
/**
* Function GetSheetLabel
* test the screen if \a aPosition is a sheet label object.
...
...
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