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
cd8aaee1
Commit
cd8aaee1
authored
May 13, 2014
by
Maciej Suminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved most of the board design rules related fields & methods to BOARD_DESIGN_SETTINGS class.
parent
7ec1313c
Changes
20
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
393 additions
and
391 deletions
+393
-391
class_board_design_settings.h
include/class_board_design_settings.h
+207
-1
solve.cpp
pcbnew/autorouter/solve.cpp
+5
-5
class_board.cpp
pcbnew/class_board.cpp
+18
-36
class_board.h
pcbnew/class_board.h
+8
-233
class_board_design_settings.cpp
pcbnew/class_board_design_settings.cpp
+32
-1
dialog_design_rules.cpp
pcbnew/dialogs/dialog_design_rules.cpp
+4
-4
dialog_global_edit_tracks_and_vias.cpp
pcbnew/dialogs/dialog_global_edit_tracks_and_vias.cpp
+6
-6
edit_track_width.cpp
pcbnew/edit_track_width.cpp
+3
-3
editrack-part2.cpp
pcbnew/editrack-part2.cpp
+2
-2
editrack.cpp
pcbnew/editrack.cpp
+9
-9
event_handlers_tracks_vias_sizes.cpp
pcbnew/event_handlers_tracks_vias_sizes.cpp
+6
-6
hotkeys_board_editor.cpp
pcbnew/hotkeys_board_editor.cpp
+6
-6
kicad_plugin.cpp
pcbnew/kicad_plugin.cpp
+6
-6
legacy_plugin.cpp
pcbnew/legacy_plugin.cpp
+21
-16
muonde.cpp
pcbnew/muonde.cpp
+5
-5
onrightclick.cpp
pcbnew/onrightclick.cpp
+12
-11
pcb_parser.cpp
pcbnew/pcb_parser.cpp
+4
-2
tool_pcb.cpp
pcbnew/tool_pcb.cpp
+12
-12
toolbars_update_user_interface.cpp
pcbnew/toolbars_update_user_interface.cpp
+11
-11
pcbnew_control.cpp
pcbnew/tools/pcbnew_control.cpp
+16
-16
No files found.
include/class_board_design_settings.h
View file @
cd8aaee1
...
...
@@ -10,6 +10,41 @@
#include <class_track.h>
#include <config_params.h>
/**
* Struct VIA_DIMENSION
* is a small helper container to handle a stock of specific vias each with
* unique diameter and drill sizes in the BOARD class.
*/
struct
VIA_DIMENSION
{
int
m_Diameter
;
// <= 0 means use Netclass via diameter
int
m_Drill
;
// <= 0 means use Netclass via drill
VIA_DIMENSION
()
{
m_Diameter
=
0
;
m_Drill
=
0
;
}
VIA_DIMENSION
(
int
aDiameter
,
int
aDrill
)
{
m_Diameter
=
aDiameter
;
m_Drill
=
aDrill
;
}
bool
operator
==
(
const
VIA_DIMENSION
&
aOther
)
const
{
return
(
m_Diameter
==
aOther
.
m_Diameter
)
&&
(
m_Drill
==
aOther
.
m_Drill
);
}
bool
operator
<
(
const
VIA_DIMENSION
&
aOther
)
const
{
if
(
m_Diameter
!=
aOther
.
m_Diameter
)
return
m_Diameter
<
aOther
.
m_Diameter
;
return
m_Drill
<
aOther
.
m_Drill
;
}
};
/**
* Class BOARD_DESIGN_SETTINGS
...
...
@@ -18,6 +53,14 @@
class
BOARD_DESIGN_SETTINGS
{
public
:
// The first value is the current netclass via size
/// Vias size and drill list
std
::
vector
<
VIA_DIMENSION
>
m_ViasDimensionsList
;
// The first value is the current netclass track width
/// Track width list
std
::
vector
<
int
>
m_TrackWidthList
;
bool
m_MicroViasAllowed
;
///< true to allow micro vias
bool
m_BlindBuriedViaAllowed
;
///< true to allow blind/buried vias
VIATYPE_T
m_CurrentViaType
;
///< via type (VIA_BLIND_BURIED, VIA_THROUGH VIA_MICROVIA)
...
...
@@ -52,9 +95,155 @@ public:
D_PAD
m_Pad_Master
;
public
:
BOARD_DESIGN_SETTINGS
();
/**
* Function GetTrackWidthIndex
* @return the current track width list index.
*/
unsigned
GetTrackWidthIndex
()
const
{
return
m_trackWidthIndex
;
}
/**
* Function SetTrackWidthIndex
* sets the current track width list index to \a aIndex.
*
* @param aIndex is the track width list index.
*/
void
SetTrackWidthIndex
(
unsigned
aIndex
);
/**
* Function GetCurrentTrackWidth
* @return the current track width, according to the selected options
* ( using the default netclass value or a preset/custom value )
* the default netclass is always in m_TrackWidthList[0]
*/
int
GetCurrentTrackWidth
()
const
{
return
m_useCustomTrackVia
?
m_customTrackWidth
:
m_TrackWidthList
[
m_trackWidthIndex
];
}
/**
* Function SetCustomTrackWidth
* Sets custom width for track (i.e. not available in netclasses or preset list). To have
* it returned with GetCurrentTrackWidth() you need to enable custom track & via sizes
* (UseCustomTrackViaSize()).
* @param aWidth is the new track width.
*/
void
SetCustomTrackWidth
(
int
aWidth
)
{
m_customTrackWidth
=
aWidth
;
}
/**
* Function GetCustomTrackWidth
* @return Current custom width for a track.
*/
int
GetCustomTrackWidth
()
const
{
return
m_customTrackWidth
;
}
/**
* Function GetViaSizeIndex
* @return the current via size list index.
*/
unsigned
GetViaSizeIndex
()
const
{
return
m_viaSizeIndex
;
}
/**
* Function SetViaSizeIndex
* sets the current via size list index to \a aIndex.
*
* @param aIndex is the via size list index.
*/
void
SetViaSizeIndex
(
unsigned
aIndex
);
/**
* Function GetCurrentViaSize
* @return the current via size, according to the selected options
* ( using the default netclass value or a preset/custom value )
* the default netclass is always in m_TrackWidthList[0]
*/
int
GetCurrentViaSize
()
const
{
if
(
m_useCustomTrackVia
)
return
m_customViaSize
.
m_Diameter
;
else
return
m_ViasDimensionsList
[
m_viaSizeIndex
].
m_Diameter
;
}
/**
* Function SetCustomViaSize
* Sets custom size for via diameter (i.e. not available in netclasses or preset list). To have
* it returned with GetCurrentViaSize() you need to enable custom track & via sizes
* (UseCustomTrackViaSize()).
* @param aSize is the new drill diameter.
*/
void
SetCustomViaSize
(
int
aSize
)
{
m_customViaSize
.
m_Diameter
=
aSize
;
}
/**
* Function GetCustomViaSize
* @return Current custom size for the via diameter.
*/
int
GetCustomViaSize
()
const
{
return
m_customViaSize
.
m_Diameter
;
}
/**
* Function GetCurrentViaDrill
* @return the current via size, according to the selected options
* ( using the default netclass value or a preset/custom value )
* the default netclass is always in m_TrackWidthList[0]
*/
int
GetCurrentViaDrill
()
const
;
/**
* Function SetCustomViaDrill
* Sets custom size for via drill (i.e. not available in netclasses or preset list). To have
* it returned with GetCurrentViaDrill() you need to enable custom track & via sizes
* (UseCustomTrackViaSize()).
* @param aDrill is the new drill size.
*/
void
SetCustomViaDrill
(
int
aDrill
)
{
m_customViaSize
.
m_Drill
=
aDrill
;
}
/**
* Function GetCustomViaDrill
* @return Current custom size for the via drill.
*/
int
GetCustomViaDrill
()
const
{
return
m_customViaSize
.
m_Drill
;
}
// TODO microvia methods should go here
/**
* Function UseCustomTrackViaSize
* Enables/disables custom track/via size settings. If enabled, values set with
* SetCustomTrackWidth()/SetCustomViaSize()/SetCustomViaDrill() are used for newly created
* tracks and vias.
* @param aEnabled decides if custom settings should be used for new tracks/vias.
*/
void
UseCustomTrackViaSize
(
bool
aEnabled
)
{
m_useCustomTrackVia
=
aEnabled
;
}
/**
* Function UseCustomTrackViaSize
* @return True if custom sizes of tracks & vias are enabled, false otherwise.
*/
bool
UseCustomTrackViaSize
()
const
{
return
m_useCustomTrackVia
;
}
/**
* Function GetVisibleLayers
* returns a bit-mask of all the layers that are visible
...
...
@@ -196,6 +385,23 @@ public:
void
SetBoardThickness
(
int
aThickness
)
{
m_boardThickness
=
aThickness
;
}
private
:
/// Index for #m_ViasDimensionsList to select the current via size.
/// 0 is the index selection of the default value Netclass
unsigned
m_viaSizeIndex
;
// Index for m_TrackWidthList to select the value.
/// 0 is the index selection of the default value Netclass
unsigned
m_trackWidthIndex
;
///> Use custom values for track/via sizes (not specified in net class nor in the size lists).
bool
m_useCustomTrackVia
;
///> Custom track width (used after UseCustomTrackViaSize( true ) was called).
int
m_customTrackWidth
;
///> Custom via size (used after UseCustomTrackViaSize( true ) was called).
VIA_DIMENSION
m_customViaSize
;
int
m_CopperLayerCount
;
///< Number of copper layers for this design
LAYER_MSK
m_EnabledLayers
;
///< Bit-mask for layer enabling
LAYER_MSK
m_VisibleLayers
;
///< Bit-mask for layer visibility
...
...
pcbnew/autorouter/solve.cpp
View file @
cd8aaee1
...
...
@@ -428,7 +428,7 @@ static int Autoroute_One_Track( PCB_EDIT_FRAME* pcbframe,
result
=
NOSUCCESS
;
marge
=
s_Clearance
+
(
pcbframe
->
Get
Board
()
->
GetCurrentTrackWidth
()
/
2
);
marge
=
s_Clearance
+
(
pcbframe
->
Get
DesignSettings
().
GetCurrentTrackWidth
()
/
2
);
/* clear direction flags */
i
=
RoutingMatrix
.
m_Nrows
*
RoutingMatrix
.
m_Ncols
*
sizeof
(
DIR_CELL
);
...
...
@@ -1174,7 +1174,7 @@ static void OrCell_Trace( BOARD* pcb, int col, int row,
(
RoutingMatrix
.
m_GridRouting
*
col
)));
g_CurrentTrackSegment
->
SetEnd
(
g_CurrentTrackSegment
->
GetStart
()
);
g_CurrentTrackSegment
->
SetWidth
(
pcb
->
GetCurrentViaSize
()
);
g_CurrentTrackSegment
->
SetWidth
(
pcb
->
Get
DesignSettings
().
Get
CurrentViaSize
()
);
newVia
->
SetViaType
(
pcb
->
GetDesignSettings
().
m_CurrentViaType
);
g_CurrentTrackSegment
->
SetNetCode
(
current_net_code
);
...
...
@@ -1233,7 +1233,7 @@ static void OrCell_Trace( BOARD* pcb, int col, int row,
}
}
g_CurrentTrackSegment
->
SetWidth
(
pcb
->
GetCurrentTrackWidth
()
);
g_CurrentTrackSegment
->
SetWidth
(
pcb
->
Get
DesignSettings
().
Get
CurrentTrackWidth
()
);
if
(
g_CurrentTrackSegment
->
GetStart
()
!=
g_CurrentTrackSegment
->
GetEnd
()
)
{
...
...
@@ -1275,8 +1275,8 @@ static void AddNewTrace( PCB_EDIT_FRAME* pcbframe, wxDC* DC )
EDA_DRAW_PANEL
*
panel
=
pcbframe
->
GetCanvas
();
PCB_SCREEN
*
screen
=
pcbframe
->
GetScreen
();
marge
=
s_Clearance
+
(
pcbframe
->
Get
Board
()
->
GetCurrentTrackWidth
()
/
2
);
via_marge
=
s_Clearance
+
(
pcbframe
->
Get
Board
()
->
GetCurrentViaSize
()
/
2
);
marge
=
s_Clearance
+
(
pcbframe
->
Get
DesignSettings
().
GetCurrentTrackWidth
()
/
2
);
via_marge
=
s_Clearance
+
(
pcbframe
->
Get
DesignSettings
().
GetCurrentViaSize
()
/
2
);
dx1
=
g_CurrentTrackSegment
->
GetEnd
().
x
-
g_CurrentTrackSegment
->
GetStart
().
x
;
dy1
=
g_CurrentTrackSegment
->
GetEnd
().
y
-
g_CurrentTrackSegment
->
GetStart
().
y
;
...
...
pcbnew/class_board.cpp
View file @
cd8aaee1
...
...
@@ -94,8 +94,8 @@ BOARD::BOARD() :
m_NetClasses
.
GetDefault
()
->
SetDescription
(
_
(
"This is the default net class."
)
);
m_
viaSizeIndex
=
0
;
m_
trackWidthIndex
=
0
;
m_
designSettings
.
SetViaSizeIndex
(
0
)
;
m_
designSettings
.
SetTrackWidthIndex
(
0
)
;
/* Dick 5-Feb-2012: this seems unnecessary. I don't believe the comment
near line 70 of class_netclass.cpp. I stepped through with debugger.
...
...
@@ -107,10 +107,10 @@ BOARD::BOARD() :
SetCurrentNetClass
(
m_NetClasses
.
GetDefault
()
->
GetName
()
);
// Set sensible initial values for custom track width & via size
m_
useCustomTrackVia
=
false
;
m_
customTrackWidth
=
GetCurrentTrackWidth
(
);
m_
customViaSize
.
m_Diameter
=
GetCurrentViaSize
(
);
m_
customViaSize
.
m_Drill
=
GetCurrentViaDrill
(
);
m_
designSettings
.
UseCustomTrackViaSize
(
false
)
;
m_
designSettings
.
SetCustomTrackWidth
(
m_designSettings
.
GetCurrentTrackWidth
()
);
m_
designSettings
.
SetCustomViaSize
(
m_designSettings
.
GetCurrentViaSize
()
);
m_
designSettings
.
SetCustomViaDrill
(
m_designSettings
.
GetCurrentViaDrill
()
);
// Initialize ratsnest
m_ratsnest
=
new
RN_DATA
(
this
);
...
...
@@ -331,37 +331,37 @@ bool BOARD::SetCurrentNetClass( const wxString& aNetClassName )
m_currentNetClassName
=
netClass
->
GetName
();
// Initialize others values:
if
(
m_ViasDimensionsList
.
size
()
==
0
)
if
(
m_
designSettings
.
m_
ViasDimensionsList
.
size
()
==
0
)
{
VIA_DIMENSION
viadim
;
lists_sizes_modified
=
true
;
m_ViasDimensionsList
.
push_back
(
viadim
);
m_
designSettings
.
m_
ViasDimensionsList
.
push_back
(
viadim
);
}
if
(
m_TrackWidthList
.
size
()
==
0
)
if
(
m_
designSettings
.
m_
TrackWidthList
.
size
()
==
0
)
{
lists_sizes_modified
=
true
;
m_TrackWidthList
.
push_back
(
0
);
m_
designSettings
.
m_
TrackWidthList
.
push_back
(
0
);
}
/* note the m_ViasDimensionsList[0] and m_TrackWidthList[0] values
* are always the Netclass values
*/
if
(
m_ViasDimensionsList
[
0
].
m_Diameter
!=
netClass
->
GetViaDiameter
()
)
if
(
m_
designSettings
.
m_
ViasDimensionsList
[
0
].
m_Diameter
!=
netClass
->
GetViaDiameter
()
)
lists_sizes_modified
=
true
;
m_ViasDimensionsList
[
0
].
m_Diameter
=
netClass
->
GetViaDiameter
();
m_
designSettings
.
m_
ViasDimensionsList
[
0
].
m_Diameter
=
netClass
->
GetViaDiameter
();
if
(
m_TrackWidthList
[
0
]
!=
netClass
->
GetTrackWidth
()
)
if
(
m_
designSettings
.
m_
TrackWidthList
[
0
]
!=
netClass
->
GetTrackWidth
()
)
lists_sizes_modified
=
true
;
m_TrackWidthList
[
0
]
=
netClass
->
GetTrackWidth
();
m_
designSettings
.
m_
TrackWidthList
[
0
]
=
netClass
->
GetTrackWidth
();
if
(
m_
viaSizeIndex
>=
m_ViasDimensionsList
.
size
()
)
m_
viaSizeIndex
=
m_ViasDimensionsList
.
size
(
);
if
(
m_
designSettings
.
GetViaSizeIndex
()
>=
m_designSettings
.
m_ViasDimensionsList
.
size
()
)
m_
designSettings
.
SetViaSizeIndex
(
m_designSettings
.
m_ViasDimensionsList
.
size
()
);
if
(
m_
trackWidthIndex
>=
m_TrackWidthList
.
size
()
)
m_
trackWidthIndex
=
m_TrackWidthList
.
size
(
);
if
(
m_
designSettings
.
GetTrackWidthIndex
()
>=
m_designSettings
.
m_TrackWidthList
.
size
()
)
m_
designSettings
.
SetTrackWidthIndex
(
m_designSettings
.
m_TrackWidthList
.
size
()
);
return
lists_sizes_modified
;
}
...
...
@@ -2200,24 +2200,6 @@ TRACK* BOARD::CreateLockPoint( wxPoint& aPosition, TRACK* aSegment, PICKED_ITEMS
}
void
BOARD
::
SetViaSizeIndex
(
unsigned
aIndex
)
{
if
(
aIndex
>=
m_ViasDimensionsList
.
size
()
)
m_viaSizeIndex
=
m_ViasDimensionsList
.
size
();
else
m_viaSizeIndex
=
aIndex
;
}
void
BOARD
::
SetTrackWidthIndex
(
unsigned
aIndex
)
{
if
(
aIndex
>=
m_TrackWidthList
.
size
()
)
m_trackWidthIndex
=
m_TrackWidthList
.
size
();
else
m_trackWidthIndex
=
aIndex
;
}
ZONE_CONTAINER
*
BOARD
::
AddArea
(
PICKED_ITEMS_LIST
*
aNewZonesList
,
int
aNetcode
,
LAYER_NUM
aLayer
,
wxPoint
aStartPointPosition
,
int
aHatch
)
{
...
...
pcbnew/class_board.h
View file @
cd8aaee1
...
...
@@ -111,8 +111,6 @@ public:
/** The type of the layer */
LAYER_T
m_Type
;
// int m_Color;
/**
* Function ShowType
* converts a LAYER_T enum to a const char*
...
...
@@ -136,52 +134,15 @@ private:
};
/**
* Struct VIA_DIMENSION
* is a small helper container to handle a stock of specific vias each with
* unique diameter and drill sizes in the BOARD class.
*/
struct
VIA_DIMENSION
{
int
m_Diameter
;
// <= 0 means use Netclass via diameter
int
m_Drill
;
// <= 0 means use Netclass via drill
VIA_DIMENSION
()
{
m_Diameter
=
0
;
m_Drill
=
0
;
}
VIA_DIMENSION
(
int
aDiameter
,
int
aDrill
)
{
m_Diameter
=
aDiameter
;
m_Drill
=
aDrill
;
}
bool
operator
==
(
const
VIA_DIMENSION
&
other
)
const
{
return
(
m_Diameter
==
other
.
m_Diameter
)
&&
(
m_Drill
==
other
.
m_Drill
);
}
bool
operator
<
(
const
VIA_DIMENSION
&
other
)
const
{
if
(
m_Diameter
!=
other
.
m_Diameter
)
return
m_Diameter
<
other
.
m_Diameter
;
return
m_Drill
<
other
.
m_Drill
;
}
};
// Helper class to handle high light nets
class
HIGH_LIGHT_INFO
{
friend
class
BOARD
;
protected
:
int
m_netCode
;
// net selected for highlight (-1 when no net selected )
bool
m_highLightOn
;
// highlight active
protected
:
void
Clear
()
{
m_netCode
=
-
1
;
...
...
@@ -251,22 +212,6 @@ private:
/// This is also the last used netclass after starting a track.
wxString
m_currentNetClassName
;
/// Index for #m_ViasDimensionsList to select the current via size.
/// 0 is the index selection of the default value Netclass
unsigned
m_viaSizeIndex
;
// Index for m_TrackWidthList to select the value.
unsigned
m_trackWidthIndex
;
///> Use custom values for track/via sizes (not specified in net class nor in the size lists).
bool
m_useCustomTrackVia
;
///> Custom track width (used after UseCustomTrackViaSize( true ) was called).
int
m_customTrackWidth
;
///> Custom via size (used after UseCustomTrackViaSize( true ) was called).
VIA_DIMENSION
m_customViaSize
;
/**
* Function chainMarkedSegments
* is used by MarkTrace() to set the BUSY flag of connected segments of the trace
...
...
@@ -308,18 +253,6 @@ public:
/// List of current netclasses. There is always the default netclass.
NETCLASSES
m_NetClasses
;
// handling of vias and tracks size:
// the first value is always the value of the current NetClass
// The others values are extra values
// The first value is the current netclass via size
/// Vias size and drill list
std
::
vector
<
VIA_DIMENSION
>
m_ViasDimensionsList
;
// The first value is the current netclass track width
/// Track width list
std
::
vector
<
int
>
m_TrackWidthList
;
BOARD
();
~
BOARD
();
...
...
@@ -647,7 +580,10 @@ public:
* Function SetDesignSettings
* @param aDesignSettings the new BOARD_DESIGN_SETTINGS to use
*/
void
SetDesignSettings
(
const
BOARD_DESIGN_SETTINGS
&
aDesignSettings
)
{
m_designSettings
=
aDesignSettings
;
}
void
SetDesignSettings
(
const
BOARD_DESIGN_SETTINGS
&
aDesignSettings
)
{
m_designSettings
=
aDesignSettings
;
}
const
PAGE_INFO
&
GetPageSettings
()
const
{
return
m_paper
;
}
void
SetPageSettings
(
const
PAGE_INFO
&
aPageSettings
)
{
m_paper
=
aPageSettings
;
}
...
...
@@ -778,7 +714,6 @@ public:
return
m_FullRatsnest
.
size
();
}
/**
* Function GetNodesCount
* @return the number of pads members of nets (i.e. with netcode > 0)
...
...
@@ -1029,10 +964,9 @@ public:
*/
int
SortedNetnamesList
(
wxArrayString
&
aNames
,
bool
aSortbyPadsCount
);
/**************************************/
/**
* Function relative to NetClasses: **/
/**************************************/
/**************************************
* Functions related to NetClasses:
**************************************/
/**
* Function SynchronizeNetsAndNetClasses
...
...
@@ -1065,144 +999,6 @@ public:
*/
int
GetSmallestClearanceValue
();
/**
* Function GetTrackWidthIndex
* @return the current track width list index.
*/
unsigned
GetTrackWidthIndex
()
const
{
return
m_trackWidthIndex
;
}
/**
* Function SetTrackWidthIndex
* sets the current track width list index to \a aIndex.
*
* @param aIndex is the track width list index.
*/
void
SetTrackWidthIndex
(
unsigned
aIndex
);
/**
* Function GetCurrentTrackWidth
* @return the current track width, according to the selected options
* ( using the default netclass value or a preset/custom value )
* the default netclass is always in m_TrackWidthList[0]
*/
int
GetCurrentTrackWidth
()
const
{
if
(
m_useCustomTrackVia
)
return
m_customTrackWidth
;
else
return
m_TrackWidthList
[
m_trackWidthIndex
];
}
/**
* Function SetCustomTrackWidth
* Sets custom width for track (i.e. not available in netclasses or preset list). To have
* it returned with GetCurrentTrackWidth() you need to enable custom track & via sizes
* (UseCustomTrackViaSize()).
* @param aWidth is the new track width.
*/
void
SetCustomTrackWidth
(
int
aWidth
)
{
m_customTrackWidth
=
aWidth
;
}
/**
* Function GetCustomTrackWidth
* @return Current custom width for a track.
*/
int
GetCustomTrackWidth
()
const
{
return
m_customTrackWidth
;
}
/**
* Function GetViaSizeIndex
* @return the current via size list index.
*/
unsigned
GetViaSizeIndex
()
const
{
return
m_viaSizeIndex
;
}
/**
* Function SetViaSizeIndex
* sets the current via size list index to \a aIndex.
*
* @param aIndex is the via size list index.
*/
void
SetViaSizeIndex
(
unsigned
aIndex
);
/**
* Function GetCurrentViaSize
* @return the current via size, according to the selected options
* ( using the default netclass value or a preset/custom value )
* the default netclass is always in m_TrackWidthList[0]
*/
int
GetCurrentViaSize
()
{
if
(
m_useCustomTrackVia
)
return
m_customViaSize
.
m_Diameter
;
else
return
m_ViasDimensionsList
[
m_viaSizeIndex
].
m_Diameter
;
}
/**
* Function SetCustomViaSize
* Sets custom size for via diameter (i.e. not available in netclasses or preset list). To have
* it returned with GetCurrentViaSize() you need to enable custom track & via sizes
* (UseCustomTrackViaSize()).
* @param aSize is the new drill diameter.
*/
void
SetCustomViaSize
(
int
aSize
)
{
m_customViaSize
.
m_Diameter
=
aSize
;
}
/**
* Function GetCustomViaSize
* @return Current custom size for the via diameter.
*/
int
GetCustomViaSize
()
const
{
return
m_customViaSize
.
m_Diameter
;
}
/**
* Function GetCurrentViaDrill
* @return the current via size, according to the selected options
* ( using the default netclass value or a preset/custom value )
* the default netclass is always in m_TrackWidthList[0]
*/
int
GetCurrentViaDrill
()
{
int
drill
;
if
(
m_useCustomTrackVia
)
drill
=
m_customViaSize
.
m_Drill
;
else
drill
=
m_ViasDimensionsList
[
m_viaSizeIndex
].
m_Drill
;
return
drill
>
0
?
drill
:
-
1
;
}
/**
* Function SetCustomViaDrill
* Sets custom size for via drill (i.e. not available in netclasses or preset list). To have
* it returned with GetCurrentViaDrill() you need to enable custom track & via sizes
* (UseCustomTrackViaSize()).
* @param aDrill is the new drill size.
*/
void
SetCustomViaDrill
(
int
aDrill
)
{
m_customViaSize
.
m_Drill
=
aDrill
;
}
/**
* Function GetCustomViaDrill
* @return Current custom size for the via drill.
*/
int
GetCustomViaDrill
()
const
{
return
m_customViaSize
.
m_Drill
;
}
/**
* Function GetCurrentMicroViaSize
* @return the current micro via size,
...
...
@@ -1217,27 +1013,6 @@ public:
*/
int
GetCurrentMicroViaDrill
();
/**
* Function UseCustomTrackViaSize
* Enables/disables custom track/via size settings. If enabled, values set with
* SetCustomTrackWidth()/SetCustomViaSize()/SetCustomViaDrill() are used for newly created
* tracks and vias.
* @param aEnabled decides if custom settings should be used for new tracks/vias.
*/
void
UseCustomTrackViaSize
(
bool
aEnabled
)
{
m_useCustomTrackVia
=
aEnabled
;
}
/**
* Function UseCustomTrackViaSize
* @return True if custom sizes of tracks & vias are enabled, false otherwise.
*/
bool
UseCustomTrackViaSize
()
const
{
return
m_useCustomTrackVia
;
}
/***************************************************************************/
wxString
GetClass
()
const
...
...
pcbnew/class_board_design_settings.cpp
View file @
cd8aaee1
...
...
@@ -81,7 +81,7 @@ BOARD_DESIGN_SETTINGS::BOARD_DESIGN_SETTINGS() :
m_PcbTextSize
=
wxSize
(
DEFAULT_TEXT_PCB_SIZE
,
DEFAULT_TEXT_PCB_SIZE
);
// current Pcb (not module) Text size
m_TrackMinWidth
=
DMils2iu
(
100
);
// track min value for width (
(min copper size value
m_TrackMinWidth
=
DMils2iu
(
100
);
// track min value for width (
min copper size value)
m_ViasMinSize
=
DMils2iu
(
350
);
// vias (not micro vias) min diameter
m_ViasMinDrill
=
DMils2iu
(
200
);
// vias (not micro vias) min drill diameter
m_MicroViasMinSize
=
DMils2iu
(
200
);
// micro vias (not vias) min diameter
...
...
@@ -171,6 +171,37 @@ void BOARD_DESIGN_SETTINGS::AppendConfigs( PARAM_CFG_ARRAY* aResult )
}
void
BOARD_DESIGN_SETTINGS
::
SetViaSizeIndex
(
unsigned
aIndex
)
{
if
(
aIndex
>=
m_ViasDimensionsList
.
size
()
)
m_viaSizeIndex
=
m_ViasDimensionsList
.
size
();
else
m_viaSizeIndex
=
aIndex
;
}
int
BOARD_DESIGN_SETTINGS
::
GetCurrentViaDrill
()
const
{
int
drill
;
if
(
m_useCustomTrackVia
)
drill
=
m_customViaSize
.
m_Drill
;
else
drill
=
m_ViasDimensionsList
[
m_viaSizeIndex
].
m_Drill
;
return
drill
>
0
?
drill
:
-
1
;
}
void
BOARD_DESIGN_SETTINGS
::
SetTrackWidthIndex
(
unsigned
aIndex
)
{
if
(
aIndex
>=
m_TrackWidthList
.
size
()
)
m_trackWidthIndex
=
m_TrackWidthList
.
size
();
else
m_trackWidthIndex
=
aIndex
;
}
// see pcbstruct.h
LAYER_MSK
BOARD_DESIGN_SETTINGS
::
GetVisibleLayers
()
const
{
...
...
pcbnew/dialogs/dialog_design_rules.cpp
View file @
cd8aaee1
...
...
@@ -276,9 +276,9 @@ void DIALOG_DESIGN_RULES::InitGlobalRules()
// Initialize Vias and Tracks sizes lists.
// note we display only extra values, never the current netclass value.
// (the first value in history list)
m_TracksWidthList
=
m_
Parent
->
GetBoard
()
->
m_TrackWidthList
;
m_TracksWidthList
=
m_
BrdSettings
.
m_TrackWidthList
;
m_TracksWidthList
.
erase
(
m_TracksWidthList
.
begin
()
);
// remove the netclass value
m_ViasDimensionsList
=
m_
Parent
->
GetBoard
()
->
m_ViasDimensionsList
;
m_ViasDimensionsList
=
m_
BrdSettings
.
m_ViasDimensionsList
;
m_ViasDimensionsList
.
erase
(
m_ViasDimensionsList
.
begin
()
);
// remove the netclass value
InitDimensionsLists
();
}
...
...
@@ -634,12 +634,12 @@ void DIALOG_DESIGN_RULES::CopyDimensionsListsToBoard()
// Sort new list by by increasing value
sort
(
m_ViasDimensionsList
.
begin
(),
m_ViasDimensionsList
.
end
()
);
std
::
vector
<
int
>*
tlist
=
&
m_Parent
->
GetBoard
()
->
m_TrackWidthList
;
std
::
vector
<
int
>*
tlist
=
&
m_BrdSettings
.
m_TrackWidthList
;
tlist
->
erase
(
tlist
->
begin
()
+
1
,
tlist
->
end
()
);
// Remove old "custom" sizes
tlist
->
insert
(
tlist
->
end
(),
m_TracksWidthList
.
begin
(),
m_TracksWidthList
.
end
()
);
//Add new "custom" sizes
// Reinitialize m_ViaSizeList
std
::
vector
<
VIA_DIMENSION
>*
vialist
=
&
m_Parent
->
GetBoard
()
->
m_ViasDimensionsList
;
std
::
vector
<
VIA_DIMENSION
>*
vialist
=
&
m_BrdSettings
.
m_ViasDimensionsList
;
vialist
->
erase
(
vialist
->
begin
()
+
1
,
vialist
->
end
()
);
vialist
->
insert
(
vialist
->
end
(),
m_ViasDimensionsList
.
begin
(),
m_ViasDimensionsList
.
end
()
);
}
...
...
pcbnew/dialogs/dialog_global_edit_tracks_and_vias.cpp
View file @
cd8aaee1
...
...
@@ -60,7 +60,7 @@ void DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::MyInit()
/* Disable the option "copy current to net" if we have only default netclass values
* i.e. when m_TrackWidthSelector and m_ViaSizeSelector are set to 0
*/
if
(
!
board
->
Get
TrackWidthIndex
()
&&
!
board
->
GetViaSizeIndex
()
)
if
(
!
board
->
Get
DesignSettings
().
GetTrackWidthIndex
()
&&
!
board
->
GetDesignSettings
().
GetViaSizeIndex
()
)
{
m_Net2CurrValueButton
->
Enable
(
false
);
m_OptionID
=
ID_NETCLASS_VALUES_TO_CURRENT_NET
;
...
...
@@ -77,9 +77,9 @@ void DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::MyInit()
msg
=
StringFromValue
(
g_UserUnit
,
value
,
true
);
m_gridDisplayCurrentSettings
->
SetCellValue
(
0
,
0
,
msg
);
if
(
board
->
GetTrackWidthIndex
()
)
if
(
board
->
Get
DesignSettings
().
Get
TrackWidthIndex
()
)
{
value
=
board
->
GetCurrentTrackWidth
();
value
=
board
->
Get
DesignSettings
().
Get
CurrentTrackWidth
();
msg
=
StringFromValue
(
g_UserUnit
,
value
,
true
);
}
else
...
...
@@ -91,9 +91,9 @@ void DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::MyInit()
msg
=
StringFromValue
(
g_UserUnit
,
value
,
true
);
m_gridDisplayCurrentSettings
->
SetCellValue
(
0
,
1
,
msg
);
if
(
board
->
GetViaSizeIndex
()
)
if
(
board
->
Get
DesignSettings
().
Get
ViaSizeIndex
()
)
{
value
=
board
->
GetCurrentViaSize
();
value
=
board
->
Get
DesignSettings
().
Get
CurrentViaSize
();
msg
=
StringFromValue
(
g_UserUnit
,
value
,
true
);
}
else
...
...
@@ -103,7 +103,7 @@ void DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::MyInit()
value
=
netclass
->
GetViaDrill
();
// Display via drill
msg
=
StringFromValue
(
g_UserUnit
,
value
,
true
);
m_gridDisplayCurrentSettings
->
SetCellValue
(
0
,
2
,
msg
);
value
=
board
->
GetCurrentViaDrill
();
value
=
board
->
Get
DesignSettings
().
Get
CurrentViaDrill
();
if
(
value
>=
0
)
msg
=
StringFromValue
(
g_UserUnit
,
value
,
true
);
else
...
...
pcbnew/edit_track_width.cpp
View file @
cd8aaee1
...
...
@@ -43,7 +43,7 @@ bool PCB_EDIT_FRAME::SetTrackSegmentWidth( TRACK* aTrackItem,
if
(
net
)
new_width
=
net
->
GetTrackWidth
();
else
new_width
=
Get
Board
()
->
GetCurrentTrackWidth
();
new_width
=
Get
DesignSettings
().
GetCurrentTrackWidth
();
if
(
aTrackItem
->
Type
()
==
PCB_VIA_T
)
{
...
...
@@ -58,8 +58,8 @@ bool PCB_EDIT_FRAME::SetTrackSegmentWidth( TRACK* aTrackItem,
}
else
{
new_width
=
Get
Board
()
->
GetCurrentViaSize
();
new_drill
=
Get
Board
()
->
GetCurrentViaDrill
();
new_width
=
Get
DesignSettings
().
GetCurrentViaSize
();
new_drill
=
Get
DesignSettings
().
GetCurrentViaDrill
();
}
if
(
via
->
GetViaType
()
==
VIA_MICROVIA
)
...
...
pcbnew/editrack-part2.cpp
View file @
cd8aaee1
...
...
@@ -98,7 +98,7 @@ bool PCB_EDIT_FRAME::Other_Layer_Route( TRACK* aTrack, wxDC* DC )
VIA
*
via
=
new
VIA
(
GetBoard
()
);
via
->
SetFlags
(
IS_NEW
);
via
->
SetViaType
(
GetDesignSettings
().
m_CurrentViaType
);
via
->
SetWidth
(
Get
Board
()
->
GetCurrentViaSize
());
via
->
SetWidth
(
Get
DesignSettings
().
GetCurrentViaSize
());
via
->
SetNetCode
(
GetBoard
()
->
GetHighLightNetCode
()
);
via
->
SetEnd
(
g_CurrentTrackSegment
->
GetEnd
()
);
via
->
SetStart
(
g_CurrentTrackSegment
->
GetEnd
()
);
...
...
@@ -106,7 +106,7 @@ bool PCB_EDIT_FRAME::Other_Layer_Route( TRACK* aTrack, wxDC* DC )
// Usual via is from copper to component.
// layer pair is LAYER_N_BACK and LAYER_N_FRONT.
via
->
SetLayerPair
(
LAYER_N_BACK
,
LAYER_N_FRONT
);
via
->
SetDrill
(
Get
Board
()
->
GetCurrentViaDrill
()
);
via
->
SetDrill
(
Get
DesignSettings
().
GetCurrentViaDrill
()
);
LAYER_NUM
first_layer
=
GetActiveLayer
();
LAYER_NUM
last_layer
;
...
...
pcbnew/editrack.cpp
View file @
cd8aaee1
...
...
@@ -170,9 +170,9 @@ TRACK* PCB_EDIT_FRAME::Begin_Route( TRACK* aTrack, wxDC* aDC )
GetBoard
()
->
SetCurrentNetClass
(
g_CurrentTrackSegment
->
GetNetClassName
()
);
g_CurrentTrackSegment
->
SetLayer
(
GetScreen
()
->
m_Active_Layer
);
g_CurrentTrackSegment
->
SetWidth
(
Get
Board
()
->
GetCurrentTrackWidth
()
);
g_CurrentTrackSegment
->
SetWidth
(
Get
DesignSettings
().
GetCurrentTrackWidth
()
);
if
(
Get
Board
()
->
Get
DesignSettings
().
m_UseConnectedTrackWidth
)
if
(
GetDesignSettings
().
m_UseConnectedTrackWidth
)
{
if
(
TrackOnStartPoint
&&
TrackOnStartPoint
->
Type
()
==
PCB_TRACE_T
)
g_CurrentTrackSegment
->
SetWidth
(
TrackOnStartPoint
->
GetWidth
());
...
...
@@ -282,8 +282,8 @@ TRACK* PCB_EDIT_FRAME::Begin_Route( TRACK* aTrack, wxDC* aDC )
newTrack
->
SetLayer
(
GetScreen
()
->
m_Active_Layer
);
if
(
!
Get
Board
()
->
Get
DesignSettings
().
m_UseConnectedTrackWidth
)
newTrack
->
SetWidth
(
Get
Board
()
->
GetCurrentTrackWidth
()
);
if
(
!
GetDesignSettings
().
m_UseConnectedTrackWidth
)
newTrack
->
SetWidth
(
Get
DesignSettings
().
GetCurrentTrackWidth
()
);
DBG
(
g_CurrentTrackList
.
VerifyListIntegrity
();
);
...
...
@@ -691,7 +691,7 @@ void ShowNewTrackWhenMovingCursor( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPo
DisplayOpt
.
ShowTrackClearanceMode
=
SHOW_CLEARANCE_ALWAYS
;
// Values to Via circle
int
boardViaRadius
=
frame
->
Get
Board
()
->
GetCurrentViaSize
()
/
2
;
int
boardViaRadius
=
frame
->
Get
DesignSettings
().
GetCurrentViaSize
()
/
2
;
int
viaRadiusWithClearence
=
boardViaRadius
+
netclass
->
GetClearance
();
EDA_RECT
*
panelClipBox
=
aPanel
->
GetClipBox
();
...
...
@@ -718,8 +718,8 @@ void ShowNewTrackWhenMovingCursor( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPo
// Set track parameters, that can be modified while creating the track
g_CurrentTrackSegment
->
SetLayer
(
screen
->
m_Active_Layer
);
if
(
!
frame
->
Get
Board
()
->
Get
DesignSettings
().
m_UseConnectedTrackWidth
)
g_CurrentTrackSegment
->
SetWidth
(
frame
->
Get
Board
()
->
GetCurrentTrackWidth
()
);
if
(
!
frame
->
GetDesignSettings
().
m_UseConnectedTrackWidth
)
g_CurrentTrackSegment
->
SetWidth
(
frame
->
Get
DesignSettings
().
GetCurrentTrackWidth
()
);
if
(
g_TwoSegmentTrackBuild
)
{
...
...
@@ -729,8 +729,8 @@ void ShowNewTrackWhenMovingCursor( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPo
{
previous_track
->
SetLayer
(
screen
->
m_Active_Layer
);
if
(
!
frame
->
Get
Board
()
->
Get
DesignSettings
().
m_UseConnectedTrackWidth
)
previous_track
->
SetWidth
(
frame
->
Get
Board
()
->
GetCurrentTrackWidth
()
);
if
(
!
frame
->
GetDesignSettings
().
m_UseConnectedTrackWidth
)
previous_track
->
SetWidth
(
frame
->
Get
DesignSettings
().
GetCurrentTrackWidth
()
);
}
}
...
...
pcbnew/event_handlers_tracks_vias_sizes.cpp
View file @
cd8aaee1
...
...
@@ -41,8 +41,8 @@ void PCB_EDIT_FRAME::Tracks_and_Vias_Size_Event( wxCommandEvent& event )
case
ID_POPUP_PCB_SELECT_USE_NETCLASS_VALUES
:
GetDesignSettings
().
m_UseConnectedTrackWidth
=
false
;
Get
Board
()
->
SetTrackWidthIndex
(
0
);
Get
Board
()
->
SetViaSizeIndex
(
0
);
Get
DesignSettings
().
SetTrackWidthIndex
(
0
);
Get
DesignSettings
().
SetViaSizeIndex
(
0
);
break
;
case
ID_POPUP_PCB_SELECT_AUTO_WIDTH
:
...
...
@@ -69,7 +69,7 @@ void PCB_EDIT_FRAME::Tracks_and_Vias_Size_Event( wxCommandEvent& event )
m_canvas
->
MoveCursorToCrossHair
();
GetDesignSettings
().
m_UseConnectedTrackWidth
=
false
;
ii
=
id
-
ID_POPUP_PCB_SELECT_WIDTH1
;
Get
Board
()
->
SetTrackWidthIndex
(
ii
);
Get
DesignSettings
().
SetTrackWidthIndex
(
ii
);
break
;
case
ID_POPUP_PCB_SELECT_VIASIZE1
:
// this is the default Netclass selection
...
...
@@ -91,17 +91,17 @@ void PCB_EDIT_FRAME::Tracks_and_Vias_Size_Event( wxCommandEvent& event )
// select the new current value for via size (via diameter)
m_canvas
->
MoveCursorToCrossHair
();
ii
=
id
-
ID_POPUP_PCB_SELECT_VIASIZE1
;
Get
Board
()
->
SetViaSizeIndex
(
ii
);
Get
DesignSettings
().
SetViaSizeIndex
(
ii
);
break
;
case
ID_AUX_TOOLBAR_PCB_TRACK_WIDTH
:
ii
=
m_SelTrackWidthBox
->
GetCurrentSelection
();
Get
Board
()
->
SetTrackWidthIndex
(
ii
);
Get
DesignSettings
().
SetTrackWidthIndex
(
ii
);
break
;
case
ID_AUX_TOOLBAR_PCB_VIA_SIZE
:
ii
=
m_SelViaSizeBox
->
GetCurrentSelection
();
Get
Board
()
->
SetViaSizeIndex
(
ii
);
Get
DesignSettings
().
SetViaSizeIndex
(
ii
);
break
;
default
:
...
...
pcbnew/hotkeys_board_editor.cpp
View file @
cd8aaee1
...
...
@@ -199,10 +199,10 @@ void PCB_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotkeyCode, const wxPoint& aPosit
if
(
GetCanvas
()
->
IsMouseCaptured
()
)
GetCanvas
()
->
CallMouseCapture
(
aDC
,
wxDefaultPosition
,
false
);
if
(
Get
Board
()
->
GetTrackWidthIndex
()
<
GetBoard
()
->
m_TrackWidthList
.
size
()
-
1
)
Get
Board
()
->
SetTrackWidthIndex
(
GetBoard
()
->
GetTrackWidthIndex
()
+
1
);
if
(
Get
DesignSettings
().
GetTrackWidthIndex
()
<
GetDesignSettings
().
m_TrackWidthList
.
size
()
-
1
)
Get
DesignSettings
().
SetTrackWidthIndex
(
GetDesignSettings
().
GetTrackWidthIndex
()
+
1
);
else
Get
Board
()
->
SetTrackWidthIndex
(
0
);
Get
DesignSettings
().
SetTrackWidthIndex
(
0
);
if
(
GetCanvas
()
->
IsMouseCaptured
()
)
GetCanvas
()
->
CallMouseCapture
(
aDC
,
wxDefaultPosition
,
false
);
...
...
@@ -213,10 +213,10 @@ void PCB_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotkeyCode, const wxPoint& aPosit
if
(
GetCanvas
()
->
IsMouseCaptured
()
)
GetCanvas
()
->
CallMouseCapture
(
aDC
,
wxDefaultPosition
,
false
);
if
(
Get
Board
()
->
GetTrackWidthIndex
()
<=
0
)
Get
Board
()
->
SetTrackWidthIndex
(
GetBoard
()
->
m_TrackWidthList
.
size
()
-
1
);
if
(
Get
DesignSettings
().
GetTrackWidthIndex
()
<=
0
)
Get
DesignSettings
().
SetTrackWidthIndex
(
GetDesignSettings
().
m_TrackWidthList
.
size
()
-
1
);
else
Get
Board
()
->
SetTrackWidthIndex
(
GetBoard
()
->
GetTrackWidthIndex
()
-
1
);
Get
DesignSettings
().
SetTrackWidthIndex
(
GetDesignSettings
().
GetTrackWidthIndex
()
-
1
);
if
(
GetCanvas
()
->
IsMouseCaptured
()
)
GetCanvas
()
->
CallMouseCapture
(
aDC
,
wxDefaultPosition
,
false
);
...
...
pcbnew/kicad_plugin.cpp
View file @
cd8aaee1
...
...
@@ -551,12 +551,12 @@ void PCB_IO::format( BOARD* aBoard, int aNestLevel ) const
// Save current default track width, for compatibility with older Pcbnew version;
m_out
->
Print
(
aNestLevel
+
1
,
"(last_trace_width %s)
\n
"
,
FMTIU
(
aBoard
->
GetCurrentTrackWidth
()
).
c_str
()
);
FMTIU
(
aBoard
->
Get
DesignSettings
().
Get
CurrentTrackWidth
()
).
c_str
()
);
// Save custom tracks width list (the first is not saved here: this is the netclass value
for
(
unsigned
ii
=
1
;
ii
<
aBoard
->
m_TrackWidthList
.
size
();
ii
++
)
for
(
unsigned
ii
=
1
;
ii
<
aBoard
->
GetDesignSettings
().
m_TrackWidthList
.
size
();
ii
++
)
m_out
->
Print
(
aNestLevel
+
1
,
"(user_trace_width %s)
\n
"
,
FMTIU
(
aBoard
->
m_TrackWidthList
[
ii
]
).
c_str
()
);
FMTIU
(
aBoard
->
GetDesignSettings
().
m_TrackWidthList
[
ii
]
).
c_str
()
);
m_out
->
Print
(
aNestLevel
+
1
,
"(trace_clearance %s)
\n
"
,
FMTIU
(
aBoard
->
m_NetClasses
.
GetDefault
()
->
GetClearance
()
).
c_str
()
);
...
...
@@ -587,10 +587,10 @@ void PCB_IO::format( BOARD* aBoard, int aNestLevel ) const
// Save custom vias diameters list (the first is not saved here: this is
// the netclass value
for
(
unsigned
ii
=
1
;
ii
<
aBoard
->
m_ViasDimensionsList
.
size
();
ii
++
)
for
(
unsigned
ii
=
1
;
ii
<
aBoard
->
GetDesignSettings
().
m_ViasDimensionsList
.
size
();
ii
++
)
m_out
->
Print
(
aNestLevel
+
1
,
"(user_via %s %s)
\n
"
,
FMTIU
(
aBoard
->
m_ViasDimensionsList
[
ii
].
m_Diameter
).
c_str
(),
FMTIU
(
aBoard
->
m_ViasDimensionsList
[
ii
].
m_Drill
).
c_str
()
);
FMTIU
(
aBoard
->
GetDesignSettings
().
m_ViasDimensionsList
[
ii
].
m_Diameter
).
c_str
(),
FMTIU
(
aBoard
->
GetDesignSettings
().
m_ViasDimensionsList
[
ii
].
m_Drill
).
c_str
()
);
// for old versions compatibility:
if
(
aBoard
->
GetDesignSettings
().
m_BlindBuriedViaAllowed
)
...
...
pcbnew/legacy_plugin.cpp
View file @
cd8aaee1
...
...
@@ -633,6 +633,8 @@ void LEGACY_PLUGIN::loadSHEET()
void
LEGACY_PLUGIN
::
loadSETUP
()
{
NETCLASS
*
netclass_default
=
m_board
->
m_NetClasses
.
GetDefault
();
// TODO Orson: is it really necessary to first operate on a copy and then apply it?
// would not it be better to use reference here and apply all the changes instantly?
BOARD_DESIGN_SETTINGS
bds
=
m_board
->
GetDesignSettings
();
ZONE_SETTINGS
zs
=
m_board
->
GetZoneSettings
();
char
*
line
;
...
...
@@ -692,7 +694,7 @@ void LEGACY_PLUGIN::loadSETUP()
else
if
(
TESTLINE
(
"TrackWidthList"
)
)
{
BIU
tmp
=
biuParse
(
line
+
SZ
(
"TrackWidthList"
)
);
m_board
->
m_TrackWidthList
.
push_back
(
tmp
);
bds
.
m_TrackWidthList
.
push_back
(
tmp
);
}
else
if
(
TESTLINE
(
"TrackClearence"
)
)
...
...
@@ -754,7 +756,8 @@ void LEGACY_PLUGIN::loadSETUP()
if
(
data
)
// DRILL may not be present ?
drill
=
biuParse
(
data
);
m_board
->
m_ViasDimensionsList
.
push_back
(
VIA_DIMENSION
(
diameter
,
drill
)
);
bds
.
m_ViasDimensionsList
.
push_back
(
VIA_DIMENSION
(
diameter
,
drill
)
);
}
else
if
(
TESTLINE
(
"ViaDrill"
)
)
...
...
@@ -907,23 +910,24 @@ void LEGACY_PLUGIN::loadSETUP()
* Sort lists by by increasing value and remove duplicates
* (the first value is not tested, because it is the netclass value
*/
sort
(
m_board
->
m_ViasDimensionsList
.
begin
()
+
1
,
m_board
->
m_ViasDimensionsList
.
end
()
);
sort
(
m_board
->
m_TrackWidthList
.
begin
()
+
1
,
m_board
->
m_TrackWidthList
.
end
()
);
BOARD_DESIGN_SETTINGS
&
designSettings
=
m_board
->
GetDesignSettings
();
sort
(
designSettings
.
m_ViasDimensionsList
.
begin
()
+
1
,
designSettings
.
m_ViasDimensionsList
.
end
()
);
sort
(
designSettings
.
m_TrackWidthList
.
begin
()
+
1
,
designSettings
.
m_TrackWidthList
.
end
()
);
for
(
unsigned
ii
=
1
;
ii
<
m_board
->
m_ViasDimensionsList
.
size
()
-
1
;
ii
++
)
for
(
unsigned
ii
=
1
;
ii
<
designSettings
.
m_ViasDimensionsList
.
size
()
-
1
;
ii
++
)
{
if
(
m_board
->
m_ViasDimensionsList
[
ii
]
==
m_board
->
m_ViasDimensionsList
[
ii
+
1
]
)
if
(
designSettings
.
m_ViasDimensionsList
[
ii
]
==
designSettings
.
m_ViasDimensionsList
[
ii
+
1
]
)
{
m_board
->
m_ViasDimensionsList
.
erase
(
m_board
->
m_ViasDimensionsList
.
begin
()
+
ii
);
designSettings
.
m_ViasDimensionsList
.
erase
(
designSettings
.
m_ViasDimensionsList
.
begin
()
+
ii
);
ii
--
;
}
}
for
(
unsigned
ii
=
1
;
ii
<
m_board
->
m_TrackWidthList
.
size
()
-
1
;
ii
++
)
for
(
unsigned
ii
=
1
;
ii
<
designSettings
.
m_TrackWidthList
.
size
()
-
1
;
ii
++
)
{
if
(
m_board
->
m_TrackWidthList
[
ii
]
==
m_board
->
m_TrackWidthList
[
ii
+
1
]
)
if
(
designSettings
.
m_TrackWidthList
[
ii
]
==
designSettings
.
m_TrackWidthList
[
ii
+
1
]
)
{
m_board
->
m_TrackWidthList
.
erase
(
m_board
->
m_TrackWidthList
.
begin
()
+
ii
);
designSettings
.
m_TrackWidthList
.
erase
(
designSettings
.
m_TrackWidthList
.
begin
()
+
ii
);
ii
--
;
}
}
...
...
@@ -3005,11 +3009,12 @@ void LEGACY_PLUGIN::saveSETUP( const BOARD* aBoard ) const
}
// Save current default track width, for compatibility with older Pcbnew version;
fprintf
(
m_fp
,
"TrackWidth %s
\n
"
,
fmtBIU
(
aBoard
->
GetCurrentTrackWidth
()
).
c_str
()
);
fprintf
(
m_fp
,
"TrackWidth %s
\n
"
,
fmtBIU
(
aBoard
->
GetDesignSettings
().
GetCurrentTrackWidth
()
).
c_str
()
);
// Save custom tracks width list (the first is not saved here: this is the netclass value
for
(
unsigned
ii
=
1
;
ii
<
aBoard
->
m_TrackWidthList
.
size
();
ii
++
)
fprintf
(
m_fp
,
"TrackWidthList %s
\n
"
,
fmtBIU
(
aBoard
->
m_TrackWidthList
[
ii
]
).
c_str
()
);
for
(
unsigned
ii
=
1
;
ii
<
aBoard
->
GetDesignSettings
().
m_TrackWidthList
.
size
();
ii
++
)
fprintf
(
m_fp
,
"TrackWidthList %s
\n
"
,
fmtBIU
(
aBoard
->
GetDesignSettings
().
m_TrackWidthList
[
ii
]
).
c_str
()
);
fprintf
(
m_fp
,
"TrackClearence %s
\n
"
,
fmtBIU
(
netclass_default
->
GetClearance
()
).
c_str
()
);
...
...
@@ -3030,10 +3035,10 @@ void LEGACY_PLUGIN::saveSETUP( const BOARD* aBoard ) const
// Save custom vias diameters list (the first is not saved here: this is
// the netclass value
for
(
unsigned
ii
=
1
;
ii
<
aBoard
->
m_ViasDimensionsList
.
size
();
ii
++
)
for
(
unsigned
ii
=
1
;
ii
<
aBoard
->
GetDesignSettings
().
m_ViasDimensionsList
.
size
();
ii
++
)
fprintf
(
m_fp
,
"ViaSizeList %s %s
\n
"
,
fmtBIU
(
aBoard
->
m_ViasDimensionsList
[
ii
].
m_Diameter
).
c_str
(),
fmtBIU
(
aBoard
->
m_ViasDimensionsList
[
ii
].
m_Drill
).
c_str
()
);
fmtBIU
(
aBoard
->
GetDesignSettings
().
m_ViasDimensionsList
[
ii
].
m_Diameter
).
c_str
(),
fmtBIU
(
aBoard
->
GetDesignSettings
().
m_ViasDimensionsList
[
ii
].
m_Drill
).
c_str
()
);
// for old versions compatibility:
fprintf
(
m_fp
,
"MicroViaSize %s
\n
"
,
fmtBIU
(
netclass_default
->
GetuViaDiameter
()
).
c_str
()
);
...
...
pcbnew/muonde.cpp
View file @
cd8aaee1
...
...
@@ -215,7 +215,7 @@ MODULE* PCB_EDIT_FRAME::Genere_Self( wxDC* DC )
}
// Calculate the elements.
Mself
.
m_Width
=
Get
Board
()
->
GetCurrentTrackWidth
();
Mself
.
m_Width
=
Get
DesignSettings
().
GetCurrentTrackWidth
();
std
::
vector
<
wxPoint
>
buffer
;
ll
=
BuildCornersList_S_Shape
(
buffer
,
Mself
.
m_Start
,
Mself
.
m_End
,
Mself
.
lng
,
Mself
.
m_Width
);
...
...
@@ -561,7 +561,7 @@ MODULE* PCB_EDIT_FRAME::Create_MuWaveBasicShape( const wxString& name, int pad_c
module
->
Pads
().
PushFront
(
pad
);
int
tw
=
Get
Board
()
->
GetCurrentTrackWidth
();
int
tw
=
Get
DesignSettings
().
GetCurrentTrackWidth
();
pad
->
SetSize
(
wxSize
(
tw
,
tw
)
);
pad
->
SetPosition
(
module
->
GetPosition
()
);
...
...
@@ -588,7 +588,7 @@ MODULE* PCB_EDIT_FRAME::Create_MuWaveComponent( int shape_type )
int
angle
=
0
;
// Enter the size of the gap or stub
int
gap_size
=
Get
Board
()
->
GetCurrentTrackWidth
();
int
gap_size
=
Get
DesignSettings
().
GetCurrentTrackWidth
();
switch
(
shape_type
)
{
...
...
@@ -1104,7 +1104,7 @@ void PCB_EDIT_FRAME::Edit_Gap( wxDC* DC, MODULE* aModule )
gap_size
=
ValueFromString
(
g_UserUnit
,
msg
);
// Updating sizes of pads forming the gap.
int
tw
=
Get
Board
()
->
GetCurrentTrackWidth
();
int
tw
=
Get
DesignSettings
().
GetCurrentTrackWidth
();
pad
->
SetSize
(
wxSize
(
tw
,
tw
)
);
pad
->
SetY0
(
0
);
...
...
@@ -1118,7 +1118,7 @@ void PCB_EDIT_FRAME::Edit_Gap( wxDC* DC, MODULE* aModule )
pad
->
SetPosition
(
padpos
);
tw
=
Get
Board
()
->
GetCurrentTrackWidth
();
tw
=
Get
DesignSettings
().
GetCurrentTrackWidth
();
next_pad
->
SetSize
(
wxSize
(
tw
,
tw
)
);
next_pad
->
SetY0
(
0
);
...
...
pcbnew/onrightclick.cpp
View file @
cd8aaee1
...
...
@@ -532,7 +532,7 @@ void PCB_EDIT_FRAME::createPopupMenuForTracks( TRACK* Track, wxMenu* PopMenu )
AddMenuItem
(
PopMenu
,
ID_POPUP_PCB_SELECT_CU_LAYER_AND_PLACE_THROUGH_VIA
,
msg
,
KiBitmap
(
select_w_layer_xpm
)
);
if
(
Get
Board
()
->
Get
DesignSettings
().
m_BlindBuriedViaAllowed
)
if
(
GetDesignSettings
().
m_BlindBuriedViaAllowed
)
{
msg
=
AddHotkeyName
(
_
(
"Place Blind/Buried Via"
),
g_Board_Editor_Hokeys_Descr
,
HK_ADD_BLIND_BURIED_VIA
);
...
...
@@ -957,17 +957,17 @@ static wxMenu* Append_Track_Width_List( BOARD* aBoard )
if
(
aBoard
->
GetDesignSettings
().
m_UseConnectedTrackWidth
)
trackwidth_menu
->
Check
(
ID_POPUP_PCB_SELECT_AUTO_WIDTH
,
true
);
if
(
aBoard
->
GetViaSizeIndex
()
!=
0
||
aBoard
->
GetTrackWidthIndex
()
!=
0
if
(
aBoard
->
Get
DesignSettings
().
Get
ViaSizeIndex
()
!=
0
||
aBoard
->
Get
DesignSettings
().
Get
TrackWidthIndex
()
!=
0
||
aBoard
->
GetDesignSettings
().
m_UseConnectedTrackWidth
)
trackwidth_menu
->
Append
(
ID_POPUP_PCB_SELECT_USE_NETCLASS_VALUES
,
_
(
"Use Netclass Values"
),
_
(
"Use track and via sizes from their Netclass values"
),
true
);
for
(
unsigned
ii
=
0
;
ii
<
aBoard
->
m_TrackWidthList
.
size
();
ii
++
)
for
(
unsigned
ii
=
0
;
ii
<
aBoard
->
GetDesignSettings
().
m_TrackWidthList
.
size
();
ii
++
)
{
value
=
StringFromValue
(
g_UserUnit
,
aBoard
->
m_TrackWidthList
[
ii
],
true
);
value
=
StringFromValue
(
g_UserUnit
,
aBoard
->
GetDesignSettings
().
m_TrackWidthList
[
ii
],
true
);
msg
.
Printf
(
_
(
"Track %s"
),
GetChars
(
value
)
);
if
(
ii
==
0
)
...
...
@@ -978,15 +978,16 @@ static wxMenu* Append_Track_Width_List( BOARD* aBoard )
trackwidth_menu
->
AppendSeparator
();
for
(
unsigned
ii
=
0
;
ii
<
aBoard
->
m_ViasDimensionsList
.
size
();
ii
++
)
for
(
unsigned
ii
=
0
;
ii
<
aBoard
->
GetDesignSettings
().
m_ViasDimensionsList
.
size
();
ii
++
)
{
value
=
StringFromValue
(
g_UserUnit
,
aBoard
->
m_ViasDimensionsList
[
ii
].
m_Diameter
,
value
=
StringFromValue
(
g_UserUnit
,
aBoard
->
GetDesignSettings
().
m_ViasDimensionsList
[
ii
].
m_Diameter
,
true
);
wxString
drill
=
StringFromValue
(
g_UserUnit
,
aBoard
->
m_ViasDimensionsList
[
ii
].
m_Drill
,
aBoard
->
GetDesignSettings
().
m_ViasDimensionsList
[
ii
].
m_Drill
,
true
);
if
(
aBoard
->
m_ViasDimensionsList
[
ii
].
m_Drill
<=
0
)
if
(
aBoard
->
GetDesignSettings
().
m_ViasDimensionsList
[
ii
].
m_Drill
<=
0
)
{
msg
.
Printf
(
_
(
"Via %s"
),
GetChars
(
value
)
);
}
...
...
pcbnew/pcb_parser.cpp
View file @
cd8aaee1
...
...
@@ -809,6 +809,8 @@ void PCB_PARSER::parseSetup() throw( IO_ERROR, PARSE_ERROR )
T
token
;
NETCLASS
*
defaultNetclass
=
m_board
->
m_NetClasses
.
GetDefault
();
// TODO Orson: is it really necessary to first operate on a copy and then apply it?
// would not it be better to use reference here and apply all the changes instantly?
BOARD_DESIGN_SETTINGS
designSettings
=
m_board
->
GetDesignSettings
();
ZONE_SETTINGS
zoneSettings
=
m_board
->
GetZoneSettings
();
...
...
@@ -827,7 +829,7 @@ void PCB_PARSER::parseSetup() throw( IO_ERROR, PARSE_ERROR )
break
;
case
T_user_trace_width
:
m_board
->
m_TrackWidthList
.
push_back
(
parseBoardUnits
(
T_user_trace_width
)
);
designSettings
.
m_TrackWidthList
.
push_back
(
parseBoardUnits
(
T_user_trace_width
)
);
NeedRIGHT
();
break
;
...
...
@@ -885,7 +887,7 @@ void PCB_PARSER::parseSetup() throw( IO_ERROR, PARSE_ERROR )
{
int
viaSize
=
parseBoardUnits
(
"user via size"
);
int
viaDrill
=
parseBoardUnits
(
"user via drill"
);
m_board
->
m_ViasDimensionsList
.
push_back
(
VIA_DIMENSION
(
viaSize
,
viaDrill
)
);
designSettings
.
m_ViasDimensionsList
.
push_back
(
VIA_DIMENSION
(
viaSize
,
viaDrill
)
);
NeedRIGHT
();
}
break
;
...
...
pcbnew/tool_pcb.cpp
View file @
cd8aaee1
...
...
@@ -620,9 +620,9 @@ void PCB_EDIT_FRAME::updateTraceWidthSelectBox()
m_SelTrackWidthBox
->
Clear
();
for
(
unsigned
ii
=
0
;
ii
<
Get
Board
()
->
m_TrackWidthList
.
size
();
ii
++
)
for
(
unsigned
ii
=
0
;
ii
<
Get
DesignSettings
().
m_TrackWidthList
.
size
();
ii
++
)
{
msg
=
_
(
"Track "
)
+
CoordinateToString
(
Get
Board
()
->
m_TrackWidthList
[
ii
],
true
);
msg
=
_
(
"Track "
)
+
CoordinateToString
(
Get
DesignSettings
().
m_TrackWidthList
[
ii
],
true
);
if
(
ii
==
0
)
msg
<<
_
(
" *"
);
...
...
@@ -630,10 +630,10 @@ void PCB_EDIT_FRAME::updateTraceWidthSelectBox()
m_SelTrackWidthBox
->
Append
(
msg
);
}
if
(
Get
Board
()
->
GetTrackWidthIndex
()
>=
GetBoard
()
->
m_TrackWidthList
.
size
()
)
Get
Board
()
->
SetTrackWidthIndex
(
0
);
if
(
Get
DesignSettings
().
GetTrackWidthIndex
()
>=
GetDesignSettings
().
m_TrackWidthList
.
size
()
)
Get
DesignSettings
().
SetTrackWidthIndex
(
0
);
m_SelTrackWidthBox
->
SetSelection
(
Get
Board
()
->
GetTrackWidthIndex
()
);
m_SelTrackWidthBox
->
SetSelection
(
Get
DesignSettings
().
GetTrackWidthIndex
()
);
}
...
...
@@ -646,14 +646,14 @@ void PCB_EDIT_FRAME::updateViaSizeSelectBox()
m_SelViaSizeBox
->
Clear
();
for
(
unsigned
ii
=
0
;
ii
<
Get
Board
()
->
m_ViasDimensionsList
.
size
();
ii
++
)
for
(
unsigned
ii
=
0
;
ii
<
Get
DesignSettings
().
m_ViasDimensionsList
.
size
();
ii
++
)
{
msg
=
_
(
"Via "
);
msg
<<
CoordinateToString
(
Get
Board
()
->
m_ViasDimensionsList
[
ii
].
m_Diameter
,
true
);
msg
<<
CoordinateToString
(
Get
DesignSettings
().
m_ViasDimensionsList
[
ii
].
m_Diameter
,
true
);
if
(
Get
Board
()
->
m_ViasDimensionsList
[
ii
].
m_Drill
)
if
(
Get
DesignSettings
().
m_ViasDimensionsList
[
ii
].
m_Drill
)
msg
<<
wxT
(
"/ "
)
<<
CoordinateToString
(
Get
Board
()
->
m_ViasDimensionsList
[
ii
].
m_Drill
,
true
);
<<
CoordinateToString
(
Get
DesignSettings
().
m_ViasDimensionsList
[
ii
].
m_Drill
,
true
);
if
(
ii
==
0
)
msg
<<
_
(
" *"
);
...
...
@@ -661,10 +661,10 @@ void PCB_EDIT_FRAME::updateViaSizeSelectBox()
m_SelViaSizeBox
->
Append
(
msg
);
}
if
(
Get
Board
()
->
GetViaSizeIndex
()
>=
GetBoard
()
->
m_ViasDimensionsList
.
size
()
)
Get
Board
()
->
SetViaSizeIndex
(
0
);
if
(
Get
DesignSettings
().
GetViaSizeIndex
()
>=
GetDesignSettings
().
m_ViasDimensionsList
.
size
()
)
Get
DesignSettings
().
SetViaSizeIndex
(
0
);
m_SelViaSizeBox
->
SetSelection
(
Get
Board
()
->
GetViaSizeIndex
()
);
m_SelViaSizeBox
->
SetSelection
(
Get
DesignSettings
().
GetViaSizeIndex
()
);
}
...
...
pcbnew/toolbars_update_user_interface.cpp
View file @
cd8aaee1
...
...
@@ -55,15 +55,15 @@ void PCB_EDIT_FRAME::OnUpdateSelectTrackWidth( wxUpdateUIEvent& aEvent )
{
if
(
aEvent
.
GetId
()
==
ID_AUX_TOOLBAR_PCB_TRACK_WIDTH
)
{
if
(
m_SelTrackWidthBox
->
GetSelection
()
!=
(
int
)
Get
Board
()
->
GetTrackWidthIndex
()
)
m_SelTrackWidthBox
->
SetSelection
(
Get
Board
()
->
GetTrackWidthIndex
()
);
if
(
m_SelTrackWidthBox
->
GetSelection
()
!=
(
int
)
Get
DesignSettings
().
GetTrackWidthIndex
()
)
m_SelTrackWidthBox
->
SetSelection
(
Get
DesignSettings
().
GetTrackWidthIndex
()
);
}
else
{
bool
check
=
(
(
(
ID_POPUP_PCB_SELECT_WIDTH1
+
(
int
)
Get
Board
()
->
GetTrackWidthIndex
()
)
==
aEvent
.
GetId
()
)
&&
(
int
)
Get
DesignSettings
().
GetTrackWidthIndex
()
)
==
aEvent
.
GetId
()
)
&&
!
GetDesignSettings
().
m_UseConnectedTrackWidth
&&
!
GetBoard
()
->
UseCustomTrackViaSize
()
);
!
GetDesignSettings
().
UseCustomTrackViaSize
()
);
aEvent
.
Check
(
check
);
}
...
...
@@ -73,13 +73,13 @@ void PCB_EDIT_FRAME::OnUpdateSelectTrackWidth( wxUpdateUIEvent& aEvent )
void
PCB_EDIT_FRAME
::
OnUpdateSelectAutoTrackWidth
(
wxUpdateUIEvent
&
aEvent
)
{
aEvent
.
Check
(
GetDesignSettings
().
m_UseConnectedTrackWidth
&&
!
Get
Board
()
->
UseCustomTrackViaSize
()
);
!
Get
DesignSettings
().
UseCustomTrackViaSize
()
);
}
void
PCB_EDIT_FRAME
::
OnUpdateSelectCustomTrackWidth
(
wxUpdateUIEvent
&
aEvent
)
{
aEvent
.
Check
(
Get
Board
()
->
UseCustomTrackViaSize
()
);
aEvent
.
Check
(
Get
DesignSettings
().
UseCustomTrackViaSize
()
);
}
...
...
@@ -89,15 +89,15 @@ void PCB_EDIT_FRAME::OnUpdateSelectViaSize( wxUpdateUIEvent& aEvent )
if
(
aEvent
.
GetId
()
==
ID_AUX_TOOLBAR_PCB_VIA_SIZE
)
{
if
(
m_SelViaSizeBox
->
GetSelection
()
!=
(
int
)
Get
Board
()
->
GetViaSizeIndex
()
)
m_SelViaSizeBox
->
SetSelection
(
Get
Board
()
->
GetViaSizeIndex
()
);
if
(
m_SelViaSizeBox
->
GetSelection
()
!=
(
int
)
Get
DesignSettings
().
GetViaSizeIndex
()
)
m_SelViaSizeBox
->
SetSelection
(
Get
DesignSettings
().
GetViaSizeIndex
()
);
}
else
{
bool
check
=
(
(
(
ID_POPUP_PCB_SELECT_VIASIZE1
+
(
int
)
Get
Board
()
->
GetViaSizeIndex
()
)
==
aEvent
.
GetId
()
)
&&
(
int
)
Get
DesignSettings
().
GetViaSizeIndex
()
)
==
aEvent
.
GetId
()
)
&&
!
GetDesignSettings
().
m_UseConnectedTrackWidth
&&
!
Get
Board
()
->
UseCustomTrackViaSize
()
);
!
Get
DesignSettings
().
UseCustomTrackViaSize
()
);
aEvent
.
Check
(
check
);
}
...
...
pcbnew/tools/pcbnew_control.cpp
View file @
cd8aaee1
...
...
@@ -416,13 +416,13 @@ int PCBNEW_CONTROL::GridPrev( TOOL_EVENT& aEvent )
int
PCBNEW_CONTROL
::
TrackWidthInc
(
TOOL_EVENT
&
aEvent
)
{
BOARD
*
board
=
getModel
<
BOARD
>
(
PCB_T
);
int
widthIndex
=
board
->
GetTrackWidthIndex
()
+
1
;
int
widthIndex
=
board
->
Get
DesignSettings
().
Get
TrackWidthIndex
()
+
1
;
if
(
widthIndex
>=
(
int
)
board
->
m_TrackWidthList
.
size
()
)
widthIndex
=
board
->
m_TrackWidthList
.
size
()
-
1
;
if
(
widthIndex
>=
(
int
)
board
->
GetDesignSettings
().
m_TrackWidthList
.
size
()
)
widthIndex
=
board
->
GetDesignSettings
().
m_TrackWidthList
.
size
()
-
1
;
board
->
SetTrackWidthIndex
(
widthIndex
);
board
->
UseCustomTrackViaSize
(
false
);
board
->
GetDesignSettings
().
SetTrackWidthIndex
(
widthIndex
);
board
->
GetDesignSettings
().
UseCustomTrackViaSize
(
false
);
wxUpdateUIEvent
dummy
;
getEditFrame
<
PCB_EDIT_FRAME
>
()
->
OnUpdateSelectTrackWidth
(
dummy
);
...
...
@@ -437,13 +437,13 @@ int PCBNEW_CONTROL::TrackWidthInc( TOOL_EVENT& aEvent )
int
PCBNEW_CONTROL
::
TrackWidthDec
(
TOOL_EVENT
&
aEvent
)
{
BOARD
*
board
=
getModel
<
BOARD
>
(
PCB_T
);
int
widthIndex
=
board
->
GetTrackWidthIndex
()
-
1
;
int
widthIndex
=
board
->
Get
DesignSettings
().
Get
TrackWidthIndex
()
-
1
;
if
(
widthIndex
<
0
)
widthIndex
=
0
;
board
->
SetTrackWidthIndex
(
widthIndex
);
board
->
UseCustomTrackViaSize
(
false
);
board
->
GetDesignSettings
().
SetTrackWidthIndex
(
widthIndex
);
board
->
GetDesignSettings
().
UseCustomTrackViaSize
(
false
);
wxUpdateUIEvent
dummy
;
getEditFrame
<
PCB_EDIT_FRAME
>
()
->
OnUpdateSelectTrackWidth
(
dummy
);
...
...
@@ -458,13 +458,13 @@ int PCBNEW_CONTROL::TrackWidthDec( TOOL_EVENT& aEvent )
int
PCBNEW_CONTROL
::
ViaSizeInc
(
TOOL_EVENT
&
aEvent
)
{
BOARD
*
board
=
getModel
<
BOARD
>
(
PCB_T
);
int
sizeIndex
=
board
->
GetViaSizeIndex
()
+
1
;
int
sizeIndex
=
board
->
Get
DesignSettings
().
Get
ViaSizeIndex
()
+
1
;
if
(
sizeIndex
>=
(
int
)
board
->
m_ViasDimensionsList
.
size
()
)
sizeIndex
=
board
->
m_ViasDimensionsList
.
size
()
-
1
;
if
(
sizeIndex
>=
(
int
)
board
->
GetDesignSettings
().
m_ViasDimensionsList
.
size
()
)
sizeIndex
=
board
->
GetDesignSettings
().
m_ViasDimensionsList
.
size
()
-
1
;
board
->
SetViaSizeIndex
(
sizeIndex
);
board
->
UseCustomTrackViaSize
(
false
);
board
->
GetDesignSettings
().
SetViaSizeIndex
(
sizeIndex
);
board
->
GetDesignSettings
().
UseCustomTrackViaSize
(
false
);
wxUpdateUIEvent
dummy
;
getEditFrame
<
PCB_EDIT_FRAME
>
()
->
OnUpdateSelectViaSize
(
dummy
);
...
...
@@ -479,13 +479,13 @@ int PCBNEW_CONTROL::ViaSizeInc( TOOL_EVENT& aEvent )
int
PCBNEW_CONTROL
::
ViaSizeDec
(
TOOL_EVENT
&
aEvent
)
{
BOARD
*
board
=
getModel
<
BOARD
>
(
PCB_T
);
int
sizeIndex
=
board
->
GetViaSizeIndex
()
-
1
;
int
sizeIndex
=
board
->
Get
DesignSettings
().
Get
ViaSizeIndex
()
-
1
;
if
(
sizeIndex
<
0
)
sizeIndex
=
0
;
board
->
SetViaSizeIndex
(
sizeIndex
);
board
->
UseCustomTrackViaSize
(
false
);
board
->
GetDesignSettings
().
SetViaSizeIndex
(
sizeIndex
);
board
->
GetDesignSettings
().
UseCustomTrackViaSize
(
false
);
wxUpdateUIEvent
dummy
;
getEditFrame
<
PCB_EDIT_FRAME
>
()
->
OnUpdateSelectViaSize
(
dummy
);
...
...
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