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
9634fa5c
Commit
9634fa5c
authored
May 01, 2013
by
Dick Hollenbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix 2 corner case bugs in specctra import
parent
a26e59d8
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
50 additions
and
49 deletions
+50
-49
dsnlexer.cpp
common/dsnlexer.cpp
+6
-1
pcb_parser.cpp
pcbnew/pcb_parser.cpp
+1
-1
specctra.cpp
pcbnew/specctra.cpp
+37
-41
specctra.h
pcbnew/specctra.h
+4
-2
specctra_import.cpp
pcbnew/specctra_import.cpp
+2
-4
No files found.
common/dsnlexer.cpp
View file @
9634fa5c
...
...
@@ -2,7 +2,7 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2007-20
08
SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 2007-20
13
SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 2007 KiCad Developers, see change_log.txt for contributors.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -30,6 +30,7 @@
#include <cctype>
#include <macros.h>
#include <fctsys.h>
#include <dsnlexer.h>
//#include "fctsys.h"
...
...
@@ -60,6 +61,8 @@ void DSNLEXER::init()
space_in_quoted_tokens
=
false
;
commentsAreTokens
=
false
;
D
(
printf
(
"readerStack::count:%zu
\n
"
,
readerStack
.
size
()
);)
}
...
...
@@ -102,6 +105,8 @@ DSNLEXER::DSNLEXER( const KEYWORD* aKeywordTable, unsigned aKeywordCount,
DSNLEXER
::~
DSNLEXER
()
{
D
(
printf
(
"~readerStack::count:%zu
\n
"
,
readerStack
.
size
()
);)
if
(
iOwnReaders
)
{
// delete the LINE_READERs from the stack, since I own them.
...
...
pcbnew/pcb_parser.cpp
View file @
9634fa5c
...
...
@@ -744,7 +744,7 @@ T PCB_PARSER::lookUpLayer( const M& aMap ) throw( PARSE_ERROR, IO_ERROR )
if
(
it
==
aMap
.
end
()
)
{
#if
1
&& defined(DEBUG)
#if
0
&& defined(DEBUG)
// dump the whole darn table, there's something wrong with it.
for( it = aMap.begin(); it != aMap.end(); ++it )
{
...
...
pcbnew/specctra.cpp
View file @
9634fa5c
...
...
@@ -1870,58 +1870,54 @@ void SPECCTRA_DB::doPLACEMENT( PLACEMENT* growth ) throw( IO_ERROR )
{
T
tok
;
NeedLEFT
();
tok
=
NextTok
();
if
(
tok
==
T_unit
||
tok
==
T_resolution
)
while
(
(
tok
=
NextTok
())
!=
T_RIGHT
)
{
growth
->
unit
=
new
UNIT_RES
(
growth
,
tok
);
if
(
tok
==
T_resolution
)
doRESOLUTION
(
growth
->
unit
);
else
doUNIT
(
growth
->
unit
);
if
(
tok
==
T_EOF
)
Unexpected
(
T_EOF
);
if
(
NextTok
()
!=
T_LEFT
)
Expecting
(
T_LEFT
);
tok
=
NextTok
();
}
if
(
tok
==
T_place_control
)
{
if
(
NextTok
()
!=
T_LEFT
)
if
(
tok
!=
T_LEFT
)
Expecting
(
T_LEFT
);
tok
=
NextTok
();
if
(
tok
!=
T_flip_style
)
Expecting
(
T_flip_style
);
tok
=
NextTok
();
if
(
tok
==
T_mirror_first
||
tok
==
T_rotate_first
)
growth
->
flip_style
=
tok
;
else
Expecting
(
"mirror_first|rotate_first"
);
switch
(
tok
)
{
case
T_unit
:
case
T_resolution
:
growth
->
unit
=
new
UNIT_RES
(
growth
,
tok
);
if
(
tok
==
T_resolution
)
doRESOLUTION
(
growth
->
unit
);
else
doUNIT
(
growth
->
unit
);
break
;
NeedRIGHT
();
NeedRIGHT
();
NeedLEFT
();
tok
=
NextTok
();
}
case
T_place_control
:
NeedRIGHT
();
tok
=
NextTok
();
if
(
tok
!=
T_flip_style
)
Expecting
(
T_flip_style
);
while
(
tok
==
T_component
)
{
COMPONENT
*
component
=
new
COMPONENT
(
growth
)
;
growth
->
components
.
push_back
(
component
);
doCOMPONENT
(
component
);
tok
=
NextTok
();
if
(
tok
==
T_mirror_first
||
tok
==
T_rotate_first
)
growth
->
flip_style
=
tok
;
else
Expecting
(
"mirror_first|rotate_first"
);
tok
=
NextTok
();
if
(
tok
==
T_RIGHT
)
return
;
NeedRIGHT
();
NeedRIGHT
();
break
;
else
if
(
tok
==
T_LEFT
)
tok
=
NextTok
();
}
case
T_component
:
COMPONENT
*
component
;
component
=
new
COMPONENT
(
growth
);
growth
->
components
.
push_back
(
component
);
doCOMPONENT
(
component
);
break
;
Unexpected
(
CurText
()
);
default
:
Unexpected
(
tok
);
}
}
}
...
...
pcbnew/specctra.h
View file @
9634fa5c
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2007-20
08
SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 2007-20
13
SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 2007 KiCad Developers, see change_log.txt for contributors.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -3796,7 +3796,9 @@ public:
SPECCTRA_DB
()
:
SPECCTRA_LEXER
(
0
)
// LINE_READER* == NULL, no DSNLEXER::PushReader()
{
iOwnReaders
=
true
;
// if an exception is thrown, close file.
// The LINE_READER will be pushed from an automatic instantiation,
// we don't own it:
wxASSERT
(
!
iOwnReaders
);
pcb
=
0
;
session
=
0
;
...
...
pcbnew/specctra_import.cpp
View file @
9634fa5c
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2007-201
0
SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 2007-201
3
SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 2007 KiCad Developers, see change_log.txt for contributors.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -94,7 +94,6 @@ void PCB_EDIT_FRAME::ImportSpecctraSession( wxCommandEvent& event )
return
;
SPECCTRA_DB
db
;
LOCALE_IO
toggle
;
try
...
...
@@ -118,7 +117,7 @@ void PCB_EDIT_FRAME::ImportSpecctraSession( wxCommandEvent& event )
/* At this point we should call Compile_Ratsnest()
* but this could be time consumming.
* So if incorrect number of Connec
r
ed and No connected pads is accepted
* So if incorrect number of Connec
t
ed and No connected pads is accepted
* until Compile_Ratsnest() is called (when track tool selected for instance)
* leave the next line commented
* Otherwise uncomment this line
...
...
@@ -377,7 +376,6 @@ SEGVIA* SPECCTRA_DB::makeVIA( PADSTACK* aPadstack, const POINT& aPoint, int aNet
}
// no UI code in this function, throw exception to report problems to the
// UI handler: void PCB_EDIT_FRAME::ImportSpecctraSession( 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