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
9461f162
Commit
9461f162
authored
Dec 09, 2011
by
Wayne Stambaugh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Encapsulate SCH_EDIT_FRAME and LIB_EDIT_FRAME classes.
parent
4cb29f61
Changes
14
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
228 additions
and
181 deletions
+228
-181
dialog_eeschema_config.cpp
eeschema/dialogs/dialog_eeschema_config.cpp
+43
-18
eelibs_read_libraryfiles.cpp
eeschema/eelibs_read_libraryfiles.cpp
+3
-3
eeschema_config.cpp
eeschema/eeschema_config.cpp
+14
-14
lib_export.cpp
eeschema/lib_export.cpp
+3
-3
lib_pin.cpp
eeschema/lib_pin.cpp
+3
-2
libeditframe.cpp
eeschema/libeditframe.cpp
+26
-26
libeditframe.h
eeschema/libeditframe.h
+65
-68
netlist_control.cpp
eeschema/netlist_control.cpp
+12
-14
schframe.cpp
eeschema/schframe.cpp
+5
-5
tool_lib.cpp
eeschema/tool_lib.cpp
+16
-16
tool_sch.cpp
eeschema/tool_sch.cpp
+1
-1
viewlib_frame.cpp
eeschema/viewlib_frame.cpp
+3
-3
viewlib_frame.h
eeschema/viewlib_frame.h
+1
-1
wxEeschemaStruct.h
include/wxEeschemaStruct.h
+33
-7
No files found.
eeschema/dialogs/dialog_eeschema_config.cpp
View file @
9461f162
/////////////////////////////////////////////////////////////////////////////
// Name: dialog_eeschema_config.cpp
// Purpose:
// Author: jean-pierre Charras
// Created: 17/02/2006 21:14:46
// Copyright: KiCad Team
// Licence: GPL
/////////////////////////////////////////////////////////////////////////////
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2006 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
* Copyright (C) 2006-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 dialog_eeschema_config.cpp
*/
#include "fctsys.h"
#include "appl_wxstruct.h"
...
...
@@ -50,9 +69,9 @@ void DIALOG_EESCHEMA_CONFIG::Init()
m_LibListChanged
=
false
;
m_LibPathChanged
=
false
;
m_UserLibDirBufferImg
=
m_Parent
->
m_UserLibraryPath
;
m_UserLibDirBufferImg
=
m_Parent
->
GetUserLibraryPath
()
;
m_ListLibr
->
InsertItems
(
m_Parent
->
m_ComponentLibFiles
,
0
);
m_ListLibr
->
InsertItems
(
m_Parent
->
GetComponentLibraries
()
,
0
);
// Load user libs paths:
wxStringTokenizer
Token
(
m_UserLibDirBufferImg
,
wxT
(
";
\n\r
"
)
);
...
...
@@ -154,7 +173,8 @@ void DIALOG_EESCHEMA_CONFIG::OnCancelClick( wxCommandEvent& event )
{
for
(
unsigned
ii
=
0
;
ii
<
m_ListLibr
->
GetCount
();
ii
++
)
wxGetApp
().
RemoveLibraryPath
(
m_listUserPaths
->
GetString
(
ii
)
);
wxGetApp
().
InsertLibraryPath
(
m_Parent
->
m_UserLibraryPath
,
1
);
wxGetApp
().
InsertLibraryPath
(
m_Parent
->
GetUserLibraryPath
(),
1
);
}
EndModal
(
wxID_CANCEL
);
...
...
@@ -166,15 +186,17 @@ void DIALOG_EESCHEMA_CONFIG::OnOkClick( wxCommandEvent& event )
// Recreate the user lib path
if
(
m_LibPathChanged
)
{
m_Parent
->
m_UserLibraryPath
.
Empty
()
;
wxString
path
;
for
(
unsigned
ii
=
0
;
ii
<
m_listUserPaths
->
GetCount
();
ii
++
)
{
if
(
ii
>
0
)
m_Parent
->
m_UserLibraryP
ath
<<
wxT
(
";"
);
p
ath
<<
wxT
(
";"
);
m_Parent
->
m_UserLibraryP
ath
<<
m_listUserPaths
->
GetString
(
ii
);
p
ath
<<
m_listUserPaths
->
GetString
(
ii
);
}
m_Parent
->
SetUserLibraryPath
(
path
);
}
/* Set new active library list if the lib list of if default path list
...
...
@@ -182,11 +204,13 @@ void DIALOG_EESCHEMA_CONFIG::OnOkClick( wxCommandEvent& event )
*/
if
(
m_LibListChanged
||
m_LibPathChanged
)
{
// Recreate lib list
m_Parent
->
m_ComponentLibFiles
.
Clear
();
wxArrayString
list
;
for
(
unsigned
ii
=
0
;
ii
<
m_ListLibr
->
GetCount
();
ii
++
)
m_Parent
->
m_ComponentLibFiles
.
Add
(
m_ListLibr
->
GetString
(
ii
)
);
list
.
Add
(
m_ListLibr
->
GetString
(
ii
)
);
// Recreate lib list
m_Parent
->
SetComponentLibraries
(
list
);
// take new list in account
m_Parent
->
LoadLibraries
();
...
...
@@ -298,6 +322,7 @@ void DIALOG_EESCHEMA_CONFIG::OnAddOrInsertLibClick( wxCommandEvent& event )
if
(
m_ListLibr
->
FindString
(
libfilename
,
fn
.
IsCaseSensitive
()
)
==
wxNOT_FOUND
)
{
m_LibListChanged
=
TRUE
;
if
(
event
.
GetId
()
==
ID_ADD_LIB
)
m_ListLibr
->
Append
(
libfilename
);
else
...
...
eeschema/eelibs_read_libraryfiles.cpp
View file @
9461f162
...
...
@@ -34,17 +34,17 @@ void SCH_EDIT_FRAME::LoadLibraries( void )
continue
;
}
if
(
m_
C
omponentLibFiles
.
Index
(
i
->
GetName
(),
false
)
==
wxNOT_FOUND
)
if
(
m_
c
omponentLibFiles
.
Index
(
i
->
GetName
(),
false
)
==
wxNOT_FOUND
)
i
=
CMP_LIBRARY
::
GetLibraryList
().
erase
(
i
);
else
i
++
;
}
/* Load missing libraries. */
for
(
ii
=
0
;
ii
<
m_
C
omponentLibFiles
.
GetCount
();
ii
++
)
for
(
ii
=
0
;
ii
<
m_
c
omponentLibFiles
.
GetCount
();
ii
++
)
{
fn
.
Clear
();
fn
.
SetName
(
m_
C
omponentLibFiles
[
ii
]
);
fn
.
SetName
(
m_
c
omponentLibFiles
[
ii
]
);
fn
.
SetExt
(
CompLibFileExtension
);
/* Skip if the file name is not valid.. */
...
...
eeschema/eeschema_config.cpp
View file @
9461f162
...
...
@@ -191,7 +191,7 @@ void SCH_EDIT_FRAME::OnSetOptions( wxCommandEvent& event )
dlg
.
SetRepeatLabel
(
g_RepeatDeltaLabel
);
dlg
.
SetAutoSaveInterval
(
GetAutoSaveInterval
()
/
60
);
dlg
.
SetShowGrid
(
IsGridVisible
()
);
dlg
.
SetShowHiddenPins
(
m_
S
howAllPins
);
dlg
.
SetShowHiddenPins
(
m_
s
howAllPins
);
dlg
.
SetEnableAutoPan
(
DrawPanel
->
m_AutoPAN_Enable
);
dlg
.
SetEnableHVBusOrientation
(
g_HVLines
);
dlg
.
SetShowPageLimits
(
g_ShowPageLimits
);
...
...
@@ -222,7 +222,7 @@ void SCH_EDIT_FRAME::OnSetOptions( wxCommandEvent& event )
g_RepeatDeltaLabel
=
dlg
.
GetRepeatLabel
();
SetAutoSaveInterval
(
dlg
.
GetAutoSaveInterval
()
*
60
);
SetGridVisibility
(
dlg
.
GetShowGrid
()
);
m_
S
howAllPins
=
dlg
.
GetShowHiddenPins
();
m_
s
howAllPins
=
dlg
.
GetShowHiddenPins
();
DrawPanel
->
m_AutoPAN_Enable
=
dlg
.
GetEnableAutoPan
();
g_HVLines
=
dlg
.
GetEnableHVBusOrientation
();
g_ShowPageLimits
=
dlg
.
GetShowPageLimits
();
...
...
@@ -258,12 +258,12 @@ PARAM_CFG_ARRAY& SCH_EDIT_FRAME::GetProjectFileParameters()
return
m_projectFileParams
;
m_projectFileParams
.
push_back
(
new
PARAM_CFG_FILENAME
(
wxT
(
"LibDir"
),
&
m_
U
serLibraryPath
)
);
&
m_
u
serLibraryPath
)
);
m_projectFileParams
.
push_back
(
new
PARAM_CFG_LIBNAME_LIST
(
wxT
(
"LibName"
),
&
m_
C
omponentLibFiles
,
&
m_
c
omponentLibFiles
,
GROUPLIB
)
);
m_projectFileParams
.
push_back
(
new
PARAM_CFG_INT
(
wxT
(
"NetFmt"
),
&
m_
Netl
istFormat
,
&
m_
netL
istFormat
,
NET_TYPE_PCBNEW
,
NET_TYPE_PCBNEW
,
NET_TYPE_CUSTOM_MAX
)
);
...
...
@@ -340,37 +340,37 @@ bool SCH_EDIT_FRAME::LoadProjectFile( const wxString& aFileName, bool aForceRere
{
wxFileName
fn
;
bool
IsRead
=
true
;
wxArrayString
liblist_tmp
=
m_
C
omponentLibFiles
;
wxArrayString
liblist_tmp
=
m_
c
omponentLibFiles
;
if
(
aFileName
.
IsEmpty
()
)
fn
=
g_RootSheet
->
GetScreen
()
->
GetFileName
();
else
fn
=
aFileName
;
m_
C
omponentLibFiles
.
Clear
();
m_
c
omponentLibFiles
.
Clear
();
/* Change the schematic file extension (.sch) to the project file
* extension (.pro). */
fn
.
SetExt
(
ProjectFileExtension
);
wxGetApp
().
RemoveLibraryPath
(
m_
U
serLibraryPath
);
wxGetApp
().
RemoveLibraryPath
(
m_
u
serLibraryPath
);
if
(
!
wxGetApp
().
ReadProjectConfig
(
fn
.
GetFullPath
(),
GROUP
,
GetProjectFileParameters
(),
!
aForceReread
)
)
{
m_
C
omponentLibFiles
=
liblist_tmp
;
m_
c
omponentLibFiles
=
liblist_tmp
;
IsRead
=
false
;
}
/* User library path takes precedent over default library search paths. */
wxGetApp
().
InsertLibraryPath
(
m_
U
serLibraryPath
,
1
);
wxGetApp
().
InsertLibraryPath
(
m_
u
serLibraryPath
,
1
);
/* If the list is void, force loading the library "power.lib" that is
* the "standard" library for power symbols.
*/
if
(
m_
C
omponentLibFiles
.
GetCount
()
==
0
)
m_
C
omponentLibFiles
.
Add
(
wxT
(
"power"
)
);
if
(
m_
c
omponentLibFiles
.
GetCount
()
==
0
)
m_
c
omponentLibFiles
.
Add
(
wxT
(
"power"
)
);
LoadLibraries
();
GetScreen
()
->
SetGrid
(
ID_POPUP_GRID_LEVEL_1000
+
m_LastGridSizeId
);
...
...
@@ -526,7 +526,7 @@ void SCH_EDIT_FRAME::LoadSettings()
m_GridColor
=
g_LayerDescr
.
LayerColor
[
LAYER_GRID
];
g_DrawDefaultLineThickness
=
cfg
->
Read
(
DefaultDrawLineWidthEntry
,(
long
)
6
);
cfg
->
Read
(
ShowHiddenPinsEntry
,
&
m_
S
howAllPins
,
false
);
cfg
->
Read
(
ShowHiddenPinsEntry
,
&
m_
s
howAllPins
,
false
);
cfg
->
Read
(
HorzVertLinesOnlyEntry
,
&
g_HVLines
,
true
);
/* Load print preview window session settings. */
...
...
@@ -617,7 +617,7 @@ void SCH_EDIT_FRAME::SaveSettings()
wxGetApp
().
SaveCurrentSetupValues
(
GetConfigurationSettings
()
);
cfg
->
Write
(
DefaultDrawLineWidthEntry
,
(
long
)
g_DrawDefaultLineThickness
);
cfg
->
Write
(
ShowHiddenPinsEntry
,
m_
S
howAllPins
);
cfg
->
Write
(
ShowHiddenPinsEntry
,
m_
s
howAllPins
);
cfg
->
Write
(
HorzVertLinesOnlyEntry
,
g_HVLines
);
/* Save print preview window session settings. */
...
...
eeschema/lib_export.cpp
View file @
9461f162
...
...
@@ -58,7 +58,7 @@ void LIB_EDIT_FRAME::OnImportPart( wxCommandEvent& event )
m_lastDrawItem
=
NULL
;
wxFileDialog
dlg
(
this
,
_
(
"Import Component"
),
m_
L
astLibImportPath
,
wxFileDialog
dlg
(
this
,
_
(
"Import Component"
),
m_
l
astLibImportPath
,
wxEmptyString
,
CompLibFileWildcard
,
wxFD_OPEN
|
wxFD_FILE_MUST_EXIST
);
...
...
@@ -86,7 +86,7 @@ void LIB_EDIT_FRAME::OnImportPart( wxCommandEvent& event )
if
(
LoadOneLibraryPartAux
(
LibEntry
,
LibTmp
)
)
{
fn
=
dlg
.
GetPath
();
m_
L
astLibImportPath
=
fn
.
GetPath
();
m_
l
astLibImportPath
=
fn
.
GetPath
();
DisplayLibInfos
();
GetScreen
()
->
ClearUndoRedoList
();
DrawPanel
->
Refresh
();
...
...
@@ -143,7 +143,7 @@ void LIB_EDIT_FRAME::OnExportPart( wxCommandEvent& event )
bool
success
=
m_library
->
Save
(
formatter
);
if
(
success
)
m_
L
astLibExportPath
=
fn
.
GetPath
();
m_
l
astLibExportPath
=
fn
.
GetPath
();
delete
m_library
;
m_library
=
CurLibTmp
;
...
...
eeschema/lib_pin.cpp
View file @
9461f162
...
...
@@ -812,16 +812,17 @@ void LIB_PIN::drawGraphic( EDA_DRAW_PANEL* aPanel,
{
// Invisible pins are only drawn on request.
// They are drawn in g_InvisibleItemColor.
// in schematic, they are drawn only if m_
S
howAllPins is true.
// in schematic, they are drawn only if m_
s
howAllPins is true.
// In other windows, they are always drawn because we must see them.
if
(
!
IsVisible
()
)
{
EDA_DRAW_FRAME
*
frame
=
NULL
;
if
(
aPanel
&&
aPanel
->
GetParent
()
)
frame
=
(
EDA_DRAW_FRAME
*
)
aPanel
->
GetParent
();
if
(
frame
&&
frame
->
IsType
(
SCHEMATIC_FRAME
)
&&
!
((
SCH_EDIT_FRAME
*
)
frame
)
->
m_ShowAllPins
)
!
((
SCH_EDIT_FRAME
*
)
frame
)
->
GetShowAllPins
()
)
return
;
aColor
=
g_InvisibleItemColor
;
...
...
eeschema/libeditframe.cpp
View file @
9461f162
...
...
@@ -195,7 +195,7 @@ LIB_EDIT_FRAME::LIB_EDIT_FRAME( SCH_EDIT_FRAME* aParent,
m_FrameName
=
wxT
(
"LibeditFrame"
);
m_Draw_Axis
=
true
;
// true to draw axis
m_
C
onfigPath
=
wxT
(
"LibraryEditor"
);
m_
c
onfigPath
=
wxT
(
"LibraryEditor"
);
SetShowDeMorgan
(
false
);
m_drawSpecificConvert
=
true
;
m_drawSpecificUnit
=
false
;
...
...
@@ -291,11 +291,11 @@ void LIB_EDIT_FRAME::LoadSettings()
EDA_DRAW_FRAME
::
LoadSettings
();
wxConfigPathChanger
cpc
(
wxGetApp
().
m_EDA_Config
,
m_
C
onfigPath
);
wxConfigPathChanger
cpc
(
wxGetApp
().
m_EDA_Config
,
m_
c
onfigPath
);
cfg
=
wxGetApp
().
m_EDA_Config
;
m_
L
astLibExportPath
=
cfg
->
Read
(
lastLibExportPathEntry
,
::
wxGetCwd
()
);
m_
L
astLibImportPath
=
cfg
->
Read
(
lastLibImportPathEntry
,
::
wxGetCwd
()
);
m_
l
astLibExportPath
=
cfg
->
Read
(
lastLibExportPathEntry
,
::
wxGetCwd
()
);
m_
l
astLibImportPath
=
cfg
->
Read
(
lastLibImportPathEntry
,
::
wxGetCwd
()
);
}
...
...
@@ -312,11 +312,11 @@ void LIB_EDIT_FRAME::SaveSettings()
EDA_DRAW_FRAME
::
SaveSettings
();
wxConfigPathChanger
cpc
(
wxGetApp
().
m_EDA_Config
,
m_
C
onfigPath
);
wxConfigPathChanger
cpc
(
wxGetApp
().
m_EDA_Config
,
m_
c
onfigPath
);
cfg
=
wxGetApp
().
m_EDA_Config
;
cfg
->
Write
(
lastLibExportPathEntry
,
m_
L
astLibExportPath
);
cfg
->
Write
(
lastLibImportPathEntry
,
m_
L
astLibImportPath
);
cfg
->
Write
(
lastLibExportPathEntry
,
m_
l
astLibExportPath
);
cfg
->
Write
(
lastLibImportPathEntry
,
m_
l
astLibImportPath
);
}
...
...
@@ -402,35 +402,35 @@ double LIB_EDIT_FRAME::BestZoom()
void
LIB_EDIT_FRAME
::
UpdateAliasSelectList
()
{
if
(
m_
SelAlias
Box
==
NULL
)
if
(
m_
aliasSelect
Box
==
NULL
)
return
;
m_
SelAlias
Box
->
Clear
();
m_
aliasSelect
Box
->
Clear
();
if
(
m_component
==
NULL
)
return
;
m_
SelAlias
Box
->
Append
(
m_component
->
GetAliasNames
()
);
m_
SelAlias
Box
->
SetSelection
(
0
);
m_
aliasSelect
Box
->
Append
(
m_component
->
GetAliasNames
()
);
m_
aliasSelect
Box
->
SetSelection
(
0
);
int
index
=
m_
SelAlias
Box
->
FindString
(
m_aliasName
);
int
index
=
m_
aliasSelect
Box
->
FindString
(
m_aliasName
);
if
(
index
!=
wxNOT_FOUND
)
m_
SelAlias
Box
->
SetSelection
(
index
);
m_
aliasSelect
Box
->
SetSelection
(
index
);
}
void
LIB_EDIT_FRAME
::
UpdatePartSelectList
()
{
if
(
m_
Selpar
tBox
==
NULL
)
if
(
m_
partSelec
tBox
==
NULL
)
return
;
if
(
m_
Selpar
tBox
->
GetCount
()
!=
0
)
m_
Selpar
tBox
->
Clear
();
if
(
m_
partSelec
tBox
->
GetCount
()
!=
0
)
m_
partSelec
tBox
->
Clear
();
if
(
m_component
==
NULL
||
m_component
->
GetPartCount
()
<=
1
)
{
m_
Selpar
tBox
->
Append
(
wxEmptyString
);
m_
partSelec
tBox
->
Append
(
wxEmptyString
);
}
else
{
...
...
@@ -438,11 +438,11 @@ void LIB_EDIT_FRAME::UpdatePartSelectList()
{
wxString
msg
;
msg
.
Printf
(
_
(
"Part %c"
),
'A'
+
i
);
m_
Selpar
tBox
->
Append
(
msg
);
m_
partSelec
tBox
->
Append
(
msg
);
}
}
m_
Selpar
tBox
->
SetSelection
(
(
m_unit
>
0
)
?
m_unit
-
1
:
0
);
m_
partSelec
tBox
->
SetSelection
(
(
m_unit
>
0
)
?
m_unit
-
1
:
0
);
}
...
...
@@ -510,13 +510,13 @@ void LIB_EDIT_FRAME::OnUpdatePinByPin( wxUpdateUIEvent& event )
void
LIB_EDIT_FRAME
::
OnUpdatePartNumber
(
wxUpdateUIEvent
&
event
)
{
if
(
m_
Selpar
tBox
==
NULL
)
if
(
m_
partSelec
tBox
==
NULL
)
return
;
/* Using the typical event.Enable() call doesn't seem to work with wxGTK
* so use the pointer to alias combobox to directly enable or disable.
*/
m_
Selpar
tBox
->
Enable
(
m_component
&&
m_component
->
GetPartCount
()
>
1
);
m_
partSelec
tBox
->
Enable
(
m_component
&&
m_component
->
GetPartCount
()
>
1
);
}
...
...
@@ -542,24 +542,24 @@ void LIB_EDIT_FRAME::OnUpdateDeMorganConvert( wxUpdateUIEvent& event )
void
LIB_EDIT_FRAME
::
OnUpdateSelectAlias
(
wxUpdateUIEvent
&
event
)
{
if
(
m_
SelAlias
Box
==
NULL
)
if
(
m_
aliasSelect
Box
==
NULL
)
return
;
/* Using the typical event.Enable() call doesn't seem to work with wxGTK
* so use the pointer to alias combobox to directly enable or disable.
*/
m_
SelAlias
Box
->
Enable
(
m_component
!=
NULL
&&
m_component
->
GetAliasCount
()
>
1
);
m_
aliasSelect
Box
->
Enable
(
m_component
!=
NULL
&&
m_component
->
GetAliasCount
()
>
1
);
}
void
LIB_EDIT_FRAME
::
OnSelectAlias
(
wxCommandEvent
&
event
)
{
if
(
m_
SelAlias
Box
==
NULL
||
(
m_
SelAlias
Box
->
GetStringSelection
().
CmpNoCase
(
m_aliasName
)
==
0
)
)
if
(
m_
aliasSelect
Box
==
NULL
||
(
m_
aliasSelect
Box
->
GetStringSelection
().
CmpNoCase
(
m_aliasName
)
==
0
)
)
return
;
m_lastDrawItem
=
NULL
;
m_aliasName
=
m_
SelAlias
Box
->
GetStringSelection
();
m_aliasName
=
m_
aliasSelect
Box
->
GetStringSelection
();
DisplayCmpDoc
();
DrawPanel
->
Refresh
();
...
...
eeschema/libeditframe.h
View file @
9461f162
...
...
@@ -53,12 +53,73 @@ class LIB_EDIT_FRAME : public EDA_DRAW_FRAME
{
LIB_COMPONENT
*
m_tempCopyComponent
;
///< Temporary copy of current component during edit.
LIB_COLLECTOR
m_collectedItems
;
// Used for hit testing.
wxComboBox
*
m_partSelectBox
;
// a Box to select a part to edit (if any)
wxComboBox
*
m_aliasSelectBox
;
// a box to select the alias to edit (if any)
LIB_ITEM
*
locateItem
(
const
wxPoint
&
aPosition
,
const
KICAD_T
aFilterList
[]
);
wxString
m_configPath
;
wxString
m_lastLibImportPath
;
wxString
m_lastLibExportPath
;
public
:
wxComboBox
*
m_SelpartBox
;
// a Box to select a part to edit (if any)
wxComboBox
*
m_SelAliasBox
;
// a box to select the alias to edit (if any)
/** Convert of the item currently being drawn. */
bool
m_drawSpecificConvert
;
/**
* Specify which component parts the current draw item applies to.
*
* If true, the item being drawn or edited applies only to the selected
* part. Otherwise it applies to all parts in the component.
*/
bool
m_drawSpecificUnit
;
/**
* Set to true to not synchronize pins at the same position when editing
* components with multiple parts or multiple body styles. Setting this
* to false allows editing each pin per part or body style individually.
* This requires the user to open each part or body style to make changes
* to the pin at the same location.
*/
bool
m_editPinsPerPartOrConvert
;
/** The current draw or edit graphic item fill style. */
static
FILL_T
m_drawFillStyle
;
/** Default line width for drawing or editing graphic items. */
static
int
m_drawLineWidth
;
/** The current active library. NULL if no active library is selected. */
static
CMP_LIBRARY
*
m_library
;
/** The current component being edited. NULL if no component is selected. */
static
LIB_COMPONENT
*
m_component
;
static
LIB_ITEM
*
m_lastDrawItem
;
static
LIB_ITEM
*
m_drawItem
;
static
wxString
m_aliasName
;
// The unit number to edit and show
static
int
m_unit
;
// Show the normal shape ( m_convert <= 1 ) or the converted shape
// ( m_convert > 1 )
static
int
m_convert
;
// true to force DeMorgan/normal tools selection enabled.
// They are enabled when the loaded component has
// Graphic items for converted shape
// But under some circumstances (New component created)
// these tools must left enable
static
bool
m_showDeMorgan
;
/// The current text size setting.
static
int
m_textSize
;
/// Current text orientation setting.
static
int
m_textOrientation
;
static
wxSize
m_clientSize
;
friend
class
DIALOG_LIB_EDIT_TEXT
;
LIB_ITEM
*
locateItem
(
const
wxPoint
&
aPosition
,
const
KICAD_T
aFilterList
[]
);
public
:
LIB_EDIT_FRAME
(
SCH_EDIT_FRAME
*
aParent
,
const
wxString
&
title
,
...
...
@@ -498,70 +559,6 @@ public:
// Automatic placement of pins
void
RepeatPinItem
(
wxDC
*
DC
,
LIB_PIN
*
Pin
);
protected
:
wxString
m_ConfigPath
;
wxString
m_LastLibImportPath
;
wxString
m_LastLibExportPath
;
/** Convert of the item currently being drawn. */
bool
m_drawSpecificConvert
;
/**
* Specify which component parts the current draw item applies to.
*
* If true, the item being drawn or edited applies only to the selected
* part. Otherwise it applies to all parts in the component.
*/
bool
m_drawSpecificUnit
;
/**
* Set to true to not synchronize pins at the same position when editing
* components with multiple parts or multiple body styles. Setting this
* to false allows editing each pin per part or body style individually.
* This requires the user to open each part or body style to make changes
* to the pin at the same location.
*/
bool
m_editPinsPerPartOrConvert
;
/** The current draw or edit graphic item fill style. */
static
FILL_T
m_drawFillStyle
;
/** Default line width for drawing or editing graphic items. */
static
int
m_drawLineWidth
;
/** The current active library. NULL if no active library is selected. */
static
CMP_LIBRARY
*
m_library
;
/** The current component being edited. NULL if no component is selected. */
static
LIB_COMPONENT
*
m_component
;
static
LIB_ITEM
*
m_lastDrawItem
;
static
LIB_ITEM
*
m_drawItem
;
static
wxString
m_aliasName
;
// The unit number to edit and show
static
int
m_unit
;
// Show the normal shape ( m_convert <= 1 ) or the converted shape
// ( m_convert > 1 )
static
int
m_convert
;
// true to force DeMorgan/normal tools selection enabled.
// They are enabled when the loaded component has
// Graphic items for converted shape
// But under some circumstances (New component created)
// these tools must left enable
static
bool
m_showDeMorgan
;
/// The current text size setting.
static
int
m_textSize
;
/// Current text orientation setting.
static
int
m_textOrientation
;
static
wxSize
m_clientSize
;
friend
class
DIALOG_LIB_EDIT_TEXT
;
/**
* Function CreatePNGorJPEGFile
* creates an image (screenshot) of the current component in PNG or JPEG format.
...
...
eeschema/netlist_control.cpp
View file @
9461f162
...
...
@@ -193,7 +193,7 @@ NETLIST_DIALOG::NETLIST_DIALOG( SCH_EDIT_FRAME* parent ) :
NET_TYPE_PCBNEW
,
ID_CURRENT_FORMAT_IS_DEFAULT
,
ID_CREATE_NETLIST
,
m_Parent
->
m_NetlistFormat
==
NET_TYPE_PCBNEW
);
m_Parent
->
GetNetListFormat
()
==
NET_TYPE_PCBNEW
);
// Add Panel FORMAT ORCADPCB2
m_PanelNetType
[
PANELORCADPCB2
]
=
...
...
@@ -202,7 +202,7 @@ NETLIST_DIALOG::NETLIST_DIALOG( SCH_EDIT_FRAME* parent ) :
NET_TYPE_ORCADPCB2
,
ID_CURRENT_FORMAT_IS_DEFAULT
,
ID_CREATE_NETLIST
,
m_Parent
->
m_NetlistFormat
==
NET_TYPE_ORCADPCB2
);
m_Parent
->
GetNetListFormat
()
==
NET_TYPE_ORCADPCB2
);
// Add Panel FORMAT CADSTAR
m_PanelNetType
[
PANELCADSTAR
]
=
...
...
@@ -211,7 +211,7 @@ NETLIST_DIALOG::NETLIST_DIALOG( SCH_EDIT_FRAME* parent ) :
NET_TYPE_CADSTAR
,
ID_CURRENT_FORMAT_IS_DEFAULT
,
ID_CREATE_NETLIST
,
m_Parent
->
m_NetlistFormat
==
NET_TYPE_CADSTAR
);
m_Parent
->
GetNetListFormat
()
==
NET_TYPE_CADSTAR
);
// Add Panel spice
InstallPageSpice
();
...
...
@@ -236,16 +236,16 @@ void NETLIST_DIALOG::InstallPageSpice()
wxT
(
"Spice"
),
NET_TYPE_SPICE
,
0
,
0
,
m_Parent
->
m_NetlistFormat
==
NET_TYPE_SPICE
);
m_Parent
->
GetNetListFormat
()
==
NET_TYPE_SPICE
);
page
->
m_IsCurrentFormat
=
new
wxCheckBox
(
page
,
ID_CURRENT_FORMAT_IS_DEFAULT
,
_
(
"Default format"
)
);
page
->
m_IsCurrentFormat
->
SetValue
(
m_Parent
->
m_NetlistFormat
==
NET_TYPE_SPICE
);
page
->
m_IsCurrentFormat
->
SetValue
(
m_Parent
->
GetNetListFormat
()
==
NET_TYPE_SPICE
);
page
->
m_LeftBoxSizer
->
Add
(
page
->
m_IsCurrentFormat
,
1
,
wxGROW
|
wxALL
,
5
);
page
->
m_AddSubPrefix
=
new
wxCheckBox
(
page
,
ID_ADD_SUBCIRCUIT_PREFIX
,
_
(
"Prefix references 'U' and 'IC' with 'X'"
)
);
page
->
m_AddSubPrefix
->
SetValue
(
m_Parent
->
m_AddSubPrefix
);
page
->
m_AddSubPrefix
->
SetValue
(
m_Parent
->
GetAddReferencePrefix
()
);
page
->
m_LeftBoxSizer
->
Add
(
page
->
m_AddSubPrefix
,
0
,
wxGROW
|
wxALL
,
5
);
...
...
@@ -304,12 +304,13 @@ void NETLIST_DIALOG::InstallCustomPages()
if
(
title
.
IsEmpty
()
&&
previoustitle
.
IsEmpty
()
)
break
;
// No more panel to install
selected
=
m_Parent
->
m_NetlistFormat
==
(
NET_TYPE_CUSTOM1
+
ii
);
selected
=
m_Parent
->
GetNetListFormat
()
==
(
NET_TYPE_CUSTOM1
+
ii
);
/* Install the panel "Add Plugin" after
* the last initialized panel */
previoustitle
=
title
;
if
(
title
.
IsEmpty
()
)
CurrPage
=
m_PanelNetType
[
PANELCUSTOMBASE
+
ii
]
=
...
...
@@ -430,7 +431,7 @@ void NETLIST_DIALOG::SelectNetlistType( wxCommandEvent& event )
if
(
CurrPage
==
NULL
)
return
;
m_Parent
->
m_NetlistFormat
=
CurrPage
->
m_IdNetType
;
m_Parent
->
SetNetListFormat
(
CurrPage
->
m_IdNetType
)
;
CurrPage
->
m_IsCurrentFormat
->
SetValue
(
true
);
}
...
...
@@ -449,10 +450,7 @@ void NETLIST_DIALOG::EnableSubcircuitPrefix( wxCommandEvent& event )
if
(
CurrPage
==
NULL
||
CurrPage
->
m_AddSubPrefix
==
NULL
)
return
;
if
(
CurrPage
->
m_AddSubPrefix
->
IsChecked
()
)
m_Parent
->
m_AddSubPrefix
=
true
;
else
m_Parent
->
m_AddSubPrefix
=
false
;
m_Parent
->
SetAddReferencePrefix
(
CurrPage
->
m_AddSubPrefix
->
IsChecked
()
);
}
void
NETLIST_DIALOG
::
NetlistUpdateOpt
()
...
...
@@ -460,7 +458,7 @@ void NETLIST_DIALOG::NetlistUpdateOpt()
int
ii
;
m_Parent
->
SetSimulatorCommand
(
m_PanelNetType
[
PANELSPICE
]
->
m_CommandStringCtrl
->
GetValue
()
);
m_Parent
->
m_NetlistFormat
=
NET_TYPE_PCBNEW
;
m_Parent
->
SetNetListFormat
(
NET_TYPE_PCBNEW
)
;
for
(
ii
=
0
;
ii
<
PANELCUSTOMBASE
+
CUSTOMPANEL_COUNTMAX
;
ii
++
)
{
...
...
@@ -468,7 +466,7 @@ void NETLIST_DIALOG::NetlistUpdateOpt()
break
;
if
(
m_PanelNetType
[
ii
]
->
m_IsCurrentFormat
->
GetValue
()
==
true
)
m_Parent
->
m_NetlistFormat
=
m_PanelNetType
[
ii
]
->
m_IdNetType
;
m_Parent
->
SetNetListFormat
(
m_PanelNetType
[
ii
]
->
m_IdNetType
)
;
}
g_OptNetListUseNames
=
true
;
// Used for pspice, gnucap
...
...
eeschema/schframe.cpp
View file @
9461f162
...
...
@@ -194,7 +194,7 @@ SCH_EDIT_FRAME::SCH_EDIT_FRAME( wxWindow* father,
m_ViewlibFrame
=
NULL
;
// Frame for browsing component libraries
m_DefaultSchematicFileName
=
NAMELESS_PROJECT
;
m_DefaultSchematicFileName
+=
wxT
(
".sch"
);
m_
S
howAllPins
=
false
;
m_
s
howAllPins
=
false
;
m_previewPosition
=
wxDefaultPosition
;
m_previewSize
=
wxDefaultSize
;
m_printMonochrome
=
true
;
...
...
@@ -592,10 +592,10 @@ void SCH_EDIT_FRAME::OnUpdateBusOrientation( wxUpdateUIEvent& aEvent )
void
SCH_EDIT_FRAME
::
OnUpdateHiddenPins
(
wxUpdateUIEvent
&
aEvent
)
{
wxString
tool_tip
=
m_
S
howAllPins
?
_
(
"Do not show hidden pins"
)
:
wxString
tool_tip
=
m_
s
howAllPins
?
_
(
"Do not show hidden pins"
)
:
_
(
"Show hidden pins"
);
aEvent
.
Check
(
m_
S
howAllPins
);
aEvent
.
Check
(
m_
s
howAllPins
);
m_OptionsToolBar
->
SetToolShortHelp
(
ID_TB_OPTIONS_HIDDEN_PINS
,
tool_tip
);
}
...
...
@@ -622,8 +622,8 @@ void SCH_EDIT_FRAME::OnCreateNetlist( wxCommandEvent& event )
{
int
i
;
if
(
m_
Netl
istFormat
<
NET_TYPE_PCBNEW
)
m_
Netl
istFormat
=
NET_TYPE_PCBNEW
;
if
(
m_
netL
istFormat
<
NET_TYPE_PCBNEW
)
m_
netL
istFormat
=
NET_TYPE_PCBNEW
;
do
{
...
...
eeschema/tool_lib.cpp
View file @
9461f162
...
...
@@ -121,7 +121,7 @@ void LIB_EDIT_FRAME::ReCreateHToolbar()
m_HToolBar
->
AddTool
(
ID_LIBEDIT_SELECT_PART
,
wxEmptyString
,
KiBitmap
(
import_cmp_from_lib_xpm
),
_
(
"Load component to edit from the current lib"
)
);
_
(
"Load component to edit from the current lib
rary
"
)
);
m_HToolBar
->
AddTool
(
ID_LIBEDIT_NEW_PART_FROM_EXISTING
,
wxEmptyString
,
KiBitmap
(
copycomponent_xpm
),
...
...
@@ -181,21 +181,21 @@ void LIB_EDIT_FRAME::ReCreateHToolbar()
_
(
"Edit document file"
)
);
m_HToolBar
->
AddSeparator
();
m_
Selpar
tBox
=
new
wxComboBox
(
m_HToolBar
,
m_
partSelec
tBox
=
new
wxComboBox
(
m_HToolBar
,
ID_LIBEDIT_SELECT_PART_NUMBER
,
wxEmptyString
,
wxDefaultPosition
,
wxSize
(
LISTBOX_WIDTH
,
-
1
),
0
,
NULL
,
wxCB_READONLY
);
m_HToolBar
->
AddControl
(
m_
Selpar
tBox
);
m_HToolBar
->
AddControl
(
m_
partSelec
tBox
);
m_
SelAlias
Box
=
new
wxComboBox
(
m_HToolBar
,
m_
aliasSelect
Box
=
new
wxComboBox
(
m_HToolBar
,
ID_LIBEDIT_SELECT_ALIAS
,
wxEmptyString
,
wxDefaultPosition
,
wxSize
(
LISTBOX_WIDTH
,
-
1
),
0
,
NULL
,
wxCB_READONLY
);
m_HToolBar
->
AddControl
(
m_
SelAlias
Box
);
m_HToolBar
->
AddControl
(
m_
aliasSelect
Box
);
m_HToolBar
->
AddSeparator
();
msg
=
_
(
"Edit pins per part or body style (Use carefully!)"
);
...
...
eeschema/tool_sch.cpp
View file @
9461f162
...
...
@@ -290,7 +290,7 @@ void SCH_EDIT_FRAME::OnSelectOptionToolbar( wxCommandEvent& event )
switch
(
id
)
{
case
ID_TB_OPTIONS_HIDDEN_PINS
:
m_
S
howAllPins
=
m_OptionsToolBar
->
GetToolState
(
id
);
m_
s
howAllPins
=
m_OptionsToolBar
->
GetToolState
(
id
);
DrawPanel
->
Refresh
(
);
break
;
...
...
eeschema/viewlib_frame.cpp
View file @
9461f162
...
...
@@ -106,7 +106,7 @@ LIB_VIEW_FRAME::LIB_VIEW_FRAME( wxWindow* father, CMP_LIBRARY* Library, wxSemaph
wxAcceleratorTable
table
(
ACCEL_TABLE_CNT
,
accels
);
m_FrameName
=
wxT
(
"ViewlibFrame"
);
m_
C
onfigPath
=
wxT
(
"LibraryViewer"
);
m_
c
onfigPath
=
wxT
(
"LibraryViewer"
);
// Give an icon
wxIcon
icon
;
...
...
@@ -513,7 +513,7 @@ void LIB_VIEW_FRAME::LoadSettings( )
EDA_DRAW_FRAME
::
LoadSettings
();
wxConfigPathChanger
cpc
(
wxGetApp
().
m_EDA_Config
,
m_
C
onfigPath
);
wxConfigPathChanger
cpc
(
wxGetApp
().
m_EDA_Config
,
m_
c
onfigPath
);
cfg
=
wxGetApp
().
m_EDA_Config
;
m_LibListSize
.
x
=
150
;
// default width of libs list
...
...
@@ -537,7 +537,7 @@ void LIB_VIEW_FRAME::SaveSettings()
EDA_DRAW_FRAME
::
SaveSettings
();
wxConfigPathChanger
cpc
(
wxGetApp
().
m_EDA_Config
,
m_
C
onfigPath
);
wxConfigPathChanger
cpc
(
wxGetApp
().
m_EDA_Config
,
m_
c
onfigPath
);
cfg
=
wxGetApp
().
m_EDA_Config
;
if
(
m_LibListSize
.
x
)
...
...
eeschema/viewlib_frame.h
View file @
9461f162
...
...
@@ -63,7 +63,7 @@ private:
// Flags
wxSemaphore
*
m_Semaphore
;
// != NULL if the frame must emulate a modal dialog
wxString
m_
C
onfigPath
;
// subpath for configuration
wxString
m_
c
onfigPath
;
// subpath for configuration
protected
:
static
wxString
m_libraryName
;
...
...
include/wxEeschemaStruct.h
View file @
9461f162
...
...
@@ -112,13 +112,6 @@ enum SCH_SEARCH_T {
*/
class
SCH_EDIT_FRAME
:
public
EDA_DRAW_FRAME
{
public
:
int
m_NetlistFormat
;
int
m_AddSubPrefix
;
bool
m_ShowAllPins
;
wxString
m_UserLibraryPath
;
wxArrayString
m_ComponentLibFiles
;
private
:
SCH_SHEET_PATH
*
m_CurrentSheet
;
///< which sheet we are presently working on.
LIB_VIEW_FRAME
*
m_ViewlibFrame
;
...
...
@@ -154,6 +147,19 @@ private:
/// An index to the last find item in the found items list #m_foundItems.
int
m_foundItemIndex
;
/// Flag to indicate show hidden pins.
bool
m_showAllPins
;
/// The format to use when generating a net list.
int
m_netListFormat
;
/// Add X prefix to componen referencess when generating spice net lists.
bool
m_addReferencPrefix
;
wxString
m_userLibraryPath
;
wxArrayString
m_componentLibFiles
;
static
int
m_lastSheetPinType
;
///< Last sheet pin type.
static
wxSize
m_lastSheetPinTextSize
;
///< Last sheet pin text size.
static
wxPoint
m_lastSheetPinPosition
;
///< Last sheet pin position.
...
...
@@ -190,6 +196,26 @@ public:
void
SetLibraryViewerWindow
(
LIB_VIEW_FRAME
*
aFrame
)
{
m_ViewlibFrame
=
aFrame
;
}
bool
GetShowAllPins
()
const
{
return
m_showAllPins
;
}
void
SetShowAllPins
(
bool
aEnable
)
{
m_showAllPins
=
aEnable
;
}
int
GetNetListFormat
()
const
{
return
m_netListFormat
;
}
void
SetNetListFormat
(
int
aFormat
)
{
m_netListFormat
=
aFormat
;
}
bool
GetAddReferencePrefix
()
const
{
return
m_addReferencPrefix
;
}
void
SetAddReferencePrefix
(
bool
aEnable
)
{
m_addReferencPrefix
=
aEnable
;
}
wxString
GetUserLibraryPath
()
const
{
return
m_userLibraryPath
;
}
void
SetUserLibraryPath
(
const
wxString
&
aPath
)
{
m_userLibraryPath
=
aPath
;
}
const
wxArrayString
&
GetComponentLibraries
()
const
{
return
m_componentLibFiles
;
}
void
SetComponentLibraries
(
const
wxArrayString
&
aList
)
{
m_componentLibFiles
=
aList
;
}
void
Process_Special_Functions
(
wxCommandEvent
&
event
);
void
OnColorConfig
(
wxCommandEvent
&
aEvent
);
void
Process_Config
(
wxCommandEvent
&
event
);
...
...
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