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
61159202
Commit
61159202
authored
Jul 05, 2014
by
Dick Hollenbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix Inner1.Cu in pcb_parser.cpp, start cvpcb work.
parent
e2e4fc48
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
125 additions
and
118 deletions
+125
-118
richio.cpp
common/richio.cpp
+2
-1
autosel.cpp
cvpcb/autosel.cpp
+17
-13
class_DisplayFootprintsFrame.cpp
cvpcb/class_DisplayFootprintsFrame.cpp
+1
-1
cvframe.cpp
cvpcb/cvframe.cpp
+69
-69
cvpcb.cpp
cvpcb/cvpcb.cpp
+0
-2
cvpcb.h
cvpcb/cvpcb.h
+0
-1
cvpcb_mainframe.h
cvpcb/cvpcb_mainframe.h
+3
-3
readwrite_dlgs.cpp
cvpcb/readwrite_dlgs.cpp
+14
-15
dsnlexer.h
include/dsnlexer.h
+0
-1
richio.h
include/richio.h
+2
-1
eagle_plugin.cpp
pcbnew/eagle_plugin.cpp
+1
-1
github_plugin.cpp
pcbnew/github/github_plugin.cpp
+1
-1
pcb_parser.cpp
pcbnew/pcb_parser.cpp
+13
-7
pcb_parser.h
pcbnew/pcb_parser.h
+2
-2
No files found.
common/richio.cpp
View file @
61159202
...
@@ -315,10 +315,11 @@ char* STRING_LINE_READER::ReadLine() throw( IO_ERROR )
...
@@ -315,10 +315,11 @@ char* STRING_LINE_READER::ReadLine() throw( IO_ERROR )
}
}
INPUTSTREAM_LINE_READER
::
INPUTSTREAM_LINE_READER
(
wxInputStream
*
aStream
)
:
INPUTSTREAM_LINE_READER
::
INPUTSTREAM_LINE_READER
(
wxInputStream
*
aStream
,
const
wxString
&
aSource
)
:
LINE_READER
(
LINE_READER_LINE_DEFAULT_MAX
),
LINE_READER
(
LINE_READER_LINE_DEFAULT_MAX
),
m_stream
(
aStream
)
m_stream
(
aStream
)
{
{
source
=
aSource
;
}
}
...
...
cvpcb/autosel.cpp
View file @
61159202
...
@@ -25,7 +25,7 @@
...
@@ -25,7 +25,7 @@
* @file autosel.cpp
* @file autosel.cpp
*/
*/
/
* Routines for automatic selection of modules. */
/
/ Routines for automatic selection of modules.
#include <fctsys.h>
#include <fctsys.h>
#include <common.h>
#include <common.h>
...
@@ -40,7 +40,10 @@
...
@@ -40,7 +40,10 @@
#include <cvpcb_mainframe.h>
#include <cvpcb_mainframe.h>
#include <cvstruct.h>
#include <cvstruct.h>
#define QUOTE '\''
#define QUOTE '\''
#define FMT_TITLE_LIB_LOAD_ERROR _( "Library Load Error" )
class
FOOTPRINT_ALIAS
class
FOOTPRINT_ALIAS
{
{
...
@@ -93,7 +96,7 @@ void CVPCB_MAINFRAME::AssocieModule( wxCommandEvent& event )
...
@@ -93,7 +96,7 @@ void CVPCB_MAINFRAME::AssocieModule( wxCommandEvent& event )
if
(
m_netlist
.
IsEmpty
()
)
if
(
m_netlist
.
IsEmpty
()
)
return
;
return
;
/
* Find equivalents in all available files. */
/
/ Find equivalents in all available files.
for
(
ii
=
0
;
ii
<
m_AliasLibNames
.
GetCount
();
ii
++
)
for
(
ii
=
0
;
ii
<
m_AliasLibNames
.
GetCount
();
ii
++
)
{
{
fn
=
m_AliasLibNames
[
ii
];
fn
=
m_AliasLibNames
[
ii
];
...
@@ -107,6 +110,7 @@ void CVPCB_MAINFRAME::AssocieModule( wxCommandEvent& event )
...
@@ -107,6 +110,7 @@ void CVPCB_MAINFRAME::AssocieModule( wxCommandEvent& event )
{
{
fn
.
SetExt
(
fn
.
GetExt
()
+
wxT
(
"."
)
+
FootprintAliasFileExtension
);
fn
.
SetExt
(
fn
.
GetExt
()
+
wxT
(
"."
)
+
FootprintAliasFileExtension
);
}
}
tmp
=
search
.
FindValidPath
(
fn
.
GetFullPath
()
);
tmp
=
search
.
FindValidPath
(
fn
.
GetFullPath
()
);
if
(
!
tmp
)
if
(
!
tmp
)
...
@@ -114,7 +118,7 @@ void CVPCB_MAINFRAME::AssocieModule( wxCommandEvent& event )
...
@@ -114,7 +118,7 @@ void CVPCB_MAINFRAME::AssocieModule( wxCommandEvent& event )
msg
.
Printf
(
_
(
"Footprint alias library file '%s' could not be found in the "
msg
.
Printf
(
_
(
"Footprint alias library file '%s' could not be found in the "
"default search paths."
),
"default search paths."
),
GetChars
(
fn
.
GetFullName
()
)
);
GetChars
(
fn
.
GetFullName
()
)
);
wxMessageBox
(
msg
,
titleLibLoadError
,
wxOK
|
wxICON_ERROR
);
wxMessageBox
(
msg
,
FMT_TITLE_LIB_LOAD_ERROR
,
wxOK
|
wxICON_ERROR
);
continue
;
continue
;
}
}
...
@@ -122,8 +126,8 @@ void CVPCB_MAINFRAME::AssocieModule( wxCommandEvent& event )
...
@@ -122,8 +126,8 @@ void CVPCB_MAINFRAME::AssocieModule( wxCommandEvent& event )
if
(
file
==
NULL
)
if
(
file
==
NULL
)
{
{
msg
.
Printf
(
_
(
"Error opening alias library
<%s>
."
),
GetChars
(
tmp
)
);
msg
.
Printf
(
_
(
"Error opening alias library
'%s'
."
),
GetChars
(
tmp
)
);
wxMessageBox
(
msg
,
titleLibLoadError
,
wxOK
|
wxICON_ERROR
);
wxMessageBox
(
msg
,
FMT_TITLE_LIB_LOAD_ERROR
,
wxOK
|
wxICON_ERROR
);
continue
;
continue
;
}
}
...
@@ -153,7 +157,7 @@ void CVPCB_MAINFRAME::AssocieModule( wxCommandEvent& event )
...
@@ -153,7 +157,7 @@ void CVPCB_MAINFRAME::AssocieModule( wxCommandEvent& event )
fclose
(
file
);
fclose
(
file
);
}
}
/
* Display the number of footprint aliases. */
/
/ Display the number of footprint aliases.
msg
.
Printf
(
_
(
"%d footprint aliases found."
),
aliases
.
size
()
);
msg
.
Printf
(
_
(
"%d footprint aliases found."
),
aliases
.
size
()
);
SetStatusText
(
msg
,
0
);
SetStatusText
(
msg
,
0
);
...
@@ -165,7 +169,7 @@ void CVPCB_MAINFRAME::AssocieModule( wxCommandEvent& event )
...
@@ -165,7 +169,7 @@ void CVPCB_MAINFRAME::AssocieModule( wxCommandEvent& event )
component
=
m_netlist
.
GetComponent
(
kk
);
component
=
m_netlist
.
GetComponent
(
kk
);
bool
found
=
false
;
bool
found
=
false
;
m_
ListCmp
->
SetSelection
(
ii
++
,
true
);
m_
compListBox
->
SetSelection
(
ii
++
,
true
);
if
(
!
component
->
GetFPID
().
empty
()
)
if
(
!
component
->
GetFPID
().
empty
()
)
continue
;
continue
;
...
@@ -176,8 +180,8 @@ void CVPCB_MAINFRAME::AssocieModule( wxCommandEvent& event )
...
@@ -176,8 +180,8 @@ void CVPCB_MAINFRAME::AssocieModule( wxCommandEvent& event )
if
(
alias
.
m_Name
.
CmpNoCase
(
component
->
GetValue
()
)
!=
0
)
if
(
alias
.
m_Name
.
CmpNoCase
(
component
->
GetValue
()
)
!=
0
)
continue
;
continue
;
/
* filter alias so one can use multiple aliases (for polar and nonpolar caps for
/
/ filter alias so one can use multiple aliases (for polar and
* example) */
// nonpolar caps for example)
const
FOOTPRINT_INFO
*
module
=
m_footprints
.
GetModuleInfo
(
alias
.
m_FootprintName
);
const
FOOTPRINT_INFO
*
module
=
m_footprints
.
GetModuleInfo
(
alias
.
m_FootprintName
);
if
(
module
)
if
(
module
)
...
@@ -207,11 +211,11 @@ void CVPCB_MAINFRAME::AssocieModule( wxCommandEvent& event )
...
@@ -207,11 +211,11 @@ void CVPCB_MAINFRAME::AssocieModule( wxCommandEvent& event )
}
}
/
* obviously the last chance: there's only one filter matching one footprint */
/
/ obviously the last chance: there's only one filter matching one footprint
if
(
!
found
&&
1
==
component
->
GetFootprintFilters
().
GetCount
()
)
if
(
!
found
&&
1
==
component
->
GetFootprintFilters
().
GetCount
()
)
{
{
/
* we do not need to analyse wildcards: single footprint do not contain them */
/
/ we do not need to analyse wildcards: single footprint do not
/
* and if there are wildcards it just will not match any */
/
/ contain them and if there are wildcards it just will not match any
const
FOOTPRINT_INFO
*
module
=
m_footprints
.
GetModuleInfo
(
component
->
GetFootprintFilters
()[
0
]
);
const
FOOTPRINT_INFO
*
module
=
m_footprints
.
GetModuleInfo
(
component
->
GetFootprintFilters
()[
0
]
);
if
(
module
)
if
(
module
)
...
...
cvpcb/class_DisplayFootprintsFrame.cpp
View file @
61159202
...
@@ -481,7 +481,7 @@ void DISPLAY_FOOTPRINTS_FRAME::InitDisplay()
...
@@ -481,7 +481,7 @@ void DISPLAY_FOOTPRINTS_FRAME::InitDisplay()
CVPCB_MAINFRAME
*
parentframe
=
(
CVPCB_MAINFRAME
*
)
GetParent
();
CVPCB_MAINFRAME
*
parentframe
=
(
CVPCB_MAINFRAME
*
)
GetParent
();
wxString
footprintName
=
parentframe
->
m_
FootprintList
->
GetSelectedFootprint
();
wxString
footprintName
=
parentframe
->
m_
footprintListBox
->
GetSelectedFootprint
();
if
(
!
footprintName
.
IsEmpty
()
)
if
(
!
footprintName
.
IsEmpty
()
)
{
{
...
...
cvpcb/cvframe.cpp
View file @
61159202
...
@@ -108,9 +108,9 @@ CVPCB_MAINFRAME::CVPCB_MAINFRAME( KIWAY* aKiway, wxWindow* aParent ) :
...
@@ -108,9 +108,9 @@ CVPCB_MAINFRAME::CVPCB_MAINFRAME( KIWAY* aKiway, wxWindow* aParent ) :
wxDefaultSize
,
KICAD_DEFAULT_DRAWFRAME_STYLE
,
CVPCB_MAINFRAME_NAME
)
wxDefaultSize
,
KICAD_DEFAULT_DRAWFRAME_STYLE
,
CVPCB_MAINFRAME_NAME
)
{
{
m_FrameName
=
CVPCB_MAINFRAME_NAME
;
m_FrameName
=
CVPCB_MAINFRAME_NAME
;
m_
ListCmp
=
NULL
;
m_
compListBox
=
NULL
;
m_
FootprintList
=
NULL
;
m_
footprintListBox
=
NULL
;
m_
LibraryList
=
NULL
;
m_
libListBox
=
NULL
;
m_mainToolBar
=
NULL
;
m_mainToolBar
=
NULL
;
m_modified
=
false
;
m_modified
=
false
;
m_isEESchemaNetlist
=
false
;
m_isEESchemaNetlist
=
false
;
...
@@ -175,18 +175,18 @@ CVPCB_MAINFRAME::CVPCB_MAINFRAME( KIWAY* aKiway, wxWindow* aParent ) :
...
@@ -175,18 +175,18 @@ CVPCB_MAINFRAME::CVPCB_MAINFRAME( KIWAY* aKiway, wxWindow* aParent ) :
m_auimgr
.
AddPane
(
m_mainToolBar
,
m_auimgr
.
AddPane
(
m_mainToolBar
,
wxAuiPaneInfo
(
horiz
).
Name
(
wxT
(
"m_mainToolBar"
)
).
Top
()
);
wxAuiPaneInfo
(
horiz
).
Name
(
wxT
(
"m_mainToolBar"
)
).
Top
()
);
if
(
m_
ListCmp
)
if
(
m_
compListBox
)
m_auimgr
.
AddPane
(
m_
ListCmp
,
m_auimgr
.
AddPane
(
m_
compListBox
,
wxAuiPaneInfo
(
horiz
).
Name
(
wxT
(
"m_
ListCmp
"
)
).
CentrePane
()
);
wxAuiPaneInfo
(
horiz
).
Name
(
wxT
(
"m_
compListBox
"
)
).
CentrePane
()
);
if
(
m_
LibraryList
)
if
(
m_
libListBox
)
m_auimgr
.
AddPane
(
m_
LibraryList
,
m_auimgr
.
AddPane
(
m_
libListBox
,
wxAuiPaneInfo
(
info
).
Name
(
wxT
(
"m_
LibraryList
"
)
).
wxAuiPaneInfo
(
info
).
Name
(
wxT
(
"m_
libListBox
"
)
).
Left
().
BestSize
(
(
int
)
(
m_FrameSize
.
x
*
0.20
),
m_FrameSize
.
y
)
);
Left
().
BestSize
(
(
int
)
(
m_FrameSize
.
x
*
0.20
),
m_FrameSize
.
y
)
);
if
(
m_
FootprintList
)
if
(
m_
footprintListBox
)
m_auimgr
.
AddPane
(
m_
FootprintList
,
m_auimgr
.
AddPane
(
m_
footprintListBox
,
wxAuiPaneInfo
(
info
).
Name
(
wxT
(
"m_
FootprintList
"
)
).
wxAuiPaneInfo
(
info
).
Name
(
wxT
(
"m_
footprintListBox
"
)
).
Right
().
BestSize
(
(
int
)
(
m_FrameSize
.
x
*
0.30
),
m_FrameSize
.
y
)
);
Right
().
BestSize
(
(
int
)
(
m_FrameSize
.
x
*
0.30
),
m_FrameSize
.
y
)
);
m_auimgr
.
Update
();
m_auimgr
.
Update
();
...
@@ -302,21 +302,21 @@ void CVPCB_MAINFRAME::ChangeFocus( bool aMoveRight )
...
@@ -302,21 +302,21 @@ void CVPCB_MAINFRAME::ChangeFocus( bool aMoveRight )
if
(
aMoveRight
)
if
(
aMoveRight
)
{
{
if
(
hasFocus
==
m_
LibraryList
)
if
(
hasFocus
==
m_
libListBox
)
m_
ListCmp
->
SetFocus
();
m_
compListBox
->
SetFocus
();
else
if
(
hasFocus
==
m_
ListCmp
)
else
if
(
hasFocus
==
m_
compListBox
)
m_
FootprintList
->
SetFocus
();
m_
footprintListBox
->
SetFocus
();
else
if
(
hasFocus
==
m_
FootprintList
)
else
if
(
hasFocus
==
m_
footprintListBox
)
m_
LibraryList
->
SetFocus
();
m_
libListBox
->
SetFocus
();
}
}
else
else
{
{
if
(
hasFocus
==
m_
LibraryList
)
if
(
hasFocus
==
m_
libListBox
)
m_
FootprintList
->
SetFocus
();
m_
footprintListBox
->
SetFocus
();
else
if
(
hasFocus
==
m_
ListCmp
)
else
if
(
hasFocus
==
m_
compListBox
)
m_
LibraryList
->
SetFocus
();
m_
libListBox
->
SetFocus
();
else
if
(
hasFocus
==
m_
FootprintList
)
else
if
(
hasFocus
==
m_
footprintListBox
)
m_
ListCmp
->
SetFocus
();
m_
compListBox
->
SetFocus
();
}
}
}
}
...
@@ -326,7 +326,7 @@ void CVPCB_MAINFRAME::ToFirstNA( wxCommandEvent& event )
...
@@ -326,7 +326,7 @@ void CVPCB_MAINFRAME::ToFirstNA( wxCommandEvent& event )
if
(
m_netlist
.
IsEmpty
()
)
if
(
m_netlist
.
IsEmpty
()
)
return
;
return
;
long
selection
=
m_
ListCmp
->
GetFirstSelected
();
long
selection
=
m_
compListBox
->
GetFirstSelected
();
if
(
selection
<
0
)
if
(
selection
<
0
)
selection
=
-
1
;
// We will start to 0 for the first search , if no item selected
selection
=
-
1
;
// We will start to 0 for the first search , if no item selected
...
@@ -335,8 +335,8 @@ void CVPCB_MAINFRAME::ToFirstNA( wxCommandEvent& event )
...
@@ -335,8 +335,8 @@ void CVPCB_MAINFRAME::ToFirstNA( wxCommandEvent& event )
{
{
if
(
m_netlist
.
GetComponent
(
jj
)
->
GetFPID
().
empty
()
)
if
(
m_netlist
.
GetComponent
(
jj
)
->
GetFPID
().
empty
()
)
{
{
m_
ListCmp
->
SetSelection
(
wxNOT_FOUND
,
false
);
// Remove all selections
m_
compListBox
->
SetSelection
(
wxNOT_FOUND
,
false
);
// Remove all selections
m_
ListCmp
->
SetSelection
(
jj
);
m_
compListBox
->
SetSelection
(
jj
);
SendMessageToEESCHEMA
();
SendMessageToEESCHEMA
();
return
;
return
;
}
}
...
@@ -349,20 +349,20 @@ void CVPCB_MAINFRAME::ToPreviousNA( wxCommandEvent& event )
...
@@ -349,20 +349,20 @@ void CVPCB_MAINFRAME::ToPreviousNA( wxCommandEvent& event )
if
(
m_netlist
.
IsEmpty
()
)
if
(
m_netlist
.
IsEmpty
()
)
return
;
return
;
int
selection
=
m_
ListCmp
->
GetFirstSelected
();
int
selection
=
m_
compListBox
->
GetFirstSelected
();
if
(
selection
<
0
)
if
(
selection
<
0
)
selection
=
m_
ListCmp
->
GetCount
();
selection
=
m_
compListBox
->
GetCount
();
else
else
while
(
m_
ListCmp
->
GetNextSelected
(
selection
)
>=
0
)
while
(
m_
compListBox
->
GetNextSelected
(
selection
)
>=
0
)
selection
=
m_
ListCmp
->
GetNextSelected
(
selection
);
selection
=
m_
compListBox
->
GetNextSelected
(
selection
);
for
(
int
kk
=
selection
-
1
;
kk
>=
0
;
kk
--
)
for
(
int
kk
=
selection
-
1
;
kk
>=
0
;
kk
--
)
{
{
if
(
m_netlist
.
GetComponent
(
kk
)
->
GetFPID
().
empty
()
)
if
(
m_netlist
.
GetComponent
(
kk
)
->
GetFPID
().
empty
()
)
{
{
m_
ListCmp
->
SetSelection
(
wxNOT_FOUND
,
false
);
// Remove all selections
m_
compListBox
->
SetSelection
(
wxNOT_FOUND
,
false
);
// Remove all selections
m_
ListCmp
->
SetSelection
(
kk
);
m_
compListBox
->
SetSelection
(
kk
);
SendMessageToEESCHEMA
();
SendMessageToEESCHEMA
();
return
;
return
;
}
}
...
@@ -392,7 +392,7 @@ void CVPCB_MAINFRAME::DelAssociations( wxCommandEvent& event )
...
@@ -392,7 +392,7 @@ void CVPCB_MAINFRAME::DelAssociations( wxCommandEvent& event )
if
(
IsOK
(
this
,
_
(
"Delete selections"
)
)
)
if
(
IsOK
(
this
,
_
(
"Delete selections"
)
)
)
{
{
m_skipComponentSelect
=
true
;
m_skipComponentSelect
=
true
;
m_
ListCmp
->
SetSelection
(
0
);
m_
compListBox
->
SetSelection
(
0
);
for
(
unsigned
i
=
0
;
i
<
m_netlist
.
GetCount
();
i
++
)
for
(
unsigned
i
=
0
;
i
<
m_netlist
.
GetCount
();
i
++
)
{
{
...
@@ -403,7 +403,7 @@ void CVPCB_MAINFRAME::DelAssociations( wxCommandEvent& event )
...
@@ -403,7 +403,7 @@ void CVPCB_MAINFRAME::DelAssociations( wxCommandEvent& event )
}
}
m_skipComponentSelect
=
false
;
m_skipComponentSelect
=
false
;
m_
ListCmp
->
SetSelection
(
0
);
m_
compListBox
->
SetSelection
(
0
);
m_undefinedComponentCnt
=
m_netlist
.
GetCount
();
m_undefinedComponentCnt
=
m_netlist
.
GetCount
();
}
}
...
@@ -562,8 +562,8 @@ void CVPCB_MAINFRAME::OnSelectComponent( wxListEvent& event )
...
@@ -562,8 +562,8 @@ void CVPCB_MAINFRAME::OnSelectComponent( wxListEvent& event )
filter
|=
FOOTPRINTS_LISTBOX
::
BY_LIBRARY
;
filter
|=
FOOTPRINTS_LISTBOX
::
BY_LIBRARY
;
component
=
GetSelectedComponent
();
component
=
GetSelectedComponent
();
libraryName
=
m_
LibraryList
->
GetSelectedLibrary
();
libraryName
=
m_
libListBox
->
GetSelectedLibrary
();
m_
FootprintList
->
SetFootprints
(
m_footprints
,
libraryName
,
component
,
filter
);
m_
footprintListBox
->
SetFootprints
(
m_footprints
,
libraryName
,
component
,
filter
);
// Tell AuiMgr that objects are changed !
// Tell AuiMgr that objects are changed !
if
(
m_auimgr
.
GetManagedWindow
()
)
// Be sure Aui Manager is initialized
if
(
m_auimgr
.
GetManagedWindow
()
)
// Be sure Aui Manager is initialized
...
@@ -578,23 +578,23 @@ void CVPCB_MAINFRAME::OnSelectComponent( wxListEvent& event )
...
@@ -578,23 +578,23 @@ void CVPCB_MAINFRAME::OnSelectComponent( wxListEvent& event )
// but only if the selection is made from the component list or the library list.
// but only if the selection is made from the component list or the library list.
// If the selection is made from the footprint list, do not change the current
// If the selection is made from the footprint list, do not change the current
// selected footprint.
// selected footprint.
if
(
FindFocus
()
==
m_
ListCmp
||
FindFocus
()
==
m_LibraryList
)
if
(
FindFocus
()
==
m_
compListBox
||
FindFocus
()
==
m_libListBox
)
{
{
wxString
module
=
FROM_UTF8
(
component
->
GetFPID
().
Format
().
c_str
()
);
wxString
module
=
FROM_UTF8
(
component
->
GetFPID
().
Format
().
c_str
()
);
bool
found
=
false
;
bool
found
=
false
;
for
(
int
ii
=
0
;
ii
<
m_
FootprintList
->
GetCount
();
ii
++
)
for
(
int
ii
=
0
;
ii
<
m_
footprintListBox
->
GetCount
();
ii
++
)
{
{
wxString
footprintName
;
wxString
footprintName
;
wxString
msg
=
m_
FootprintList
->
OnGetItemText
(
ii
,
0
);
wxString
msg
=
m_
footprintListBox
->
OnGetItemText
(
ii
,
0
);
msg
.
Trim
(
true
);
msg
.
Trim
(
true
);
msg
.
Trim
(
false
);
msg
.
Trim
(
false
);
footprintName
=
msg
.
AfterFirst
(
wxChar
(
' '
)
);
footprintName
=
msg
.
AfterFirst
(
wxChar
(
' '
)
);
if
(
module
.
Cmp
(
footprintName
)
==
0
)
if
(
module
.
Cmp
(
footprintName
)
==
0
)
{
{
m_
FootprintList
->
SetSelection
(
ii
,
true
);
m_
footprintListBox
->
SetSelection
(
ii
,
true
);
found
=
true
;
found
=
true
;
break
;
break
;
}
}
...
@@ -602,10 +602,10 @@ void CVPCB_MAINFRAME::OnSelectComponent( wxListEvent& event )
...
@@ -602,10 +602,10 @@ void CVPCB_MAINFRAME::OnSelectComponent( wxListEvent& event )
if
(
!
found
)
if
(
!
found
)
{
{
int
ii
=
m_
FootprintList
->
GetSelection
();
int
ii
=
m_
footprintListBox
->
GetSelection
();
if
(
ii
>=
0
)
if
(
ii
>=
0
)
m_
FootprintList
->
SetSelection
(
ii
,
false
);
m_
footprintListBox
->
SetSelection
(
ii
,
false
);
if
(
GetFpViewerFrame
()
)
if
(
GetFpViewerFrame
()
)
{
{
...
@@ -638,7 +638,7 @@ void CVPCB_MAINFRAME::DisplayStatus()
...
@@ -638,7 +638,7 @@ void CVPCB_MAINFRAME::DisplayStatus()
wxString
msg
;
wxString
msg
;
COMPONENT
*
component
;
COMPONENT
*
component
;
if
(
wxWindow
::
FindFocus
()
==
m_
ListCmp
||
wxWindow
::
FindFocus
()
==
m_LibraryList
)
if
(
wxWindow
::
FindFocus
()
==
m_
compListBox
||
wxWindow
::
FindFocus
()
==
m_libListBox
)
{
{
msg
.
Printf
(
_
(
"Components: %d, unassigned: %d"
),
(
int
)
m_netlist
.
GetCount
(),
msg
.
Printf
(
_
(
"Components: %d, unassigned: %d"
),
(
int
)
m_netlist
.
GetCount
(),
m_undefinedComponentCnt
);
m_undefinedComponentCnt
);
...
@@ -665,7 +665,7 @@ void CVPCB_MAINFRAME::DisplayStatus()
...
@@ -665,7 +665,7 @@ void CVPCB_MAINFRAME::DisplayStatus()
}
}
else
else
{
{
wxString
footprintName
=
m_
FootprintList
->
GetSelectedFootprint
();
wxString
footprintName
=
m_
footprintListBox
->
GetSelectedFootprint
();
FOOTPRINT_INFO
*
module
=
m_footprints
.
GetModuleInfo
(
footprintName
);
FOOTPRINT_INFO
*
module
=
m_footprints
.
GetModuleInfo
(
footprintName
);
...
@@ -681,7 +681,7 @@ void CVPCB_MAINFRAME::DisplayStatus()
...
@@ -681,7 +681,7 @@ void CVPCB_MAINFRAME::DisplayStatus()
msg
.
Empty
();
msg
.
Empty
();
if
(
m_
FootprintList
)
if
(
m_
footprintListBox
)
{
{
if
(
m_mainToolBar
->
GetToolToggled
(
ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST
)
)
if
(
m_mainToolBar
->
GetToolToggled
(
ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST
)
)
msg
=
_
(
"key words"
);
msg
=
_
(
"key words"
);
...
@@ -707,7 +707,7 @@ void CVPCB_MAINFRAME::DisplayStatus()
...
@@ -707,7 +707,7 @@ void CVPCB_MAINFRAME::DisplayStatus()
else
else
msg
=
_
(
"Filtered by "
)
+
msg
;
msg
=
_
(
"Filtered by "
)
+
msg
;
msg
<<
wxT
(
": "
)
<<
m_
FootprintList
->
GetCount
();
msg
<<
wxT
(
": "
)
<<
m_
footprintListBox
->
GetCount
();
SetStatusText
(
msg
,
2
);
SetStatusText
(
msg
,
2
);
}
}
...
@@ -762,7 +762,7 @@ void CVPCB_MAINFRAME::SendMessageToEESCHEMA()
...
@@ -762,7 +762,7 @@ void CVPCB_MAINFRAME::SendMessageToEESCHEMA()
if
(
m_netlist
.
IsEmpty
()
)
if
(
m_netlist
.
IsEmpty
()
)
return
;
return
;
int
selection
=
m_
ListCmp
->
GetSelection
();
int
selection
=
m_
compListBox
->
GetSelection
();
if
(
selection
<
0
)
if
(
selection
<
0
)
selection
=
0
;
selection
=
0
;
...
@@ -914,17 +914,17 @@ void CVPCB_MAINFRAME::BuildFOOTPRINTS_LISTBOX()
...
@@ -914,17 +914,17 @@ void CVPCB_MAINFRAME::BuildFOOTPRINTS_LISTBOX()
{
{
wxFont
guiFont
=
wxSystemSettings
::
GetFont
(
wxSYS_DEFAULT_GUI_FONT
);
wxFont
guiFont
=
wxSystemSettings
::
GetFont
(
wxSYS_DEFAULT_GUI_FONT
);
if
(
m_
FootprintList
==
NULL
)
if
(
m_
footprintListBox
==
NULL
)
{
{
m_
FootprintList
=
new
FOOTPRINTS_LISTBOX
(
this
,
ID_CVPCB_FOOTPRINT_LIST
,
m_
footprintListBox
=
new
FOOTPRINTS_LISTBOX
(
this
,
ID_CVPCB_FOOTPRINT_LIST
,
wxDefaultPosition
,
wxDefaultSize
);
wxDefaultPosition
,
wxDefaultSize
);
m_
FootprintList
->
SetFont
(
wxFont
(
guiFont
.
GetPointSize
(),
m_
footprintListBox
->
SetFont
(
wxFont
(
guiFont
.
GetPointSize
(),
wxFONTFAMILY_MODERN
,
wxFONTFAMILY_MODERN
,
wxFONTSTYLE_NORMAL
,
wxFONTSTYLE_NORMAL
,
wxFONTWEIGHT_NORMAL
)
);
wxFONTWEIGHT_NORMAL
)
);
}
}
m_
FootprintList
->
SetFootprints
(
m_footprints
,
wxEmptyString
,
NULL
,
m_
footprintListBox
->
SetFootprints
(
m_footprints
,
wxEmptyString
,
NULL
,
FOOTPRINTS_LISTBOX
::
UNFILTERED
);
FOOTPRINTS_LISTBOX
::
UNFILTERED
);
DisplayStatus
();
DisplayStatus
();
}
}
...
@@ -936,34 +936,34 @@ void CVPCB_MAINFRAME::BuildCmpListBox()
...
@@ -936,34 +936,34 @@ void CVPCB_MAINFRAME::BuildCmpListBox()
COMPONENT
*
component
;
COMPONENT
*
component
;
wxFont
guiFont
=
wxSystemSettings
::
GetFont
(
wxSYS_DEFAULT_GUI_FONT
);
wxFont
guiFont
=
wxSystemSettings
::
GetFont
(
wxSYS_DEFAULT_GUI_FONT
);
if
(
m_
ListCmp
==
NULL
)
if
(
m_
compListBox
==
NULL
)
{
{
m_
ListCmp
=
new
COMPONENTS_LISTBOX
(
this
,
ID_CVPCB_COMPONENT_LIST
,
m_
compListBox
=
new
COMPONENTS_LISTBOX
(
this
,
ID_CVPCB_COMPONENT_LIST
,
wxDefaultPosition
,
wxDefaultSize
);
wxDefaultPosition
,
wxDefaultSize
);
m_
ListCmp
->
SetFont
(
wxFont
(
guiFont
.
GetPointSize
(),
m_
compListBox
->
SetFont
(
wxFont
(
guiFont
.
GetPointSize
(),
wxFONTFAMILY_MODERN
,
wxFONTFAMILY_MODERN
,
wxFONTSTYLE_NORMAL
,
wxFONTSTYLE_NORMAL
,
wxFONTWEIGHT_NORMAL
)
);
wxFONTWEIGHT_NORMAL
)
);
}
}
m_
ListCmp
->
m_ComponentList
.
Clear
();
m_
compListBox
->
m_ComponentList
.
Clear
();
for
(
unsigned
i
=
0
;
i
<
m_netlist
.
GetCount
();
i
++
)
for
(
unsigned
i
=
0
;
i
<
m_netlist
.
GetCount
();
i
++
)
{
{
component
=
m_netlist
.
GetComponent
(
i
);
component
=
m_netlist
.
GetComponent
(
i
);
msg
.
Printf
(
CMP_FORMAT
,
m_
ListCmp
->
GetCount
()
+
1
,
msg
.
Printf
(
CMP_FORMAT
,
m_
compListBox
->
GetCount
()
+
1
,
GetChars
(
component
->
GetReference
()
),
GetChars
(
component
->
GetReference
()
),
GetChars
(
component
->
GetValue
()
),
GetChars
(
component
->
GetValue
()
),
GetChars
(
FROM_UTF8
(
component
->
GetFPID
().
Format
().
c_str
()
)
)
);
GetChars
(
FROM_UTF8
(
component
->
GetFPID
().
Format
().
c_str
()
)
)
);
m_
ListCmp
->
m_ComponentList
.
Add
(
msg
);
m_
compListBox
->
m_ComponentList
.
Add
(
msg
);
}
}
if
(
m_
ListCmp
->
m_ComponentList
.
Count
()
)
if
(
m_
compListBox
->
m_ComponentList
.
Count
()
)
{
{
m_
ListCmp
->
SetItemCount
(
m_ListCmp
->
m_ComponentList
.
Count
()
);
m_
compListBox
->
SetItemCount
(
m_compListBox
->
m_ComponentList
.
Count
()
);
m_
ListCmp
->
SetSelection
(
0
,
true
);
m_
compListBox
->
SetSelection
(
0
,
true
);
m_
ListCmp
->
RefreshItems
(
0L
,
m_ListCmp
->
m_ComponentList
.
Count
()
-
1
);
m_
compListBox
->
RefreshItems
(
0L
,
m_compListBox
->
m_ComponentList
.
Count
()
-
1
);
#if defined (__WXGTK__ )
#if defined (__WXGTK__ )
// @bug On GTK and wxWidgets 2.8.x, this will assert in debug builds because the
// @bug On GTK and wxWidgets 2.8.x, this will assert in debug builds because the
...
@@ -971,9 +971,9 @@ void CVPCB_MAINFRAME::BuildCmpListBox()
...
@@ -971,9 +971,9 @@ void CVPCB_MAINFRAME::BuildCmpListBox()
// ellipsizing long strings down to a few characters. It still doesn't set
// ellipsizing long strings down to a few characters. It still doesn't set
// the scroll bars correctly (too short) but it's better than any of the
// the scroll bars correctly (too short) but it's better than any of the
// other alternatives. If someone knows how to fix this, please do.
// other alternatives. If someone knows how to fix this, please do.
m_
ListCmp
->
SetColumnWidth
(
-
1
,
wxLIST_AUTOSIZE
);
m_
compListBox
->
SetColumnWidth
(
-
1
,
wxLIST_AUTOSIZE
);
#else
#else
m_
ListCmp
->
SetColumnWidth
(
0
,
wxLIST_AUTOSIZE
);
m_
compListBox
->
SetColumnWidth
(
0
,
wxLIST_AUTOSIZE
);
#endif
#endif
}
}
}
}
...
@@ -983,11 +983,11 @@ void CVPCB_MAINFRAME::BuildLIBRARY_LISTBOX()
...
@@ -983,11 +983,11 @@ void CVPCB_MAINFRAME::BuildLIBRARY_LISTBOX()
{
{
wxFont
guiFont
=
wxSystemSettings
::
GetFont
(
wxSYS_DEFAULT_GUI_FONT
);
wxFont
guiFont
=
wxSystemSettings
::
GetFont
(
wxSYS_DEFAULT_GUI_FONT
);
if
(
m_
LibraryList
==
NULL
)
if
(
m_
libListBox
==
NULL
)
{
{
m_
LibraryList
=
new
LIBRARY_LISTBOX
(
this
,
ID_CVPCB_LIBRARY_LIST
,
m_
libListBox
=
new
LIBRARY_LISTBOX
(
this
,
ID_CVPCB_LIBRARY_LIST
,
wxDefaultPosition
,
wxDefaultSize
);
wxDefaultPosition
,
wxDefaultSize
);
m_
LibraryList
->
SetFont
(
wxFont
(
guiFont
.
GetPointSize
(),
m_
libListBox
->
SetFont
(
wxFont
(
guiFont
.
GetPointSize
(),
wxFONTFAMILY_MODERN
,
wxFONTFAMILY_MODERN
,
wxFONTSTYLE_NORMAL
,
wxFONTSTYLE_NORMAL
,
wxFONTWEIGHT_NORMAL
)
);
wxFONTWEIGHT_NORMAL
)
);
...
@@ -1004,14 +1004,14 @@ void CVPCB_MAINFRAME::BuildLIBRARY_LISTBOX()
...
@@ -1004,14 +1004,14 @@ void CVPCB_MAINFRAME::BuildLIBRARY_LISTBOX()
for
(
unsigned
ii
=
0
;
ii
<
libNickNames
.
size
();
ii
++
)
for
(
unsigned
ii
=
0
;
ii
<
libNickNames
.
size
();
ii
++
)
libNames
.
Add
(
libNickNames
[
ii
]
);
libNames
.
Add
(
libNickNames
[
ii
]
);
m_
LibraryList
->
SetLibraryList
(
libNames
);
m_
libListBox
->
SetLibraryList
(
libNames
);
}
}
}
}
COMPONENT
*
CVPCB_MAINFRAME
::
GetSelectedComponent
()
COMPONENT
*
CVPCB_MAINFRAME
::
GetSelectedComponent
()
{
{
int
selection
=
m_
ListCmp
->
GetSelection
();
int
selection
=
m_
compListBox
->
GetSelection
();
if
(
selection
>=
0
&&
selection
<
(
int
)
m_netlist
.
GetCount
()
)
if
(
selection
>=
0
&&
selection
<
(
int
)
m_netlist
.
GetCount
()
)
return
m_netlist
.
GetComponent
(
selection
);
return
m_netlist
.
GetComponent
(
selection
);
...
...
cvpcb/cvpcb.cpp
View file @
61159202
...
@@ -56,8 +56,6 @@ const wxString FootprintAliasFileExtension( wxT( "equ" ) );
...
@@ -56,8 +56,6 @@ const wxString FootprintAliasFileExtension( wxT( "equ" ) );
// Wildcard for schematic retroannotation (import footprint names in schematic):
// Wildcard for schematic retroannotation (import footprint names in schematic):
const
wxString
FootprintAliasFileWildcard
(
_
(
"KiCad footprint alias files (*.equ)|*.equ"
)
);
const
wxString
FootprintAliasFileWildcard
(
_
(
"KiCad footprint alias files (*.equ)|*.equ"
)
);
const
wxString
titleLibLoadError
(
_
(
"Library Load Error"
)
);
#if 0 // add this logic to OpenProjectFiles()
#if 0 // add this logic to OpenProjectFiles()
...
...
cvpcb/cvpcb.h
View file @
61159202
...
@@ -21,6 +21,5 @@ extern const wxString RetroFileExtension;
...
@@ -21,6 +21,5 @@ extern const wxString RetroFileExtension;
extern
const
wxString
FootprintAliasFileWildcard
;
extern
const
wxString
FootprintAliasFileWildcard
;
extern
const
wxString
titleLibLoadError
;
#endif
/* __CVPCB_H__ */
#endif
/* __CVPCB_H__ */
cvpcb/cvpcb_mainframe.h
View file @
61159202
...
@@ -60,9 +60,9 @@ class CVPCB_MAINFRAME : public KIWAY_PLAYER
...
@@ -60,9 +60,9 @@ class CVPCB_MAINFRAME : public KIWAY_PLAYER
public
:
public
:
bool
m_KeepCvpcbOpen
;
bool
m_KeepCvpcbOpen
;
FOOTPRINTS_LISTBOX
*
m_
FootprintList
;
FOOTPRINTS_LISTBOX
*
m_
footprintListBox
;
LIBRARY_LISTBOX
*
m_
LibraryList
;
LIBRARY_LISTBOX
*
m_
libListBox
;
COMPONENTS_LISTBOX
*
m_
ListCmp
;
COMPONENTS_LISTBOX
*
m_
compListBox
;
wxAuiToolBar
*
m_mainToolBar
;
wxAuiToolBar
*
m_mainToolBar
;
wxFileName
m_NetlistFileName
;
wxFileName
m_NetlistFileName
;
wxArrayString
m_ModuleLibNames
;
wxArrayString
m_ModuleLibNames
;
...
...
cvpcb/readwrite_dlgs.cpp
View file @
61159202
...
@@ -49,23 +49,22 @@ void CVPCB_MAINFRAME::SetNewPkg( const wxString& aFootprintName )
...
@@ -49,23 +49,22 @@ void CVPCB_MAINFRAME::SetNewPkg( const wxString& aFootprintName )
COMPONENT
*
component
;
COMPONENT
*
component
;
bool
hasFootprint
=
false
;
bool
hasFootprint
=
false
;
int
componentIndex
;
int
componentIndex
;
wxString
description
;
if
(
m_netlist
.
IsEmpty
()
)
if
(
m_netlist
.
IsEmpty
()
)
return
;
return
;
// If no component is selected, select the first one
// If no component is selected, select the first one
if
(
m_
ListCmp
->
GetFirstSelected
()
<
0
)
if
(
m_
compListBox
->
GetFirstSelected
()
<
0
)
{
{
componentIndex
=
0
;
componentIndex
=
0
;
m_
ListCmp
->
SetSelection
(
componentIndex
,
true
);
m_
compListBox
->
SetSelection
(
componentIndex
,
true
);
}
}
// iterate over the selection
// iterate over the selection
while
(
m_
ListCmp
->
GetFirstSelected
()
!=
-
1
)
while
(
m_
compListBox
->
GetFirstSelected
()
!=
-
1
)
{
{
// Get the component for the current iteration
// Get the component for the current iteration
componentIndex
=
m_
ListCmp
->
GetFirstSelected
();
componentIndex
=
m_
compListBox
->
GetFirstSelected
();
component
=
m_netlist
.
GetComponent
(
componentIndex
);
component
=
m_netlist
.
GetComponent
(
componentIndex
);
if
(
component
==
NULL
)
if
(
component
==
NULL
)
...
@@ -86,7 +85,7 @@ void CVPCB_MAINFRAME::SetNewPkg( const wxString& aFootprintName )
...
@@ -86,7 +85,7 @@ void CVPCB_MAINFRAME::SetNewPkg( const wxString& aFootprintName )
component
->
SetFPID
(
fpid
);
component
->
SetFPID
(
fpid
);
// create the new component description
// create the new component description
description
.
Printf
(
CMP_FORMAT
,
componentIndex
+
1
,
wxString
description
=
wxString
::
Format
(
CMP_FORMAT
,
componentIndex
+
1
,
GetChars
(
component
->
GetReference
()
),
GetChars
(
component
->
GetReference
()
),
GetChars
(
component
->
GetValue
()
),
GetChars
(
component
->
GetValue
()
),
GetChars
(
FROM_UTF8
(
component
->
GetFPID
().
Format
().
c_str
()
)
)
);
GetChars
(
FROM_UTF8
(
component
->
GetFPID
().
Format
().
c_str
()
)
)
);
...
@@ -101,18 +100,18 @@ void CVPCB_MAINFRAME::SetNewPkg( const wxString& aFootprintName )
...
@@ -101,18 +100,18 @@ void CVPCB_MAINFRAME::SetNewPkg( const wxString& aFootprintName )
}
}
// Set the new description and deselect the processed component
// Set the new description and deselect the processed component
m_
ListCmp
->
SetString
(
componentIndex
,
description
);
m_
compListBox
->
SetString
(
componentIndex
,
description
);
m_
ListCmp
->
SetSelection
(
componentIndex
,
false
);
m_
compListBox
->
SetSelection
(
componentIndex
,
false
);
}
}
// Mark this "session" as modified
// Mark this "session" as modified
m_modified
=
true
;
m_modified
=
true
;
// select the next component, if there is one
// select the next component, if there is one
if
(
componentIndex
<
(
m_
ListCmp
->
GetCount
()
-
1
)
)
if
(
componentIndex
<
(
m_
compListBox
->
GetCount
()
-
1
)
)
componentIndex
++
;
componentIndex
++
;
m_
ListCmp
->
SetSelection
(
componentIndex
,
true
);
m_
compListBox
->
SetSelection
(
componentIndex
,
true
);
// update the statusbar
// update the statusbar
DisplayStatus
();
DisplayStatus
();
...
@@ -166,7 +165,7 @@ bool CVPCB_MAINFRAME::ReadNetListAndLinkFiles()
...
@@ -166,7 +165,7 @@ bool CVPCB_MAINFRAME::ReadNetListAndLinkFiles()
ReadSchematicNetlist
();
ReadSchematicNetlist
();
if
(
m_
ListCmp
==
NULL
)
if
(
m_
compListBox
==
NULL
)
return
false
;
return
false
;
LoadProjectFile
(
m_NetlistFileName
.
GetFullPath
()
);
LoadProjectFile
(
m_NetlistFileName
.
GetFullPath
()
);
...
@@ -175,7 +174,7 @@ bool CVPCB_MAINFRAME::ReadNetListAndLinkFiles()
...
@@ -175,7 +174,7 @@ bool CVPCB_MAINFRAME::ReadNetListAndLinkFiles()
BuildFOOTPRINTS_LISTBOX
();
BuildFOOTPRINTS_LISTBOX
();
BuildLIBRARY_LISTBOX
();
BuildLIBRARY_LISTBOX
();
m_
ListCmp
->
Clear
();
m_
compListBox
->
Clear
();
m_undefinedComponentCnt
=
0
;
m_undefinedComponentCnt
=
0
;
if
(
m_netlist
.
AnyFootprintsLinked
()
)
if
(
m_netlist
.
AnyFootprintsLinked
()
)
...
@@ -295,12 +294,12 @@ bool CVPCB_MAINFRAME::ReadNetListAndLinkFiles()
...
@@ -295,12 +294,12 @@ bool CVPCB_MAINFRAME::ReadNetListAndLinkFiles()
{
{
COMPONENT
*
component
=
m_netlist
.
GetComponent
(
i
);
COMPONENT
*
component
=
m_netlist
.
GetComponent
(
i
);
msg
.
Printf
(
CMP_FORMAT
,
m_
ListCmp
->
GetCount
()
+
1
,
msg
.
Printf
(
CMP_FORMAT
,
m_
compListBox
->
GetCount
()
+
1
,
GetChars
(
component
->
GetReference
()
),
GetChars
(
component
->
GetReference
()
),
GetChars
(
component
->
GetValue
()
),
GetChars
(
component
->
GetValue
()
),
GetChars
(
FROM_UTF8
(
component
->
GetFPID
().
Format
().
c_str
()
)
)
);
GetChars
(
FROM_UTF8
(
component
->
GetFPID
().
Format
().
c_str
()
)
)
);
m_
ListCmp
->
AppendLine
(
msg
);
m_
compListBox
->
AppendLine
(
msg
);
if
(
component
->
GetFPID
().
empty
()
)
if
(
component
->
GetFPID
().
empty
()
)
{
{
...
@@ -310,7 +309,7 @@ bool CVPCB_MAINFRAME::ReadNetListAndLinkFiles()
...
@@ -310,7 +309,7 @@ bool CVPCB_MAINFRAME::ReadNetListAndLinkFiles()
}
}
if
(
!
m_netlist
.
IsEmpty
()
)
if
(
!
m_netlist
.
IsEmpty
()
)
m_
ListCmp
->
SetSelection
(
0
,
true
);
m_
compListBox
->
SetSelection
(
0
,
true
);
DisplayStatus
();
DisplayStatus
();
...
...
include/dsnlexer.h
View file @
61159202
...
@@ -155,7 +155,6 @@ protected:
...
@@ -155,7 +155,6 @@ protected:
return
false
;
return
false
;
}
}
#endif
#endif
public
:
public
:
...
...
include/richio.h
View file @
61159202
...
@@ -432,8 +432,9 @@ public:
...
@@ -432,8 +432,9 @@ public:
* Constructor WXINPUTSTREAM_LINE_READER
* Constructor WXINPUTSTREAM_LINE_READER
*
*
* @param aStream A pointer to a wxInputStream object to read.
* @param aStream A pointer to a wxInputStream object to read.
* @param aSource The name of the stream source, for error reporting purposes.
*/
*/
INPUTSTREAM_LINE_READER
(
wxInputStream
*
aStream
);
INPUTSTREAM_LINE_READER
(
wxInputStream
*
aStream
,
const
wxString
&
aSource
);
char
*
ReadLine
()
throw
(
IO_ERROR
);
// see LINE_READER::ReadLine() description
char
*
ReadLine
()
throw
(
IO_ERROR
);
// see LINE_READER::ReadLine() description
};
};
...
...
pcbnew/eagle_plugin.cpp
View file @
61159202
...
@@ -2708,7 +2708,7 @@ LAYER_ID EAGLE_PLUGIN::kicad_layer( int aEagleLayer ) const
...
@@ -2708,7 +2708,7 @@ LAYER_ID EAGLE_PLUGIN::kicad_layer( int aEagleLayer ) const
}
}
}
}
return
To
LAYER_ID
(
kiLayer
);
return
LAYER_ID
(
kiLayer
);
}
}
...
...
pcbnew/github/github_plugin.cpp
View file @
61159202
...
@@ -221,7 +221,7 @@ MODULE* GITHUB_PLUGIN::FootprintLoad( const wxString& aLibraryPath,
...
@@ -221,7 +221,7 @@ MODULE* GITHUB_PLUGIN::FootprintLoad( const wxString& aLibraryPath,
if
(
zis
.
OpenEntry
(
*
entry
)
)
if
(
zis
.
OpenEntry
(
*
entry
)
)
{
{
INPUTSTREAM_LINE_READER
reader
(
&
zis
);
INPUTSTREAM_LINE_READER
reader
(
&
zis
,
aLibraryPath
);
#if 1
#if 1
// I am a PCB_IO derivative with my own PCB_PARSER
// I am a PCB_IO derivative with my own PCB_PARSER
m_parser
->
SetLineReader
(
&
reader
);
// ownership not passed
m_parser
->
SetLineReader
(
&
reader
);
// ownership not passed
...
...
pcbnew/pcb_parser.cpp
View file @
61159202
...
@@ -79,14 +79,15 @@ void PCB_PARSER::init()
...
@@ -79,14 +79,15 @@ void PCB_PARSER::init()
m_layerMasks
[
"*.Fab"
]
=
LSET
(
2
,
B_Fab
,
F_Fab
);
m_layerMasks
[
"*.Fab"
]
=
LSET
(
2
,
B_Fab
,
F_Fab
);
m_layerMasks
[
"*.CrtYd"
]
=
LSET
(
2
,
B_CrtYd
,
F_CrtYd
);
m_layerMasks
[
"*.CrtYd"
]
=
LSET
(
2
,
B_CrtYd
,
F_CrtYd
);
// This is for the first pretty format, which had Inner1_Cu-Inner14_Cu with the numbering
// This is for the first pretty & *.kicad_pcb formats, which had
// sequence reversed from the In1_Cu-In30_Cu version 2 pretty numbering scheme.
// Inner1_Cu - Inner14_Cu with the numbering sequence
// Version 2 brought in an additional 16 Cu layers and flipped the cu stack but
// reversed from the subsequent format's In1_Cu - In30_Cu numbering scheme.
// The newer format brought in an additional 16 Cu layers and flipped the cu stack but
// kept the gap between one of the outside layers and the last cu internal.
// kept the gap between one of the outside layers and the last cu internal.
for
(
int
i
=
1
;
i
<=
14
;
++
i
)
for
(
int
i
=
1
;
i
<=
14
;
++
i
)
{
{
std
::
string
key
=
StrPrintf
(
"Inner%d"
,
i
);
std
::
string
key
=
StrPrintf
(
"Inner%d
.Cu
"
,
i
);
m_layerMasks
[
key
]
=
LSET
(
LAYER_ID
(
In15_Cu
-
i
)
);
m_layerMasks
[
key
]
=
LSET
(
LAYER_ID
(
In15_Cu
-
i
)
);
}
}
...
@@ -867,9 +868,14 @@ T PCB_PARSER::lookUpLayer( const M& aMap ) throw( PARSE_ERROR, IO_ERROR )
...
@@ -867,9 +868,14 @@ T PCB_PARSER::lookUpLayer( const M& aMap ) throw( PARSE_ERROR, IO_ERROR )
}
}
#endif
#endif
wxString
error
=
wxString
::
Format
(
wxString
error
=
wxString
::
Format
(
_
(
_
(
"Layer '%s' in file <%s> at line %d, position %d, was not defined in the layers section"
),
"Layer '%s' in file
\n
"
GetChars
(
FROM_UTF8
(
CurText
()
)
),
GetChars
(
CurSource
()
),
"'%s'
\n
"
"at line %d, position %d
\n
"
"was not defined in the layers section"
),
GetChars
(
FROM_UTF8
(
CurText
()
)
),
GetChars
(
CurSource
()
),
CurLineNumber
(),
CurOffset
()
);
CurLineNumber
(),
CurOffset
()
);
THROW_IO_ERROR
(
error
);
THROW_IO_ERROR
(
error
);
...
...
pcbnew/pcb_parser.h
View file @
61159202
...
@@ -62,8 +62,8 @@ struct LAYER;
...
@@ -62,8 +62,8 @@ struct LAYER;
*/
*/
class
PCB_PARSER
:
public
PCB_LEXER
class
PCB_PARSER
:
public
PCB_LEXER
{
{
typedef
boost
::
unordered_map
<
std
::
string
,
LAYER_ID
>
LAYER_ID_MAP
;
typedef
boost
::
unordered_map
<
std
::
string
,
LAYER_ID
>
LAYER_ID_MAP
;
typedef
boost
::
unordered_map
<
std
::
string
,
LSET
>
LSET_MAP
;
typedef
boost
::
unordered_map
<
std
::
string
,
LSET
>
LSET_MAP
;
BOARD
*
m_board
;
BOARD
*
m_board
;
LAYER_ID_MAP
m_layerIndices
;
///< map layer name to it's index
LAYER_ID_MAP
m_layerIndices
;
///< map layer name to it's index
...
...
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