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
e6239e74
Commit
e6239e74
authored
Aug 22, 2007
by
dickelbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
moved m_Layer into EDA_BaseStruct
parent
755c3a1b
Changes
19
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
1189 additions
and
971 deletions
+1189
-971
change_log.txt
change_log.txt
+14
-0
base_screen.cpp
common/base_screen.cpp
+5
-0
base_struct.cpp
common/base_struct.cpp
+1
-1
common.cpp
common/common.cpp
+308
-256
class_screen.h
eeschema/class_screen.h
+0
-1
program.h
eeschema/program.h
+0
-3
base_struct.h
include/base_struct.h
+1
-2
pcbstruct.h
include/pcbstruct.h
+1
-1
buildmnu.cpp
kicad/buildmnu.cpp
+1
-1
class_cotation.h
pcbnew/class_cotation.h
+0
-1
class_mire.h
pcbnew/class_mire.h
+0
-1
class_module.h
pcbnew/class_module.h
+0
-1
class_pcb_text.h
pcbnew/class_pcb_text.h
+12
-0
class_text_mod.h
pcbnew/class_text_mod.h
+0
-1
locate.cpp
pcbnew/locate.cpp
+12
-13
onrightclick.cpp
pcbnew/onrightclick.cpp
+2
-1
pcbframe.cpp
pcbnew/pcbframe.cpp
+69
-3
drawpanel.cpp
share/drawpanel.cpp
+761
-683
zoom.cpp
share/zoom.cpp
+2
-2
No files found.
change_log.txt
View file @
e6239e74
...
...
@@ -4,6 +4,19 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with
email address.
2007-Aug-22 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
+ eeschema & pcbnew
* Fixed a filename case sensitivity problem that would show up on Linux
but probably not on Windows: bitmap/Reload.xpm needed uppercase R.
* Since so many classes introduced m_Layer, I moved m_Layer into
EDA_BaseStruct so all classes can inherit it and that way we can test
layer using a general, polymorphic test, i.e. don't have to cast a
EDA_BaseStruct* to a class specific pointer to test layer. Could also have
used a virtual function but too many places use m_Layer directly.
2007-aug-21 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
+ eeschema & pcbnew
...
...
@@ -15,6 +28,7 @@ email address.
================================================================================
+ administrative
Added copyright.h as a proposed copyright header for Mr. Charras's review.
Added uncrustify.cfg the configuration program for "uncrustify" C++ beautifier.
2007-Aug-20 UPDATE Dick Hollenbeck <dick@softplc.com>
...
...
common/base_screen.cpp
View file @
e6239e74
...
...
@@ -557,5 +557,10 @@ EDA_BaseStruct* BASE_SCREEN::GetItemFromRedoList( void )
void
BASE_SCREEN
::
SetCurItem
(
EDA_BaseStruct
*
aCurItem
)
{
#if defined(DEBUG)
printf
(
"SetCurItem(%p)
\n
"
,
aCurItem
);
#endif
m_CurrentItem
=
aCurItem
;
}
common/base_struct.cpp
View file @
e6239e74
...
...
@@ -106,6 +106,7 @@ void EDA_BaseStruct::InitVars( void )
m_TimeStamp
=
0
;
// Time stamp used for logical links
m_Status
=
0
;
m_Selected
=
0
;
/* Used by block commands, and selective editing */
m_Layer
=
0
;
}
...
...
@@ -297,7 +298,6 @@ EDA_BaseLineStruct::EDA_BaseLineStruct( EDA_BaseStruct* StructFather, DrawStruct
/*********************************************************/
EDA_TextStruct
::
EDA_TextStruct
(
const
wxString
&
text
)
{
m_Layer
=
0
;
m_Size
.
x
=
m_Size
.
y
=
DEFAULT_SIZE_TEXT
;
/* XY size of font */
m_Orient
=
0
;
/* Orient in 0.1 degrees */
m_Attributs
=
0
;
...
...
common/common.cpp
View file @
e6239e74
This diff is collapsed.
Click to expand it.
eeschema/class_screen.h
View file @
e6239e74
...
...
@@ -141,7 +141,6 @@ public:
int
m_FileNameSize
;
wxPoint
m_Pos
;
wxSize
m_Size
;
/* Position and Size of sheet symbol */
int
m_Layer
;
DrawSheetLabelStruct
*
m_Label
;
/* Points de connection */
int
m_NbLabel
;
/* Nombre de points de connexion */
...
...
eeschema/program.h
View file @
e6239e74
...
...
@@ -106,7 +106,6 @@ class DrawBusEntryStruct: public EDA_BaseStruct /* Struct de descr 1 raccord
a 45 degres de BUS ou WIRE */
{
public
:
int
m_Layer
;
int
m_Width
;
wxPoint
m_Pos
;
wxSize
m_Size
;
...
...
@@ -122,7 +121,6 @@ public:
class
DrawPolylineStruct
:
public
EDA_BaseStruct
/* Polyligne (serie de segments) */
{
public
:
int
m_Layer
;
int
m_Width
;
int
m_NumOfPoints
;
/* Number of XY pairs in Points array. */
int
*
m_Points
;
/* XY pairs that forms the polyline. */
...
...
@@ -137,7 +135,6 @@ public:
class
DrawJunctionStruct
:
public
EDA_BaseStruct
{
public
:
int
m_Layer
;
wxPoint
m_Pos
;
/* XY coordinates of connection. */
public
:
...
...
include/base_struct.h
View file @
e6239e74
...
...
@@ -154,6 +154,7 @@ public:
unsigned
long
m_TimeStamp
;
// Time stamp used for logical links
int
m_Selected
;
/* Used by block commands, and selective editing */
int
m_Layer
;
///< used by many derived classes, so make common
private
:
int
m_Status
;
...
...
@@ -347,7 +348,6 @@ class EDA_TextStruct
{
public
:
wxString
m_Text
;
/* text! */
int
m_Layer
;
/* couche d'appartenance */
wxPoint
m_Pos
;
/* XY position of anchor text. */
wxSize
m_Size
;
/* XY size of text */
int
m_Width
;
/* epaisseur du trait */
...
...
@@ -389,7 +389,6 @@ public:
class
EDA_BaseLineStruct
:
public
EDA_BaseStruct
{
public
:
int
m_Layer
;
// Layer number
int
m_Width
;
// 0 = line, > 0 = tracks, bus ...
wxPoint
m_Start
;
// Line start point
wxPoint
m_End
;
// Line end point
...
...
include/pcbstruct.h
View file @
e6239e74
...
...
@@ -276,7 +276,7 @@ public:
/**
* Function FindNet
* searches for a net with the given netcode.
* @param anetcode
The
netcode to search for.
* @param anetcode
A
netcode to search for.
* @return EQUIPOT* - the net or NULL if not found.
*/
EQUIPOT
*
FindNet
(
int
anetcode
);
...
...
kicad/buildmnu.cpp
View file @
e6239e74
...
...
@@ -27,7 +27,7 @@
#include "New_Project.xpm"
#include "Open_Project.xpm"
#include "../bitmaps/icon_python.xpm"
#include "../bitmaps/
r
eload.xpm"
#include "../bitmaps/
R
eload.xpm"
#include "id.h"
...
...
pcbnew/class_cotation.h
View file @
e6239e74
...
...
@@ -9,7 +9,6 @@
class
COTATION
:
public
EDA_BaseStruct
{
public
:
int
m_Layer
;
// 0.. 32 ( NON bit a bit)
int
m_Width
;
wxPoint
m_Pos
;
int
m_Shape
;
...
...
pcbnew/class_mire.h
View file @
e6239e74
...
...
@@ -10,7 +10,6 @@
class
MIREPCB
:
public
EDA_BaseStruct
{
public
:
int
m_Layer
;
// 0.. 32 ( NON bit a bit)
int
m_Width
;
wxPoint
m_Pos
;
int
m_Shape
;
// bit 0 : 0 = forme +, 1 = forme X
...
...
pcbnew/class_module.h
View file @
e6239e74
...
...
@@ -38,7 +38,6 @@ enum Mod_Attribut /* Attributs d'un module */
class
MODULE
:
public
EDA_BaseStruct
{
public
:
int
m_Layer
;
// layer number
wxPoint
m_Pos
;
// Real coord on board
D_PAD
*
m_Pads
;
/* Pad list (linked list) */
EDA_BaseStruct
*
m_Drawings
;
/* Graphic items list (linked list) */
...
...
pcbnew/class_pcb_text.h
View file @
e6239e74
...
...
@@ -35,6 +35,18 @@ public:
* @param frame A WinEDA_BasePcbFrame in which to print status information.
*/
void
Display_Infos
(
WinEDA_DrawFrame
*
frame
);
/**
* Function HitTest
* tests if the given wxPoint is within the bounds of this object.
* @param refPos A wxPoint to test
* @return bool - true if a hit, else false
*/
bool
HitTest
(
const
wxPoint
&
refPos
)
{
return
EDA_TextStruct
::
HitTest
(
refPos
);
}
#if defined(DEBUG)
...
...
pcbnew/class_text_mod.h
View file @
e6239e74
...
...
@@ -16,7 +16,6 @@
class
TEXTE_MODULE
:
public
EDA_BaseStruct
{
public
:
int
m_Layer
;
// layer number
int
m_Width
;
wxPoint
m_Pos
;
// Real coord
wxPoint
m_Pos0
;
// coord du debut du texte /ancre, orient 0
...
...
pcbnew/locate.cpp
View file @
e6239e74
...
...
@@ -483,16 +483,18 @@ D_PAD* Locate_Pads( MODULE* module, const wxPoint& ref_pos, int masque_layer )
}
/********************************************************/
MODULE
*
Locate_Prefered_Module
(
BOARD
*
Pcb
,
int
typeloc
)
/********************************************************/
/*
* localisation d'une empreinte par son rectangle d'encadrement
* Si plusieurs empreintes sont possibles, la priorite est:
* - sur la couche active
* - la plus petite
/**
* Function Locate_Prefered_Module
* locates a footprint by its bounding rectangle. If several footprints
* are possible, then the priority is: on the active layer, then smallest.
* The current mouse or cursor coordinates are grabbed from the active window
* to performe hit-testing.
*
* @param Pcb The BOARD to search within.
* @param typeloc Flag bits, tuning the search, see pcbnew.h
* @return MODULE* - the best module or NULL if none.
*/
MODULE
*
Locate_Prefered_Module
(
BOARD
*
Pcb
,
int
typeloc
)
{
MODULE
*
pt_module
;
int
lx
,
ly
;
/* dimensions du rectangle d'encadrement du module */
...
...
@@ -898,10 +900,7 @@ TEXTE_PCB* Locate_Texte_Pcb( EDA_BaseStruct* PtStruct, int LayerSearch, int type
if
(
pt_txt_pcb
->
m_Layer
==
LayerSearch
)
{
// because HitTest() is present in both base classes of TEXTE_PCB
// use a clarifying cast to tell compiler which HitTest()
// to call.
if
(
static_cast
<
EDA_TextStruct
*>
(
pt_txt_pcb
)
->
HitTest
(
ref
)
)
if
(
pt_txt_pcb
->
HitTest
(
ref
)
)
{
return
pt_txt_pcb
;
}
...
...
pcbnew/onrightclick.cpp
View file @
e6239e74
...
...
@@ -134,7 +134,7 @@ void WinEDA_PcbFrame::OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu )
wxString
msg
;
int
flags
=
0
;
bool
locate_track
=
FALSE
;
bool
BlockActive
=
(
m_CurrentScreen
->
BlockLocate
.
m_Command
!=
BLOCK_IDLE
);
bool
BlockActive
=
(
m_CurrentScreen
->
BlockLocate
.
m_Command
!=
BLOCK_IDLE
);
wxClientDC
dc
(
DrawPanel
);
DrawPanel
->
CursorOff
(
&
dc
);
...
...
@@ -202,6 +202,7 @@ void WinEDA_PcbFrame::OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu )
ADD_MENUITEM
(
PopMenu
,
ID_POPUP_PCB_GET_AND_MOVE_MODULE_REQUEST
,
_
(
"Get and Move Footprint"
),
Move_Module_xpm
);
}
if
(
DrawStruct
)
{
switch
(
DrawStruct
->
m_StructType
)
...
...
pcbnew/pcbframe.cpp
View file @
e6239e74
...
...
@@ -12,7 +12,7 @@
#include "id.h"
#if defined(DEBUG)
#include
<class_collector.h>
#include
"class_collector.h"
#endif
...
...
@@ -69,8 +69,8 @@ BEGIN_EVENT_TABLE( WinEDA_PcbFrame, wxFrame )
EVT_MENU
(
ID_CONFIG_REQ
,
WinEDA_PcbFrame
::
Process_Config
)
EVT_MENU
(
ID_COLORS_SETUP
,
WinEDA_PcbFrame
::
Process_Config
)
EVT_MENU
(
ID_OPTIONS_SETUP
,
WinEDA_PcbFrame
::
Process_Config
)
EVT_MENU
(
ID_PREFERENCES_CREATE_CONFIG_HOTKEYS
,
WinEDA_PcbFrame
::
Process_Config
)
EVT_MENU
(
ID_PREFERENCES_READ_CONFIG_HOTKEYS
,
WinEDA_PcbFrame
::
Process_Config
)
EVT_MENU
(
ID_PREFERENCES_CREATE_CONFIG_HOTKEYS
,
WinEDA_PcbFrame
::
Process_Config
)
EVT_MENU
(
ID_PREFERENCES_READ_CONFIG_HOTKEYS
,
WinEDA_PcbFrame
::
Process_Config
)
EVT_MENU
(
ID_PCB_TRACK_SIZE_SETUP
,
WinEDA_PcbFrame
::
Process_Config
)
EVT_MENU
(
ID_PCB_DRAWINGS_WIDTHS_SETUP
,
WinEDA_PcbFrame
::
Process_Config
)
EVT_MENU
(
ID_PCB_PAD_SETUP
,
WinEDA_PcbFrame
::
Process_Config
)
...
...
@@ -172,11 +172,77 @@ END_EVENT_TABLE()
#if defined(DEBUG)
class
RAT1COLLECTOR
:
public
COLLECTOR
{
;
};
class
ARROWCOLLECTOR
:
public
COLLECTOR
{
const
KICAD_T
*
m_ScanTypes
;
/**
* A place to hold collected objects which don't match precisely the search
* criteria, but would be acceptable if nothing else is found.
* "2nd" choice, which will be appended to the end of COLLECTOR's prime
* "list" at the end of the search.
*/
std
::
vector
<
EDA_BaseStruct
*>
list2nd
;
public
:
ARROWCOLLECTOR
()
:
COLLECTOR
(
0
),
m_ScanTypes
(
0
)
{
}
~
ARROWCOLLECTOR
()
{
// empty list2nd so that ~list2nd() does not try and delete all
// the objects that it holds, it is not the owner of such objects
// and this prevents a double free()ing.
Empty2nd
();
}
void
Empty2nd
()
{
list2nd
.
clear
();
}
/**
* Function Inspect
* is the examining function within the INSPECTOR which is passed to the
* Iterate function. It is used primarily for searching, but not limited to
* that. It can also collect or modify the scanned objects.
*
* @param testItem An EDA_BaseStruct to examine.
* @param testData is arbitrary data needed by the inspector to determine
* if the EDA_BaseStruct under test meets its match criteria.
* @return SEARCH_RESULT - SEARCH_QUIT if the Iterator is to stop the scan,
* else SCAN_CONTINUE;
*/
SEARCH_RESULT
Inspect
(
EDA_BaseStruct
*
testItem
,
const
void
*
testData
)
{
const
wxPoint
&
refPos
=
*
(
const
wxPoint
*
)
testData
;
switch
(
testItem
->
m_StructType
)
{
case
TYPEMODULE
:
if
(
testItem
->
HitTest
(
refPos
)
)
Append
(
testItem
);
break
;
}
return
SEARCH_CONTINUE
;
}
void
SetScanTypes
(
const
KICAD_T
*
scanTypes
)
{
m_ScanTypes
=
scanTypes
;
}
};
#endif
...
...
share/drawpanel.cpp
View file @
e6239e74
This diff is collapsed.
Click to expand it.
share/zoom.cpp
View file @
e6239e74
...
...
@@ -329,7 +329,7 @@ void WinEDA_DrawPanel::AddMenuZoom( wxMenu* MasterMenu )
int
ii
;
wxString
line
;
grid_list_struct
grid_list_pcb
[]
=
static
const
grid_list_struct
grid_list_pcb
[]
=
{
{
1000
,
ID_POPUP_GRID_LEVEL_1000
,
wxT
(
" 100"
)
},
{
500
,
ID_POPUP_GRID_LEVEL_500
,
wxT
(
" 50"
)
},
...
...
@@ -346,7 +346,7 @@ void WinEDA_DrawPanel::AddMenuZoom( wxMenu* MasterMenu )
{
0
,
ID_POPUP_GRID_USER
,
_
(
"grid user"
)
}
};
grid_list_struct
grid_list_schematic
[]
=
static
const
grid_list_struct
grid_list_schematic
[]
=
{
{
50
,
ID_POPUP_GRID_LEVEL_50
,
wxT
(
" 50"
)
},
{
25
,
ID_POPUP_GRID_LEVEL_25
,
wxT
(
" 25"
)
},
...
...
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