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
Hide 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,
...
@@ -84,7 +84,7 @@ void SCH_EDIT_FRAME::AnnotateComponents( bool aAnnotateSchematic,
}
}
else
else
{
{
GetSheet
()
->
GetComponents
(
references
);
m_CurrentSheet
->
GetComponents
(
references
);
}
}
/* Break full components reference in name (prefix) and number:
/* Break full components reference in name (prefix) and number:
...
@@ -162,7 +162,7 @@ int SCH_EDIT_FRAME::CheckAnnotate( wxArrayString* aMessageList, bool aOneSheetOn
...
@@ -162,7 +162,7 @@ int SCH_EDIT_FRAME::CheckAnnotate( wxArrayString* aMessageList, bool aOneSheetOn
if
(
!
aOneSheetOnly
)
if
(
!
aOneSheetOnly
)
SheetList
.
GetComponents
(
ComponentsList
);
SheetList
.
GetComponents
(
ComponentsList
);
else
else
GetSheet
()
->
GetComponents
(
ComponentsList
);
m_CurrentSheet
->
GetComponents
(
ComponentsList
);
return
ComponentsList
.
CheckAnnotation
(
aMessageList
);
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
...
@@ -106,7 +106,7 @@ SCH_ITEM* SCH_EDIT_FRAME::LocateAndShowItem( const wxPoint& aPosition, const KIC
Pin
->
DisplayInfo
(
this
);
Pin
->
DisplayInfo
(
this
);
if
(
LibItem
)
if
(
LibItem
)
AppendMsgPanel
(
LibItem
->
GetRef
(
GetSheet
()
),
AppendMsgPanel
(
LibItem
->
GetRef
(
m_CurrentSheet
),
LibItem
->
GetField
(
VALUE
)
->
m_Text
,
DARKCYAN
);
LibItem
->
GetField
(
VALUE
)
->
m_Text
,
DARKCYAN
);
// Cross probing:2 - pin found, and send a locate pin command to Pcbnew (highlight net)
// 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 )
...
@@ -125,7 +125,8 @@ void DIALOG_SVG_PRINT::PrintSVGDoc( bool aPrintAll, bool aPrint_Sheet_Ref )
if
(
aPrintAll
&&
m_Parent
->
IsType
(
SCHEMATIC_FRAME
)
)
if
(
aPrintAll
&&
m_Parent
->
IsType
(
SCHEMATIC_FRAME
)
)
{
{
SCH_EDIT_FRAME
*
schframe
=
(
SCH_EDIT_FRAME
*
)
m_Parent
;
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_SCREEN
*
schscreen
=
schframe
->
GetScreen
();
SCH_SHEET_LIST
SheetList
(
NULL
);
SCH_SHEET_LIST
SheetList
(
NULL
);
sheetpath
=
SheetList
.
GetFirst
();
sheetpath
=
SheetList
.
GetFirst
();
...
@@ -135,14 +136,15 @@ void DIALOG_SVG_PRINT::PrintSVGDoc( bool aPrintAll, bool aPrint_Sheet_Ref )
...
@@ -135,14 +136,15 @@ void DIALOG_SVG_PRINT::PrintSVGDoc( bool aPrintAll, bool aPrint_Sheet_Ref )
{
{
if
(
sheetpath
==
NULL
)
if
(
sheetpath
==
NULL
)
break
;
break
;
list
.
Clear
();
list
.
Clear
();
if
(
list
.
BuildSheetPathInfoFromSheetPathValue
(
sheetpath
->
Path
()
)
)
if
(
list
.
BuildSheetPathInfoFromSheetPathValue
(
sheetpath
->
Path
()
)
)
{
{
schframe
->
m_CurrentSheet
=
&
list
;
schframe
->
SetCurrentSheet
(
list
)
;
schframe
->
m_CurrentSheet
->
UpdateAllScreenReferences
();
schframe
->
GetCurrentSheet
().
UpdateAllScreenReferences
();
schframe
->
SetSheetNumberAndCount
();
schframe
->
SetSheetNumberAndCount
();
schscreen
=
schframe
->
m_CurrentSheet
->
LastScreen
();
schscreen
=
schframe
->
GetCurrentSheet
().
LastScreen
();
}
}
else
// Should not happen
else
// Should not happen
return
;
return
;
...
@@ -161,8 +163,8 @@ void DIALOG_SVG_PRINT::PrintSVGDoc( bool aPrintAll, bool aPrint_Sheet_Ref )
...
@@ -161,8 +163,8 @@ void DIALOG_SVG_PRINT::PrintSVGDoc( bool aPrintAll, bool aPrint_Sheet_Ref )
m_MessagesBox
->
AppendText
(
msg
);
m_MessagesBox
->
AppendText
(
msg
);
}
}
schframe
->
m_CurrentSheet
=
oldsheetpath
;
schframe
->
SetCurrentSheet
(
oldsheetpath
)
;
schframe
->
m_CurrentSheet
->
UpdateAllScreenReferences
();
schframe
->
GetCurrentSheet
().
UpdateAllScreenReferences
();
schframe
->
SetSheetNumberAndCount
();
schframe
->
SetSheetNumberAndCount
();
}
}
else
else
...
...
eeschema/dialogs/dialog_edit_component_in_schematic.cpp
View file @
d8ad2cce
...
@@ -167,7 +167,7 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copyPanelToOptions()
...
@@ -167,7 +167,7 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copyPanelToOptions()
if
(
m_Cmp
->
GetUnit
()
)
if
(
m_Cmp
->
GetUnit
()
)
{
{
int
unit_selection
=
unitChoice
->
GetCurrentSelection
()
+
1
;
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
);
m_Cmp
->
SetUnit
(
unit_selection
);
}
}
...
@@ -279,7 +279,7 @@ Do you wish to remove this and all remaining undefined fields?" ),
...
@@ -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
// 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
// because for a given component, in a complex hierarchy, there are more than one
// reference.
// 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
->
OnModify
();
m_Parent
->
GetScreen
()
->
TestDanglingEnds
();
m_Parent
->
GetScreen
()
->
TestDanglingEnds
();
...
@@ -520,7 +520,7 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::InitBuffers( SCH_COMPONENT* aComponent
...
@@ -520,7 +520,7 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::InitBuffers( SCH_COMPONENT* aComponent
}
}
#endif
#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
)
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 )
...
@@ -196,11 +196,11 @@ void DIALOG_ERC::OnLeftDClickMarkersList( wxCommandEvent& event )
return
;
return
;
}
}
if
(
sheet
!=
m_Parent
->
Ge
tSheet
()
)
if
(
*
sheet
!=
m_Parent
->
GetCurren
tSheet
()
)
{
{
sheet
->
LastScreen
()
->
SetZoom
(
m_Parent
->
GetScreen
()
->
GetZoom
()
);
sheet
->
LastScreen
()
->
SetZoom
(
m_Parent
->
GetScreen
()
->
GetZoom
()
);
*
m_Parent
->
m_CurrentSheet
=
*
sheet
;
m_Parent
->
SetCurrentSheet
(
*
sheet
)
;
m_Parent
->
m_CurrentSheet
->
UpdateAllScreenReferences
();
m_Parent
->
GetCurrentSheet
().
UpdateAllScreenReferences
();
}
}
m_Parent
->
GetScreen
()
->
SetCrossHairPosition
(
pos
);
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( )
...
@@ -145,7 +145,8 @@ void DIALOG_PLOT_SCHEMATIC_DXF::CreateDXFFile( )
{
{
SCH_EDIT_FRAME
*
schframe
=
(
SCH_EDIT_FRAME
*
)
m_Parent
;
SCH_EDIT_FRAME
*
schframe
=
(
SCH_EDIT_FRAME
*
)
m_Parent
;
SCH_SCREEN
*
screen
=
schframe
->
GetScreen
();
SCH_SCREEN
*
screen
=
schframe
->
GetScreen
();
SCH_SHEET_PATH
*
sheetpath
,
*
oldsheetpath
=
schframe
->
GetSheet
();
SCH_SHEET_PATH
*
sheetpath
;
SCH_SHEET_PATH
oldsheetpath
=
schframe
->
GetCurrentSheet
();
wxString
PlotFileName
;
wxString
PlotFileName
;
Ki_PageDescr
*
PlotSheet
;
Ki_PageDescr
*
PlotSheet
;
wxPoint
plot_offset
;
wxPoint
plot_offset
;
...
@@ -172,13 +173,15 @@ void DIALOG_PLOT_SCHEMATIC_DXF::CreateDXFFile( )
...
@@ -172,13 +173,15 @@ void DIALOG_PLOT_SCHEMATIC_DXF::CreateDXFFile( )
if
(
list
.
BuildSheetPathInfoFromSheetPathValue
(
sheetpath
->
Path
()
)
)
if
(
list
.
BuildSheetPathInfoFromSheetPathValue
(
sheetpath
->
Path
()
)
)
{
{
schframe
->
m_CurrentSheet
=
&
list
;
schframe
->
SetCurrentSheet
(
list
)
;
schframe
->
m_CurrentSheet
->
UpdateAllScreenReferences
();
schframe
->
GetCurrentSheet
().
UpdateAllScreenReferences
();
schframe
->
SetSheetNumberAndCount
();
schframe
->
SetSheetNumberAndCount
();
screen
=
schframe
->
m_CurrentSheet
->
LastScreen
();
screen
=
schframe
->
GetCurrentSheet
().
LastScreen
();
}
}
else
// Should not happen
else
// Should not happen
{
return
;
return
;
}
sheetpath
=
SheetList
.
GetNext
();
sheetpath
=
SheetList
.
GetNext
();
}
}
...
@@ -197,8 +200,8 @@ void DIALOG_PLOT_SCHEMATIC_DXF::CreateDXFFile( )
...
@@ -197,8 +200,8 @@ void DIALOG_PLOT_SCHEMATIC_DXF::CreateDXFFile( )
break
;
break
;
}
}
schframe
->
m_CurrentSheet
=
oldsheetpath
;
schframe
->
SetCurrentSheet
(
oldsheetpath
)
;
schframe
->
m_CurrentSheet
->
UpdateAllScreenReferences
();
schframe
->
GetCurrentSheet
().
UpdateAllScreenReferences
();
schframe
->
SetSheetNumberAndCount
();
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
...
@@ -281,7 +281,8 @@ void DIALOG_PLOT_SCHEMATIC_HPGL::Plot_Schematic_HPGL( bool aPlotAll, int HPGL_Sh
{
{
wxString
PlotFileName
;
wxString
PlotFileName
;
SCH_SCREEN
*
screen
=
m_Parent
->
GetScreen
();
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
;
Ki_PageDescr
*
PlotSheet
;
wxSize
SheetSize
;
wxSize
SheetSize
;
wxPoint
SheetOffset
,
PlotOffset
;
wxPoint
SheetOffset
,
PlotOffset
;
...
@@ -308,10 +309,10 @@ void DIALOG_PLOT_SCHEMATIC_HPGL::Plot_Schematic_HPGL( bool aPlotAll, int HPGL_Sh
...
@@ -308,10 +309,10 @@ void DIALOG_PLOT_SCHEMATIC_HPGL::Plot_Schematic_HPGL( bool aPlotAll, int HPGL_Sh
if
(
list
.
BuildSheetPathInfoFromSheetPathValue
(
sheetpath
->
Path
()
)
)
if
(
list
.
BuildSheetPathInfoFromSheetPathValue
(
sheetpath
->
Path
()
)
)
{
{
m_Parent
->
m_CurrentSheet
=
&
list
;
m_Parent
->
SetCurrentSheet
(
list
)
;
m_Parent
->
m_CurrentSheet
->
UpdateAllScreenReferences
();
m_Parent
->
GetCurrentSheet
().
UpdateAllScreenReferences
();
m_Parent
->
SetSheetNumberAndCount
();
m_Parent
->
SetSheetNumberAndCount
();
screen
=
m_Parent
->
m_CurrentSheet
->
LastScreen
();
screen
=
m_Parent
->
GetCurrentSheet
().
LastScreen
();
}
}
else
// Should not happen
else
// Should not happen
return
;
return
;
...
@@ -344,8 +345,8 @@ void DIALOG_PLOT_SCHEMATIC_HPGL::Plot_Schematic_HPGL( bool aPlotAll, int HPGL_Sh
...
@@ -344,8 +345,8 @@ void DIALOG_PLOT_SCHEMATIC_HPGL::Plot_Schematic_HPGL( bool aPlotAll, int HPGL_Sh
break
;
break
;
}
}
m_Parent
->
m_CurrentSheet
=
oldsheetpath
;
m_Parent
->
SetCurrentSheet
(
oldsheetpath
)
;
m_Parent
->
m_CurrentSheet
->
UpdateAllScreenReferences
();
m_Parent
->
GetCurrentSheet
().
UpdateAllScreenReferences
();
m_Parent
->
SetSheetNumberAndCount
();
m_Parent
->
SetSheetNumberAndCount
();
}
}
...
...
eeschema/dialogs/dialog_plot_schematic_PS.cpp
View file @
d8ad2cce
...
@@ -174,7 +174,7 @@ void DIALOG_PLOT_SCHEMATIC_PS::createPSFile()
...
@@ -174,7 +174,7 @@ void DIALOG_PLOT_SCHEMATIC_PS::createPSFile()
{
{
SCH_SCREEN
*
screen
=
m_Parent
->
GetScreen
();
SCH_SCREEN
*
screen
=
m_Parent
->
GetScreen
();
SCH_SHEET_PATH
*
sheetpath
;
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
;
wxString
plotFileName
;
Ki_PageDescr
*
actualPage
;
// page size selected in schematic
Ki_PageDescr
*
actualPage
;
// page size selected in schematic
Ki_PageDescr
*
plotPage
;
// page size selected to plot
Ki_PageDescr
*
plotPage
;
// page size selected to plot
...
@@ -202,10 +202,10 @@ void DIALOG_PLOT_SCHEMATIC_PS::createPSFile()
...
@@ -202,10 +202,10 @@ void DIALOG_PLOT_SCHEMATIC_PS::createPSFile()
if
(
list
.
BuildSheetPathInfoFromSheetPathValue
(
sheetpath
->
Path
()
)
)
if
(
list
.
BuildSheetPathInfoFromSheetPathValue
(
sheetpath
->
Path
()
)
)
{
{
m_Parent
->
m_CurrentSheet
=
&
list
;
m_Parent
->
SetCurrentSheet
(
list
)
;
m_Parent
->
m_CurrentSheet
->
UpdateAllScreenReferences
();
m_Parent
->
GetCurrentSheet
().
UpdateAllScreenReferences
();
m_Parent
->
SetSheetNumberAndCount
();
m_Parent
->
SetSheetNumberAndCount
();
screen
=
m_Parent
->
m_CurrentSheet
->
LastScreen
();
screen
=
m_Parent
->
GetCurrentSheet
().
LastScreen
();
}
}
else
// Should not happen
else
// Should not happen
return
;
return
;
...
@@ -246,8 +246,8 @@ void DIALOG_PLOT_SCHEMATIC_PS::createPSFile()
...
@@ -246,8 +246,8 @@ void DIALOG_PLOT_SCHEMATIC_PS::createPSFile()
break
;
break
;
}
}
m_Parent
->
m_CurrentSheet
=
oldsheetpath
;
m_Parent
->
SetCurrentSheet
(
oldsheetpath
)
;
m_Parent
->
m_CurrentSheet
->
UpdateAllScreenReferences
();
m_Parent
->
GetCurrentSheet
().
UpdateAllScreenReferences
();
m_Parent
->
SetSheetNumberAndCount
();
m_Parent
->
SetSheetNumberAndCount
();
}
}
...
...
eeschema/dialogs/dialog_print_using_printer.cpp
View file @
d8ad2cce
...
@@ -231,17 +231,17 @@ bool SCH_PRINTOUT::OnPrintPage( int page )
...
@@ -231,17 +231,17 @@ bool SCH_PRINTOUT::OnPrintPage( int page )
parent
->
AppendMsgPanel
(
msg
,
wxEmptyString
,
CYAN
);
parent
->
AppendMsgPanel
(
msg
,
wxEmptyString
,
CYAN
);
SCH_SCREEN
*
screen
=
parent
->
GetScreen
();
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_PATH
list
;
SCH_SHEET_LIST
SheetList
(
NULL
);
SCH_SHEET_LIST
SheetList
(
NULL
);
SCH_SHEET_PATH
*
sheetpath
=
SheetList
.
GetSheet
(
page
-
1
);
SCH_SHEET_PATH
*
sheetpath
=
SheetList
.
GetSheet
(
page
-
1
);
if
(
list
.
BuildSheetPathInfoFromSheetPathValue
(
sheetpath
->
Path
()
)
)
if
(
list
.
BuildSheetPathInfoFromSheetPathValue
(
sheetpath
->
Path
()
)
)
{
{
parent
->
m_CurrentSheet
=
&
list
;
parent
->
SetCurrentSheet
(
list
)
;
parent
->
m_CurrentSheet
->
UpdateAllScreenReferences
();
parent
->
GetCurrentSheet
().
UpdateAllScreenReferences
();
parent
->
SetSheetNumberAndCount
();
parent
->
SetSheetNumberAndCount
();
screen
=
parent
->
m_CurrentSheet
->
LastScreen
();
screen
=
parent
->
GetCurrentSheet
().
LastScreen
();
}
}
else
else
{
{
...
@@ -252,8 +252,8 @@ bool SCH_PRINTOUT::OnPrintPage( int page )
...
@@ -252,8 +252,8 @@ bool SCH_PRINTOUT::OnPrintPage( int page )
return
false
;
return
false
;
DrawPage
(
screen
);
DrawPage
(
screen
);
parent
->
m_CurrentSheet
=
oldsheetpath
;
parent
->
SetCurrentSheet
(
oldsheetpath
)
;
parent
->
m_CurrentSheet
->
UpdateAllScreenReferences
();
parent
->
GetCurrentSheet
().
UpdateAllScreenReferences
();
parent
->
SetSheetNumberAndCount
();
parent
->
SetSheetNumberAndCount
();
return
true
;
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()
...
@@ -106,7 +106,7 @@ create a new power component with the new value." ), GetChars( entry->GetName()
// Test is reference is acceptable:
// Test is reference is acceptable:
if
(
SCH_COMPONENT
::
IsReferenceStringValid
(
newtext
)
)
if
(
SCH_COMPONENT
::
IsReferenceStringValid
(
newtext
)
)
{
{
component
->
SetRef
(
GetSheet
()
,
newtext
);
component
->
SetRef
(
m_CurrentSheet
,
newtext
);
aField
->
SetText
(
newtext
);
aField
->
SetText
(
newtext
);
}
}
else
else
...
...
eeschema/find.cpp
View file @
d8ad2cce
...
@@ -82,7 +82,7 @@ void SCH_EDIT_FRAME::OnFindDrcMarker( wxFindDialogEvent& event )
...
@@ -82,7 +82,7 @@ void SCH_EDIT_FRAME::OnFindDrcMarker( wxFindDialogEvent& event )
if
(
lastMarker
!=
NULL
)
if
(
lastMarker
!=
NULL
)
{
{
if
(
sheetFoundIn
!=
GetSheet
()
)
if
(
*
sheetFoundIn
!=
*
m_CurrentSheet
)
{
{
sheetFoundIn
->
LastScreen
()
->
SetZoom
(
GetScreen
()
->
GetZoom
()
);
sheetFoundIn
->
LastScreen
()
->
SetZoom
(
GetScreen
()
->
GetZoom
()
);
*
m_CurrentSheet
=
*
sheetFoundIn
;
*
m_CurrentSheet
=
*
sheetFoundIn
;
...
@@ -193,7 +193,7 @@ SCH_ITEM* SCH_EDIT_FRAME::FindComponentAndItem( const wxString& aReference,
...
@@ -193,7 +193,7 @@ SCH_ITEM* SCH_EDIT_FRAME::FindComponentAndItem( const wxString& aReference,
{
{
sheet
=
sheetWithComponentFound
;
sheet
=
sheetWithComponentFound
;
if
(
*
sheet
!=
*
GetSheet
()
)
if
(
*
sheet
!=
*
m_CurrentSheet
)
{
{
sheet
->
LastScreen
()
->
SetZoom
(
GetScreen
()
->
GetZoom
()
);
sheet
->
LastScreen
()
->
SetZoom
(
GetScreen
()
->
GetZoom
()
);
*
m_CurrentSheet
=
*
sheet
;
*
m_CurrentSheet
=
*
sheet
;
...
@@ -362,7 +362,7 @@ void SCH_EDIT_FRAME::OnFindSchematicItem( wxFindDialogEvent& aEvent )
...
@@ -362,7 +362,7 @@ void SCH_EDIT_FRAME::OnFindSchematicItem( wxFindDialogEvent& aEvent )
wxCHECK_RET
(
sheet
!=
NULL
,
wxT
(
"Could not find sheet path "
)
+
wxCHECK_RET
(
sheet
!=
NULL
,
wxT
(
"Could not find sheet path "
)
+
data
.
GetSheetPath
()
);
data
.
GetSheetPath
()
);
if
(
sheet
->
PathHumanReadable
()
!=
GetSheet
()
->
PathHumanReadable
()
)
if
(
sheet
->
PathHumanReadable
()
!=
m_CurrentSheet
->
PathHumanReadable
()
)
{
{
sheet
->
LastScreen
()
->
SetZoom
(
GetScreen
()
->
GetZoom
()
);
sheet
->
LastScreen
()
->
SetZoom
(
GetScreen
()
->
GetZoom
()
);
*
m_CurrentSheet
=
*
sheet
;
*
m_CurrentSheet
=
*
sheet
;
...
...
eeschema/getpart.cpp
View file @
d8ad2cce
...
@@ -219,7 +219,7 @@ SCH_COMPONENT* SCH_EDIT_FRAME::Load_Component( wxDC* DC,
...
@@ -219,7 +219,7 @@ SCH_COMPONENT* SCH_EDIT_FRAME::Load_Component( wxDC* DC,
lastCommponentName
=
Name
;
lastCommponentName
=
Name
;
AddHistoryComponentName
(
HistoryList
,
Name
);
AddHistoryComponentName
(
HistoryList
,
Name
);
component
=
new
SCH_COMPONENT
(
*
Entry
,
GetSheet
()
,
unit
,
convert
,
component
=
new
SCH_COMPONENT
(
*
Entry
,
m_CurrentSheet
,
unit
,
convert
,
GetScreen
()
->
GetCrossHairPosition
(),
true
);
GetScreen
()
->
GetCrossHairPosition
(),
true
);
// Set the m_ChipName value, from component name in lib, for aliases
// Set the m_ChipName value, from component name in lib, for aliases
...
@@ -335,7 +335,7 @@ void SCH_EDIT_FRAME::OnSelectUnit( wxCommandEvent& aEvent )
...
@@ -335,7 +335,7 @@ void SCH_EDIT_FRAME::OnSelectUnit( wxCommandEvent& aEvent )
component
->
Draw
(
DrawPanel
,
&
dc
,
wxPoint
(
0
,
0
),
g_XorMode
);
component
->
Draw
(
DrawPanel
,
&
dc
,
wxPoint
(
0
,
0
),
g_XorMode
);
/* Update the unit number. */
/* Update the unit number. */
component
->
SetUnitSelection
(
GetSheet
()
,
unit
);
component
->
SetUnitSelection
(
m_CurrentSheet
,
unit
);
component
->
SetUnit
(
unit
);
component
->
SetUnit
(
unit
);
component
->
ClearFlags
();
component
->
ClearFlags
();
component
->
SetFlags
(
flags
);
// Restore m_Flag modified by SetUnit()
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
* @file hierarch.cpp
*/
*/
...
@@ -136,7 +161,7 @@ HIERARCHY_NAVIG_DLG::HIERARCHY_NAVIG_DLG( SCH_EDIT_FRAME* parent, wxDC* DC, cons
...
@@ -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
.
x
=
itemrect
.
GetWidth
()
+
10
;
m_TreeSize
.
y
=
20
;
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.
m_Tree
->
SelectItem
(
cellule
);
//root.
maxposx
=
15
;
maxposx
=
15
;
...
@@ -211,7 +236,7 @@ void HIERARCHY_NAVIG_DLG::BuildSheetsTree( SCH_SHEET_PATH* list, wxTreeItemId*
...
@@ -211,7 +236,7 @@ void HIERARCHY_NAVIG_DLG::BuildSheetsTree( SCH_SHEET_PATH* list, wxTreeItemId*
m_TreeSize
.
x
=
MAX
(
m_TreeSize
.
x
,
ll
);
m_TreeSize
.
x
=
MAX
(
m_TreeSize
.
x
,
ll
);
m_TreeSize
.
y
+=
1
;
m_TreeSize
.
y
+=
1
;
if
(
*
list
==
*
(
m_Parent
->
GetSheet
()
)
)
if
(
*
list
==
m_Parent
->
GetCurrentSheet
(
)
)
{
{
m_Tree
->
EnsureVisible
(
menu
);
m_Tree
->
EnsureVisible
(
menu
);
m_Tree
->
SelectItem
(
menu
);
m_Tree
->
SelectItem
(
menu
);
...
@@ -237,8 +262,7 @@ void HIERARCHY_NAVIG_DLG::OnSelect( wxTreeEvent& event )
...
@@ -237,8 +262,7 @@ void HIERARCHY_NAVIG_DLG::OnSelect( wxTreeEvent& event )
{
{
wxTreeItemId
ItemSel
=
m_Tree
->
GetSelection
();
wxTreeItemId
ItemSel
=
m_Tree
->
GetSelection
();
*
(
m_Parent
->
m_CurrentSheet
)
=
m_Parent
->
SetCurrentSheet
((
(
TreeItemData
*
)
m_Tree
->
GetItemData
(
ItemSel
)
)
->
m_SheetPath
);
(
(
TreeItemData
*
)
m_Tree
->
GetItemData
(
ItemSel
)
)
->
m_SheetPath
;
m_Parent
->
DisplayCurrentSheet
();
m_Parent
->
DisplayCurrentSheet
();
Close
(
true
);
Close
(
true
);
}
}
...
...
eeschema/lib_pin.cpp
View file @
d8ad2cce
...
@@ -188,37 +188,29 @@ LIB_PIN::LIB_PIN( LIB_COMPONENT* aParent ) :
...
@@ -188,37 +188,29 @@ LIB_PIN::LIB_PIN( LIB_COMPONENT* aParent ) :
m_length
=
300
;
/* default Pin len */
m_length
=
300
;
/* default Pin len */
m_orientation
=
PIN_RIGHT
;
/* Pin orient: Up, Down, Left, Right */
m_orientation
=
PIN_RIGHT
;
/* Pin orient: Up, Down, Left, Right */
m_shape
=
NONE
;
/* Pin shape, bitwise. */
m_shape
=
NONE
;
/* Pin shape, bitwise. */
m_type
=
PIN_UNSPECIFIED
;
/* electrical type of pin */
m_type
=
PIN_UNSPECIFIED
;
/* electrical type of pin */
m_attributes
=
0
;
/* bit 0 != 0: pin invisible */
m_attributes
=
0
;
/* bit 0 != 0: pin invisible */
m_number
=
0
;
/* pin number ( i.e. 4 codes ASCII ) */
m_number
=
0
;
/* pin number ( i.e. 4 codes ASCII ) */
m_
PinNumSize
=
50
;
m_
numTextSize
=
50
;
m_
PinNameSize
=
50
;
/* Default size for pin name and num */
m_
nameTextSize
=
50
;
/* Default size for pin name and num */
m_width
=
0
;
m_width
=
0
;
m_typeName
=
_
(
"Pin"
);
m_typeName
=
_
(
"Pin"
);
m_PinNumShapeOpt
=
0
;
m_PinNameShapeOpt
=
0
;
m_PinNumPositionOpt
=
0
;
m_PinNamePositionOpt
=
0
;
}
}
LIB_PIN
::
LIB_PIN
(
const
LIB_PIN
&
pin
)
:
LIB_ITEM
(
pin
)
LIB_PIN
::
LIB_PIN
(
const
LIB_PIN
&
pin
)
:
LIB_ITEM
(
pin
)
{
{
m_position
=
pin
.
m_position
;
m_position
=
pin
.
m_position
;
m_length
=
pin
.
m_length
;
m_length
=
pin
.
m_length
;
m_orientation
=
pin
.
m_orientation
;
m_orientation
=
pin
.
m_orientation
;
m_shape
=
pin
.
m_shape
;
m_shape
=
pin
.
m_shape
;
m_type
=
pin
.
m_type
;
m_type
=
pin
.
m_type
;
m_attributes
=
pin
.
m_attributes
;
m_attributes
=
pin
.
m_attributes
;
m_number
=
pin
.
m_number
;
m_number
=
pin
.
m_number
;
m_PinNumSize
=
pin
.
m_PinNumSize
;
m_numTextSize
=
pin
.
m_numTextSize
;
m_PinNameSize
=
pin
.
m_PinNameSize
;
m_nameTextSize
=
pin
.
m_nameTextSize
;
m_PinNumShapeOpt
=
pin
.
m_PinNumShapeOpt
;
m_PinNameShapeOpt
=
pin
.
m_PinNameShapeOpt
;
m_PinNumPositionOpt
=
pin
.
m_PinNumPositionOpt
;
m_PinNamePositionOpt
=
pin
.
m_PinNamePositionOpt
;
m_width
=
pin
.
m_width
;
m_width
=
pin
.
m_width
;
m_name
=
pin
.
m_name
;
m_name
=
pin
.
m_name
;
}
}
...
@@ -253,9 +245,9 @@ void LIB_PIN::SetName( const wxString& aName )
...
@@ -253,9 +245,9 @@ void LIB_PIN::SetName( const wxString& aName )
void
LIB_PIN
::
SetNameTextSize
(
int
size
)
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
();
SetModified
();
}
}
...
@@ -267,10 +259,10 @@ void LIB_PIN::SetNameTextSize( int size )
...
@@ -267,10 +259,10 @@ void LIB_PIN::SetNameTextSize( int size )
for
(
size_t
i
=
0
;
i
<
pinList
.
size
();
i
++
)
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
;
continue
;
pinList
[
i
]
->
m_
PinName
Size
=
size
;
pinList
[
i
]
->
m_
nameText
Size
=
size
;
SetModified
();
SetModified
();
}
}
}
}
...
@@ -297,9 +289,9 @@ void LIB_PIN::SetNumber( const wxString& number )
...
@@ -297,9 +289,9 @@ void LIB_PIN::SetNumber( const wxString& number )
void
LIB_PIN
::
SetNumberTextSize
(
int
size
)
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
();
SetModified
();
}
}
...
@@ -311,10 +303,10 @@ void LIB_PIN::SetNumberTextSize( int size )
...
@@ -311,10 +303,10 @@ void LIB_PIN::SetNumberTextSize( int size )
for
(
size_t
i
=
0
;
i
<
pinList
.
size
();
i
++
)
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
;
continue
;
pinList
[
i
]
->
m_
PinNum
Size
=
size
;
pinList
[
i
]
->
m_
numText
Size
=
size
;
SetModified
();
SetModified
();
}
}
}
}
...
@@ -639,7 +631,7 @@ bool LIB_PIN::Save( OUTPUTFORMATTER& aFormatter )
...
@@ -639,7 +631,7 @@ bool LIB_PIN::Save( OUTPUTFORMATTER& aFormatter )
if
(
aFormatter
.
Print
(
0
,
" %s %d %d %d %c %d %d %d %d %c"
,
if
(
aFormatter
.
Print
(
0
,
" %s %d %d %d %c %d %d %d %d %c"
,
TO_UTF8
(
StringPinNum
),
m_position
.
x
,
m_position
.
y
,
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
)
m_Unit
,
m_Convert
,
Etype
)
<
0
)
return
false
;
return
false
;
...
@@ -692,8 +684,8 @@ bool LIB_PIN::Load( LINE_READER& aLineReader, wxString& aErrorMsg )
...
@@ -692,8 +684,8 @@ bool LIB_PIN::Load( LINE_READER& aLineReader, wxString& aErrorMsg )
*
pinAttrs
=
0
;
*
pinAttrs
=
0
;
i
=
sscanf
(
line
+
2
,
"%s %s %d %d %d %s %d %d %d %d %s %s"
,
pinName
,
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
,
pinNum
,
&
m_position
.
x
,
&
m_position
.
y
,
&
m_length
,
pinOrient
,
&
m_
numText
Size
,
&
m_
PinName
Size
,
&
m_Unit
,
&
m_Convert
,
pinType
,
pinAttrs
);
&
m_
nameText
Size
,
&
m_Unit
,
&
m_Convert
,
pinType
,
pinAttrs
);
if
(
i
<
11
)
if
(
i
<
11
)
{
{
...
@@ -1099,14 +1091,14 @@ void LIB_PIN::DrawPinTexts( EDA_DRAW_PANEL* panel,
...
@@ -1099,14 +1091,14 @@ void LIB_PIN::DrawPinTexts( EDA_DRAW_PANEL* panel,
wxString
StringPinNum
;
wxString
StringPinNum
;
EDA_Colors
NameColor
,
NumColor
;
EDA_Colors
NameColor
,
NumColor
;
wxSize
PinNameSize
(
m_
PinNameSize
,
m_PinName
Size
);
wxSize
PinNameSize
(
m_
nameTextSize
,
m_nameText
Size
);
wxSize
PinNumSize
(
m_
PinNumSize
,
m_PinNum
Size
);
wxSize
PinNumSize
(
m_
numTextSize
,
m_numText
Size
);
int
nameLineWidth
=
GetPenSize
();
int
nameLineWidth
=
GetPenSize
();
nameLineWidth
=
Clamp_Text_PenSize
(
nameLineWidth
,
m_
PinName
Size
,
false
);
nameLineWidth
=
Clamp_Text_PenSize
(
nameLineWidth
,
m_
nameText
Size
,
false
);
int
numLineWidth
=
GetPenSize
();
int
numLineWidth
=
GetPenSize
();
numLineWidth
=
Clamp_Text_PenSize
(
numLineWidth
,
m_
PinNum
Size
,
false
);
numLineWidth
=
Clamp_Text_PenSize
(
numLineWidth
,
m_
numText
Size
,
false
);
GRSetDrawMode
(
DC
,
DrawMode
);
GRSetDrawMode
(
DC
,
DrawMode
);
...
@@ -1406,8 +1398,8 @@ void LIB_PIN::PlotPinTexts( PLOTTER* plotter,
...
@@ -1406,8 +1398,8 @@ void LIB_PIN::PlotPinTexts( PLOTTER* plotter,
int
x
,
y
,
x1
,
y1
;
int
x
,
y
,
x1
,
y1
;
wxString
StringPinNum
;
wxString
StringPinNum
;
EDA_Colors
NameColor
,
NumColor
;
EDA_Colors
NameColor
,
NumColor
;
wxSize
PinNameSize
=
wxSize
(
m_
PinNameSize
,
m_PinName
Size
);
wxSize
PinNameSize
=
wxSize
(
m_
nameTextSize
,
m_nameText
Size
);
wxSize
PinNumSize
=
wxSize
(
m_
PinNumSize
,
m_PinNum
Size
);
wxSize
PinNumSize
=
wxSize
(
m_
numTextSize
,
m_numText
Size
);
/* Get the num and name colors */
/* Get the num and name colors */
NameColor
=
ReturnLayerColor
(
LAYER_PINNAM
);
NameColor
=
ReturnLayerColor
(
LAYER_PINNAM
);
...
@@ -1909,10 +1901,10 @@ EDA_RECT LIB_PIN::GetBoundingBox() const
...
@@ -1909,10 +1901,10 @@ EDA_RECT LIB_PIN::GetBoundingBox() const
}
}
// First, calculate boundary box corners position
// 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
// 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
)
if
(
m_shape
&
INVERT
)
minsizeV
=
MAX
(
TARGET_PIN_RADIUS
,
INVERT_PIN_RADIUS
);
minsizeV
=
MAX
(
TARGET_PIN_RADIUS
,
INVERT_PIN_RADIUS
);
...
@@ -1934,9 +1926,10 @@ EDA_RECT LIB_PIN::GetBoundingBox() const
...
@@ -1934,9 +1926,10 @@ EDA_RECT LIB_PIN::GetBoundingBox() const
if
(
m_name
.
Left
(
1
)
==
wxT
(
"~"
)
)
if
(
m_name
.
Left
(
1
)
==
wxT
(
"~"
)
)
length
-=
1
;
length
-=
1
;
nameTextLength
=
(
m_PinNameSize
*
length
)
+
nameTextOffset
;
nameTextLength
=
(
m_nameTextSize
*
length
)
+
nameTextOffset
;
// Actual text height are bigger than text size
// 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
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
...
@@ -114,6 +114,8 @@ class LIB_PIN : public LIB_ITEM
long
m_number
;
///< Pin number defined as 4 ASCII characters like "12", "anod",
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
///< "G6", or "12". It is stored as "12\0\0" and does not
///< depend on endian type.
///< depend on endian type.
int
m_numTextSize
;
int
m_nameTextSize
;
/* Pin num and Pin name sizes */
/**
/**
* Draw the pin.
* Draw the pin.
...
@@ -121,18 +123,6 @@ class LIB_PIN : public LIB_ITEM
...
@@ -121,18 +123,6 @@ class LIB_PIN : public LIB_ITEM
void
drawGraphic
(
EDA_DRAW_PANEL
*
aPanel
,
wxDC
*
aDC
,
const
wxPoint
&
aOffset
,
void
drawGraphic
(
EDA_DRAW_PANEL
*
aPanel
,
wxDC
*
aDC
,
const
wxPoint
&
aOffset
,
int
aColor
,
int
aDrawMode
,
void
*
aData
,
const
TRANSFORM
&
aTransform
);
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
:
public
:
LIB_PIN
(
LIB_COMPONENT
*
aParent
);
LIB_PIN
(
LIB_COMPONENT
*
aParent
);
LIB_PIN
(
const
LIB_PIN
&
aPin
);
LIB_PIN
(
const
LIB_PIN
&
aPin
);
...
@@ -186,7 +176,7 @@ public:
...
@@ -186,7 +176,7 @@ public:
virtual
void
DisplayInfo
(
EDA_DRAW_FRAME
*
aFrame
);
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
);
virtual
bool
Matches
(
wxFindReplaceData
&
aSearchData
,
void
*
aAuxData
,
wxPoint
*
aFindLocation
);
...
@@ -263,6 +253,8 @@ public:
...
@@ -263,6 +253,8 @@ public:
*/
*/
void
SetNameTextSize
(
int
aSize
);
void
SetNameTextSize
(
int
aSize
);
int
GetNameTextSize
()
const
{
return
m_nameTextSize
;
}
/**
/**
* Set the pin number.
* Set the pin number.
*
*
...
@@ -283,6 +275,8 @@ public:
...
@@ -283,6 +275,8 @@ public:
*/
*/
void
SetNumberTextSize
(
int
aSize
);
void
SetNumberTextSize
(
int
aSize
);
int
GetNumberTextSize
()
const
{
return
m_numTextSize
;
}
int
GetOrientation
()
const
{
return
m_orientation
;
}
int
GetOrientation
()
const
{
return
m_orientation
;
}
/**
/**
...
...
eeschema/libeditframe.cpp
View file @
d8ad2cce
...
@@ -275,7 +275,7 @@ LIB_EDIT_FRAME::~LIB_EDIT_FRAME()
...
@@ -275,7 +275,7 @@ LIB_EDIT_FRAME::~LIB_EDIT_FRAME()
{
{
SCH_EDIT_FRAME
*
frame
=
(
SCH_EDIT_FRAME
*
)
wxGetApp
().
GetTopWindow
();
SCH_EDIT_FRAME
*
frame
=
(
SCH_EDIT_FRAME
*
)
wxGetApp
().
GetTopWindow
();
frame
->
m_LibeditFrame
=
NULL
;
frame
->
SetLibraryEditorWindow
(
NULL
)
;
m_drawItem
=
m_lastDrawItem
=
NULL
;
m_drawItem
=
m_lastDrawItem
=
NULL
;
if
(
m_tempCopyComponent
)
if
(
m_tempCopyComponent
)
...
...
eeschema/onrightclick.cpp
View file @
d8ad2cce
...
@@ -125,7 +125,7 @@ bool SCH_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
...
@@ -125,7 +125,7 @@ bool SCH_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
if
(
item
==
NULL
)
if
(
item
==
NULL
)
{
{
if
(
GetSheet
()
->
Last
()
!=
g_RootSheet
)
if
(
m_CurrentSheet
->
Last
()
!=
g_RootSheet
)
AddMenuItem
(
PopMenu
,
ID_POPUP_SCH_LEAVE_SHEET
,
_
(
"Leave Sheet"
),
AddMenuItem
(
PopMenu
,
ID_POPUP_SCH_LEAVE_SHEET
,
_
(
"Leave Sheet"
),
KiBitmap
(
leave_sheet_xpm
)
);
KiBitmap
(
leave_sheet_xpm
)
);
...
...
eeschema/pinedit.cpp
View file @
d8ad2cce
...
@@ -85,12 +85,12 @@ void LIB_EDIT_FRAME::OnEditPin( wxCommandEvent& event )
...
@@ -85,12 +85,12 @@ void LIB_EDIT_FRAME::OnEditPin( wxCommandEvent& event )
dlg
.
SetElectricalType
(
pin
->
GetType
()
);
dlg
.
SetElectricalType
(
pin
->
GetType
()
);
dlg
.
SetName
(
pin
->
GetName
()
);
dlg
.
SetName
(
pin
->
GetName
()
);
dlg
.
SetNameTextSize
(
ReturnStringFromValue
(
g_UserUnit
,
dlg
.
SetNameTextSize
(
ReturnStringFromValue
(
g_UserUnit
,
pin
->
m_PinNameSize
,
pin
->
GetNameTextSize
()
,
m_InternalUnits
)
);
m_InternalUnits
)
);
dlg
.
SetNameTextSizeUnits
(
units
);
dlg
.
SetNameTextSizeUnits
(
units
);
dlg
.
SetPadName
(
pin
->
GetNumberString
()
);
dlg
.
SetPadName
(
pin
->
GetNumberString
()
);
dlg
.
SetPadNameTextSize
(
ReturnStringFromValue
(
g_UserUnit
,
dlg
.
SetPadNameTextSize
(
ReturnStringFromValue
(
g_UserUnit
,
pin
->
m_PinNumSize
,
pin
->
GetNumberTextSize
()
,
m_InternalUnits
)
);
m_InternalUnits
)
);
dlg
.
SetPadNameTextSizeUnits
(
units
);
dlg
.
SetPadNameTextSizeUnits
(
units
);
...
@@ -391,8 +391,8 @@ void LIB_EDIT_FRAME::CreatePin( wxDC* DC )
...
@@ -391,8 +391,8 @@ void LIB_EDIT_FRAME::CreatePin( wxDC* DC )
pin
->
SetOrientation
(
LastPinOrient
);
pin
->
SetOrientation
(
LastPinOrient
);
pin
->
SetType
(
LastPinType
);
pin
->
SetType
(
LastPinType
);
pin
->
SetShape
(
LastPinShape
);
pin
->
SetShape
(
LastPinShape
);
pin
->
m_PinNameSize
=
LastPinNameSize
;
pin
->
SetNameTextSize
(
LastPinNameSize
)
;
pin
->
m_PinNumSize
=
LastPinNumSize
;
pin
->
SetNumberTextSize
(
LastPinNumSize
)
;
pin
->
SetConvert
(
LastPinCommonConvert
?
0
:
m_convert
);
pin
->
SetConvert
(
LastPinCommonConvert
?
0
:
m_convert
);
pin
->
SetUnit
(
LastPinCommonUnit
?
0
:
m_unit
);
pin
->
SetUnit
(
LastPinCommonUnit
?
0
:
m_unit
);
pin
->
SetVisible
(
LastPinVisible
);
pin
->
SetVisible
(
LastPinVisible
);
...
@@ -507,11 +507,11 @@ void LIB_EDIT_FRAME::GlobalSetPins( wxDC* DC, LIB_PIN* MasterPin, int id )
...
@@ -507,11 +507,11 @@ void LIB_EDIT_FRAME::GlobalSetPins( wxDC* DC, LIB_PIN* MasterPin, int id )
switch
(
id
)
switch
(
id
)
{
{
case
ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_PINNUMSIZE_ITEM
:
case
ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_PINNUMSIZE_ITEM
:
Pin
->
m_PinNumSize
=
MasterPin
->
m_PinNumSize
;
Pin
->
SetNumberTextSize
(
MasterPin
->
GetNumberTextSize
()
)
;
break
;
break
;
case
ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_PINNAMESIZE_ITEM
:
case
ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_PINNAMESIZE_ITEM
:
Pin
->
m_PinNameSize
=
MasterPin
->
m_PinNameSize
;
Pin
->
SetNameTextSize
(
MasterPin
->
GetNameTextSize
()
)
;
break
;
break
;
case
ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_PINSIZE_ITEM
:
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 )
...
@@ -1472,7 +1472,8 @@ void SCH_COMPONENT::DisplayInfo( EDA_DRAW_FRAME* frame )
frame
->
ClearMsgPanel
();
frame
->
ClearMsgPanel
();
frame
->
AppendMsgPanel
(
_
(
"Reference"
),
GetRef
(
(
(
SCH_EDIT_FRAME
*
)
frame
)
->
GetSheet
()
),
frame
->
AppendMsgPanel
(
_
(
"Reference"
),
GetRef
(
&
(
(
(
SCH_EDIT_FRAME
*
)
frame
)
->
GetCurrentSheet
()
)
),
DARKCYAN
);
DARKCYAN
);
if
(
root_component
->
IsPower
()
)
if
(
root_component
->
IsPower
()
)
...
...
eeschema/sch_sheet_path.cpp
View file @
d8ad2cce
...
@@ -59,7 +59,7 @@ bool SCH_SHEET_PATH::BuildSheetPathInfoFromSheetPathValue( const wxString& aPath
...
@@ -59,7 +59,7 @@ bool SCH_SHEET_PATH::BuildSheetPathInfoFromSheetPathValue( const wxString& aPath
if
(
aFound
)
if
(
aFound
)
return
true
;
return
true
;
if
(
GetSheetsCount
()
==
0
)
if
(
GetSheetsCount
()
==
0
)
Push
(
g_RootSheet
);
Push
(
g_RootSheet
);
if
(
aPath
==
Path
()
)
if
(
aPath
==
Path
()
)
...
...
eeschema/schframe.cpp
View file @
d8ad2cce
...
@@ -286,12 +286,6 @@ SCH_EDIT_FRAME::~SCH_EDIT_FRAME()
...
@@ -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
()
void
SCH_EDIT_FRAME
::
SetSheetNumberAndCount
()
{
{
SCH_SCREEN
*
screen
=
GetScreen
();
SCH_SCREEN
*
screen
=
GetScreen
();
...
@@ -369,6 +363,20 @@ void SCH_EDIT_FRAME::CreateScreens()
...
@@ -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
)
void
SCH_EDIT_FRAME
::
SetUndoItem
(
const
SCH_ITEM
*
aItem
)
{
{
// if aItem != NULL, delete a previous m_undoItem, if exists
// 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
...
@@ -261,7 +261,7 @@ LIB_VIEW_FRAME::LIB_VIEW_FRAME( wxWindow* father, CMP_LIBRARY* Library, wxSemaph
LIB_VIEW_FRAME
::~
LIB_VIEW_FRAME
()
LIB_VIEW_FRAME
::~
LIB_VIEW_FRAME
()
{
{
SCH_EDIT_FRAME
*
frame
=
(
SCH_EDIT_FRAME
*
)
wxGetApp
().
GetTopWindow
();
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 {
...
@@ -113,18 +113,16 @@ enum SCH_SEARCH_T {
class
SCH_EDIT_FRAME
:
public
EDA_DRAW_FRAME
class
SCH_EDIT_FRAME
:
public
EDA_DRAW_FRAME
{
{
public
:
public
:
wxComboBox
*
m_SelPartBox
;
SCH_SHEET_PATH
*
m_CurrentSheet
;
///< which sheet we are presently working on.
int
m_NetlistFormat
;
int
m_NetlistFormat
;
int
m_AddSubPrefix
;
int
m_AddSubPrefix
;
bool
m_ShowAllPins
;
bool
m_ShowAllPins
;
wxPoint
m_OldPos
;
LIB_EDIT_FRAME
*
m_LibeditFrame
;
LIB_VIEW_FRAME
*
m_ViewlibFrame
;
wxString
m_UserLibraryPath
;
wxString
m_UserLibraryPath
;
wxArrayString
m_ComponentLibFiles
;
wxArrayString
m_ComponentLibFiles
;
private
:
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
;
wxString
m_DefaultSchematicFileName
;
int
m_TextFieldSize
;
int
m_TextFieldSize
;
PARAM_CFG_ARRAY
m_projectFileParams
;
PARAM_CFG_ARRAY
m_projectFileParams
;
...
@@ -187,6 +185,11 @@ public:
...
@@ -187,6 +185,11 @@ public:
~
SCH_EDIT_FRAME
();
~
SCH_EDIT_FRAME
();
void
OnCloseWindow
(
wxCloseEvent
&
Event
);
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
Process_Special_Functions
(
wxCommandEvent
&
event
);
void
OnColorConfig
(
wxCommandEvent
&
aEvent
);
void
OnColorConfig
(
wxCommandEvent
&
aEvent
);
void
Process_Config
(
wxCommandEvent
&
event
);
void
Process_Config
(
wxCommandEvent
&
event
);
...
@@ -311,8 +314,6 @@ public:
...
@@ -311,8 +314,6 @@ public:
*/
*/
void
OnModify
();
void
OnModify
();
SCH_SHEET_PATH
*
GetSheet
();
SCH_SCREEN
*
GetScreen
()
const
;
SCH_SCREEN
*
GetScreen
()
const
;
virtual
wxString
GetScreenDesc
();
virtual
wxString
GetScreenDesc
();
...
@@ -498,6 +499,10 @@ public:
...
@@ -498,6 +499,10 @@ public:
int
CheckAnnotate
(
wxArrayString
*
aMessageList
,
bool
aOneSheetOnly
);
int
CheckAnnotate
(
wxArrayString
*
aMessageList
,
bool
aOneSheetOnly
);
// Functions used for hierarchy handling
// Functions used for hierarchy handling
SCH_SHEET_PATH
&
GetCurrentSheet
();
void
SetCurrentSheet
(
const
SCH_SHEET_PATH
&
aSheet
);
/**
/**
* Function DisplayCurrentSheet
* Function DisplayCurrentSheet
* draws the current sheet on the display.
* 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