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
64f12ffe
Commit
64f12ffe
authored
Sep 25, 2007
by
dickelbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gerberview & pcbnew fixes
parent
5e448ec4
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
1003 additions
and
889 deletions
+1003
-889
change_log.txt
change_log.txt
+15
-0
files.cpp
gerbview/files.cpp
+191
-183
readgerb.cpp
gerbview/readgerb.cpp
+259
-249
rs274x.cpp
gerbview/rs274x.cpp
+475
-416
class_collector.h
include/class_collector.h
+3
-3
wxstruct.h
include/wxstruct.h
+5
-1
collectors.cpp
pcbnew/collectors.cpp
+25
-18
collectors.h
pcbnew/collectors.h
+7
-0
controle.cpp
pcbnew/controle.cpp
+23
-19
No files found.
change_log.txt
View file @
64f12ffe
...
@@ -4,6 +4,21 @@ Started 2007-June-11
...
@@ -4,6 +4,21 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with
Please add newer entries at the top, list the date and your name with
email address.
email address.
2007-Sep-25 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
+ pcbnew
* got rid of reference to global display options DisplayOpt.DisplayZones from
collectors.cpp so collectors.cpp can continue to be used in multiple future
(non-display related) general contexts.
* Moved TYPEZONE to end of AllBoardItems, added GENERAL_COLLECTOR::AllButZones to
provide support of DisplayOpt.DisplayZones.
* Added aHotKeyCode to PcbGeneralLocateAndDisplay()
+ gerbview
* viewer was getting stuck in a loop when loading a bad gerber file. Fixed
the bug, but line 223 through 225 of readgerb.cpp need review.
* beautified a few files with uncrustify, (any I had to look at).
2007-sept-25 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
2007-sept-25 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
================================================================================
+ pcbnew:
+ pcbnew:
...
...
gerbview/files.cpp
View file @
64f12ffe
This diff is collapsed.
Click to expand it.
gerbview/readgerb.cpp
View file @
64f12ffe
This diff is collapsed.
Click to expand it.
gerbview/rs274x.cpp
View file @
64f12ffe
This diff is collapsed.
Click to expand it.
include/class_collector.h
View file @
64f12ffe
...
@@ -112,11 +112,11 @@ public:
...
@@ -112,11 +112,11 @@ public:
/**
/**
* Function Remove
* Function Remove
* removes the item at item_position (first position is 0);
* removes the item at item_position (first position is 0);
* @param
item_position index
.
* @param
ndx The index into the list
.
*/
*/
void
Remove
(
unsigned
int
item_position
)
void
Remove
(
int
ndx
)
{
{
m_List
.
erase
(
m_List
.
begin
()
+
item_position
);
m_List
.
erase
(
m_List
.
begin
()
+
(
unsigned
)
ndx
);
}
}
/**
/**
...
...
include/wxstruct.h
View file @
64f12ffe
...
@@ -400,8 +400,12 @@ public:
...
@@ -400,8 +400,12 @@ public:
* a popup menu is shown which allows the user to pick which item he/she is
* a popup menu is shown which allows the user to pick which item he/she is
* interested in. Once an item is chosen, then it is make the "current item"
* interested in. Once an item is chosen, then it is make the "current item"
* and the status window is updated to reflect this.
* and the status window is updated to reflect this.
*
* @param aHotKeyCode The hotkey which relates to the caller and determines the
* type of search to be performed. If zero, then the mouse tools will be
* tested instead.
*/
*/
BOARD_ITEM
*
PcbGeneralLocateAndDisplay
();
BOARD_ITEM
*
PcbGeneralLocateAndDisplay
(
int
aHotKeyCode
=
0
);
BOARD_ITEM
*
Locate
(
int
typeloc
,
int
LayerSearch
);
BOARD_ITEM
*
Locate
(
int
typeloc
,
int
LayerSearch
);
void
ProcessItemSelection
(
wxCommandEvent
&
event
);
void
ProcessItemSelection
(
wxCommandEvent
&
event
);
...
...
pcbnew/collectors.cpp
View file @
64f12ffe
...
@@ -38,10 +38,10 @@ const KICAD_T GENERAL_COLLECTOR::AllBoardItems[] = {
...
@@ -38,10 +38,10 @@ const KICAD_T GENERAL_COLLECTOR::AllBoardItems[] = {
TYPECOTATION
,
TYPECOTATION
,
TYPEVIA
,
TYPEVIA
,
TYPETRACK
,
TYPETRACK
,
TYPEZONE
,
TYPEPAD
,
TYPEPAD
,
TYPETEXTEMODULE
,
TYPETEXTEMODULE
,
TYPEMODULE
,
TYPEMODULE
,
TYPEZONE
,
EOT
EOT
};
};
...
@@ -52,13 +52,24 @@ const KICAD_T GENERAL_COLLECTOR::PrimaryItems[] = {
...
@@ -52,13 +52,24 @@ const KICAD_T GENERAL_COLLECTOR::PrimaryItems[] = {
TYPECOTATION
,
TYPECOTATION
,
TYPEVIA
,
TYPEVIA
,
TYPETRACK
,
TYPETRACK
,
// TYPEPAD, TYPEPAD and TYPETEXTEMODULE are handled in a subsearch
// TYPETEXTEMODULE,
TYPEMODULE
,
TYPEMODULE
,
EOT
EOT
};
};
const
KICAD_T
GENERAL_COLLECTOR
::
AllButZones
[]
=
{
TYPETEXTE
,
TYPEDRAWSEGMENT
,
TYPECOTATION
,
TYPEVIA
,
TYPETRACK
,
TYPEPAD
,
TYPETEXTEMODULE
,
TYPEMODULE
,
EOT
};
const
KICAD_T
GENERAL_COLLECTOR
::
ModuleItems
[]
=
{
const
KICAD_T
GENERAL_COLLECTOR
::
ModuleItems
[]
=
{
TYPEMODULE
,
TYPEMODULE
,
EOT
EOT
...
@@ -95,7 +106,6 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_BaseStruct* testItem, const void*
...
@@ -95,7 +106,6 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_BaseStruct* testItem, const void*
{
{
BOARD_ITEM
*
item
=
(
BOARD_ITEM
*
)
testItem
;
BOARD_ITEM
*
item
=
(
BOARD_ITEM
*
)
testItem
;
MODULE
*
module
=
NULL
;
MODULE
*
module
=
NULL
;
bool
skip_item
=
false
;
#if 0 // debugging
#if 0 // debugging
static int breakhere = 0;
static int breakhere = 0;
...
@@ -173,7 +183,6 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_BaseStruct* testItem, const void*
...
@@ -173,7 +183,6 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_BaseStruct* testItem, const void*
case
TYPETRACK
:
case
TYPETRACK
:
break
;
break
;
case
TYPEZONE
:
case
TYPEZONE
:
if
(
!
DisplayOpt
.
DisplayZones
)
skip_item
=
true
;
break
;
break
;
case
TYPETEXTE
:
case
TYPETEXTE
:
break
;
break
;
...
@@ -183,20 +192,18 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_BaseStruct* testItem, const void*
...
@@ -183,20 +192,18 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_BaseStruct* testItem, const void*
break
;
break
;
case
TYPETEXTEMODULE
:
case
TYPETEXTEMODULE
:
module
=
(
MODULE
*
)
item
->
GetParent
();
if
(
m_Guide
->
IgnoreMTextsMarkedNoShow
()
&&
((
TEXTE_MODULE
*
)
item
)
->
m_NoShow
)
goto
exit
;
if
(
module
)
{
{
module
=
(
MODULE
*
)
item
->
GetParent
();
if
(
m_Guide
->
IgnoreMTextsOnCopper
()
&&
module
->
GetLayer
()
==
LAYER_CUIVRE_N
)
if
(
m_Guide
->
IgnoreMTextsMarkedNoShow
()
&&
((
TEXTE_MODULE
*
)
item
)
->
m_NoShow
)
goto
exit
;
goto
exit
;
if
(
module
)
if
(
m_Guide
->
IgnoreMTextsOnCmp
()
&&
module
->
GetLayer
()
==
LAYER_CMP_N
)
{
goto
exit
;
if
(
m_Guide
->
IgnoreMTextsOnCopper
()
&&
module
->
GetLayer
()
==
LAYER_CUIVRE_N
)
goto
exit
;
if
(
m_Guide
->
IgnoreMTextsOnCmp
()
&&
module
->
GetLayer
()
==
LAYER_CMP_N
)
goto
exit
;
}
}
}
break
;
break
;
...
@@ -234,7 +241,7 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_BaseStruct* testItem, const void*
...
@@ -234,7 +241,7 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_BaseStruct* testItem, const void*
{
{
if
(
item
->
HitTest
(
m_RefPos
)
)
if
(
item
->
HitTest
(
m_RefPos
)
)
{
{
if
(
!
skip_item
)
Append
(
item
);
Append
(
item
);
goto
exit
;
goto
exit
;
}
}
}
}
...
@@ -261,7 +268,7 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_BaseStruct* testItem, const void*
...
@@ -261,7 +268,7 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_BaseStruct* testItem, const void*
{
{
if
(
item
->
HitTest
(
m_RefPos
)
)
if
(
item
->
HitTest
(
m_RefPos
)
)
{
{
if
(
!
skip_item
)
Append2nd
(
item
);
Append2nd
(
item
);
goto
exit
;
goto
exit
;
}
}
}
}
...
...
pcbnew/collectors.h
View file @
64f12ffe
...
@@ -146,6 +146,7 @@ public:
...
@@ -146,6 +146,7 @@ public:
* @return bool - ture if should ignore MODULEs on component layer.
* @return bool - ture if should ignore MODULEs on component layer.
*/
*/
virtual
bool
IgnoreModulesOnCmp
()
const
=
0
;
virtual
bool
IgnoreModulesOnCmp
()
const
=
0
;
/**
/**
* Function UseHitTesting
* Function UseHitTesting
...
@@ -201,6 +202,12 @@ public:
...
@@ -201,6 +202,12 @@ public:
static
const
KICAD_T
AllBoardItems
[];
static
const
KICAD_T
AllBoardItems
[];
/**
* A scan list for all editable board items, except zones
*/
static
const
KICAD_T
AllButZones
[];
/**
/**
* A scan list for all primary board items, omitting items which are subordinate to
* A scan list for all primary board items, omitting items which are subordinate to
* a MODULE, such as D_PAD and TEXTEMODULE.
* a MODULE, such as D_PAD and TEXTEMODULE.
...
...
pcbnew/controle.cpp
View file @
64f12ffe
...
@@ -153,9 +153,9 @@ static BOARD_ITEM* AllAreModulesAndReturnSmallestIfSo( GENERAL_COLLECTOR* aColle
...
@@ -153,9 +153,9 @@ static BOARD_ITEM* AllAreModulesAndReturnSmallestIfSo( GENERAL_COLLECTOR* aColle
}
}
/*************************************************************/
/*************************************************************
***************
/
BOARD_ITEM
*
WinEDA_BasePcbFrame
::
PcbGeneralLocateAndDisplay
()
BOARD_ITEM
*
WinEDA_BasePcbFrame
::
PcbGeneralLocateAndDisplay
(
int
aHotKeyCode
)
/*************************************************************/
/*************************************************************
***************
/
{
{
BOARD_ITEM
*
item
;
BOARD_ITEM
*
item
;
...
@@ -166,7 +166,11 @@ BOARD_ITEM* WinEDA_BasePcbFrame::PcbGeneralLocateAndDisplay()
...
@@ -166,7 +166,11 @@ BOARD_ITEM* WinEDA_BasePcbFrame::PcbGeneralLocateAndDisplay()
const
KICAD_T
*
scanList
;
const
KICAD_T
*
scanList
;
if
(
m_ID_current_state
==
0
)
if
(
aHotKeyCode
)
{
// switch here
}
else
if
(
m_ID_current_state
==
0
)
{
{
switch
(
m_HTOOL_current_state
)
switch
(
m_HTOOL_current_state
)
{
{
...
@@ -175,7 +179,9 @@ BOARD_ITEM* WinEDA_BasePcbFrame::PcbGeneralLocateAndDisplay()
...
@@ -175,7 +179,9 @@ BOARD_ITEM* WinEDA_BasePcbFrame::PcbGeneralLocateAndDisplay()
break
;
break
;
default
:
default
:
scanList
=
GENERAL_COLLECTOR
::
AllBoardItems
;
scanList
=
DisplayOpt
.
DisplayZones
?
GENERAL_COLLECTOR
::
AllBoardItems
:
GENERAL_COLLECTOR
::
AllButZones
;
break
;
break
;
}
}
}
}
...
@@ -196,26 +202,32 @@ BOARD_ITEM* WinEDA_BasePcbFrame::PcbGeneralLocateAndDisplay()
...
@@ -196,26 +202,32 @@ BOARD_ITEM* WinEDA_BasePcbFrame::PcbGeneralLocateAndDisplay()
break
;
break
;
default
:
default
:
scanList
=
GENERAL_COLLECTOR
::
AllBoardItems
;
scanList
=
DisplayOpt
.
DisplayZones
?
GENERAL_COLLECTOR
::
AllBoardItems
:
GENERAL_COLLECTOR
::
AllButZones
;
}
}
}
}
m_Collector
->
Collect
(
m_Pcb
,
scanList
,
GetScreen
()
->
RefPos
(
true
),
guide
);
m_Collector
->
Collect
(
m_Pcb
,
scanList
,
GetScreen
()
->
RefPos
(
true
),
guide
);
/* debugging: print out the collected items, showing their priority order too.
#if 0
* for( unsigned i=0; i<m_Collector->GetCount(); ++i )
// debugging: print out the collected items, showing their priority order too.
* (*m_Collector)[i]->Show( 0, std::cout );
for( unsigned i=0; i<m_Collector->GetCount(); ++i )
*/
(*m_Collector)[i]->Show( 0, std::cout );
#endif
/* Remove redundancies: most of time, zones are found twice,
/* Remove redundancies: most of time, zones are found twice,
* because zones are filled twice ( once by by horizontal and once by vertical segments )
* because zones are filled twice ( once by by horizontal and once by vertical segments )
*/
*/
unsigned
long
timestampzone
=
0
;
unsigned
long
timestampzone
=
0
;
for
(
unsigned
int
ii
=
0
;
ii
<
m_Collector
->
GetCount
();
ii
++
)
int
limit
=
m_Collector
->
GetCount
();
for
(
int
ii
=
0
;
ii
<
limit
;
ii
++
)
{
{
item
=
(
*
m_Collector
)[
ii
];
item
=
(
*
m_Collector
)[
ii
];
if
(
item
->
Type
()
!=
TYPEZONE
)
if
(
item
->
Type
()
!=
TYPEZONE
)
continue
;
continue
;
/* Found a TYPE ZONE */
/* Found a TYPE ZONE */
if
(
item
->
m_TimeStamp
==
timestampzone
)
// Remove it, redundant, zone already found
if
(
item
->
m_TimeStamp
==
timestampzone
)
// Remove it, redundant, zone already found
{
{
...
@@ -282,14 +294,6 @@ BOARD_ITEM* WinEDA_BasePcbFrame::PcbGeneralLocateAndDisplay()
...
@@ -282,14 +294,6 @@ BOARD_ITEM* WinEDA_BasePcbFrame::PcbGeneralLocateAndDisplay()
}
}
return
item
;
return
item
;
/* old way:
*
* item = Locate( CURSEUR_OFF_GRILLE, GetScreen()->m_Active_Layer );
* if( item == NULL )
* item = Locate( CURSEUR_OFF_GRILLE, -1 );
* return item;
*/
}
}
...
...
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