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
d8ad2cce
Commit
d8ad2cce
authored
Dec 08, 2011
by
Wayne Stambaugh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Encapsulate LIB_PIN class and begin encapsulating SCH_EDIT_FRAME class.
parent
37c3e321
Changes
23
Show whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
160 additions
and
129 deletions
+160
-129
annotate.cpp
eeschema/annotate.cpp
+2
-2
controle.cpp
eeschema/controle.cpp
+1
-1
dialog_SVG_print.cpp
eeschema/dialogs/dialog_SVG_print.cpp
+8
-6
dialog_edit_component_in_schematic.cpp
eeschema/dialogs/dialog_edit_component_in_schematic.cpp
+3
-3
dialog_erc.cpp
eeschema/dialogs/dialog_erc.cpp
+3
-3
dialog_plot_schematic_DXF.cpp
eeschema/dialogs/dialog_plot_schematic_DXF.cpp
+9
-6
dialog_plot_schematic_HPGL.cpp
eeschema/dialogs/dialog_plot_schematic_HPGL.cpp
+7
-6
dialog_plot_schematic_PS.cpp
eeschema/dialogs/dialog_plot_schematic_PS.cpp
+6
-6
dialog_print_using_printer.cpp
eeschema/dialogs/dialog_print_using_printer.cpp
+6
-6
edit_component_in_schematic.cpp
eeschema/edit_component_in_schematic.cpp
+1
-1
find.cpp
eeschema/find.cpp
+3
-3
getpart.cpp
eeschema/getpart.cpp
+2
-2
hierarch.cpp
eeschema/hierarch.cpp
+28
-4
lib_pin.cpp
eeschema/lib_pin.cpp
+36
-43
lib_pin.h
eeschema/lib_pin.h
+7
-13
libeditframe.cpp
eeschema/libeditframe.cpp
+1
-1
onrightclick.cpp
eeschema/onrightclick.cpp
+1
-1
pinedit.cpp
eeschema/pinedit.cpp
+6
-6
sch_component.cpp
eeschema/sch_component.cpp
+2
-1
sch_sheet_path.cpp
eeschema/sch_sheet_path.cpp
+1
-1
schframe.cpp
eeschema/schframe.cpp
+14
-6
viewlib_frame.cpp
eeschema/viewlib_frame.cpp
+1
-1
wxEeschemaStruct.h
include/wxEeschemaStruct.h
+12
-7
No files found.
eeschema/annotate.cpp
View file @
d8ad2cce
...
...
@@ -84,7 +84,7 @@ void SCH_EDIT_FRAME::AnnotateComponents( bool aAnnotateSchematic,
}
else
{
GetSheet
()
->
GetComponents
(
references
);
m_CurrentSheet
->
GetComponents
(
references
);
}
/* Break full components reference in name (prefix) and number:
...
...
@@ -162,7 +162,7 @@ int SCH_EDIT_FRAME::CheckAnnotate( wxArrayString* aMessageList, bool aOneSheetOn
if
(
!
aOneSheetOnly
)
SheetList
.
GetComponents
(
ComponentsList
);
else
GetSheet
()
->
GetComponents
(
ComponentsList
);
m_CurrentSheet
->
GetComponents
(
ComponentsList
);
return
ComponentsList
.
CheckAnnotation
(
aMessageList
);
}
eeschema/controle.cpp
View file @
d8ad2cce
...
...
@@ -106,7 +106,7 @@ SCH_ITEM* SCH_EDIT_FRAME::LocateAndShowItem( const wxPoint& aPosition, const KIC
Pin
->
DisplayInfo
(
this
);
if
(
LibItem
)
AppendMsgPanel
(
LibItem
->
GetRef
(
GetSheet
()
),
AppendMsgPanel
(
LibItem
->
GetRef
(
m_CurrentSheet
),
LibItem
->
GetField
(
VALUE
)
->
m_Text
,
DARKCYAN
);
// Cross probing:2 - pin found, and send a locate pin command to Pcbnew (highlight net)
...
...
eeschema/dialogs/dialog_SVG_print.cpp
View file @
d8ad2cce
...
...
@@ -125,7 +125,8 @@ void DIALOG_SVG_PRINT::PrintSVGDoc( bool aPrintAll, bool aPrint_Sheet_Ref )
if
(
aPrintAll
&&
m_Parent
->
IsType
(
SCHEMATIC_FRAME
)
)
{
SCH_EDIT_FRAME
*
schframe
=
(
SCH_EDIT_FRAME
*
)
m_Parent
;
SCH_SHEET_PATH
*
sheetpath
,
*
oldsheetpath
=
schframe
->
GetSheet
();
SCH_SHEET_PATH
*
sheetpath
;
SCH_SHEET_PATH
oldsheetpath
=
schframe
->
GetCurrentSheet
();
SCH_SCREEN
*
schscreen
=
schframe
->
GetScreen
();
SCH_SHEET_LIST
SheetList
(
NULL
);
sheetpath
=
SheetList
.
GetFirst
();
...
...
@@ -135,14 +136,15 @@ void DIALOG_SVG_PRINT::PrintSVGDoc( bool aPrintAll, bool aPrint_Sheet_Ref )
{
if
(
sheetpath
==
NULL
)
break
;
list
.
Clear
();
if
(
list
.
BuildSheetPathInfoFromSheetPathValue
(
sheetpath
->
Path
()
)
)
{
schframe
->
m_CurrentSheet
=
&
list
;
schframe
->
m_CurrentSheet
->
UpdateAllScreenReferences
();
schframe
->
SetCurrentSheet
(
list
)
;
schframe
->
GetCurrentSheet
().
UpdateAllScreenReferences
();
schframe
->
SetSheetNumberAndCount
();
schscreen
=
schframe
->
m_CurrentSheet
->
LastScreen
();
schscreen
=
schframe
->
GetCurrentSheet
().
LastScreen
();
}
else
// Should not happen
return
;
...
...
@@ -161,8 +163,8 @@ void DIALOG_SVG_PRINT::PrintSVGDoc( bool aPrintAll, bool aPrint_Sheet_Ref )
m_MessagesBox
->
AppendText
(
msg
);
}
schframe
->
m_CurrentSheet
=
oldsheetpath
;
schframe
->
m_CurrentSheet
->
UpdateAllScreenReferences
();
schframe
->
SetCurrentSheet
(
oldsheetpath
)
;
schframe
->
GetCurrentSheet
().
UpdateAllScreenReferences
();
schframe
->
SetSheetNumberAndCount
();
}
else
...
...
eeschema/dialogs/dialog_edit_component_in_schematic.cpp
View file @
d8ad2cce
...
...
@@ -167,7 +167,7 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copyPanelToOptions()
if
(
m_Cmp
->
GetUnit
()
)
{
int
unit_selection
=
unitChoice
->
GetCurrentSelection
()
+
1
;
m_Cmp
->
SetUnitSelection
(
m_Parent
->
Ge
tSheet
(),
unit_selection
);
m_Cmp
->
SetUnitSelection
(
&
m_Parent
->
GetCurren
tSheet
(),
unit_selection
);
m_Cmp
->
SetUnit
(
unit_selection
);
}
...
...
@@ -279,7 +279,7 @@ Do you wish to remove this and all remaining undefined fields?" ),
// Reference has a specific initialization, depending on the current active sheet
// because for a given component, in a complex hierarchy, there are more than one
// reference.
m_Cmp
->
SetRef
(
m_Parent
->
Ge
tSheet
(),
m_FieldsBuf
[
REFERENCE
].
m_Text
);
m_Cmp
->
SetRef
(
&
m_Parent
->
GetCurren
tSheet
(),
m_FieldsBuf
[
REFERENCE
].
m_Text
);
m_Parent
->
OnModify
();
m_Parent
->
GetScreen
()
->
TestDanglingEnds
();
...
...
@@ -520,7 +520,7 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::InitBuffers( SCH_COMPONENT* aComponent
}
#endif
m_FieldsBuf
[
REFERENCE
].
m_Text
=
m_Cmp
->
GetRef
(
m_Parent
->
Ge
tSheet
()
);
m_FieldsBuf
[
REFERENCE
].
m_Text
=
m_Cmp
->
GetRef
(
&
m_Parent
->
GetCurren
tSheet
()
);
for
(
unsigned
i
=
0
;
i
<
m_FieldsBuf
.
size
();
++
i
)
{
...
...
eeschema/dialogs/dialog_erc.cpp
View file @
d8ad2cce
...
...
@@ -196,11 +196,11 @@ void DIALOG_ERC::OnLeftDClickMarkersList( wxCommandEvent& event )
return
;
}
if
(
sheet
!=
m_Parent
->
Ge
tSheet
()
)
if
(
*
sheet
!=
m_Parent
->
GetCurren
tSheet
()
)
{
sheet
->
LastScreen
()
->
SetZoom
(
m_Parent
->
GetScreen
()
->
GetZoom
()
);
*
m_Parent
->
m_CurrentSheet
=
*
sheet
;
m_Parent
->
m_CurrentSheet
->
UpdateAllScreenReferences
();
m_Parent
->
SetCurrentSheet
(
*
sheet
)
;
m_Parent
->
GetCurrentSheet
().
UpdateAllScreenReferences
();
}
m_Parent
->
GetScreen
()
->
SetCrossHairPosition
(
pos
);
...
...
eeschema/dialogs/dialog_plot_schematic_DXF.cpp
View file @
d8ad2cce
...
...
@@ -145,7 +145,8 @@ void DIALOG_PLOT_SCHEMATIC_DXF::CreateDXFFile( )
{
SCH_EDIT_FRAME
*
schframe
=
(
SCH_EDIT_FRAME
*
)
m_Parent
;
SCH_SCREEN
*
screen
=
schframe
->
GetScreen
();
SCH_SHEET_PATH
*
sheetpath
,
*
oldsheetpath
=
schframe
->
GetSheet
();
SCH_SHEET_PATH
*
sheetpath
;
SCH_SHEET_PATH
oldsheetpath
=
schframe
->
GetCurrentSheet
();
wxString
PlotFileName
;
Ki_PageDescr
*
PlotSheet
;
wxPoint
plot_offset
;
...
...
@@ -172,13 +173,15 @@ void DIALOG_PLOT_SCHEMATIC_DXF::CreateDXFFile( )
if
(
list
.
BuildSheetPathInfoFromSheetPathValue
(
sheetpath
->
Path
()
)
)
{
schframe
->
m_CurrentSheet
=
&
list
;
schframe
->
m_CurrentSheet
->
UpdateAllScreenReferences
();
schframe
->
SetCurrentSheet
(
list
)
;
schframe
->
GetCurrentSheet
().
UpdateAllScreenReferences
();
schframe
->
SetSheetNumberAndCount
();
screen
=
schframe
->
m_CurrentSheet
->
LastScreen
();
screen
=
schframe
->
GetCurrentSheet
().
LastScreen
();
}
else
// Should not happen
{
return
;
}
sheetpath
=
SheetList
.
GetNext
();
}
...
...
@@ -197,8 +200,8 @@ void DIALOG_PLOT_SCHEMATIC_DXF::CreateDXFFile( )
break
;
}
schframe
->
m_CurrentSheet
=
oldsheetpath
;
schframe
->
m_CurrentSheet
->
UpdateAllScreenReferences
();
schframe
->
SetCurrentSheet
(
oldsheetpath
)
;
schframe
->
GetCurrentSheet
().
UpdateAllScreenReferences
();
schframe
->
SetSheetNumberAndCount
();
}
...
...
eeschema/dialogs/dialog_plot_schematic_HPGL.cpp
View file @
d8ad2cce
...
...
@@ -281,7 +281,8 @@ void DIALOG_PLOT_SCHEMATIC_HPGL::Plot_Schematic_HPGL( bool aPlotAll, int HPGL_Sh
{
wxString
PlotFileName
;
SCH_SCREEN
*
screen
=
m_Parent
->
GetScreen
();
SCH_SHEET_PATH
*
sheetpath
,
*
oldsheetpath
=
m_Parent
->
GetSheet
();
SCH_SHEET_PATH
*
sheetpath
;
SCH_SHEET_PATH
oldsheetpath
=
m_Parent
->
GetCurrentSheet
();
Ki_PageDescr
*
PlotSheet
;
wxSize
SheetSize
;
wxPoint
SheetOffset
,
PlotOffset
;
...
...
@@ -308,10 +309,10 @@ void DIALOG_PLOT_SCHEMATIC_HPGL::Plot_Schematic_HPGL( bool aPlotAll, int HPGL_Sh
if
(
list
.
BuildSheetPathInfoFromSheetPathValue
(
sheetpath
->
Path
()
)
)
{
m_Parent
->
m_CurrentSheet
=
&
list
;
m_Parent
->
m_CurrentSheet
->
UpdateAllScreenReferences
();
m_Parent
->
SetCurrentSheet
(
list
)
;
m_Parent
->
GetCurrentSheet
().
UpdateAllScreenReferences
();
m_Parent
->
SetSheetNumberAndCount
();
screen
=
m_Parent
->
m_CurrentSheet
->
LastScreen
();
screen
=
m_Parent
->
GetCurrentSheet
().
LastScreen
();
}
else
// Should not happen
return
;
...
...
@@ -344,8 +345,8 @@ void DIALOG_PLOT_SCHEMATIC_HPGL::Plot_Schematic_HPGL( bool aPlotAll, int HPGL_Sh
break
;
}
m_Parent
->
m_CurrentSheet
=
oldsheetpath
;
m_Parent
->
m_CurrentSheet
->
UpdateAllScreenReferences
();
m_Parent
->
SetCurrentSheet
(
oldsheetpath
)
;
m_Parent
->
GetCurrentSheet
().
UpdateAllScreenReferences
();
m_Parent
->
SetSheetNumberAndCount
();
}
...
...
eeschema/dialogs/dialog_plot_schematic_PS.cpp
View file @
d8ad2cce
...
...
@@ -174,7 +174,7 @@ void DIALOG_PLOT_SCHEMATIC_PS::createPSFile()
{
SCH_SCREEN
*
screen
=
m_Parent
->
GetScreen
();
SCH_SHEET_PATH
*
sheetpath
;
SCH_SHEET_PATH
*
oldsheetpath
=
m_Parent
->
GetSheet
();
// sheetpath is saved here
SCH_SHEET_PATH
oldsheetpath
=
m_Parent
->
GetCurrentSheet
();
// sheetpath is saved here
wxString
plotFileName
;
Ki_PageDescr
*
actualPage
;
// page size selected in schematic
Ki_PageDescr
*
plotPage
;
// page size selected to plot
...
...
@@ -202,10 +202,10 @@ void DIALOG_PLOT_SCHEMATIC_PS::createPSFile()
if
(
list
.
BuildSheetPathInfoFromSheetPathValue
(
sheetpath
->
Path
()
)
)
{
m_Parent
->
m_CurrentSheet
=
&
list
;
m_Parent
->
m_CurrentSheet
->
UpdateAllScreenReferences
();
m_Parent
->
SetCurrentSheet
(
list
)
;
m_Parent
->
GetCurrentSheet
().
UpdateAllScreenReferences
();
m_Parent
->
SetSheetNumberAndCount
();
screen
=
m_Parent
->
m_CurrentSheet
->
LastScreen
();
screen
=
m_Parent
->
GetCurrentSheet
().
LastScreen
();
}
else
// Should not happen
return
;
...
...
@@ -246,8 +246,8 @@ void DIALOG_PLOT_SCHEMATIC_PS::createPSFile()
break
;
}
m_Parent
->
m_CurrentSheet
=
oldsheetpath
;
m_Parent
->
m_CurrentSheet
->
UpdateAllScreenReferences
();
m_Parent
->
SetCurrentSheet
(
oldsheetpath
)
;
m_Parent
->
GetCurrentSheet
().
UpdateAllScreenReferences
();
m_Parent
->
SetSheetNumberAndCount
();
}
...
...
eeschema/dialogs/dialog_print_using_printer.cpp
View file @
d8ad2cce
...
...
@@ -231,17 +231,17 @@ bool SCH_PRINTOUT::OnPrintPage( int page )
parent
->
AppendMsgPanel
(
msg
,
wxEmptyString
,
CYAN
);
SCH_SCREEN
*
screen
=
parent
->
GetScreen
();
SCH_SHEET_PATH
*
oldsheetpath
=
parent
->
Ge
tSheet
();
SCH_SHEET_PATH
oldsheetpath
=
parent
->
GetCurren
tSheet
();
SCH_SHEET_PATH
list
;
SCH_SHEET_LIST
SheetList
(
NULL
);
SCH_SHEET_PATH
*
sheetpath
=
SheetList
.
GetSheet
(
page
-
1
);
if
(
list
.
BuildSheetPathInfoFromSheetPathValue
(
sheetpath
->
Path
()
)
)
{
parent
->
m_CurrentSheet
=
&
list
;
parent
->
m_CurrentSheet
->
UpdateAllScreenReferences
();
parent
->
SetCurrentSheet
(
list
)
;
parent
->
GetCurrentSheet
().
UpdateAllScreenReferences
();
parent
->
SetSheetNumberAndCount
();
screen
=
parent
->
m_CurrentSheet
->
LastScreen
();
screen
=
parent
->
GetCurrentSheet
().
LastScreen
();
}
else
{
...
...
@@ -252,8 +252,8 @@ bool SCH_PRINTOUT::OnPrintPage( int page )
return
false
;
DrawPage
(
screen
);
parent
->
m_CurrentSheet
=
oldsheetpath
;
parent
->
m_CurrentSheet
->
UpdateAllScreenReferences
();
parent
->
SetCurrentSheet
(
oldsheetpath
)
;
parent
->
GetCurrentSheet
().
UpdateAllScreenReferences
();
parent
->
SetSheetNumberAndCount
();
return
true
;
...
...
eeschema/edit_component_in_schematic.cpp
View file @
d8ad2cce
...
...
@@ -106,7 +106,7 @@ create a new power component with the new value." ), GetChars( entry->GetName()
// Test is reference is acceptable:
if
(
SCH_COMPONENT
::
IsReferenceStringValid
(
newtext
)
)
{
component
->
SetRef
(
GetSheet
()
,
newtext
);
component
->
SetRef
(
m_CurrentSheet
,
newtext
);
aField
->
SetText
(
newtext
);
}
else
...
...
eeschema/find.cpp
View file @
d8ad2cce
...
...
@@ -82,7 +82,7 @@ void SCH_EDIT_FRAME::OnFindDrcMarker( wxFindDialogEvent& event )
if
(
lastMarker
!=
NULL
)
{
if
(
sheetFoundIn
!=
GetSheet
()
)
if
(
*
sheetFoundIn
!=
*
m_CurrentSheet
)
{
sheetFoundIn
->
LastScreen
()
->
SetZoom
(
GetScreen
()
->
GetZoom
()
);
*
m_CurrentSheet
=
*
sheetFoundIn
;
...
...
@@ -193,7 +193,7 @@ SCH_ITEM* SCH_EDIT_FRAME::FindComponentAndItem( const wxString& aReference,
{
sheet
=
sheetWithComponentFound
;
if
(
*
sheet
!=
*
GetSheet
()
)
if
(
*
sheet
!=
*
m_CurrentSheet
)
{
sheet
->
LastScreen
()
->
SetZoom
(
GetScreen
()
->
GetZoom
()
);
*
m_CurrentSheet
=
*
sheet
;
...
...
@@ -362,7 +362,7 @@ void SCH_EDIT_FRAME::OnFindSchematicItem( wxFindDialogEvent& aEvent )
wxCHECK_RET
(
sheet
!=
NULL
,
wxT
(
"Could not find sheet path "
)
+
data
.
GetSheetPath
()
);
if
(
sheet
->
PathHumanReadable
()
!=
GetSheet
()
->
PathHumanReadable
()
)
if
(
sheet
->
PathHumanReadable
()
!=
m_CurrentSheet
->
PathHumanReadable
()
)
{
sheet
->
LastScreen
()
->
SetZoom
(
GetScreen
()
->
GetZoom
()
);
*
m_CurrentSheet
=
*
sheet
;
...
...
eeschema/getpart.cpp
View file @
d8ad2cce
...
...
@@ -219,7 +219,7 @@ SCH_COMPONENT* SCH_EDIT_FRAME::Load_Component( wxDC* DC,
lastCommponentName
=
Name
;
AddHistoryComponentName
(
HistoryList
,
Name
);
component
=
new
SCH_COMPONENT
(
*
Entry
,
GetSheet
()
,
unit
,
convert
,
component
=
new
SCH_COMPONENT
(
*
Entry
,
m_CurrentSheet
,
unit
,
convert
,
GetScreen
()
->
GetCrossHairPosition
(),
true
);
// Set the m_ChipName value, from component name in lib, for aliases
...
...
@@ -335,7 +335,7 @@ void SCH_EDIT_FRAME::OnSelectUnit( wxCommandEvent& aEvent )
component
->
Draw
(
DrawPanel
,
&
dc
,
wxPoint
(
0
,
0
),
g_XorMode
);
/* Update the unit number. */
component
->
SetUnitSelection
(
GetSheet
()
,
unit
);
component
->
SetUnitSelection
(
m_CurrentSheet
,
unit
);
component
->
SetUnit
(
unit
);
component
->
ClearFlags
();
component
->
SetFlags
(
flags
);
// Restore m_Flag modified by SetUnit()
...
...
eeschema/hierarch.cpp
View file @
d8ad2cce
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
* Copyright (C) 2008-2011 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 2004-2011 KiCad Developers, see change_log.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file hierarch.cpp
*/
...
...
@@ -136,7 +161,7 @@ HIERARCHY_NAVIG_DLG::HIERARCHY_NAVIG_DLG( SCH_EDIT_FRAME* parent, wxDC* DC, cons
m_TreeSize
.
x
=
itemrect
.
GetWidth
()
+
10
;
m_TreeSize
.
y
=
20
;
if
(
m_Parent
->
Get
Sheet
()
->
Last
()
==
g_RootSheet
)
if
(
m_Parent
->
Get
CurrentSheet
().
Last
()
==
g_RootSheet
)
m_Tree
->
SelectItem
(
cellule
);
//root.
maxposx
=
15
;
...
...
@@ -211,7 +236,7 @@ void HIERARCHY_NAVIG_DLG::BuildSheetsTree( SCH_SHEET_PATH* list, wxTreeItemId*
m_TreeSize
.
x
=
MAX
(
m_TreeSize
.
x
,
ll
);
m_TreeSize
.
y
+=
1
;
if
(
*
list
==
*
(
m_Parent
->
GetSheet
()
)
)
if
(
*
list
==
m_Parent
->
GetCurrentSheet
(
)
)
{
m_Tree
->
EnsureVisible
(
menu
);
m_Tree
->
SelectItem
(
menu
);
...
...
@@ -237,8 +262,7 @@ void HIERARCHY_NAVIG_DLG::OnSelect( wxTreeEvent& event )
{
wxTreeItemId
ItemSel
=
m_Tree
->
GetSelection
();
*
(
m_Parent
->
m_CurrentSheet
)
=
(
(
TreeItemData
*
)
m_Tree
->
GetItemData
(
ItemSel
)
)
->
m_SheetPath
;
m_Parent
->
SetCurrentSheet
((
(
TreeItemData
*
)
m_Tree
->
GetItemData
(
ItemSel
)
)
->
m_SheetPath
);
m_Parent
->
DisplayCurrentSheet
();
Close
(
true
);
}
...
...
eeschema/lib_pin.cpp
View file @
d8ad2cce
...
...
@@ -191,14 +191,10 @@ LIB_PIN::LIB_PIN( LIB_COMPONENT* aParent ) :
m_type
=
PIN_UNSPECIFIED
;
/* electrical type of pin */
m_attributes
=
0
;
/* bit 0 != 0: pin invisible */
m_number
=
0
;
/* pin number ( i.e. 4 codes ASCII ) */
m_
PinNumSize
=
50
;
m_
PinNameSize
=
50
;
/* Default size for pin name and num */
m_
numTextSize
=
50
;
m_
nameTextSize
=
50
;
/* Default size for pin name and num */
m_width
=
0
;
m_typeName
=
_
(
"Pin"
);
m_PinNumShapeOpt
=
0
;
m_PinNameShapeOpt
=
0
;
m_PinNumPositionOpt
=
0
;
m_PinNamePositionOpt
=
0
;
}
...
...
@@ -211,12 +207,8 @@ LIB_PIN::LIB_PIN( const LIB_PIN& pin ) : LIB_ITEM( pin )
m_type
=
pin
.
m_type
;
m_attributes
=
pin
.
m_attributes
;
m_number
=
pin
.
m_number
;
m_PinNumSize
=
pin
.
m_PinNumSize
;
m_PinNameSize
=
pin
.
m_PinNameSize
;
m_PinNumShapeOpt
=
pin
.
m_PinNumShapeOpt
;
m_PinNameShapeOpt
=
pin
.
m_PinNameShapeOpt
;
m_PinNumPositionOpt
=
pin
.
m_PinNumPositionOpt
;
m_PinNamePositionOpt
=
pin
.
m_PinNamePositionOpt
;
m_numTextSize
=
pin
.
m_numTextSize
;
m_nameTextSize
=
pin
.
m_nameTextSize
;
m_width
=
pin
.
m_width
;
m_name
=
pin
.
m_name
;
}
...
...
@@ -253,9 +245,9 @@ void LIB_PIN::SetName( const wxString& aName )
void
LIB_PIN
::
SetNameTextSize
(
int
size
)
{
if
(
size
!=
m_
PinName
Size
)
if
(
size
!=
m_
nameText
Size
)
{
m_
PinName
Size
=
size
;
m_
nameText
Size
=
size
;
SetModified
();
}
...
...
@@ -267,10 +259,10 @@ void LIB_PIN::SetNameTextSize( int size )
for
(
size_t
i
=
0
;
i
<
pinList
.
size
();
i
++
)
{
if
(
(
pinList
[
i
]
->
m_Flags
&
IS_LINKED
)
==
0
||
pinList
[
i
]
->
m_
PinName
Size
==
size
)
if
(
(
pinList
[
i
]
->
m_Flags
&
IS_LINKED
)
==
0
||
pinList
[
i
]
->
m_
nameText
Size
==
size
)
continue
;
pinList
[
i
]
->
m_
PinName
Size
=
size
;
pinList
[
i
]
->
m_
nameText
Size
=
size
;
SetModified
();
}
}
...
...
@@ -297,9 +289,9 @@ void LIB_PIN::SetNumber( const wxString& number )
void
LIB_PIN
::
SetNumberTextSize
(
int
size
)
{
if
(
size
!=
m_
PinNum
Size
)
if
(
size
!=
m_
numText
Size
)
{
m_
PinNum
Size
=
size
;
m_
numText
Size
=
size
;
SetModified
();
}
...
...
@@ -311,10 +303,10 @@ void LIB_PIN::SetNumberTextSize( int size )
for
(
size_t
i
=
0
;
i
<
pinList
.
size
();
i
++
)
{
if
(
(
pinList
[
i
]
->
m_Flags
&
IS_LINKED
)
==
0
||
pinList
[
i
]
->
m_
PinNum
Size
==
size
)
if
(
(
pinList
[
i
]
->
m_Flags
&
IS_LINKED
)
==
0
||
pinList
[
i
]
->
m_
numText
Size
==
size
)
continue
;
pinList
[
i
]
->
m_
PinNum
Size
=
size
;
pinList
[
i
]
->
m_
numText
Size
=
size
;
SetModified
();
}
}
...
...
@@ -639,7 +631,7 @@ bool LIB_PIN::Save( OUTPUTFORMATTER& aFormatter )
if
(
aFormatter
.
Print
(
0
,
" %s %d %d %d %c %d %d %d %d %c"
,
TO_UTF8
(
StringPinNum
),
m_position
.
x
,
m_position
.
y
,
(
int
)
m_length
,
(
int
)
m_orientation
,
m_
PinNumSize
,
m_PinName
Size
,
(
int
)
m_length
,
(
int
)
m_orientation
,
m_
numTextSize
,
m_nameText
Size
,
m_Unit
,
m_Convert
,
Etype
)
<
0
)
return
false
;
...
...
@@ -692,8 +684,8 @@ bool LIB_PIN::Load( LINE_READER& aLineReader, wxString& aErrorMsg )
*
pinAttrs
=
0
;
i
=
sscanf
(
line
+
2
,
"%s %s %d %d %d %s %d %d %d %d %s %s"
,
pinName
,
pinNum
,
&
m_position
.
x
,
&
m_position
.
y
,
&
m_length
,
pinOrient
,
&
m_
PinNum
Size
,
&
m_
PinName
Size
,
&
m_Unit
,
&
m_Convert
,
pinType
,
pinAttrs
);
pinNum
,
&
m_position
.
x
,
&
m_position
.
y
,
&
m_length
,
pinOrient
,
&
m_
numText
Size
,
&
m_
nameText
Size
,
&
m_Unit
,
&
m_Convert
,
pinType
,
pinAttrs
);
if
(
i
<
11
)
{
...
...
@@ -1099,14 +1091,14 @@ void LIB_PIN::DrawPinTexts( EDA_DRAW_PANEL* panel,
wxString
StringPinNum
;
EDA_Colors
NameColor
,
NumColor
;
wxSize
PinNameSize
(
m_
PinNameSize
,
m_PinName
Size
);
wxSize
PinNumSize
(
m_
PinNumSize
,
m_PinNum
Size
);
wxSize
PinNameSize
(
m_
nameTextSize
,
m_nameText
Size
);
wxSize
PinNumSize
(
m_
numTextSize
,
m_numText
Size
);
int
nameLineWidth
=
GetPenSize
();
nameLineWidth
=
Clamp_Text_PenSize
(
nameLineWidth
,
m_
PinName
Size
,
false
);
nameLineWidth
=
Clamp_Text_PenSize
(
nameLineWidth
,
m_
nameText
Size
,
false
);
int
numLineWidth
=
GetPenSize
();
numLineWidth
=
Clamp_Text_PenSize
(
numLineWidth
,
m_
PinNum
Size
,
false
);
numLineWidth
=
Clamp_Text_PenSize
(
numLineWidth
,
m_
numText
Size
,
false
);
GRSetDrawMode
(
DC
,
DrawMode
);
...
...
@@ -1406,8 +1398,8 @@ void LIB_PIN::PlotPinTexts( PLOTTER* plotter,
int
x
,
y
,
x1
,
y1
;
wxString
StringPinNum
;
EDA_Colors
NameColor
,
NumColor
;
wxSize
PinNameSize
=
wxSize
(
m_
PinNameSize
,
m_PinName
Size
);
wxSize
PinNumSize
=
wxSize
(
m_
PinNumSize
,
m_PinNum
Size
);
wxSize
PinNameSize
=
wxSize
(
m_
nameTextSize
,
m_nameText
Size
);
wxSize
PinNumSize
=
wxSize
(
m_
numTextSize
,
m_numText
Size
);
/* Get the num and name colors */
NameColor
=
ReturnLayerColor
(
LAYER_PINNAM
);
...
...
@@ -1909,10 +1901,10 @@ EDA_RECT LIB_PIN::GetBoundingBox() const
}
// First, calculate boundary box corners position
int
numberTextLength
=
showNum
?
m_
PinNum
Size
*
GetNumberString
().
Len
()
:
0
;
int
numberTextLength
=
showNum
?
m_
numText
Size
*
GetNumberString
().
Len
()
:
0
;
// Actual text height is bigger than text size
int
numberTextHeight
=
showNum
?
wxRound
(
m_
PinNum
Size
*
1.1
)
:
0
;
int
numberTextHeight
=
showNum
?
wxRound
(
m_
numText
Size
*
1.1
)
:
0
;
if
(
m_shape
&
INVERT
)
minsizeV
=
MAX
(
TARGET_PIN_RADIUS
,
INVERT_PIN_RADIUS
);
...
...
@@ -1934,9 +1926,10 @@ EDA_RECT LIB_PIN::GetBoundingBox() const
if
(
m_name
.
Left
(
1
)
==
wxT
(
"~"
)
)
length
-=
1
;
nameTextLength
=
(
m_PinNameSize
*
length
)
+
nameTextOffset
;
nameTextLength
=
(
m_nameTextSize
*
length
)
+
nameTextOffset
;
// Actual text height are bigger than text size
nameTextHeight
=
wxRound
(
m_
PinName
Size
*
1.1
)
+
TXTMARGE
;
nameTextHeight
=
wxRound
(
m_
nameText
Size
*
1.1
)
+
TXTMARGE
;
}
if
(
nameTextOffset
)
// for values > 0, pin name is inside the body
...
...
eeschema/lib_pin.h
View file @
d8ad2cce
...
...
@@ -114,6 +114,8 @@ class LIB_PIN : public LIB_ITEM
long
m_number
;
///< Pin number defined as 4 ASCII characters like "12", "anod",
///< "G6", or "12". It is stored as "12\0\0" and does not
///< depend on endian type.
int
m_numTextSize
;
int
m_nameTextSize
;
/* Pin num and Pin name sizes */
/**
* Draw the pin.
...
...
@@ -121,18 +123,6 @@ class LIB_PIN : public LIB_ITEM
void
drawGraphic
(
EDA_DRAW_PANEL
*
aPanel
,
wxDC
*
aDC
,
const
wxPoint
&
aOffset
,
int
aColor
,
int
aDrawMode
,
void
*
aData
,
const
TRANSFORM
&
aTransform
);
public
:
int
m_PinNumSize
;
int
m_PinNameSize
;
/* Pin num and Pin name sizes */
/* (Currently Unused) Pin num and Pin name text options: italic/normal
* /bold, 0 = default */
char
m_PinNumShapeOpt
;
char
m_PinNameShapeOpt
;
// (Currently Unused) Pin num and Pin name text opt position, 0 = default:
char
m_PinNumPositionOpt
;
char
m_PinNamePositionOpt
;
public
:
LIB_PIN
(
LIB_COMPONENT
*
aParent
);
LIB_PIN
(
const
LIB_PIN
&
aPin
);
...
...
@@ -186,7 +176,7 @@ public:
virtual
void
DisplayInfo
(
EDA_DRAW_FRAME
*
aFrame
);
/**
* @copydoc EDA_ITEM::Matches()
* @copydoc EDA_ITEM::Matches(
wxFindReplaceData&,void*,wxPoint*
)
*/
virtual
bool
Matches
(
wxFindReplaceData
&
aSearchData
,
void
*
aAuxData
,
wxPoint
*
aFindLocation
);
...
...
@@ -263,6 +253,8 @@ public:
*/
void
SetNameTextSize
(
int
aSize
);
int
GetNameTextSize
()
const
{
return
m_nameTextSize
;
}
/**
* Set the pin number.
*
...
...
@@ -283,6 +275,8 @@ public:
*/
void
SetNumberTextSize
(
int
aSize
);
int
GetNumberTextSize
()
const
{
return
m_numTextSize
;
}
int
GetOrientation
()
const
{
return
m_orientation
;
}
/**
...
...
eeschema/libeditframe.cpp
View file @
d8ad2cce
...
...
@@ -275,7 +275,7 @@ LIB_EDIT_FRAME::~LIB_EDIT_FRAME()
{
SCH_EDIT_FRAME
*
frame
=
(
SCH_EDIT_FRAME
*
)
wxGetApp
().
GetTopWindow
();
frame
->
m_LibeditFrame
=
NULL
;
frame
->
SetLibraryEditorWindow
(
NULL
)
;
m_drawItem
=
m_lastDrawItem
=
NULL
;
if
(
m_tempCopyComponent
)
...
...
eeschema/onrightclick.cpp
View file @
d8ad2cce
...
...
@@ -125,7 +125,7 @@ bool SCH_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
if
(
item
==
NULL
)
{
if
(
GetSheet
()
->
Last
()
!=
g_RootSheet
)
if
(
m_CurrentSheet
->
Last
()
!=
g_RootSheet
)
AddMenuItem
(
PopMenu
,
ID_POPUP_SCH_LEAVE_SHEET
,
_
(
"Leave Sheet"
),
KiBitmap
(
leave_sheet_xpm
)
);
...
...
eeschema/pinedit.cpp
View file @
d8ad2cce
...
...
@@ -85,12 +85,12 @@ void LIB_EDIT_FRAME::OnEditPin( wxCommandEvent& event )
dlg
.
SetElectricalType
(
pin
->
GetType
()
);
dlg
.
SetName
(
pin
->
GetName
()
);
dlg
.
SetNameTextSize
(
ReturnStringFromValue
(
g_UserUnit
,
pin
->
m_PinNameSize
,
pin
->
GetNameTextSize
()
,
m_InternalUnits
)
);
dlg
.
SetNameTextSizeUnits
(
units
);
dlg
.
SetPadName
(
pin
->
GetNumberString
()
);
dlg
.
SetPadNameTextSize
(
ReturnStringFromValue
(
g_UserUnit
,
pin
->
m_PinNumSize
,
pin
->
GetNumberTextSize
()
,
m_InternalUnits
)
);
dlg
.
SetPadNameTextSizeUnits
(
units
);
...
...
@@ -391,8 +391,8 @@ void LIB_EDIT_FRAME::CreatePin( wxDC* DC )
pin
->
SetOrientation
(
LastPinOrient
);
pin
->
SetType
(
LastPinType
);
pin
->
SetShape
(
LastPinShape
);
pin
->
m_PinNameSize
=
LastPinNameSize
;
pin
->
m_PinNumSize
=
LastPinNumSize
;
pin
->
SetNameTextSize
(
LastPinNameSize
)
;
pin
->
SetNumberTextSize
(
LastPinNumSize
)
;
pin
->
SetConvert
(
LastPinCommonConvert
?
0
:
m_convert
);
pin
->
SetUnit
(
LastPinCommonUnit
?
0
:
m_unit
);
pin
->
SetVisible
(
LastPinVisible
);
...
...
@@ -507,11 +507,11 @@ void LIB_EDIT_FRAME::GlobalSetPins( wxDC* DC, LIB_PIN* MasterPin, int id )
switch
(
id
)
{
case
ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_PINNUMSIZE_ITEM
:
Pin
->
m_PinNumSize
=
MasterPin
->
m_PinNumSize
;
Pin
->
SetNumberTextSize
(
MasterPin
->
GetNumberTextSize
()
)
;
break
;
case
ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_PINNAMESIZE_ITEM
:
Pin
->
m_PinNameSize
=
MasterPin
->
m_PinNameSize
;
Pin
->
SetNameTextSize
(
MasterPin
->
GetNameTextSize
()
)
;
break
;
case
ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_PINSIZE_ITEM
:
...
...
eeschema/sch_component.cpp
View file @
d8ad2cce
...
...
@@ -1472,7 +1472,8 @@ void SCH_COMPONENT::DisplayInfo( EDA_DRAW_FRAME* frame )
frame
->
ClearMsgPanel
();
frame
->
AppendMsgPanel
(
_
(
"Reference"
),
GetRef
(
(
(
SCH_EDIT_FRAME
*
)
frame
)
->
GetSheet
()
),
frame
->
AppendMsgPanel
(
_
(
"Reference"
),
GetRef
(
&
(
(
(
SCH_EDIT_FRAME
*
)
frame
)
->
GetCurrentSheet
()
)
),
DARKCYAN
);
if
(
root_component
->
IsPower
()
)
...
...
eeschema/sch_sheet_path.cpp
View file @
d8ad2cce
eeschema/schframe.cpp
View file @
d8ad2cce
...
...
@@ -286,12 +286,6 @@ SCH_EDIT_FRAME::~SCH_EDIT_FRAME()
}
SCH_SHEET_PATH
*
SCH_EDIT_FRAME
::
GetSheet
()
{
return
m_CurrentSheet
;
}
void
SCH_EDIT_FRAME
::
SetSheetNumberAndCount
()
{
SCH_SCREEN
*
screen
=
GetScreen
();
...
...
@@ -369,6 +363,20 @@ void SCH_EDIT_FRAME::CreateScreens()
}
SCH_SHEET_PATH
&
SCH_EDIT_FRAME
::
GetCurrentSheet
()
{
wxASSERT_MSG
(
m_CurrentSheet
!=
NULL
,
wxT
(
"SCH_EDIT_FRAME m_CurrentSheet member is NULL."
)
);
return
*
m_CurrentSheet
;
}
void
SCH_EDIT_FRAME
::
SetCurrentSheet
(
const
SCH_SHEET_PATH
&
aSheet
)
{
*
m_CurrentSheet
=
aSheet
;
}
void
SCH_EDIT_FRAME
::
SetUndoItem
(
const
SCH_ITEM
*
aItem
)
{
// if aItem != NULL, delete a previous m_undoItem, if exists
...
...
eeschema/viewlib_frame.cpp
View file @
d8ad2cce
...
...
@@ -261,7 +261,7 @@ LIB_VIEW_FRAME::LIB_VIEW_FRAME( wxWindow* father, CMP_LIBRARY* Library, wxSemaph
LIB_VIEW_FRAME
::~
LIB_VIEW_FRAME
()
{
SCH_EDIT_FRAME
*
frame
=
(
SCH_EDIT_FRAME
*
)
wxGetApp
().
GetTopWindow
();
frame
->
m_ViewlibFrame
=
NULL
;
frame
->
SetLibraryViewerWindow
(
NULL
)
;
}
...
...
include/wxEeschemaStruct.h
View file @
d8ad2cce
...
...
@@ -113,18 +113,16 @@ enum SCH_SEARCH_T {
class
SCH_EDIT_FRAME
:
public
EDA_DRAW_FRAME
{
public
:
wxComboBox
*
m_SelPartBox
;
SCH_SHEET_PATH
*
m_CurrentSheet
;
///< which sheet we are presently working on.
int
m_NetlistFormat
;
int
m_AddSubPrefix
;
bool
m_ShowAllPins
;
wxPoint
m_OldPos
;
LIB_EDIT_FRAME
*
m_LibeditFrame
;
LIB_VIEW_FRAME
*
m_ViewlibFrame
;
wxString
m_UserLibraryPath
;
wxArrayString
m_ComponentLibFiles
;
private
:
SCH_SHEET_PATH
*
m_CurrentSheet
;
///< which sheet we are presently working on.
LIB_VIEW_FRAME
*
m_ViewlibFrame
;
LIB_EDIT_FRAME
*
m_LibeditFrame
;
wxString
m_DefaultSchematicFileName
;
int
m_TextFieldSize
;
PARAM_CFG_ARRAY
m_projectFileParams
;
...
...
@@ -187,6 +185,11 @@ public:
~
SCH_EDIT_FRAME
();
void
OnCloseWindow
(
wxCloseEvent
&
Event
);
void
SetLibraryEditorWindow
(
LIB_EDIT_FRAME
*
aFrame
)
{
m_LibeditFrame
=
aFrame
;
}
void
SetLibraryViewerWindow
(
LIB_VIEW_FRAME
*
aFrame
)
{
m_ViewlibFrame
=
aFrame
;
}
void
Process_Special_Functions
(
wxCommandEvent
&
event
);
void
OnColorConfig
(
wxCommandEvent
&
aEvent
);
void
Process_Config
(
wxCommandEvent
&
event
);
...
...
@@ -311,8 +314,6 @@ public:
*/
void
OnModify
();
SCH_SHEET_PATH
*
GetSheet
();
SCH_SCREEN
*
GetScreen
()
const
;
virtual
wxString
GetScreenDesc
();
...
...
@@ -498,6 +499,10 @@ public:
int
CheckAnnotate
(
wxArrayString
*
aMessageList
,
bool
aOneSheetOnly
);
// Functions used for hierarchy handling
SCH_SHEET_PATH
&
GetCurrentSheet
();
void
SetCurrentSheet
(
const
SCH_SHEET_PATH
&
aSheet
);
/**
* Function DisplayCurrentSheet
* draws the current sheet on the display.
...
...
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