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
a3f2980d
Commit
a3f2980d
authored
Jun 12, 2013
by
Alexander Lunev
Committed by
jean-pierre charras
Jun 12, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix pcad2kicad issue, from A. Lunev, and a minor code cleaning in component_references_lister.cpp.
parent
179ada1c
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
49 additions
and
55 deletions
+49
-55
wildcards_and_files_ext.cpp
common/wildcards_and_files_ext.cpp
+1
-1
component_references_lister.cpp
eeschema/component_references_lister.cpp
+13
-23
xnode.h
include/xnode.h
+7
-3
pcad2kicad_common.cpp
pcbnew/pcad2kicadpcb_plugin/pcad2kicad_common.cpp
+2
-1
pcb_text.cpp
pcbnew/pcad2kicadpcb_plugin/pcb_text.cpp
+1
-4
s_expr_loader.cpp
pcbnew/pcad2kicadpcb_plugin/s_expr_loader.cpp
+25
-23
No files found.
common/wildcards_and_files_ext.cpp
View file @
a3f2980d
...
...
@@ -72,7 +72,7 @@ const wxString NetlistFileWildcard( _( "KiCad netlist files (*.net)|*.net" ) );
const
wxString
GerberFileWildcard
(
_
(
"Gerber files (*.pho)|*.pho"
)
);
const
wxString
LegacyPcbFileWildcard
(
_
(
"KiCad printed circuit board files (*.brd)|*.brd"
)
);
const
wxString
EaglePcbFileWildcard
(
_
(
"Eagle ver. 6.x XML PCB files (*.brd)|*.brd"
)
);
const
wxString
PCadPcbFileWildcard
(
_
(
"P-Cad 200
2/2004
ASCII PCB files (*.pcb)|*.pcb"
)
);
const
wxString
PCadPcbFileWildcard
(
_
(
"P-Cad 200
x
ASCII PCB files (*.pcb)|*.pcb"
)
);
const
wxString
PcbFileWildcard
(
_
(
"KiCad s-expr printed circuit board files (*.kicad_pcb)|*.kicad_pcb"
)
);
const
wxString
KiCadFootprintLibFileWildcard
(
_
(
"KiCad footprint s-expre library file (*.kicad_mod)|*.kicad_mod"
)
);
const
wxString
KiCadFootprintLibPathWildcard
(
_
(
"KiCad footprint s-expre library path (*.pretty)|*.pretty"
)
);
...
...
eeschema/component_references_lister.cpp
View file @
a3f2980d
...
...
@@ -837,27 +837,17 @@ int SCH_REFERENCE_LIST::CheckAnnotation( wxArrayString* aMessageList )
if
(
componentFlatList
[
ii
].
CompareValue
(
componentFlatList
[
next
]
)
!=
0
)
{
#if defined(KICAD_GOST)
msg
.
Printf
(
_
(
"Different values for %s%d.%d (%s) and %s%d.%d (%s)"
),
msg
.
Printf
(
_
(
"Different values for %s%d%s (%s) and %s%d%s (%s)"
),
GetChars
(
componentFlatList
[
ii
].
GetRef
()
),
componentFlatList
[
ii
].
m_NumRef
,
componentFlatList
[
ii
].
m_Unit
,
GetChars
(
LIB_COMPONENT
::
ReturnSubReference
(
componentFlatList
[
ii
].
m_Unit
)
),
GetChars
(
componentFlatList
[
ii
].
m_Value
->
GetText
()
),
GetChars
(
componentFlatList
[
next
].
GetRef
()
),
componentFlatList
[
next
].
m_NumRef
,
componentFlatList
[
next
].
m_Unit
,
componentFlatList
[
next
].
m_Value
->
GetText
().
GetData
()
);
#else
msg
.
Printf
(
_
(
"Different values for %s%d%c (%s) and %s%d%c (%s)"
),
GetChars
(
componentFlatList
[
ii
].
GetRef
()
),
componentFlatList
[
ii
].
m_NumRef
,
componentFlatList
[
ii
].
m_Unit
+
'A'
-
1
,
GetChars
(
componentFlatList
[
ii
].
m_Value
->
GetText
()
),
GetChars
(
componentFlatList
[
next
].
GetRef
()
),
componentFlatList
[
next
].
m_NumRef
,
componentFlatList
[
next
].
m_Unit
+
'A'
-
1
,
GetChars
(
LIB_COMPONENT
::
ReturnSubReference
(
componentFlatList
[
next
].
m_Unit
)
),
GetChars
(
componentFlatList
[
next
].
m_Value
->
GetText
()
)
);
#endif
if
(
aMessageList
)
aMessageList
->
Add
(
msg
+
wxT
(
"
\n
"
));
...
...
include/xnode.h
View file @
a3f2980d
...
...
@@ -106,15 +106,19 @@ public:
wxString
GetAttribute
(
const
wxString
&
attrName
,
const
wxString
&
defaultVal
)
const
{
return
GetPropVal
(
attrName
,
defaultVal
);
return
GetPropVal
(
attrName
,
defaultVal
);
}
bool
GetAttribute
(
const
wxString
&
attrName
,
wxString
*
value
)
const
{
return
GetPropVal
(
attrName
,
value
);
return
GetPropVal
(
attrName
,
value
);
}
void
AddAttribute
(
const
wxString
&
attrName
,
const
wxString
&
value
)
{
AddProperty
(
attrName
,
value
);
AddProperty
(
attrName
,
value
);
}
bool
DeleteAttribute
(
const
wxString
&
attrName
)
{
DeleteProperty
(
attrName
);
}
wxXmlProperty
*
GetAttributes
()
const
{
...
...
pcbnew/pcad2kicadpcb_plugin/pcad2kicad_common.cpp
View file @
a3f2980d
...
...
@@ -131,7 +131,8 @@ double StrToDoublePrecisionUnits( wxString aStr, char aAxe, wxString aActualConv
{
ls
.
ToDouble
(
&
i
);
#ifdef PCAD2KICAD_SCALE_SCH_TO_INCH_GRID
if
(
aActualConversion
==
wxT
(
"SCH"
)
)
if
(
aActualConversion
==
wxT
(
"SCH"
)
||
aActualConversion
==
wxT
(
"SCHLIB"
)
)
i
=
i
*
(
0.0254
/
0.025
);
#endif
i
=
Millimeter2iu
(
i
);
...
...
pcbnew/pcad2kicadpcb_plugin/pcb_text.cpp
View file @
a3f2980d
...
...
@@ -76,10 +76,7 @@ void PCB_TEXT::Parse( XNODE* aNode,
m_rotation
=
StrToInt1Units
(
str
);
}
lNode
=
FindNode
(
aNode
,
wxT
(
"value"
)
);
if
(
lNode
)
m_name
.
text
=
lNode
->
GetNodeContent
();
aNode
->
GetAttribute
(
wxT
(
"Name"
),
&
m_name
.
text
);
str
=
FindNodeGetContent
(
aNode
,
wxT
(
"isFlipped"
)
);
...
...
pcbnew/pcad2kicadpcb_plugin/s_expr_loader.cpp
View file @
a3f2980d
...
...
@@ -39,9 +39,7 @@ void LoadInputFile( wxString aFileName, wxXmlDocument* aXmlDoc )
{
int
tok
;
XNODE
*
iNode
=
NULL
,
*
cNode
=
NULL
;
wxString
str
;
bool
growing
=
false
;
bool
attr
=
false
;
wxString
str
,
propValue
,
content
;
wxCSConv
conv
(
wxT
(
"windows-1251"
)
);
FILE
*
fp
=
wxFopen
(
aFileName
,
wxT
(
"rt"
)
);
...
...
@@ -56,21 +54,6 @@ void LoadInputFile( wxString aFileName, wxXmlDocument* aXmlDoc )
while
(
(
tok
=
lexer
.
NextTok
()
)
!=
DSN_EOF
)
{
if
(
growing
&&
(
tok
==
DSN_LEFT
||
tok
==
DSN_RIGHT
)
)
{
if
(
attr
)
{
cNode
->
AddAttribute
(
wxT
(
"Name"
),
str
.
Trim
(
false
)
);
}
else
if
(
str
!=
wxEmptyString
)
{
cNode
->
AddChild
(
new
XNODE
(
wxXML_TEXT_NODE
,
wxEmptyString
,
str
)
);
}
growing
=
false
;
attr
=
false
;
}
if
(
tok
==
DSN_RIGHT
)
{
iNode
=
iNode
->
GetParent
();
...
...
@@ -82,14 +65,33 @@ void LoadInputFile( wxString aFileName, wxXmlDocument* aXmlDoc )
cNode
=
new
XNODE
(
wxXML_ELEMENT_NODE
,
wxString
(
lexer
.
CurText
(),
conv
)
);
iNode
->
AddChild
(
cNode
);
iNode
=
cNode
;
growing
=
true
;
}
else
else
if
(
cNode
)
{
str
+=
wxT
(
' '
);
str
+=
wxString
(
lexer
.
CurText
(),
conv
);
str
=
wxString
(
lexer
.
CurText
(),
conv
);
if
(
tok
==
DSN_STRING
)
attr
=
true
;
{
// update attribute
if
(
iNode
->
GetAttribute
(
wxT
(
"Name"
),
&
propValue
)
)
{
iNode
->
DeleteAttribute
(
wxT
(
"Name"
)
);
iNode
->
AddAttribute
(
wxT
(
"Name"
),
propValue
+
wxT
(
' '
)
+
str
);
}
else
iNode
->
AddAttribute
(
wxT
(
"Name"
),
str
);
}
else
if
(
str
!=
wxEmptyString
)
{
// update node content
content
=
cNode
->
GetNodeContent
()
+
wxT
(
' '
)
+
str
;
if
(
cNode
->
GetChildren
()
)
cNode
->
GetChildren
()
->
SetContent
(
content
);
else
cNode
->
AddChild
(
new
wxXmlNode
(
wxXML_TEXT_NODE
,
wxEmptyString
,
content
)
);
}
}
}
...
...
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