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
74a635c1
Commit
74a635c1
authored
Sep 05, 2007
by
dickelbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
see 2007-Sep-4 change_log.txt
parent
8383ce25
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
254 additions
and
198 deletions
+254
-198
change_log.txt
change_log.txt
+12
-2
makefile.include
cvpcb/makefile.include
+5
-1
makefile.include
gerbview/makefile.include
+5
-1
wxstruct.h
include/wxstruct.h
+18
-5
basepcbframe.cpp
pcbnew/basepcbframe.cpp
+115
-72
collectors.cpp
pcbnew/collectors.cpp
+73
-78
collectors.h
pcbnew/collectors.h
+14
-12
controle.cpp
pcbnew/controle.cpp
+1
-4
ioascii.cpp
pcbnew/ioascii.cpp
+5
-1
onrightclick.cpp
pcbnew/onrightclick.cpp
+3
-2
pcbframe.cpp
pcbnew/pcbframe.cpp
+1
-12
todo.txt
todo.txt
+2
-8
No files found.
change_log.txt
View file @
74a635c1
...
...
@@ -4,6 +4,18 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with
email address.
2007-Sep-4 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
+ pcbnew
* Made GENERAL_COLLECTORS_GUIDE and GENERAL_COLLECTOR useable. They can now
serve as a fully functional replacement for PcbGeneralLocateAndDisplay(),
see DEBUG code in BOARD_ITEM* WinEDA_BasePcbFrame::PcbGeneralLocateAndDisplay().
* Made GENERAL_COLLECTOR capable of Collect()ing from a MODULE as well as a BOARD.
* pcbnew/onrightclick.cpp changed English from "Free Module" to "Unlock Module".
Next I hope to add some UI to handle multiple items under the mouse in onrightclick.cpp
2007-sept-04 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
+ pcbnew
...
...
@@ -39,8 +51,6 @@ email address.
be instantiated. This was not happening in ioascii.cpp when reading
the vias. Bug fixed.
* GENERAL_COLLECTOR getting closer to useable.
@todo search further for new TRACK( TRACK* ) and make sure no vias are
being made this way.
2007-aug-30 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
...
...
cvpcb/makefile.include
View file @
74a635c1
...
...
@@ -43,7 +43,8 @@ OBJECTS = $(TARGET).o \
class_edge_mod.o
\
class_equipot.o
\
class_track.o
\
basepcbframe.o
basepcbframe.o
\
collectors.o
cvpcb.o
:
cvpcb.cpp cvpcb.h $(DEPEND)
...
...
@@ -99,6 +100,9 @@ class_equipot.o: ../pcbnew/class_equipot.cpp $(DEPEND)
basepcbframe.o
:
../pcbnew/basepcbframe.cpp $(DEPEND)
$(CC)
-c
$(EDACPPFLAGS)
-o
$@
../pcbnew/
$*
.cpp
collectors.o
:
../pcbnew/collectors.cpp $(COMMON)
$(CC)
-c
$(EDACPPFLAGS)
-o
$@
../pcbnew/
$*
.cpp
readschematicnetlist.o
:
readschematicnetlist.cpp $(DEPEND)
viewlogi.o
:
viewlogi.cpp $(DEPEND)
...
...
gerbview/makefile.include
View file @
74a635c1
...
...
@@ -45,7 +45,8 @@ OBJECTS= \
block.o
\
controle.o
\
basepcbframe.o
\
export_to_pcbnew.o
export_to_pcbnew.o
\
collectors.o
setpage.o
:
../share/setpage.cpp
$(CC)
-c
$(EDACPPFLAGS)
-o
$@
../share/
$*
.cpp
...
...
@@ -85,6 +86,9 @@ class_board.o: ../pcbnew/class_board.cpp $(DEPEND)
basepcbframe.o
:
../pcbnew/basepcbframe.cpp $(COMMON)
$(CC)
-c
$(EDACPPFLAGS)
-o
$@
../pcbnew/
$*
.cpp
collectors.o
:
../pcbnew/collectors.cpp $(COMMON)
$(CC)
-c
$(EDACPPFLAGS)
-o
$@
../pcbnew/
$*
.cpp
class_track.o
:
../pcbnew/class_track.cpp $(COMMON)
$(CC)
-c
$(EDACPPFLAGS)
-o
$@
../pcbnew/
$*
.cpp
...
...
include/wxstruct.h
View file @
74a635c1
...
...
@@ -97,6 +97,7 @@ class PARAM_CFG_BASE;
class
Ki_PageDescr
;
class
Ki_HotkeyInfo
;
class
GENERAL_COLLECTOR
;
class
GENERAL_COLLECTORS_GUIDE
;
enum
id_librarytype
{
...
...
@@ -338,6 +339,12 @@ public:
bool
m_DisplayPcbTrackFill
;
/* FALSE = sketch , TRUE = rempli */
WinEDA3D_DrawFrame
*
m_Draw3DFrame
;
protected
:
#if defined(DEBUG)
GENERAL_COLLECTOR
*
m_Collector
;
#endif
public
:
WinEDA_BasePcbFrame
(
wxWindow
*
father
,
WinEDA_App
*
parent
,
int
idtype
,
const
wxString
&
title
,
...
...
@@ -372,11 +379,6 @@ private:
virtual
void
GetComponentFromUndoList
();
virtual
void
GetComponentFromRedoList
();
#if defined(DEBUG)
protected
:
GENERAL_COLLECTOR
*
m_Collector
;
#endif
public
:
// Read/write fonctions:
...
...
@@ -393,6 +395,14 @@ public:
BOARD_ITEM
*
PcbGeneralLocateAndDisplay
();
BOARD_ITEM
*
Locate
(
int
typeloc
,
int
LayerSearch
);
#if defined(DEBUG)
/**
* Function GetCollectorsGuide
* @return GENERAL_COLLECTORS_GUIDE - that considers the global configuration options.
*/
GENERAL_COLLECTORS_GUIDE
GetCollectorsGuide
();
#endif
// Gestion du curseur
void
place_marqueur
(
wxDC
*
DC
,
const
wxPoint
&
pos
,
char
*
pt_bitmap
,
int
DrawMode
,
int
color
,
int
type
);
...
...
@@ -522,6 +532,7 @@ private:
bool
m_SelViaSizeBox_Changed
;
wxMenu
*
m_FilesMenu
;
public
:
WinEDA_PcbFrame
(
wxWindow
*
father
,
WinEDA_App
*
parent
,
const
wxString
&
title
,
const
wxPoint
&
pos
,
const
wxSize
&
size
);
...
...
@@ -764,6 +775,8 @@ public:
EDA_BaseStruct
*
GerberGeneralLocateAndDisplay
();
EDA_BaseStruct
*
Locate
(
int
typeloc
);
void
SetToolbars
();
void
Process_Settings
(
wxCommandEvent
&
event
);
...
...
pcbnew/basepcbframe.cpp
View file @
74a635c1
/************************************************************************/
/* basepcbframe.cpp - fonctions des classes du type WinEDA_BasePcbFrame */
/************************************************************************/
/************************************************************************/
/* basepcbframe.cpp - fonctions des classes du type WinEDA_BasePcbFrame */
/************************************************************************/
#ifdef __GNUG__
#pragma implementation
...
...
@@ -15,89 +15,108 @@
#include "protos.h"
#include "id.h"
#if defined(DEBUG)
#include "collectors.h"
#endif
/*******************************/
/* class WinEDA_BasePcbFrame */
/*******************************/
/*******************************/
/* class WinEDA_BasePcbFrame */
/*******************************/
/****************/
/* Constructeur */
/****************/
/****************/
/* Constructeur */
/****************/
WinEDA_BasePcbFrame
::
WinEDA_BasePcbFrame
(
wxWindow
*
father
,
WinEDA_App
*
parent
,
int
idtype
,
const
wxString
&
title
,
const
wxPoint
&
pos
,
const
wxSize
&
size
)
:
WinEDA_DrawFrame
(
father
,
idtype
,
parent
,
title
,
pos
,
size
)
WinEDA_BasePcbFrame
::
WinEDA_BasePcbFrame
(
wxWindow
*
father
,
WinEDA_App
*
parent
,
int
idtype
,
const
wxString
&
title
,
const
wxPoint
&
pos
,
const
wxSize
&
size
)
:
WinEDA_DrawFrame
(
father
,
idtype
,
parent
,
title
,
pos
,
size
)
{
m_InternalUnits
=
10000
;
// Internal unit = 1/10000 inch
m_CurrentScreen
=
NULL
;
m_Pcb
=
NULL
;
m_DisplayPadFill
=
TRUE
;
// How to draw pads
m_DisplayPadNum
=
TRUE
;
// show pads number
m_DisplayModEdge
=
FILLED
;
// How to show module drawings
m_DisplayModText
=
FILLED
;
// How to show module texts
m_DisplayPcbTrackFill
=
TRUE
;
/* FALSE = sketch , TRUE = filled */
m_Draw3DFrame
=
NULL
;
// Display Window in 3D mode (OpenGL)
m_InternalUnits
=
10000
;
// Internal unit = 1/10000 inch
m_CurrentScreen
=
NULL
;
m_Pcb
=
NULL
;
m_DisplayPadFill
=
TRUE
;
// How to draw pads
m_DisplayPadNum
=
TRUE
;
// show pads number
m_DisplayModEdge
=
FILLED
;
// How to show module drawings
m_DisplayModText
=
FILLED
;
// How to show module texts
m_DisplayPcbTrackFill
=
TRUE
;
/* FALSE = sketch , TRUE = filled */
m_Draw3DFrame
=
NULL
;
// Display Window in 3D mode (OpenGL)
#if defined(DEBUG)
m_Collector
=
new
GENERAL_COLLECTOR
();
#endif
}
WinEDA_BasePcbFrame
::~
WinEDA_BasePcbFrame
(
void
)
WinEDA_BasePcbFrame
::~
WinEDA_BasePcbFrame
(
void
)
{
#if defined(DEBUG)
delete
m_Collector
;
#endif
}
/**************************************/
int
WinEDA_BasePcbFrame
::
BestZoom
(
void
)
int
WinEDA_BasePcbFrame
::
BestZoom
(
void
)
/**************************************/
{
int
dx
,
dy
,
ii
,
jj
;
int
bestzoom
;
wxSize
size
;
int
dx
,
dy
,
ii
,
jj
;
int
bestzoom
;
wxSize
size
;
if
(
m_Pcb
==
NULL
)
return
32
;
if
(
m_Pcb
==
NULL
)
return
32
;
m_Pcb
->
ComputeBoundaryBox
();
m_Pcb
->
ComputeBoundaryBox
();
/* calcul du zoom montrant tout le dessim */
dx
=
m_Pcb
->
m_BoundaryBox
.
GetWidth
();
dy
=
m_Pcb
->
m_BoundaryBox
.
GetHeight
();
/* calcul du zoom montrant tout le dessim */
dx
=
m_Pcb
->
m_BoundaryBox
.
GetWidth
();
dy
=
m_Pcb
->
m_BoundaryBox
.
GetHeight
();
size
=
DrawPanel
->
GetClientSize
();
ii
=
(
dx
+
(
size
.
x
/
2
)
)
/
size
.
x
;
jj
=
(
dy
+
(
size
.
y
/
2
)
)
/
size
.
y
;
bestzoom
=
MAX
(
ii
,
jj
)
+
1
;
size
=
DrawPanel
->
GetClientSize
();
ii
=
(
dx
+
(
size
.
x
/
2
)
)
/
size
.
x
;
jj
=
(
dy
+
(
size
.
y
/
2
)
)
/
size
.
y
;
bestzoom
=
MAX
(
ii
,
jj
)
+
1
;
m_CurrentScreen
->
m_Curseur
=
m_Pcb
->
m_BoundaryBox
.
Centre
();
m_CurrentScreen
->
m_Curseur
=
m_Pcb
->
m_BoundaryBox
.
Centre
();
return
(
bestzoom
)
;
return
bestzoom
;
}
void
WinEDA_BasePcbFrame
::
ReCreateMenuBar
(
void
)
// fonction virtuelle
void
WinEDA_BasePcbFrame
::
ReCreateMenuBar
(
void
)
// fonction virtuelle
{
}
#include "3d_viewer.h"
/***********************************************************/
void
WinEDA_BasePcbFrame
::
Show3D_Frame
(
wxCommandEvent
&
event
)
void
WinEDA_BasePcbFrame
::
Show3D_Frame
(
wxCommandEvent
&
event
)
/***********************************************************/
/* Ouvre la frame d'affichage 3D
*/
*/
{
#ifndef GERBVIEW
// Create the main frame window
if
(
m_Draw3DFrame
)
{
DisplayInfo
(
this
,
_
(
"3D Frame already opened"
)
);
return
;
}
m_Draw3DFrame
=
new
WinEDA3D_DrawFrame
(
this
,
m_Parent
,
_
(
"3D Viewer"
)
);
// Show the frame
m_Draw3DFrame
->
Show
(
TRUE
);
// Create the main frame window
if
(
m_Draw3DFrame
)
{
DisplayInfo
(
this
,
_
(
"3D Frame already opened"
)
);
return
;
}
m_Draw3DFrame
=
new
WinEDA3D_DrawFrame
(
this
,
m_Parent
,
_
(
"3D Viewer"
)
);
// Show the frame
m_Draw3DFrame
->
Show
(
TRUE
);
#endif
}
...
...
@@ -105,43 +124,67 @@ void WinEDA_BasePcbFrame::Show3D_Frame(wxCommandEvent& event)
/* Virtual functions: Do nothing for WinEDA_BasePcbFrame window */
/***********************************************************************************/
void
WinEDA_BasePcbFrame
::
SaveCopyInUndoList
(
EDA_BaseStruct
*
ItemToCopy
,
int
flag
)
void
WinEDA_BasePcbFrame
::
SaveCopyInUndoList
(
EDA_BaseStruct
*
ItemToCopy
,
int
flag
)
/***********************************************************************************/
{
}
/********************************************************/
void
WinEDA_BasePcbFrame
::
GetComponentFromUndoList
(
void
)
void
WinEDA_BasePcbFrame
::
GetComponentFromUndoList
(
void
)
/********************************************************/
{
}
/********************************************************/
void
WinEDA_BasePcbFrame
::
GetComponentFromRedoList
(
void
)
void
WinEDA_BasePcbFrame
::
GetComponentFromRedoList
(
void
)
/********************************************************/
{
}
/****************************************************************/
void
WinEDA_BasePcbFrame
::
SwitchLayer
(
wxDC
*
DC
,
int
layer
)
void
WinEDA_BasePcbFrame
::
SwitchLayer
(
wxDC
*
DC
,
int
layer
)
/*****************************************************************/
{
//Note: virtual, overridden in WinEDA_PcbFrame;
int
preslayer
=
GetScreen
()
->
m_Active_Layer
;
//if there is only one layer, don't switch.
if
(
m_Pcb
->
m_BoardSettings
->
m_CopperLayerCount
<=
1
)
layer
=
LAYER_CUIVRE_N
;
// Of course we select the copper layer
//otherwise, we select the requested layer only if it is possible
if
(
layer
!=
LAYER_CMP_N
&&
layer
>=
m_Pcb
->
m_BoardSettings
->
m_CopperLayerCount
-
1
)
return
;
if
(
preslayer
==
layer
)
return
;
GetScreen
()
->
m_Active_Layer
=
layer
;
if
(
DisplayOpt
.
ContrastModeDisplay
)
GetScreen
()
->
SetRefreshReq
();
//Note: virtual, overridden in WinEDA_PcbFrame;
int
preslayer
=
GetScreen
()
->
m_Active_Layer
;
//if there is only one layer, don't switch.
if
(
m_Pcb
->
m_BoardSettings
->
m_CopperLayerCount
<=
1
)
layer
=
LAYER_CUIVRE_N
;
// Of course we select the copper layer
//otherwise, we select the requested layer only if it is possible
if
(
layer
!=
LAYER_CMP_N
&&
layer
>=
m_Pcb
->
m_BoardSettings
->
m_CopperLayerCount
-
1
)
return
;
if
(
preslayer
==
layer
)
return
;
GetScreen
()
->
m_Active_Layer
=
layer
;
if
(
DisplayOpt
.
ContrastModeDisplay
)
GetScreen
()
->
SetRefreshReq
();
}
#if defined(DEBUG)
/****************************************************************/
GENERAL_COLLECTORS_GUIDE
WinEDA_BasePcbFrame
::
GetCollectorsGuide
()
/****************************************************************/
{
GENERAL_COLLECTORS_GUIDE
guide
(
m_Pcb
->
m_BoardSettings
->
GetVisibleLayers
(),
GetScreen
()
->
m_Active_Layer
);
// account for the globals
guide
.
SetIgnoreMTextsMarkedNoShow
(
g_ModuleTextNOVColor
&
ITEM_NOT_SHOW
);
guide
.
SetIgnoreMTextsOnCopper
(
g_ModuleTextCUColor
&
ITEM_NOT_SHOW
);
guide
.
SetIgnoreMTextsOnCmp
(
g_ModuleTextCMPColor
&
ITEM_NOT_SHOW
);
guide
.
SetIgnoreModulesOnCu
(
!
DisplayOpt
.
Show_Modules_Cu
);
guide
.
SetIgnoreModulesOnCmp
(
!
DisplayOpt
.
Show_Modules_Cmp
);
return
guide
;
}
#endif
pcbnew/collectors.cpp
View file @
74a635c1
...
...
@@ -68,62 +68,95 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_BaseStruct* testItem, const void*
switch
(
item
->
Type
()
)
{
case
TYPEPAD
:
breakhere
++
;
break
;
breakhere
++
;
break
;
case
TYPEVIA
:
breakhere
++
;
break
;
breakhere
++
;
break
;
case
TYPETRACK
:
breakhere
++
;
break
;
breakhere
++
;
break
;
case
TYPETEXTE
:
breakhere
++
;
break
;
breakhere
++
;
break
;
case
TYPEDRAWSEGMENT
:
breakhere
++
;
break
;
breakhere
++
;
break
;
case
TYPECOTATION
:
breakhere
++
;
break
;
breakhere
++
;
break
;
case
TYPETEXTEMODULE
:
TEXTE_MODULE
*
tm
;
tm
=
(
TEXTE_MODULE
*
)
item
;
{
TEXTE_MODULE
*
tm
=
(
TEXTE_MODULE
*
)
item
;
if
(
tm
->
m_Text
==
wxT
(
"10uH"
)
)
{
breakhere
++
;
}
break
;
}
break
;
case
TYPEMODULE
:
MODULE
*
m
;
m
=
(
MODULE
*
)
item
;
if
(
m
->
GetReference
()
==
wxT
(
"
L1
"
)
)
{
MODULE
*
m
=
(
MODULE
*
)
item
;
if
(
m
->
GetReference
()
==
wxT
(
"
C98
"
)
)
{
breakhere
++
;
}
break
;
}
break
;
default
:
breakhere
++
;
break
;
breakhere
++
;
break
;
}
#endif
#if 1
/*
int m_PreferredLayer; x
bool m_IgnorePreferredLayer
int m_LayerVisible; x
bool m_IgnoreNonVisibleLayers;
int m_LayerLocked; x
bool m_IgnoreLockedLayers;
switch
(
item
->
Type
()
)
{
case
TYPEPAD
:
break
;
case
TYPEVIA
:
break
;
case
TYPETRACK
:
break
;
case
TYPETEXTE
:
break
;
case
TYPEDRAWSEGMENT
:
break
;
case
TYPECOTATION
:
break
;
case
TYPETEXTEMODULE
:
{
TEXTE_MODULE
*
tm
=
(
TEXTE_MODULE
*
)
item
;
MODULE
*
parent
=
(
MODULE
*
)
tm
->
GetParent
();
if
(
m_Guide
->
IgnoreMTextsMarkedNoShow
()
&&
tm
->
m_NoShow
)
goto
exit
;
if
(
parent
)
{
if
(
m_Guide
->
IgnoreMTextsOnCopper
()
&&
parent
->
GetLayer
()
==
LAYER_CUIVRE_N
)
goto
exit
;
if
(
m_Guide
->
IgnoreMTextsOnCmp
()
&&
parent
->
GetLayer
()
==
LAYER_CMP_N
)
goto
exit
;
}
}
break
;
case
TYPEMODULE
:
if
(
m_Guide
->
IgnoreModulesOnCu
()
&&
item
->
GetLayer
()
==
LAYER_CUIVRE_N
)
goto
exit
;
if
(
m_Guide
->
IgnoreModulesOnCmp
()
&&
item
->
GetLayer
()
==
LAYER_CMP_N
)
goto
exit
;
break
;
default
:
break
;
}
bool m_IgnoreLockedItems; x
// common tests:
bool m_IncludeSecondary;
*/
if
(
item
->
IsOnLayer
(
m_Guide
->
GetPreferredLayer
()
)
||
m_Guide
->
IgnorePreferredLayer
()
)
{
int
layer
=
item
->
GetLayer
();
...
...
@@ -144,6 +177,7 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_BaseStruct* testItem, const void*
}
}
if
(
m_Guide
->
IncludeSecondary
()
)
{
// for now, "secondary" means "tolerate any layer". It has
...
...
@@ -168,27 +202,6 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_BaseStruct* testItem, const void*
}
}
#else
// The primary search criteria:
if
(
item
->
IsOnLayer
(
m_PreferredLayer
)
)
{
if
(
item
->
HitTest
(
m_RefPos
)
)
{
if
(
!
item
->
IsLocked
()
)
Append
(
item
);
else
Append2nd
(
item
);
// 2nd if locked.
}
}
// The secondary search criteria
else
if
(
item
->
IsOnOneOfTheseLayers
(
m_LayerMask
)
)
{
if
(
item
->
HitTest
(
m_RefPos
)
)
Append2nd
(
item
);
}
#endif
exit
:
return
SEARCH_CONTINUE
;
// always when collecting
}
...
...
@@ -229,21 +242,21 @@ void GENERAL_COLLECTOR::Collect( BOARD* board, const wxPoint& refPos,
// see collectors.h
void
GENERAL_COLLECTOR
::
Collect
(
BOARD
*
board
,
const
wxPoint
&
refPos
,
const
COLLECTORS_GUIDE
*
g
uide
)
void
GENERAL_COLLECTOR
::
Collect
(
BOARD
_ITEM
*
aItem
,
const
wxPoint
&
refPos
,
const
COLLECTORS_GUIDE
*
aG
uide
)
{
Empty
();
// empty the collection, primary criteria list
Empty2nd
();
// empty the collection, secondary criteria list
// remember guide, pass it to Inspect()
SetGuide
(
g
uide
);
SetGuide
(
aG
uide
);
// remember where the snapshot was taken from and pass refPos to
// the Inspect() function.
SetRefPos
(
refPos
);
// visit the board with the INSPECTOR (me).
board
->
Visit
(
this
,
// INSPECTOR* inspector
aItem
->
Visit
(
this
,
// INSPECTOR* inspector
NULL
,
// const void* testData, not used here
m_ScanTypes
);
...
...
@@ -257,24 +270,6 @@ void GENERAL_COLLECTOR::Collect( BOARD* board, const wxPoint& refPos,
}
/** is still inline
* Constructor GENERAL_COLLECTORS_GUIDE
* grabs stuff from global preferences and uses reasonable defaults.
* Add more constructors as needed.
GENERAL_COLLECTORS_GUIDE::GENERAL_COLLECTORS_GUIDE()
{
m_LayerLocked;
m_LayerVisible;
m_IgnoreLockedLayers;
m_IgnoreNonVisibleLayers;
m_PreferredLayer;
m_IgnoreLockedItems;
m_IncludeSecondary;
}
*/
#endif // DEBUG
//EOF
pcbnew/collectors.h
View file @
74a635c1
...
...
@@ -280,11 +280,11 @@ public:
/**
* Function Collect
* scans a BOARD using this class's Inspector method, which does the collection.
* @param a
Board A BOARD to scan.
* @param a
Item A BOARD_ITEM to scan, may be a BOARD or MODULE, or whatever.
* @param aRefPos A wxPoint to use in hit-testing.
* @param aGuide The COLLECTORS_GUIDE to use in collecting items.
*/
void
Collect
(
BOARD
*
aBoard
,
const
wxPoint
&
aRefPos
,
const
COLLECTORS_GUIDE
*
aGuide
);
void
Collect
(
BOARD
_ITEM
*
aItem
,
const
wxPoint
&
aRefPos
,
const
COLLECTORS_GUIDE
*
aGuide
);
};
...
...
@@ -325,29 +325,31 @@ public:
* Add more constructors as needed.
* @param settings The EDA_BoardDesignSettings to reference.
*/
GENERAL_COLLECTORS_GUIDE
(
const
EDA_BoardDesignSettings
*
settings
)
GENERAL_COLLECTORS_GUIDE
(
int
aVisibleLayerMask
,
int
aPreferredLayer
)
{
m_PreferredLayer
=
LAYER_CMP_N
;
m_IgnorePreferredLayer
=
false
;
m_LayerLocked
=
0
;
m_LayerVisible
=
settings
->
GetVisibleLayers
()
;
m_LayerVisible
=
aVisibleLayerMask
;
m_IgnoreLockedLayers
=
true
;
m_IgnoreNonVisibleLayers
=
true
;
m_IgnoreLockedItems
=
tru
e
;
m_IgnoreLockedItems
=
fals
e
;
#if defined(USE_MATCH_LAYER)
m_IncludeSecondary
=
false
;
#else
m_IncludeSecondary
=
true
;
#endif
#endif
// m_IgnoreMTextsMarkedNoShow = g_ModuleTextNOVColor;
m_IgnoreMTextsOnCopper
;
m_IgnoreMTextsOnCmp
;
m_IgnoreModulesOnCu
;
// m_IgnoreModulesOnCmp = !settings->Show_Modules_Cmp;
}
m_PreferredLayer
=
aPreferredLayer
;
m_IgnoreMTextsMarkedNoShow
=
true
;
// g_ModuleTextNOVColor;
m_IgnoreMTextsOnCopper
=
true
;
m_IgnoreMTextsOnCmp
=
false
;
m_IgnoreModulesOnCu
=
true
;
// !Show_Modules_Cmp;
m_IgnoreModulesOnCmp
=
false
;
}
/**
* Function IsLayerLocked
...
...
pcbnew/controle.cpp
View file @
74a635c1
...
...
@@ -131,10 +131,7 @@ BOARD_ITEM* WinEDA_BasePcbFrame::PcbGeneralLocateAndDisplay()
#if defined(DEBUG)
// test scaffolding for Collect():
GENERAL_COLLECTORS_GUIDE
guide
(
m_Pcb
->
m_BoardSettings
);
guide
.
SetIgnoreLockedItems
(
false
);
guide
.
SetPreferredLayer
(
GetScreen
()
->
m_Active_Layer
);
GENERAL_COLLECTORS_GUIDE
guide
=
GetCollectorsGuide
();
m_Collector
->
Collect
(
m_Pcb
,
GetScreen
()
->
RefPos
(
true
),
...
...
pcbnew/ioascii.cpp
View file @
74a635c1
...
...
@@ -423,6 +423,7 @@ int WinEDA_BasePcbFrame::ReadSetup( FILE* File, int* LineNum )
}
else
continue
;
data
=
strtok
(
NULL
,
" =
\n\r
"
);
if
(
data
)
{
...
...
@@ -431,6 +432,7 @@ int WinEDA_BasePcbFrame::ReadSetup( FILE* File, int* LineNum )
}
else
g_UserGrid
.
y
=
g_UserGrid
.
x
;
GetScreen
()
->
m_UserGrid
=
g_UserGrid
;
data
=
strtok
(
NULL
,
" =
\n\r
"
);
if
(
data
)
...
...
@@ -565,6 +567,7 @@ static int WriteSetup( FILE* File, WinEDA_BasePcbFrame* frame )
ii
=
frame
->
GetScreen
()
->
GetGrid
().
x
;
jj
=
frame
->
GetScreen
()
->
GetGrid
().
y
;
}
sprintf
(
text
,
"GridSize %d %d
\n
"
,
ii
,
jj
);
fprintf
(
File
,
text
);
...
...
@@ -602,6 +605,7 @@ static int WriteSetup( FILE* File, WinEDA_BasePcbFrame* frame )
fprintf
(
File
,
"TextPcbWidth %d
\n
"
,
g_DesignSettings
.
m_PcbTextWidth
);
fprintf
(
File
,
"TextPcbSize %d %d
\n
"
,
g_DesignSettings
.
m_PcbTextSize
.
x
,
g_DesignSettings
.
m_PcbTextSize
.
y
);
fprintf
(
File
,
"EdgeModWidth %d
\n
"
,
ModuleSegmentWidth
);
fprintf
(
File
,
"TextModSize %d %d
\n
"
,
ModuleTextSize
.
x
,
ModuleTextSize
.
y
);
fprintf
(
File
,
"TextModWidth %d
\n
"
,
ModuleTextWidth
);
...
...
@@ -613,11 +617,11 @@ static int WriteSetup( FILE* File, WinEDA_BasePcbFrame* frame )
fprintf
(
File
,
"AuxiliaryAxisOrg %d %d
\n
"
,
frame
->
m_Auxiliary_Axis_Position
.
x
,
frame
->
m_Auxiliary_Axis_Position
.
y
);
fprintf
(
File
,
"$EndSETUP
\n\n
"
);
return
1
;
}
#endif
...
...
pcbnew/onrightclick.cpp
View file @
74a635c1
...
...
@@ -187,7 +187,8 @@ void WinEDA_PcbFrame::OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu )
if
(
BlockActive
)
{
DrawPanel
->
CursorOn
(
&
dc
);
return
;
DrawPanel
->
CursorOn
(
&
dc
);
return
;
}
m_CurrentScreen
->
SetCurItem
(
DrawStruct
);
...
...
@@ -218,7 +219,7 @@ void WinEDA_PcbFrame::OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu )
PopMenu
->
AppendSeparator
();
ADD_MENUITEM
(
PopMenu
,
ID_POPUP_PCB_AUTOPLACE_FIXE_MODULE
,
_
(
"Lock Module"
),
Locked_xpm
);
ADD_MENUITEM
(
PopMenu
,
ID_POPUP_PCB_AUTOPLACE_FREE_MODULE
,
_
(
"
Free
Module"
),
ADD_MENUITEM
(
PopMenu
,
ID_POPUP_PCB_AUTOPLACE_FREE_MODULE
,
_
(
"
Unlock
Module"
),
Unlocked_xpm
);
if
(
!
flags
)
PopMenu
->
Append
(
ID_POPUP_PCB_AUTOPLACE_CURRENT_MODULE
,
...
...
pcbnew/pcbframe.cpp
View file @
74a635c1
...
...
@@ -11,10 +11,6 @@
#include "protos.h"
#include "id.h"
#if defined(DEBUG)
#include "collectors.h"
#endif
/*******************************/
/* class WinEDA_PcbFrame */
...
...
@@ -192,10 +188,6 @@ WinEDA_PcbFrame::WinEDA_PcbFrame( wxWindow* father, WinEDA_App* parent,
m_SelTrackWidthBox_Changed
=
FALSE
;
m_SelViaSizeBox_Changed
=
FALSE
;
#if defined(DEBUG)
m_Collector
=
new
GENERAL_COLLECTOR
();
#endif
m_DisplayPcbTrackFill
=
DisplayOpt
.
DisplayPcbTrackFill
;
m_DisplayPadFill
=
DisplayOpt
.
DisplayPadFill
;
m_DisplayPadNum
=
DisplayOpt
.
DisplayPadNum
;
...
...
@@ -241,10 +233,6 @@ WinEDA_PcbFrame::~WinEDA_PcbFrame()
{
m_Parent
->
m_PcbFrame
=
NULL
;
m_CurrentScreen
=
ScreenPcb
;
#if defined(DEBUG)
delete
m_Collector
;
#endif
}
...
...
@@ -551,3 +539,4 @@ void WinEDA_PcbFrame::SetToolbars()
DisplayUnitsMsg
();
}
todo.txt
View file @
74a635c1
...
...
@@ -4,14 +4,8 @@ folks will see these items and volunteer to do them.
*** Look at @todo in editrack-part2.cpp. Is this is a bug? ** Done (JP Charras) **
Concerns:
a) Isn't there a problem with losing the memory of the original?
b) If this is supposed to duplicate a SEGVIA to, then this call should be changed
to the new TRACK::Copy(), i.e. g_CurrentTrackSegment->Copy()
>> (JP Charras:) No problem. the code is correct.
I have put comments to explain this code section and modified some line for a more intelligible code
*** Add hierarchical menu to right mouse click in PCBNEW for the case when
multiple items are under the mouse cursor.
*** Set up a DOXYGEN environment starting with a configuration file that:
...
...
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