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
f406e9d9
Commit
f406e9d9
authored
Feb 23, 2008
by
dickelbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drc dialog fixes
parent
6bd9b7fc
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
218 additions
and
188 deletions
+218
-188
change_log.txt
change_log.txt
+5
-2
class_marker.cpp
pcbnew/class_marker.cpp
+33
-33
dialog_drc.cpp
pcbnew/dialog_drc.cpp
+107
-101
drc.cpp
pcbnew/drc.cpp
+6
-1
onleftclick.cpp
pcbnew/onleftclick.cpp
+39
-39
surbrill.cpp
pcbnew/surbrill.cpp
+28
-12
No files found.
change_log.txt
View file @
f406e9d9
...
@@ -9,9 +9,12 @@ email address.
...
@@ -9,9 +9,12 @@ email address.
2008-Feb-22 UPDATE Dick Hollenbeck <dick@softplc.com>
2008-Feb-22 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
================================================================================
+pcbnew
+pcbnew
specctra_export.cpp: added DSN 'outline' support from EDGE_MODULEs.
*
specctra_export.cpp: added DSN 'outline' support from EDGE_MODULEs.
lines and circles, not arcs.
lines and circles, not arcs.
factored out EDGE_MODULE::ShowShape() from EDGE_MODULE::Show().
* factored out EDGE_MODULE::ShowShape() from EDGE_MODULE::Show().
* drc.cpp changed AsSecondItem to HasSecondItem and test it in generating
the file report and when making the popup menu in the dialog_drc and
when generating the html list item.
2008-Feb-21 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
2008-Feb-21 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
...
...
pcbnew/class_marker.cpp
View file @
f406e9d9
...
@@ -44,7 +44,7 @@ void MARKER::init()
...
@@ -44,7 +44,7 @@ void MARKER::init()
m_Type
=
0
;
m_Type
=
0
;
m_Color
=
RED
;
m_Color
=
RED
;
m_Bitmap
=
Default_MarkerBitmap
;
m_Bitmap
=
Default_MarkerBitmap
;
m_Size
.
x
=
Default_MarkerBitmap
[
0
];
m_Size
.
x
=
Default_MarkerBitmap
[
0
];
m_Size
.
y
=
Default_MarkerBitmap
[
1
];
m_Size
.
y
=
Default_MarkerBitmap
[
1
];
}
}
...
@@ -56,25 +56,25 @@ MARKER::MARKER( BOARD_ITEM* StructFather ) :
...
@@ -56,25 +56,25 @@ MARKER::MARKER( BOARD_ITEM* StructFather ) :
}
}
MARKER
::
MARKER
(
int
aErrorCode
,
const
wxPoint
&
aMarkerPos
,
MARKER
::
MARKER
(
int
aErrorCode
,
const
wxPoint
&
aMarkerPos
,
const
wxString
&
aText
,
const
wxPoint
&
aPos
,
const
wxString
&
aText
,
const
wxPoint
&
aPos
,
const
wxString
&
bText
,
const
wxPoint
&
bPos
)
:
const
wxString
&
bText
,
const
wxPoint
&
bPos
)
:
BOARD_ITEM
(
NULL
,
TYPEMARKER
)
// parent set during BOARD::Add()
BOARD_ITEM
(
NULL
,
TYPEMARKER
)
// parent set during BOARD::Add()
{
{
init
();
init
();
SetData
(
aErrorCode
,
aMarkerPos
,
SetData
(
aErrorCode
,
aMarkerPos
,
aText
,
aPos
,
aText
,
aPos
,
bText
,
bPos
);
bText
,
bPos
);
}
}
MARKER
::
MARKER
(
int
aErrorCode
,
const
wxPoint
&
aMarkerPos
,
MARKER
::
MARKER
(
int
aErrorCode
,
const
wxPoint
&
aMarkerPos
,
const
wxString
&
aText
,
const
wxPoint
&
aPos
)
:
const
wxString
&
aText
,
const
wxPoint
&
aPos
)
:
BOARD_ITEM
(
NULL
,
TYPEMARKER
)
// parent set during BOARD::Add()
BOARD_ITEM
(
NULL
,
TYPEMARKER
)
// parent set during BOARD::Add()
{
{
init
();
init
();
SetData
(
aErrorCode
,
aMarkerPos
,
SetData
(
aErrorCode
,
aMarkerPos
,
aText
,
aPos
);
aText
,
aPos
);
}
}
...
@@ -88,25 +88,25 @@ MARKER::~MARKER()
...
@@ -88,25 +88,25 @@ MARKER::~MARKER()
}
}
void
MARKER
::
SetData
(
int
aErrorCode
,
const
wxPoint
&
aMarkerPos
,
void
MARKER
::
SetData
(
int
aErrorCode
,
const
wxPoint
&
aMarkerPos
,
const
wxString
&
aText
,
const
wxPoint
&
aPos
,
const
wxString
&
aText
,
const
wxPoint
&
aPos
,
const
wxString
&
bText
,
const
wxPoint
&
bPos
)
const
wxString
&
bText
,
const
wxPoint
&
bPos
)
{
{
m_drc
.
SetData
(
aErrorCode
,
aMarkerPos
,
m_drc
.
SetData
(
aErrorCode
,
aMarkerPos
,
aText
,
bText
,
aText
,
bText
,
aPos
,
bPos
);
aPos
,
bPos
);
// @todo: switch on error code to set error code specific color, and possibly bitmap.
// @todo: switch on error code to set error code specific color, and possibly bitmap.
m_Color
=
WHITE
;
m_Color
=
WHITE
;
}
}
void
MARKER
::
SetData
(
int
aErrorCode
,
const
wxPoint
&
aMarkerPos
,
void
MARKER
::
SetData
(
int
aErrorCode
,
const
wxPoint
&
aMarkerPos
,
const
wxString
&
aText
,
const
wxPoint
&
aPos
)
const
wxString
&
aText
,
const
wxPoint
&
aPos
)
{
{
m_drc
.
SetData
(
aErrorCode
,
aMarkerPos
,
m_drc
.
SetData
(
aErrorCode
,
aMarkerPos
,
aText
,
aPos
);
aText
,
aPos
);
// @todo: switch on error code to set error code specific color, and possibly bitmap.
// @todo: switch on error code to set error code specific color, and possibly bitmap.
m_Color
=
WHITE
;
m_Color
=
WHITE
;
}
}
...
@@ -128,24 +128,24 @@ void MARKER::Display_Infos( WinEDA_DrawFrame* frame )
...
@@ -128,24 +128,24 @@ void MARKER::Display_Infos( WinEDA_DrawFrame* frame )
frame
->
MsgPanel
->
EraseMsgBox
();
frame
->
MsgPanel
->
EraseMsgBox
();
const
DRC_ITEM
&
rpt
=
m_drc
;
const
DRC_ITEM
&
rpt
=
m_drc
;
text_pos
=
1
;
text_pos
=
1
;
Affiche_1_Parametre
(
frame
,
text_pos
,
_
(
"Type"
),
_
(
"Marker"
),
DARKCYAN
);
Affiche_1_Parametre
(
frame
,
text_pos
,
_
(
"Type"
),
_
(
"Marker"
),
DARKCYAN
);
wxString
errorTxt
;
wxString
errorTxt
;
errorTxt
<<
_
(
"ErrType"
)
<<
wxT
(
"("
)
<<
rpt
.
GetErrorCode
()
<<
wxT
(
")- "
)
<<
rpt
.
GetErrorText
()
<<
wxT
(
":"
);
errorTxt
<<
_
(
"ErrType"
)
<<
wxT
(
"("
)
<<
rpt
.
GetErrorCode
()
<<
wxT
(
")- "
)
<<
rpt
.
GetErrorText
()
<<
wxT
(
":"
);
text_pos
=
5
;
text_pos
=
5
;
Affiche_1_Parametre
(
frame
,
text_pos
,
errorTxt
,
wxEmptyString
,
RED
);
Affiche_1_Parametre
(
frame
,
text_pos
,
errorTxt
,
wxEmptyString
,
RED
);
wxString
txtA
;
wxString
txtA
;
txtA
<<
DRC_ITEM
::
ShowCoord
(
rpt
.
GetPointA
()
)
<<
wxT
(
": "
)
<<
rpt
.
GetTextA
();
txtA
<<
DRC_ITEM
::
ShowCoord
(
rpt
.
GetPointA
()
)
<<
wxT
(
": "
)
<<
rpt
.
GetTextA
();
wxString
txtB
;
wxString
txtB
;
if
(
rpt
.
A
sSecondItem
()
)
if
(
rpt
.
Ha
sSecondItem
()
)
txtB
<<
DRC_ITEM
::
ShowCoord
(
rpt
.
GetPointB
()
)
<<
wxT
(
": "
)
<<
rpt
.
GetTextB
();
txtB
<<
DRC_ITEM
::
ShowCoord
(
rpt
.
GetPointB
()
)
<<
wxT
(
": "
)
<<
rpt
.
GetTextB
();
text_pos
=
25
;
text_pos
=
25
;
Affiche_1_Parametre
(
frame
,
text_pos
,
txtA
,
txtB
,
DARKBROWN
);
Affiche_1_Parametre
(
frame
,
text_pos
,
txtA
,
txtB
,
DARKBROWN
);
}
}
...
@@ -157,23 +157,23 @@ bool MARKER::HitTest( const wxPoint& refPos )
...
@@ -157,23 +157,23 @@ bool MARKER::HitTest( const wxPoint& refPos )
{
{
// the MARKER is 12 pixels by 12 pixels, but is not resized with zoom, so
// the MARKER is 12 pixels by 12 pixels, but is not resized with zoom, so
// as zoom changes, the effective real size (in user units) of the MARKER changes.
// as zoom changes, the effective real size (in user units) of the MARKER changes.
wxSize
TrueSize
=
m_Size
;
wxSize
TrueSize
=
m_Size
;
if
(
ActiveScreen
)
if
(
ActiveScreen
)
{
{
TrueSize
.
x
*=
ActiveScreen
->
GetZoom
();
TrueSize
.
x
*=
ActiveScreen
->
GetZoom
();
TrueSize
.
y
*=
ActiveScreen
->
GetZoom
();
TrueSize
.
y
*=
ActiveScreen
->
GetZoom
();
}
}
wxPoint
pos
=
GetPosition
();
wxPoint
pos
=
GetPosition
();
int
dx
=
refPos
.
x
-
pos
.
x
;
int
dx
=
refPos
.
x
-
pos
.
x
;
int
dy
=
refPos
.
y
-
pos
.
y
;
int
dy
=
refPos
.
y
-
pos
.
y
;
/* is refPos in the box: Marker size to right an bottom,
/* is refPos in the box: Marker size to right an bottom,
or size/2 to left or top */
or size/2 to left or top */
if
(
dx
<=
TrueSize
.
x
&&
dy
<=
TrueSize
.
y
&&
if
(
dx
<=
TrueSize
.
x
&&
dy
<=
TrueSize
.
y
&&
dx
>=
-
TrueSize
.
x
/
2
&&
dy
>=
-
TrueSize
.
y
/
2
)
dx
>=
-
TrueSize
.
x
/
2
&&
dy
>=
-
TrueSize
.
y
/
2
)
return
true
;
return
true
;
else
else
return
false
;
return
false
;
...
@@ -201,11 +201,11 @@ void MARKER::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int DrawMode )
...
@@ -201,11 +201,11 @@ void MARKER::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int DrawMode )
GRSetDrawMode
(
DC
,
DrawMode
);
GRSetDrawMode
(
DC
,
DrawMode
);
px
=
GRMapX
(
GetPosition
().
x
);
px
=
GRMapX
(
GetPosition
().
x
);
py
=
GRMapY
(
GetPosition
().
y
);
py
=
GRMapY
(
GetPosition
().
y
);
/* Get the bitmap size */
/* Get the bitmap size */
m_Size
.
x
=
*
(
pt_bitmap
++
);
m_Size
.
x
=
*
(
pt_bitmap
++
);
m_Size
.
y
=
*
(
pt_bitmap
++
);
m_Size
.
y
=
*
(
pt_bitmap
++
);
/* Draw the bitmap */
/* Draw the bitmap */
...
...
pcbnew/dialog_drc.cpp
View file @
f406e9d9
...
@@ -43,7 +43,7 @@
...
@@ -43,7 +43,7 @@
/**
/**
* Class DRC_LIST_MARKERS
* Class DRC_LIST_MARKERS
* is an implementation of the interface named DRC_ITEM_LIST which uses
* is an implementation of the interface named DRC_ITEM_LIST which uses
* a BOARD instance to fulfill the interface. No ownership is taken of the
* a BOARD instance to fulfill the interface. No ownership is taken of the
* BOARD.
* BOARD.
*/
*/
class
DRC_LIST_MARKERS
:
public
DRC_ITEM_LIST
class
DRC_LIST_MARKERS
:
public
DRC_ITEM_LIST
...
@@ -61,15 +61,15 @@ public:
...
@@ -61,15 +61,15 @@ public:
~DRC_LIST_MARKERS() {}
~DRC_LIST_MARKERS() {}
*/
*/
//-----<Interface DRC_ITEM_LIST>---------------------------------------
//-----<Interface DRC_ITEM_LIST>---------------------------------------
void
DeleteAllItems
()
void
DeleteAllItems
()
{
{
m_board
->
DeleteMARKERs
();
m_board
->
DeleteMARKERs
();
}
}
const
DRC_ITEM
*
GetItem
(
int
aIndex
)
const
DRC_ITEM
*
GetItem
(
int
aIndex
)
{
{
const
MARKER
*
marker
=
m_board
->
GetMARKER
(
aIndex
);
const
MARKER
*
marker
=
m_board
->
GetMARKER
(
aIndex
);
...
@@ -83,7 +83,7 @@ public:
...
@@ -83,7 +83,7 @@ public:
m_board
->
DeleteMARKER
(
aIndex
);
m_board
->
DeleteMARKER
(
aIndex
);
}
}
/**
/**
* Function GetCount
* Function GetCount
* returns the number of items in the list.
* returns the number of items in the list.
...
@@ -92,7 +92,7 @@ public:
...
@@ -92,7 +92,7 @@ public:
{
{
return
m_board
->
GetMARKERCount
();
return
m_board
->
GetMARKERCount
();
}
}
//-----</Interface DRC_ITEM_LIST>--------------------------------------
//-----</Interface DRC_ITEM_LIST>--------------------------------------
};
};
...
@@ -101,7 +101,7 @@ public:
...
@@ -101,7 +101,7 @@ public:
/**
/**
* Class DRC_LIST_UNCONNECTED
* Class DRC_LIST_UNCONNECTED
* is an implementation of the interface named DRC_ITEM_LIST which uses
* is an implementation of the interface named DRC_ITEM_LIST which uses
* a vector of pointers to DRC_ITEMs to fulfill the interface. No ownership is taken of the
* a vector of pointers to DRC_ITEMs to fulfill the interface. No ownership is taken of the
* vector, which will reside in class DRC
* vector, which will reside in class DRC
*/
*/
class
DRC_LIST_UNCONNECTED
:
public
DRC_ITEM_LIST
class
DRC_LIST_UNCONNECTED
:
public
DRC_ITEM_LIST
...
@@ -119,21 +119,21 @@ public:
...
@@ -119,21 +119,21 @@ public:
~DRC_LIST_UNCONNECTED() {}
~DRC_LIST_UNCONNECTED() {}
*/
*/
//-----<Interface DRC_ITEM_LIST>---------------------------------------
//-----<Interface DRC_ITEM_LIST>---------------------------------------
void
DeleteAllItems
()
void
DeleteAllItems
()
{
{
if
(
m_vector
)
if
(
m_vector
)
{
{
for
(
unsigned
i
=
0
;
i
<
m_vector
->
size
();
++
i
)
for
(
unsigned
i
=
0
;
i
<
m_vector
->
size
();
++
i
)
delete
(
*
m_vector
)[
i
];
delete
(
*
m_vector
)[
i
];
m_vector
->
clear
();
m_vector
->
clear
();
}
}
}
}
const
DRC_ITEM
*
GetItem
(
int
aIndex
)
const
DRC_ITEM
*
GetItem
(
int
aIndex
)
{
{
if
(
m_vector
&&
(
unsigned
)
aIndex
<
m_vector
->
size
()
)
if
(
m_vector
&&
(
unsigned
)
aIndex
<
m_vector
->
size
()
)
...
@@ -153,7 +153,7 @@ public:
...
@@ -153,7 +153,7 @@ public:
}
}
}
}
/**
/**
* Function GetCount
* Function GetCount
* returns the number of items in the list.
* returns the number of items in the list.
...
@@ -166,7 +166,7 @@ public:
...
@@ -166,7 +166,7 @@ public:
}
}
return
0
;
return
0
;
}
}
//-----</Interface DRC_ITEM_LIST>--------------------------------------
//-----</Interface DRC_ITEM_LIST>--------------------------------------
};
};
...
@@ -176,7 +176,7 @@ public:
...
@@ -176,7 +176,7 @@ public:
/**
/**
* Class DRCLISTBOX
* Class DRCLISTBOX
* is used to display a DRC_ITEM_LIST.
* is used to display a DRC_ITEM_LIST.
*/
*/
class
DRCLISTBOX
:
public
wxHtmlListBox
class
DRCLISTBOX
:
public
wxHtmlListBox
{
{
private
:
private
:
...
@@ -191,16 +191,16 @@ public:
...
@@ -191,16 +191,16 @@ public:
m_list
=
0
;
m_list
=
0
;
}
}
~
DRCLISTBOX
()
~
DRCLISTBOX
()
{
{
delete
m_list
;
// I own it, I destroy it.
delete
m_list
;
// I own it, I destroy it.
}
}
/**
/**
* Function SetList
* Function SetList
* sets the DRC_ITEM_LIST for this listbox. Ownership of the DRC_ITEM_LIST is
* sets the DRC_ITEM_LIST for this listbox. Ownership of the DRC_ITEM_LIST is
* transfered to this DRCLISTBOX.
* transfered to this DRCLISTBOX.
* @param aList The DRC_ITEM_LIST* containing the DRC_ITEMs which will be
* @param aList The DRC_ITEM_LIST* containing the DRC_ITEMs which will be
* displayed in the wxHtmlListBox
* displayed in the wxHtmlListBox
...
@@ -208,7 +208,7 @@ public:
...
@@ -208,7 +208,7 @@ public:
void
SetList
(
DRC_ITEM_LIST
*
aList
)
void
SetList
(
DRC_ITEM_LIST
*
aList
)
{
{
delete
m_list
;
delete
m_list
;
m_list
=
aList
;
m_list
=
aList
;
SetItemCount
(
aList
->
GetCount
()
);
SetItemCount
(
aList
->
GetCount
()
);
Refresh
();
Refresh
();
...
@@ -227,8 +227,8 @@ public:
...
@@ -227,8 +227,8 @@ public:
}
}
return
NULL
;
return
NULL
;
}
}
/**
/**
* Function OnGetItem
* Function OnGetItem
* returns the html text associated with the DRC_ITEM given by index 'n'.
* returns the html text associated with the DRC_ITEM given by index 'n'.
...
@@ -257,8 +257,8 @@ public:
...
@@ -257,8 +257,8 @@ public:
{
{
return
OnGetItem
(
n
);
return
OnGetItem
(
n
);
}
}
/**
/**
* Function DeleteElement
* Function DeleteElement
* will delete one of the items in the list.
* will delete one of the items in the list.
...
@@ -268,20 +268,20 @@ public:
...
@@ -268,20 +268,20 @@ public:
{
{
if
(
m_list
)
if
(
m_list
)
{
{
int
selection
=
GetSelection
();
int
selection
=
GetSelection
();
m_list
->
DeleteItem
(
aIndex
);
m_list
->
DeleteItem
(
aIndex
);
int
count
=
m_list
->
GetCount
();
int
count
=
m_list
->
GetCount
();
SetItemCount
(
count
);
SetItemCount
(
count
);
// if old selection >= new count
// if old selection >= new count
if
(
selection
>=
count
)
if
(
selection
>=
count
)
SetSelection
(
count
-
1
);
// -1 is "no selection"
SetSelection
(
count
-
1
);
// -1 is "no selection"
Refresh
();
Refresh
();
}
}
}
}
/**
/**
* Function DeleteAllItems
* Function DeleteAllItems
* deletes all items in the list.
* deletes all items in the list.
...
@@ -342,7 +342,7 @@ BEGIN_EVENT_TABLE( DrcDialog, wxDialog )
...
@@ -342,7 +342,7 @@ BEGIN_EVENT_TABLE( DrcDialog, wxDialog )
EVT_MENU
(
ID_POPUP_UNCONNECTED_B
,
DrcDialog
::
OnPopupMenu
)
EVT_MENU
(
ID_POPUP_UNCONNECTED_B
,
DrcDialog
::
OnPopupMenu
)
EVT_MENU
(
ID_POPUP_MARKERS_A
,
DrcDialog
::
OnPopupMenu
)
EVT_MENU
(
ID_POPUP_MARKERS_A
,
DrcDialog
::
OnPopupMenu
)
EVT_MENU
(
ID_POPUP_MARKERS_B
,
DrcDialog
::
OnPopupMenu
)
EVT_MENU
(
ID_POPUP_MARKERS_B
,
DrcDialog
::
OnPopupMenu
)
END_EVENT_TABLE
()
END_EVENT_TABLE
()
/*!
/*!
...
@@ -353,7 +353,7 @@ DrcDialog::DrcDialog( )
...
@@ -353,7 +353,7 @@ DrcDialog::DrcDialog( )
{
{
}
}
DrcDialog
::
DrcDialog
(
DRC
*
aTester
,
WinEDA_PcbFrame
*
parent
,
DrcDialog
::
DrcDialog
(
DRC
*
aTester
,
WinEDA_PcbFrame
*
parent
,
wxWindowID
id
,
wxWindowID
id
,
const
wxString
&
caption
,
const
wxString
&
caption
,
const
wxPoint
&
pos
,
const
wxPoint
&
pos
,
...
@@ -361,7 +361,7 @@ DrcDialog::DrcDialog( DRC* aTester, WinEDA_PcbFrame* parent,
...
@@ -361,7 +361,7 @@ DrcDialog::DrcDialog( DRC* aTester, WinEDA_PcbFrame* parent,
long
style
)
long
style
)
{
{
m_tester
=
aTester
;
m_tester
=
aTester
;
m_Parent
=
parent
;
m_Parent
=
parent
;
Create
(
parent
,
id
,
caption
,
pos
,
size
,
style
);
Create
(
parent
,
id
,
caption
,
pos
,
size
,
style
);
...
@@ -609,7 +609,7 @@ wxIcon DrcDialog::GetIconResource( const wxString& name )
...
@@ -609,7 +609,7 @@ wxIcon DrcDialog::GetIconResource( const wxString& name )
void
DrcDialog
::
OnStartdrcClick
(
wxCommandEvent
&
event
)
void
DrcDialog
::
OnStartdrcClick
(
wxCommandEvent
&
event
)
{
{
wxString
reportName
;
wxString
reportName
;
if
(
m_CreateRptCtrl
->
IsChecked
()
)
// Create a file rpt
if
(
m_CreateRptCtrl
->
IsChecked
()
)
// Create a file rpt
{
{
reportName
=
m_RptFilenameCtrl
->
GetValue
();
reportName
=
m_RptFilenameCtrl
->
GetValue
();
...
@@ -625,16 +625,16 @@ void DrcDialog::OnStartdrcClick( wxCommandEvent& event )
...
@@ -625,16 +625,16 @@ void DrcDialog::OnStartdrcClick( wxCommandEvent& event )
g_DesignSettings
.
m_TrackClearence
=
g_DesignSettings
.
m_TrackClearence
=
ReturnValueFromTextCtrl
(
*
m_SetClearance
,
m_Parent
->
m_InternalUnits
);
ReturnValueFromTextCtrl
(
*
m_SetClearance
,
m_Parent
->
m_InternalUnits
);
m_tester
->
SetSettings
(
m_Pad2PadTestCtrl
->
IsChecked
(),
m_tester
->
SetSettings
(
m_Pad2PadTestCtrl
->
IsChecked
(),
m_UnconnectedTestCtrl
->
IsChecked
(),
m_UnconnectedTestCtrl
->
IsChecked
(),
m_ZonesTestCtrl
->
IsChecked
(),
m_ZonesTestCtrl
->
IsChecked
(),
reportName
,
m_CreateRptCtrl
->
IsChecked
()
);
reportName
,
m_CreateRptCtrl
->
IsChecked
()
);
DelDRCMarkers
();
DelDRCMarkers
();
wxBeginBusyCursor
();
wxBeginBusyCursor
();
// run all the tests, with no UI at this time.
// run all the tests, with no UI at this time.
m_tester
->
RunTests
();
m_tester
->
RunTests
();
...
@@ -643,30 +643,30 @@ void DrcDialog::OnStartdrcClick( wxCommandEvent& event )
...
@@ -643,30 +643,30 @@ void DrcDialog::OnStartdrcClick( wxCommandEvent& event )
#else
#else
m_Notebook
->
SetSelection
(
0
);
// display the 1at tab "... Markers..."
m_Notebook
->
SetSelection
(
0
);
// display the 1at tab "... Markers..."
#endif
#endif
// Generate the report
// Generate the report
if
(
!
reportName
.
IsEmpty
()
)
if
(
!
reportName
.
IsEmpty
()
)
{
{
FILE
*
fp
=
wxFopen
(
reportName
,
wxT
(
"w"
)
);
FILE
*
fp
=
wxFopen
(
reportName
,
wxT
(
"w"
)
);
writeReport
(
fp
);
writeReport
(
fp
);
fclose
(
fp
);
fclose
(
fp
);
wxString
msg
;
wxString
msg
;
msg
.
Printf
(
_
(
"Report file
\"
%s
\"
created"
),
reportName
.
GetData
()
);
msg
.
Printf
(
_
(
"Report file
\"
%s
\"
created"
),
reportName
.
GetData
()
);
wxString
caption
(
_
(
"Disk File Report Completed"
)
);
wxString
caption
(
_
(
"Disk File Report Completed"
)
);
wxMessageDialog
popupWindow
(
this
,
msg
,
caption
);
wxMessageDialog
popupWindow
(
this
,
msg
,
caption
);
popupWindow
.
ShowModal
();
popupWindow
.
ShowModal
();
}
}
wxEndBusyCursor
();
wxEndBusyCursor
();
RedrawDrawPanel
();
RedrawDrawPanel
();
}
}
...
@@ -689,7 +689,7 @@ void DrcDialog::OnDeleteAllClick( wxCommandEvent& event )
...
@@ -689,7 +689,7 @@ void DrcDialog::OnDeleteAllClick( wxCommandEvent& event )
void
DrcDialog
::
OnListUnconnectedClick
(
wxCommandEvent
&
event
)
void
DrcDialog
::
OnListUnconnectedClick
(
wxCommandEvent
&
event
)
{
{
wxString
reportName
;
wxString
reportName
;
if
(
m_CreateRptCtrl
->
IsChecked
()
)
// Create a file rpt
if
(
m_CreateRptCtrl
->
IsChecked
()
)
// Create a file rpt
{
{
reportName
=
m_RptFilenameCtrl
->
GetValue
();
reportName
=
m_RptFilenameCtrl
->
GetValue
();
...
@@ -705,16 +705,16 @@ void DrcDialog::OnListUnconnectedClick( wxCommandEvent& event )
...
@@ -705,16 +705,16 @@ void DrcDialog::OnListUnconnectedClick( wxCommandEvent& event )
g_DesignSettings
.
m_TrackClearence
=
g_DesignSettings
.
m_TrackClearence
=
ReturnValueFromTextCtrl
(
*
m_SetClearance
,
m_Parent
->
m_InternalUnits
);
ReturnValueFromTextCtrl
(
*
m_SetClearance
,
m_Parent
->
m_InternalUnits
);
m_tester
->
SetSettings
(
m_Pad2PadTestCtrl
->
IsChecked
(),
m_tester
->
SetSettings
(
m_Pad2PadTestCtrl
->
IsChecked
(),
m_UnconnectedTestCtrl
->
IsChecked
(),
m_UnconnectedTestCtrl
->
IsChecked
(),
m_ZonesTestCtrl
->
IsChecked
(),
m_ZonesTestCtrl
->
IsChecked
(),
reportName
,
m_CreateRptCtrl
->
IsChecked
()
);
reportName
,
m_CreateRptCtrl
->
IsChecked
()
);
DelDRCMarkers
();
DelDRCMarkers
();
wxBeginBusyCursor
();
wxBeginBusyCursor
();
m_tester
->
ListUnconnectedPads
();
m_tester
->
ListUnconnectedPads
();
#if wxCHECK_VERSION( 2, 8, 0 )
#if wxCHECK_VERSION( 2, 8, 0 )
...
@@ -722,30 +722,30 @@ void DrcDialog::OnListUnconnectedClick( wxCommandEvent& event )
...
@@ -722,30 +722,30 @@ void DrcDialog::OnListUnconnectedClick( wxCommandEvent& event )
#else
#else
m_Notebook
->
SetSelection
(
1
);
// display the 2nd tab "Unconnected..."
m_Notebook
->
SetSelection
(
1
);
// display the 2nd tab "Unconnected..."
#endif
#endif
// Generate the report
// Generate the report
if
(
!
reportName
.
IsEmpty
()
)
if
(
!
reportName
.
IsEmpty
()
)
{
{
FILE
*
fp
=
wxFopen
(
reportName
,
wxT
(
"w"
)
);
FILE
*
fp
=
wxFopen
(
reportName
,
wxT
(
"w"
)
);
writeReport
(
fp
);
writeReport
(
fp
);
fclose
(
fp
);
fclose
(
fp
);
wxString
msg
;
wxString
msg
;
msg
.
Printf
(
_
(
"Report file
\"
%s
\"
created"
),
reportName
.
GetData
()
);
msg
.
Printf
(
_
(
"Report file
\"
%s
\"
created"
),
reportName
.
GetData
()
);
wxString
caption
(
_
(
"Disk File Report Completed"
)
);
wxString
caption
(
_
(
"Disk File Report Completed"
)
);
wxMessageDialog
popupWindow
(
this
,
msg
,
caption
);
wxMessageDialog
popupWindow
(
this
,
msg
,
caption
);
popupWindow
.
ShowModal
();
popupWindow
.
ShowModal
();
}
}
wxEndBusyCursor
();
wxEndBusyCursor
();
/* there is currently nothing visible on the DrawPanel for unconnected pads
/* there is currently nothing visible on the DrawPanel for unconnected pads
RedrawDrawPanel();
RedrawDrawPanel();
*/
*/
}
}
...
@@ -837,14 +837,14 @@ void DrcDialog::OnReportCheckBoxClicked( wxCommandEvent& event )
...
@@ -837,14 +837,14 @@ void DrcDialog::OnReportCheckBoxClicked( wxCommandEvent& event )
void
DrcDialog
::
OnInitDialog
(
wxInitDialogEvent
&
event
)
void
DrcDialog
::
OnInitDialog
(
wxInitDialogEvent
&
event
)
{
{
wxCommandEvent
junk
;
wxCommandEvent
junk
;
// Set the initial "enabled" status of the browse button and the text
// Set the initial "enabled" status of the browse button and the text
// field for report name
// field for report name
OnReportCheckBoxClicked
(
junk
);
OnReportCheckBoxClicked
(
junk
);
m_SetClearance
->
SetFocus
();
m_SetClearance
->
SetFocus
();
// deselect the existing text, seems SetFocus() wants to emulate
// deselect the existing text, seems SetFocus() wants to emulate
// Microsoft and select all text, which is not desireable here.
// Microsoft and select all text, which is not desireable here.
m_SetClearance
->
SetSelection
(
0
,
0
);
m_SetClearance
->
SetSelection
(
0
,
0
);
...
@@ -861,7 +861,7 @@ void DrcDialog::OnLeftDClickClearance( wxMouseEvent& event )
...
@@ -861,7 +861,7 @@ void DrcDialog::OnLeftDClickClearance( wxMouseEvent& event )
event
.
Skip
();
event
.
Skip
();
// I am assuming that the double click actually changed the selected item.
// I am assuming that the double click actually changed the selected item.
// please verify this.
// please verify this.
int
selection
=
m_ClearanceListBox
->
GetSelection
();
int
selection
=
m_ClearanceListBox
->
GetSelection
();
if
(
selection
!=
wxNOT_FOUND
)
if
(
selection
!=
wxNOT_FOUND
)
...
@@ -873,16 +873,16 @@ void DrcDialog::OnLeftDClickClearance( wxMouseEvent& event )
...
@@ -873,16 +873,16 @@ void DrcDialog::OnLeftDClickClearance( wxMouseEvent& event )
{
{
/*
/*
// after the goto, process a button OK command later.
// after the goto, process a button OK command later.
wxCommandEvent cmd( wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK );
wxCommandEvent cmd( wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK );
::wxPostEvent( GetEventHandler(), cmd );
::wxPostEvent( GetEventHandler(), cmd );
*/
*/
m_Parent
->
CursorGoto
(
item
->
GetPosition
()
);
m_Parent
->
CursorGoto
(
item
->
GetPosition
()
);
// turn control over to m_Parent, hide this DrcDialog window,
// turn control over to m_Parent, hide this DrcDialog window,
// no destruction so we can preserve listbox cursor
// no destruction so we can preserve listbox cursor
Hide
();
Hide
();
event
.
StopPropagation
();
// still get the popup window.
event
.
StopPropagation
();
// still get the popup window.
}
}
}
}
...
@@ -892,11 +892,11 @@ void DrcDialog::OnLeftDClickClearance( wxMouseEvent& event )
...
@@ -892,11 +892,11 @@ void DrcDialog::OnLeftDClickClearance( wxMouseEvent& event )
void
DrcDialog
::
OnPopupMenu
(
wxCommandEvent
&
event
)
void
DrcDialog
::
OnPopupMenu
(
wxCommandEvent
&
event
)
{
{
int
source
=
event
.
GetId
();
int
source
=
event
.
GetId
();
const
DRC_ITEM
*
item
=
0
;
const
DRC_ITEM
*
item
=
0
;
wxPoint
pos
;
wxPoint
pos
;
int
selection
;
int
selection
;
switch
(
source
)
switch
(
source
)
{
{
...
@@ -940,20 +940,23 @@ void DrcDialog::OnRightUpUnconnected( wxMouseEvent& event )
...
@@ -940,20 +940,23 @@ void DrcDialog::OnRightUpUnconnected( wxMouseEvent& event )
event
.
Skip
();
event
.
Skip
();
// popup menu to go to either of the items listed in the DRC_ITEM.
// popup menu to go to either of the items listed in the DRC_ITEM.
int
selection
=
m_UnconnectedListBox
->
GetSelection
();
int
selection
=
m_UnconnectedListBox
->
GetSelection
();
if
(
selection
!=
wxNOT_FOUND
)
if
(
selection
!=
wxNOT_FOUND
)
{
{
wxMenu
menu
;
wxMenu
menu
;
wxMenuItem
*
mItem
;
wxMenuItem
*
mItem
;
const
DRC_ITEM
*
dItem
=
m_UnconnectedListBox
->
GetItem
(
selection
);
const
DRC_ITEM
*
dItem
=
m_UnconnectedListBox
->
GetItem
(
selection
);
mItem
=
new
wxMenuItem
(
&
menu
,
ID_POPUP_UNCONNECTED_A
,
dItem
->
GetTextA
()
);
mItem
=
new
wxMenuItem
(
&
menu
,
ID_POPUP_UNCONNECTED_A
,
dItem
->
GetTextA
()
);
menu
.
Append
(
mItem
);
menu
.
Append
(
mItem
);
mItem
=
new
wxMenuItem
(
&
menu
,
ID_POPUP_UNCONNECTED_B
,
dItem
->
GetTextB
()
);
if
(
dItem
->
HasSecondItem
()
)
menu
.
Append
(
mItem
);
{
mItem
=
new
wxMenuItem
(
&
menu
,
ID_POPUP_UNCONNECTED_B
,
dItem
->
GetTextB
()
);
menu
.
Append
(
mItem
);
}
PopupMenu
(
&
menu
);
PopupMenu
(
&
menu
);
}
}
...
@@ -969,20 +972,23 @@ void DrcDialog::OnRightUpClearance( wxMouseEvent& event )
...
@@ -969,20 +972,23 @@ void DrcDialog::OnRightUpClearance( wxMouseEvent& event )
event
.
Skip
();
event
.
Skip
();
// popup menu to go to either of the items listed in the DRC_ITEM.
// popup menu to go to either of the items listed in the DRC_ITEM.
int
selection
=
m_ClearanceListBox
->
GetSelection
();
int
selection
=
m_ClearanceListBox
->
GetSelection
();
if
(
selection
!=
wxNOT_FOUND
)
if
(
selection
!=
wxNOT_FOUND
)
{
{
wxMenu
menu
;
wxMenu
menu
;
wxMenuItem
*
mItem
;
wxMenuItem
*
mItem
;
const
DRC_ITEM
*
dItem
=
m_ClearanceListBox
->
GetItem
(
selection
);
const
DRC_ITEM
*
dItem
=
m_ClearanceListBox
->
GetItem
(
selection
);
mItem
=
new
wxMenuItem
(
&
menu
,
ID_POPUP_MARKERS_A
,
dItem
->
GetTextA
()
);
mItem
=
new
wxMenuItem
(
&
menu
,
ID_POPUP_MARKERS_A
,
dItem
->
GetTextA
()
);
menu
.
Append
(
mItem
);
menu
.
Append
(
mItem
);
mItem
=
new
wxMenuItem
(
&
menu
,
ID_POPUP_MARKERS_B
,
dItem
->
GetTextB
()
);
if
(
dItem
->
HasSecondItem
()
)
menu
.
Append
(
mItem
);
{
mItem
=
new
wxMenuItem
(
&
menu
,
ID_POPUP_MARKERS_B
,
dItem
->
GetTextB
()
);
menu
.
Append
(
mItem
);
}
PopupMenu
(
&
menu
);
PopupMenu
(
&
menu
);
}
}
...
@@ -998,23 +1004,23 @@ void DrcDialog::OnLeftDClickUnconnected( wxMouseEvent& event )
...
@@ -998,23 +1004,23 @@ void DrcDialog::OnLeftDClickUnconnected( wxMouseEvent& event )
event
.
Skip
();
event
.
Skip
();
// I am assuming that the double click actually changed the selected item.
// I am assuming that the double click actually changed the selected item.
// please verify this.
// please verify this.
int
selection
=
m_UnconnectedListBox
->
GetSelection
();
int
selection
=
m_UnconnectedListBox
->
GetSelection
();
if
(
selection
!=
wxNOT_FOUND
)
if
(
selection
!=
wxNOT_FOUND
)
{
{
// Find the selected DRC_ITEM in the listbox, position cursor there,
// Find the selected DRC_ITEM in the listbox, position cursor there,
// at the first of the two pads.
// at the first of the two pads.
// Then hide the dialog.
// Then hide the dialog.
const
DRC_ITEM
*
item
=
m_UnconnectedListBox
->
GetItem
(
selection
);
const
DRC_ITEM
*
item
=
m_UnconnectedListBox
->
GetItem
(
selection
);
if
(
item
)
if
(
item
)
{
{
m_Parent
->
CursorGoto
(
item
->
GetPosition
()
);
m_Parent
->
CursorGoto
(
item
->
GetPosition
()
);
Hide
();
Hide
();
// intermittently, still get the popup window, even with this.
// intermittently, still get the popup window, even with this.
event
.
StopPropagation
();
event
.
StopPropagation
();
}
}
}
}
}
}
...
@@ -1023,26 +1029,26 @@ void DrcDialog::OnLeftDClickUnconnected( wxMouseEvent& event )
...
@@ -1023,26 +1029,26 @@ void DrcDialog::OnLeftDClickUnconnected( wxMouseEvent& event )
void
DrcDialog
::
OnMarkerSelectionEvent
(
wxCommandEvent
&
event
)
void
DrcDialog
::
OnMarkerSelectionEvent
(
wxCommandEvent
&
event
)
{
{
int
selection
=
event
.
GetSelection
();
int
selection
=
event
.
GetSelection
();
if
(
selection
!=
wxNOT_FOUND
)
if
(
selection
!=
wxNOT_FOUND
)
{
{
// until a MARKER is selected, this button is not enabled.
// until a MARKER is selected, this button is not enabled.
m_DeleteCurrentMarkerButton
->
Enable
(
true
);
m_DeleteCurrentMarkerButton
->
Enable
(
true
);
}
}
event
.
Skip
();
event
.
Skip
();
}
}
void
DrcDialog
::
OnUnconnectedSelectionEvent
(
wxCommandEvent
&
event
)
void
DrcDialog
::
OnUnconnectedSelectionEvent
(
wxCommandEvent
&
event
)
{
{
int
selection
=
event
.
GetSelection
();
int
selection
=
event
.
GetSelection
();
if
(
selection
!=
wxNOT_FOUND
)
if
(
selection
!=
wxNOT_FOUND
)
{
{
// until a MARKER is selected, this button is not enabled.
// until a MARKER is selected, this button is not enabled.
m_DeleteCurrentMarkerButton
->
Enable
(
true
);
m_DeleteCurrentMarkerButton
->
Enable
(
true
);
}
}
event
.
Skip
();
event
.
Skip
();
}
}
...
@@ -1070,23 +1076,23 @@ void DrcDialog::writeReport( FILE* fp )
...
@@ -1070,23 +1076,23 @@ void DrcDialog::writeReport( FILE* fp )
CONV_TO_UTF8
(
m_Parent
->
GetScreen
()
->
m_FileName
)
);
CONV_TO_UTF8
(
m_Parent
->
GetScreen
()
->
m_FileName
)
);
wxDateTime
now
=
wxDateTime
::
Now
();
wxDateTime
now
=
wxDateTime
::
Now
();
fprintf
(
fp
,
"** Created on %s **
\n
"
,
CONV_TO_UTF8
(
now
.
Format
(
wxT
(
"%F %T"
)))
);
fprintf
(
fp
,
"** Created on %s **
\n
"
,
CONV_TO_UTF8
(
now
.
Format
(
wxT
(
"%F %T"
)))
);
count
=
m_ClearanceListBox
->
GetItemCount
();
count
=
m_ClearanceListBox
->
GetItemCount
();
fprintf
(
fp
,
"
\n
** Found %d DRC errors **
\n
"
,
count
);
fprintf
(
fp
,
"
\n
** Found %d DRC errors **
\n
"
,
count
);
for
(
int
i
=
0
;
i
<
count
;
++
i
)
for
(
int
i
=
0
;
i
<
count
;
++
i
)
fprintf
(
fp
,
m_ClearanceListBox
->
GetItem
(
i
)
->
ShowReport
().
mb_str
()
);
fprintf
(
fp
,
m_ClearanceListBox
->
GetItem
(
i
)
->
ShowReport
().
mb_str
()
);
count
=
m_UnconnectedListBox
->
GetItemCount
();
count
=
m_UnconnectedListBox
->
GetItemCount
();
fprintf
(
fp
,
"
\n
** Found %d unconnected pads **
\n
"
,
count
);
fprintf
(
fp
,
"
\n
** Found %d unconnected pads **
\n
"
,
count
);
for
(
int
i
=
0
;
i
<
count
;
++
i
)
for
(
int
i
=
0
;
i
<
count
;
++
i
)
fprintf
(
fp
,
m_UnconnectedListBox
->
GetItem
(
i
)
->
ShowReport
().
mb_str
()
);
fprintf
(
fp
,
m_UnconnectedListBox
->
GetItem
(
i
)
->
ShowReport
().
mb_str
()
);
fprintf
(
fp
,
"
\n
** End of Report **
\n
"
);
fprintf
(
fp
,
"
\n
** End of Report **
\n
"
);
}
}
...
@@ -1106,25 +1112,25 @@ void DrcDialog::OnDeleteOneClick( wxCommandEvent& event )
...
@@ -1106,25 +1112,25 @@ void DrcDialog::OnDeleteOneClick( wxCommandEvent& event )
if
(
selectedIndex
!=
wxNOT_FOUND
)
if
(
selectedIndex
!=
wxNOT_FOUND
)
{
{
m_ClearanceListBox
->
DeleteItem
(
selectedIndex
);
m_ClearanceListBox
->
DeleteItem
(
selectedIndex
);
// redraw the pcb
// redraw the pcb
RedrawDrawPanel
();
RedrawDrawPanel
();
}
}
}
}
else
if
(
curTab
==
1
)
else
if
(
curTab
==
1
)
{
{
selectedIndex
=
m_UnconnectedListBox
->
GetSelection
();
selectedIndex
=
m_UnconnectedListBox
->
GetSelection
();
if
(
selectedIndex
!=
wxNOT_FOUND
)
if
(
selectedIndex
!=
wxNOT_FOUND
)
{
{
m_UnconnectedListBox
->
DeleteItem
(
selectedIndex
);
m_UnconnectedListBox
->
DeleteItem
(
selectedIndex
);
/* these unconnected DRC_ITEMs are not currently visible on the pcb
/* these unconnected DRC_ITEMs are not currently visible on the pcb
RedrawDrawPanel();
RedrawDrawPanel();
*/
*/
}
}
}
}
// event.Skip();
// event.Skip();
}
}
pcbnew/drc.cpp
View file @
f406e9d9
...
@@ -510,11 +510,16 @@ bool DRC::doTrackDrc( TRACK* aRefSeg, TRACK* aStart )
...
@@ -510,11 +510,16 @@ bool DRC::doTrackDrc( TRACK* aRefSeg, TRACK* aStart )
// This test seems necessary since the dialog box that displays the
// This test seems necessary since the dialog box that displays the
// desired via hole size and width does not enforce a hole size smaller
// desired via hole size and width does not enforce a hole size smaller
// than the via's diameter.
// than the via's diameter.
if
(
!
aRefSeg
->
GetDrillValue
()
>
aRefSeg
->
m_Width
)
if
(
aRefSeg
->
GetDrillValue
()
>
aRefSeg
->
m_Width
)
{
{
#if 0 // a temporary way to fix a bad board here, change for your values
if( aRefSeg->GetDrillValue()==120 && aRefSeg->m_Width==100 )
aRefSeg->m_Width = 180;
#else
m_currentMarker
=
fillMarker
(
aRefSeg
,
NULL
,
m_currentMarker
=
fillMarker
(
aRefSeg
,
NULL
,
DRCE_VIA_HOLE_BIGGER
,
m_currentMarker
);
DRCE_VIA_HOLE_BIGGER
,
m_currentMarker
);
return
false
;
return
false
;
#endif
}
}
// For microvias: test if they are blindvias and only between 2 layers
// For microvias: test if they are blindvias and only between 2 layers
...
...
pcbnew/onleftclick.cpp
View file @
f406e9d9
...
@@ -26,23 +26,23 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
...
@@ -26,23 +26,23 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
*/
*/
{
{
BOARD_ITEM
*
DrawStruct
=
GetCurItem
();
BOARD_ITEM
*
DrawStruct
=
GetCurItem
();
bool
exit
=
false
;
bool
exit
=
false
;
if
(
(
m_ID_current_state
==
0
)
||
(
DrawStruct
&&
DrawStruct
->
m_Flags
)
)
if
(
(
m_ID_current_state
==
0
)
||
(
DrawStruct
&&
DrawStruct
->
m_Flags
)
)
{
{
DrawPanel
->
m_AutoPAN_Request
=
FALSE
;
DrawPanel
->
m_AutoPAN_Request
=
FALSE
;
if
(
DrawStruct
&&
DrawStruct
->
m_Flags
)
// "POPUP" in progress
if
(
DrawStruct
&&
DrawStruct
->
m_Flags
)
// "POPUP" in progress
{
{
DrawPanel
->
m_IgnoreMouseEvents
=
TRUE
;
DrawPanel
->
m_IgnoreMouseEvents
=
TRUE
;
DrawPanel
->
CursorOff
(
DC
);
DrawPanel
->
CursorOff
(
DC
);
switch
(
DrawStruct
->
Type
()
)
switch
(
DrawStruct
->
Type
()
)
{
{
case
TYPEZONE_CONTAINER
:
case
TYPEZONE_CONTAINER
:
if
(
(
DrawStruct
->
m_Flags
&
IS_NEW
)
)
if
(
(
DrawStruct
->
m_Flags
&
IS_NEW
)
)
Begin_Zone
(
DC
);
Begin_Zone
(
DC
);
else
else
End_Move_Zone_Corner_Or_Outlines
(
DC
,
(
ZONE_CONTAINER
*
)
DrawStruct
);
End_Move_Zone_Corner_Or_Outlines
(
DC
,
(
ZONE_CONTAINER
*
)
DrawStruct
);
exit
=
true
;
exit
=
true
;
break
;
break
;
...
@@ -95,23 +95,23 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
...
@@ -95,23 +95,23 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
wxT
(
"WinEDA_PcbFrame::OnLeftClick() err: DrawType %d m_Flags != 0"
),
DrawStruct
->
Type
()
);
wxT
(
"WinEDA_PcbFrame::OnLeftClick() err: DrawType %d m_Flags != 0"
),
DrawStruct
->
Type
()
);
exit
=
true
;
exit
=
true
;
}
}
break
;
break
;
}
}
DrawPanel
->
m_IgnoreMouseEvents
=
FALSE
;
DrawPanel
->
m_IgnoreMouseEvents
=
FALSE
;
DrawPanel
->
CursorOn
(
DC
);
DrawPanel
->
CursorOn
(
DC
);
if
(
exit
)
return
;
if
(
exit
)
return
;
}
}
else
if
(
!
wxGetKeyState
(
WXK_SHIFT
)
&&
!
wxGetKeyState
(
WXK_ALT
)
&&
else
if
(
!
wxGetKeyState
(
WXK_SHIFT
)
&&
!
wxGetKeyState
(
WXK_ALT
)
&&
!
wxGetKeyState
(
WXK_CONTROL
)
)
!
wxGetKeyState
(
WXK_CONTROL
)
)
{
{
DrawStruct
=
PcbGeneralLocateAndDisplay
();
DrawStruct
=
PcbGeneralLocateAndDisplay
();
if
(
DrawStruct
)
if
(
DrawStruct
)
SendMessageToEESCHEMA
(
DrawStruct
);
SendMessageToEESCHEMA
(
DrawStruct
);
}
}
}
}
switch
(
m_ID_current_state
)
switch
(
m_ID_current_state
)
{
{
case
ID_MAIN_MENUBAR
:
case
ID_MAIN_MENUBAR
:
...
@@ -130,19 +130,19 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
...
@@ -130,19 +130,19 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
break
;
break
;
case
ID_PCB_HIGHLIGHT_BUTT
:
case
ID_PCB_HIGHLIGHT_BUTT
:
{
{
int
netcode
=
Select_High_Light
(
DC
);
int
netcode
=
Select_High_Light
(
DC
);
if
(
netcode
<
0
)
if
(
netcode
<
0
)
m_Pcb
->
Display_Infos
(
this
);
m_Pcb
->
Display_Infos
(
this
);
else
else
Affiche_Infos_Equipot
(
netcode
,
this
);
Affiche_Infos_Equipot
(
netcode
,
this
);
}
}
break
;
break
;
case
ID_PCB_SHOW_1_RATSNEST_BUTT
:
case
ID_PCB_SHOW_1_RATSNEST_BUTT
:
DrawStruct
=
PcbGeneralLocateAndDisplay
();
DrawStruct
=
PcbGeneralLocateAndDisplay
();
Show_1_Ratsnest
(
DrawStruct
,
DC
);
Show_1_Ratsnest
(
DrawStruct
,
DC
);
if
(
DrawStruct
)
if
(
DrawStruct
)
SendMessageToEESCHEMA
(
DrawStruct
);
SendMessageToEESCHEMA
(
DrawStruct
);
break
;
break
;
...
@@ -171,14 +171,14 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
...
@@ -171,14 +171,14 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
if
(
m_ID_current_state
==
ID_PCB_ARC_BUTT
)
if
(
m_ID_current_state
==
ID_PCB_ARC_BUTT
)
shape
=
S_ARC
;
shape
=
S_ARC
;
if
(
((
PCB_SCREEN
*
)
GetScreen
())
->
m_Active_Layer
<=
LAST_COPPER_LAYER
)
if
(
((
PCB_SCREEN
*
)
GetScreen
())
->
m_Active_Layer
<=
LAST_COPPER_LAYER
)
{
{
DisplayError
(
this
,
_
(
"Graphic not authorized on Copper layers"
)
);
DisplayError
(
this
,
_
(
"Graphic not authorized on Copper layers"
)
);
break
;
break
;
}
}
if
(
(
DrawStruct
==
NULL
)
||
(
DrawStruct
->
m_Flags
==
0
)
)
if
(
(
DrawStruct
==
NULL
)
||
(
DrawStruct
->
m_Flags
==
0
)
)
{
{
DrawStruct
=
Begin_DrawSegment
(
NULL
,
shape
,
DC
);
DrawStruct
=
Begin_DrawSegment
(
NULL
,
shape
,
DC
);
SetCurItem
(
DrawStruct
);
SetCurItem
(
DrawStruct
);
DrawPanel
->
m_AutoPAN_Request
=
TRUE
;
DrawPanel
->
m_AutoPAN_Request
=
TRUE
;
}
}
...
@@ -194,7 +194,7 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
...
@@ -194,7 +194,7 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
}
}
case
ID_TRACK_BUTT
:
case
ID_TRACK_BUTT
:
if
(
((
PCB_SCREEN
*
)
GetScreen
())
->
m_Active_Layer
>
LAST_COPPER_LAYER
)
if
(
((
PCB_SCREEN
*
)
GetScreen
())
->
m_Active_Layer
>
LAST_COPPER_LAYER
)
{
{
DisplayError
(
this
,
_
(
"Tracks on Copper layers only "
)
);
DisplayError
(
this
,
_
(
"Tracks on Copper layers only "
)
);
break
;
break
;
...
@@ -223,18 +223,18 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
...
@@ -223,18 +223,18 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
case
ID_PCB_ZONES_BUTT
:
case
ID_PCB_ZONES_BUTT
:
if
(
(
DrawStruct
==
NULL
)
||
(
DrawStruct
->
m_Flags
==
0
)
)
if
(
(
DrawStruct
==
NULL
)
||
(
DrawStruct
->
m_Flags
==
0
)
)
{
{
if
(
Begin_Zone
(
DC
)
)
if
(
Begin_Zone
(
DC
)
)
{
{
DrawStruct
=
m_Pcb
->
m_CurrentZoneContour
;
DrawStruct
=
m_Pcb
->
m_CurrentZoneContour
;
GetScreen
()
->
SetCurItem
(
DrawStruct
);
GetScreen
()
->
SetCurItem
(
DrawStruct
);
}
}
}
}
else
if
(
DrawStruct
else
if
(
DrawStruct
&&
(
DrawStruct
->
Type
()
==
TYPEZONE_CONTAINER
)
&&
(
DrawStruct
->
Type
()
==
TYPEZONE_CONTAINER
)
&&
(
DrawStruct
->
m_Flags
&
IS_NEW
)
)
&&
(
DrawStruct
->
m_Flags
&
IS_NEW
)
)
{
{
Begin_Zone
(
DC
);
Begin_Zone
(
DC
);
DrawStruct
=
m_Pcb
->
m_CurrentZoneContour
;
DrawStruct
=
m_Pcb
->
m_CurrentZoneContour
;
GetScreen
()
->
SetCurItem
(
DrawStruct
);
GetScreen
()
->
SetCurItem
(
DrawStruct
);
}
}
else
else
...
@@ -261,7 +261,7 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
...
@@ -261,7 +261,7 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
if
(
(
DrawStruct
==
NULL
)
||
(
DrawStruct
->
m_Flags
==
0
)
)
if
(
(
DrawStruct
==
NULL
)
||
(
DrawStruct
->
m_Flags
==
0
)
)
{
{
DrawPanel
->
MouseToCursorSchema
();
DrawPanel
->
MouseToCursorSchema
();
DrawStruct
=
Load_Module_From_Library
(
wxEmptyString
,
DC
);
DrawStruct
=
Load_Module_From_Library
(
wxEmptyString
,
DC
);
SetCurItem
(
DrawStruct
);
SetCurItem
(
DrawStruct
);
if
(
DrawStruct
)
if
(
DrawStruct
)
StartMove_Module
(
(
MODULE
*
)
DrawStruct
,
DC
);
StartMove_Module
(
(
MODULE
*
)
DrawStruct
,
DC
);
...
@@ -276,7 +276,7 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
...
@@ -276,7 +276,7 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
break
;
break
;
case
ID_PCB_COTATION_BUTT
:
case
ID_PCB_COTATION_BUTT
:
if
(
((
PCB_SCREEN
*
)
GetScreen
())
->
m_Active_Layer
<=
LAST_COPPER_LAYER
)
if
(
((
PCB_SCREEN
*
)
GetScreen
())
->
m_Active_Layer
<=
LAST_COPPER_LAYER
)
{
{
DisplayError
(
this
,
_
(
"Cotation not authorized on Copper layers"
)
);
DisplayError
(
this
,
_
(
"Cotation not authorized on Copper layers"
)
);
break
;
break
;
...
@@ -291,7 +291,7 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
...
@@ -291,7 +291,7 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
&&
(
DrawStruct
->
Type
()
==
TYPECOTATION
)
&&
(
DrawStruct
->
Type
()
==
TYPECOTATION
)
&&
(
DrawStruct
->
m_Flags
&
IS_NEW
)
)
&&
(
DrawStruct
->
m_Flags
&
IS_NEW
)
)
{
{
DrawStruct
=
Begin_Cotation
(
(
COTATION
*
)
DrawStruct
,
DC
);
DrawStruct
=
Begin_Cotation
(
(
COTATION
*
)
DrawStruct
,
DC
);
SetCurItem
(
DrawStruct
);
SetCurItem
(
DrawStruct
);
DrawPanel
->
m_AutoPAN_Request
=
TRUE
;
DrawPanel
->
m_AutoPAN_Request
=
TRUE
;
}
}
...
@@ -331,7 +331,7 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
...
@@ -331,7 +331,7 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
void
WinEDA_PcbFrame
::
OnLeftDClick
(
wxDC
*
DC
,
const
wxPoint
&
MousePos
)
void
WinEDA_PcbFrame
::
OnLeftDClick
(
wxDC
*
DC
,
const
wxPoint
&
MousePos
)
/********************************************************************************/
/********************************************************************************/
/* handle the double click on the mouse left button
/* handle the double click on the mouse left button
*/
*/
{
{
BOARD_ITEM
*
DrawStruct
=
GetCurItem
();
BOARD_ITEM
*
DrawStruct
=
GetCurItem
();
...
@@ -416,10 +416,10 @@ void WinEDA_PcbFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos )
...
@@ -416,10 +416,10 @@ void WinEDA_PcbFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos )
case
ID_PCB_ZONES_BUTT
:
case
ID_PCB_ZONES_BUTT
:
if
(
End_Zone
(
DC
)
)
if
(
End_Zone
(
DC
)
)
{
{
DrawPanel
->
m_AutoPAN_Request
=
FALSE
;
DrawPanel
->
m_AutoPAN_Request
=
FALSE
;
SetCurItem
(
NULL
);
SetCurItem
(
NULL
);
}
}
break
;
break
;
case
ID_LINE_COMMENT_BUTT
:
case
ID_LINE_COMMENT_BUTT
:
...
...
pcbnew/surbrill.cpp
View file @
f406e9d9
...
@@ -53,7 +53,10 @@ void WinEDA_PcbFrame::Liste_Equipot( wxCommandEvent& event )
...
@@ -53,7 +53,10 @@ void WinEDA_PcbFrame::Liste_Equipot( wxCommandEvent& event )
List
->
Append
(
Line
);
List
->
Append
(
Line
);
}
}
ii
=
List
->
ShowModal
();
List
->
Destroy
();
ii
=
List
->
ShowModal
();
List
->
Destroy
();
if
(
ii
<
0
)
if
(
ii
<
0
)
return
;
return
;
...
@@ -64,6 +67,7 @@ void WinEDA_PcbFrame::Liste_Equipot( wxCommandEvent& event )
...
@@ -64,6 +67,7 @@ void WinEDA_PcbFrame::Liste_Equipot( wxCommandEvent& event )
/* calcul adr relative du nom de la pastille reference de la piste */
/* calcul adr relative du nom de la pastille reference de la piste */
if
(
!
WildCompareString
(
msg
,
Equipot
->
m_Netname
,
FALSE
)
)
if
(
!
WildCompareString
(
msg
,
Equipot
->
m_Netname
,
FALSE
)
)
continue
;
continue
;
if
(
ii
==
jj
)
if
(
ii
==
jj
)
{
{
ii
=
Equipot
->
GetNet
();
ii
=
Equipot
->
GetNet
();
...
@@ -78,6 +82,7 @@ void WinEDA_PcbFrame::Liste_Equipot( wxCommandEvent& event )
...
@@ -78,6 +82,7 @@ void WinEDA_PcbFrame::Liste_Equipot( wxCommandEvent& event )
if
(
g_HightLigt_Status
)
if
(
g_HightLigt_Status
)
Hight_Light
(
&
dc
);
Hight_Light
(
&
dc
);
g_HightLigth_NetCode
=
ii
;
g_HightLigth_NetCode
=
ii
;
Hight_Light
(
&
dc
);
Hight_Light
(
&
dc
);
}
}
...
@@ -95,7 +100,7 @@ int WinEDA_PcbFrame::Select_High_Light( wxDC* DC )
...
@@ -95,7 +100,7 @@ int WinEDA_PcbFrame::Select_High_Light( wxDC* DC )
// use this scheme because of pad is higher priority than tracks in the
// use this scheme because of pad is higher priority than tracks in the
// search, and finding a pad, instead of a track on a pad,
// search, and finding a pad, instead of a track on a pad,
// allows us to fire a message to eescema.
// allows us to fire a message to eesc
h
ema.
GENERAL_COLLECTORS_GUIDE
guide
=
GetCollectorsGuide
();
GENERAL_COLLECTORS_GUIDE
guide
=
GetCollectorsGuide
();
...
@@ -168,20 +173,16 @@ void WinEDA_PcbFrame::DrawHightLight( wxDC* DC, int NetCode )
...
@@ -168,20 +173,16 @@ void WinEDA_PcbFrame::DrawHightLight( wxDC* DC, int NetCode )
else
else
draw_mode
=
GR_AND
|
GR_SURBRILL
;
draw_mode
=
GR_AND
|
GR_SURBRILL
;
/* Redraw pads */
#if 0 // does not unhighlight properly
for
(
MODULE
*
module
=
m_Pcb
->
m_Modules
;
module
;
module
=
module
->
Next
()
)
// redraw the zones with the NetCode
for( SEGZONE* zone = m_Pcb->m_Zone; zone; zone = zone->Next() )
{
{
Pad_Surbrillance
(
DrawPanel
,
DC
,
module
,
NetCode
);
if( zone->GetNet() == NetCode )
}
/* Redraw track and vias: */
for
(
TRACK
*
pts
=
m_Pcb
->
m_Track
;
pts
;
pts
=
pts
->
Next
()
)
{
if
(
pts
->
GetNet
()
==
NetCode
)
{
{
pts
->
Draw
(
DrawPanel
,
DC
,
draw_mode
);
zone
->Draw( DrawPanel, DC, draw_mode );
}
}
}
}
#endif
wxPoint
zero
(
0
,
0
);
// construct outside loop for speed
wxPoint
zero
(
0
,
0
);
// construct outside loop for speed
...
@@ -194,6 +195,21 @@ void WinEDA_PcbFrame::DrawHightLight( wxDC* DC, int NetCode )
...
@@ -194,6 +195,21 @@ void WinEDA_PcbFrame::DrawHightLight( wxDC* DC, int NetCode )
(
*
zc
)
->
Draw
(
DrawPanel
,
DC
,
zero
,
draw_mode
);
(
*
zc
)
->
Draw
(
DrawPanel
,
DC
,
zero
,
draw_mode
);
}
}
}
}
/* Redraw pads */
for
(
MODULE
*
module
=
m_Pcb
->
m_Modules
;
module
;
module
=
module
->
Next
()
)
{
Pad_Surbrillance
(
DrawPanel
,
DC
,
module
,
NetCode
);
}
/* Redraw track and vias: */
for
(
TRACK
*
pts
=
m_Pcb
->
m_Track
;
pts
;
pts
=
pts
->
Next
()
)
{
if
(
pts
->
GetNet
()
==
NetCode
)
{
pts
->
Draw
(
DrawPanel
,
DC
,
draw_mode
);
}
}
}
}
...
...
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