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
13
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
123 additions
and
116 deletions
+123
-116
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
No files found.
common/richio.cpp
View file @
61159202
...
...
@@ -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
),
m_stream
(
aStream
)
{
source
=
aSource
;
}
...
...
cvpcb/autosel.cpp
View file @
61159202
...
...
@@ -25,7 +25,7 @@
* @file autosel.cpp
*/
/
* Routines for automatic selection of modules. */
/
/ Routines for automatic selection of modules.
#include <fctsys.h>
#include <common.h>
...
...
@@ -42,6 +42,9 @@
#define QUOTE '\''
#define FMT_TITLE_LIB_LOAD_ERROR _( "Library Load Error" )
class
FOOTPRINT_ALIAS
{
public
:
...
...
@@ -93,7 +96,7 @@ void CVPCB_MAINFRAME::AssocieModule( wxCommandEvent& event )
if
(
m_netlist
.
IsEmpty
()
)
return
;
/
* Find equivalents in all available files. */
/
/ Find equivalents in all available files.
for
(
ii
=
0
;
ii
<
m_AliasLibNames
.
GetCount
();
ii
++
)
{
fn
=
m_AliasLibNames
[
ii
];
...
...
@@ -107,6 +110,7 @@ void CVPCB_MAINFRAME::AssocieModule( wxCommandEvent& event )
{
fn
.
SetExt
(
fn
.
GetExt
()
+
wxT
(
"."
)
+
FootprintAliasFileExtension
);
}
tmp
=
search
.
FindValidPath
(
fn
.
GetFullPath
()
);
if
(
!
tmp
)
...
...
@@ -114,7 +118,7 @@ void CVPCB_MAINFRAME::AssocieModule( wxCommandEvent& event )
msg
.
Printf
(
_
(
"Footprint alias library file '%s' could not be found in the "
"default search paths."
),
GetChars
(
fn
.
GetFullName
()
)
);
wxMessageBox
(
msg
,
titleLibLoadError
,
wxOK
|
wxICON_ERROR
);
wxMessageBox
(
msg
,
FMT_TITLE_LIB_LOAD_ERROR
,
wxOK
|
wxICON_ERROR
);
continue
;
}
...
...
@@ -122,8 +126,8 @@ void CVPCB_MAINFRAME::AssocieModule( wxCommandEvent& event )
if
(
file
==
NULL
)
{
msg
.
Printf
(
_
(
"Error opening alias library
<%s>
."
),
GetChars
(
tmp
)
);
wxMessageBox
(
msg
,
titleLibLoadError
,
wxOK
|
wxICON_ERROR
);
msg
.
Printf
(
_
(
"Error opening alias library
'%s'
."
),
GetChars
(
tmp
)
);
wxMessageBox
(
msg
,
FMT_TITLE_LIB_LOAD_ERROR
,
wxOK
|
wxICON_ERROR
);
continue
;
}
...
...
@@ -153,7 +157,7 @@ void CVPCB_MAINFRAME::AssocieModule( wxCommandEvent& event )
fclose
(
file
);
}
/
* Display the number of footprint aliases. */
/
/ Display the number of footprint aliases.
msg
.
Printf
(
_
(
"%d footprint aliases found."
),
aliases
.
size
()
);
SetStatusText
(
msg
,
0
);
...
...
@@ -165,7 +169,7 @@ void CVPCB_MAINFRAME::AssocieModule( wxCommandEvent& event )
component
=
m_netlist
.
GetComponent
(
kk
);
bool
found
=
false
;
m_
ListCmp
->
SetSelection
(
ii
++
,
true
);
m_
compListBox
->
SetSelection
(
ii
++
,
true
);
if
(
!
component
->
GetFPID
().
empty
()
)
continue
;
...
...
@@ -176,8 +180,8 @@ void CVPCB_MAINFRAME::AssocieModule( wxCommandEvent& event )
if
(
alias
.
m_Name
.
CmpNoCase
(
component
->
GetValue
()
)
!=
0
)
continue
;
/
* filter alias so one can use multiple aliases (for polar and nonpolar caps for
* example) */
/
/ filter alias so one can use multiple aliases (for polar and
// nonpolar caps for example)
const
FOOTPRINT_INFO
*
module
=
m_footprints
.
GetModuleInfo
(
alias
.
m_FootprintName
);
if
(
module
)
...
...
@@ -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
()
)
{
/
* we do not need to analyse wildcards: single footprint do not contain them */
/
* and if there are wildcards it just will not match any */
/
/ we do not need to analyse wildcards: single footprint do not
/
/ contain them and if there are wildcards it just will not match any
const
FOOTPRINT_INFO
*
module
=
m_footprints
.
GetModuleInfo
(
component
->
GetFootprintFilters
()[
0
]
);
if
(
module
)
...
...
cvpcb/class_DisplayFootprintsFrame.cpp
View file @
61159202
...
...
@@ -481,7 +481,7 @@ void DISPLAY_FOOTPRINTS_FRAME::InitDisplay()
CVPCB_MAINFRAME
*
parentframe
=
(
CVPCB_MAINFRAME
*
)
GetParent
();
wxString
footprintName
=
parentframe
->
m_
FootprintList
->
GetSelectedFootprint
();
wxString
footprintName
=
parentframe
->
m_
footprintListBox
->
GetSelectedFootprint
();
if
(
!
footprintName
.
IsEmpty
()
)
{
...
...
cvpcb/cvframe.cpp
View file @
61159202
This diff is collapsed.
Click to expand it.
cvpcb/cvpcb.cpp
View file @
61159202
...
...
@@ -56,8 +56,6 @@ const wxString FootprintAliasFileExtension( wxT( "equ" ) );
// Wildcard for schematic retroannotation (import footprint names in schematic):
const
wxString
FootprintAliasFileWildcard
(
_
(
"KiCad footprint alias files (*.equ)|*.equ"
)
);
const
wxString
titleLibLoadError
(
_
(
"Library Load Error"
)
);
#if 0 // add this logic to OpenProjectFiles()
...
...
cvpcb/cvpcb.h
View file @
61159202
...
...
@@ -21,6 +21,5 @@ extern const wxString RetroFileExtension;
extern
const
wxString
FootprintAliasFileWildcard
;
extern
const
wxString
titleLibLoadError
;
#endif
/* __CVPCB_H__ */
cvpcb/cvpcb_mainframe.h
View file @
61159202
...
...
@@ -60,9 +60,9 @@ class CVPCB_MAINFRAME : public KIWAY_PLAYER
public
:
bool
m_KeepCvpcbOpen
;
FOOTPRINTS_LISTBOX
*
m_
FootprintList
;
LIBRARY_LISTBOX
*
m_
LibraryList
;
COMPONENTS_LISTBOX
*
m_
ListCmp
;
FOOTPRINTS_LISTBOX
*
m_
footprintListBox
;
LIBRARY_LISTBOX
*
m_
libListBox
;
COMPONENTS_LISTBOX
*
m_
compListBox
;
wxAuiToolBar
*
m_mainToolBar
;
wxFileName
m_NetlistFileName
;
wxArrayString
m_ModuleLibNames
;
...
...
cvpcb/readwrite_dlgs.cpp
View file @
61159202
...
...
@@ -49,23 +49,22 @@ void CVPCB_MAINFRAME::SetNewPkg( const wxString& aFootprintName )
COMPONENT
*
component
;
bool
hasFootprint
=
false
;
int
componentIndex
;
wxString
description
;
if
(
m_netlist
.
IsEmpty
()
)
return
;
// If no component is selected, select the first one
if
(
m_
ListCmp
->
GetFirstSelected
()
<
0
)
if
(
m_
compListBox
->
GetFirstSelected
()
<
0
)
{
componentIndex
=
0
;
m_
ListCmp
->
SetSelection
(
componentIndex
,
true
);
m_
compListBox
->
SetSelection
(
componentIndex
,
true
);
}
// iterate over the selection
while
(
m_
ListCmp
->
GetFirstSelected
()
!=
-
1
)
while
(
m_
compListBox
->
GetFirstSelected
()
!=
-
1
)
{
// Get the component for the current iteration
componentIndex
=
m_
ListCmp
->
GetFirstSelected
();
componentIndex
=
m_
compListBox
->
GetFirstSelected
();
component
=
m_netlist
.
GetComponent
(
componentIndex
);
if
(
component
==
NULL
)
...
...
@@ -86,7 +85,7 @@ void CVPCB_MAINFRAME::SetNewPkg( const wxString& aFootprintName )
component
->
SetFPID
(
fpid
);
// create the new component description
description
.
Printf
(
CMP_FORMAT
,
componentIndex
+
1
,
wxString
description
=
wxString
::
Format
(
CMP_FORMAT
,
componentIndex
+
1
,
GetChars
(
component
->
GetReference
()
),
GetChars
(
component
->
GetValue
()
),
GetChars
(
FROM_UTF8
(
component
->
GetFPID
().
Format
().
c_str
()
)
)
);
...
...
@@ -101,18 +100,18 @@ void CVPCB_MAINFRAME::SetNewPkg( const wxString& aFootprintName )
}
// Set the new description and deselect the processed component
m_
ListCmp
->
SetString
(
componentIndex
,
description
);
m_
ListCmp
->
SetSelection
(
componentIndex
,
false
);
m_
compListBox
->
SetString
(
componentIndex
,
description
);
m_
compListBox
->
SetSelection
(
componentIndex
,
false
);
}
// Mark this "session" as modified
m_modified
=
true
;
// select the next component, if there is one
if
(
componentIndex
<
(
m_
ListCmp
->
GetCount
()
-
1
)
)
if
(
componentIndex
<
(
m_
compListBox
->
GetCount
()
-
1
)
)
componentIndex
++
;
m_
ListCmp
->
SetSelection
(
componentIndex
,
true
);
m_
compListBox
->
SetSelection
(
componentIndex
,
true
);
// update the statusbar
DisplayStatus
();
...
...
@@ -166,7 +165,7 @@ bool CVPCB_MAINFRAME::ReadNetListAndLinkFiles()
ReadSchematicNetlist
();
if
(
m_
ListCmp
==
NULL
)
if
(
m_
compListBox
==
NULL
)
return
false
;
LoadProjectFile
(
m_NetlistFileName
.
GetFullPath
()
);
...
...
@@ -175,7 +174,7 @@ bool CVPCB_MAINFRAME::ReadNetListAndLinkFiles()
BuildFOOTPRINTS_LISTBOX
();
BuildLIBRARY_LISTBOX
();
m_
ListCmp
->
Clear
();
m_
compListBox
->
Clear
();
m_undefinedComponentCnt
=
0
;
if
(
m_netlist
.
AnyFootprintsLinked
()
)
...
...
@@ -295,12 +294,12 @@ bool CVPCB_MAINFRAME::ReadNetListAndLinkFiles()
{
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
->
GetValue
()
),
GetChars
(
FROM_UTF8
(
component
->
GetFPID
().
Format
().
c_str
()
)
)
);
m_
ListCmp
->
AppendLine
(
msg
);
m_
compListBox
->
AppendLine
(
msg
);
if
(
component
->
GetFPID
().
empty
()
)
{
...
...
@@ -310,7 +309,7 @@ bool CVPCB_MAINFRAME::ReadNetListAndLinkFiles()
}
if
(
!
m_netlist
.
IsEmpty
()
)
m_
ListCmp
->
SetSelection
(
0
,
true
);
m_
compListBox
->
SetSelection
(
0
,
true
);
DisplayStatus
();
...
...
include/dsnlexer.h
View file @
61159202
...
...
@@ -155,7 +155,6 @@ protected:
return
false
;
}
#endif
public
:
...
...
include/richio.h
View file @
61159202
...
...
@@ -432,8 +432,9 @@ public:
* Constructor WXINPUTSTREAM_LINE_READER
*
* @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
};
...
...
pcbnew/eagle_plugin.cpp
View file @
61159202
...
...
@@ -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,
if
(
zis
.
OpenEntry
(
*
entry
)
)
{
INPUTSTREAM_LINE_READER
reader
(
&
zis
);
INPUTSTREAM_LINE_READER
reader
(
&
zis
,
aLibraryPath
);
#if 1
// I am a PCB_IO derivative with my own PCB_PARSER
m_parser
->
SetLineReader
(
&
reader
);
// ownership not passed
...
...
pcbnew/pcb_parser.cpp
View file @
61159202
...
...
@@ -79,14 +79,15 @@ void PCB_PARSER::init()
m_layerMasks
[
"*.Fab"
]
=
LSET
(
2
,
B_Fab
,
F_Fab
);
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
// sequence reversed from the In1_Cu-In30_Cu version 2 pretty numbering scheme.
// Version 2 brought in an additional 16 Cu layers and flipped the cu stack but
// This is for the first pretty & *.kicad_pcb formats, which had
// Inner1_Cu - Inner14_Cu with the numbering sequence
// 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.
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
)
);
}
...
...
@@ -867,9 +868,14 @@ T PCB_PARSER::lookUpLayer( const M& aMap ) throw( PARSE_ERROR, IO_ERROR )
}
#endif
wxString
error
=
wxString
::
Format
(
_
(
"Layer '%s' in file <%s> at line %d, position %d, was not defined in the layers section"
),
GetChars
(
FROM_UTF8
(
CurText
()
)
),
GetChars
(
CurSource
()
),
wxString
error
=
wxString
::
Format
(
_
(
"Layer '%s' in file
\n
"
"'%s'
\n
"
"at line %d, position %d
\n
"
"was not defined in the layers section"
),
GetChars
(
FROM_UTF8
(
CurText
()
)
),
GetChars
(
CurSource
()
),
CurLineNumber
(),
CurOffset
()
);
THROW_IO_ERROR
(
error
);
...
...
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