2009-10-28 11:48:47 +00:00
|
|
|
/**********************************************************/
|
|
|
|
/* class_board_design_settings.h : handle board options */
|
|
|
|
/**********************************************************/
|
|
|
|
|
2012-02-06 07:14:51 +00:00
|
|
|
#ifndef BOARD_DESIGN_SETTINGS_H_
|
|
|
|
#define BOARD_DESIGN_SETTINGS_H_
|
2009-10-28 11:48:47 +00:00
|
|
|
|
2012-01-23 04:33:36 +00:00
|
|
|
#include <pcbstruct.h> // NB_COLORS
|
2012-02-19 04:02:19 +00:00
|
|
|
#include <class_pad.h>
|
2014-04-25 06:00:04 +00:00
|
|
|
#include <class_track.h>
|
2014-05-13 09:22:51 +00:00
|
|
|
#include <class_netclass.h>
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
#include <config_params.h>
|
2010-01-21 07:41:30 +00:00
|
|
|
|
2014-05-13 09:22:51 +00:00
|
|
|
/**
|
|
|
|
* 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;
|
|
|
|
}
|
|
|
|
};
|
2012-02-19 04:02:19 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Class BOARD_DESIGN_SETTINGS
|
|
|
|
* contains design settings for a BOARD object.
|
|
|
|
*/
|
2010-01-31 20:01:46 +00:00
|
|
|
class BOARD_DESIGN_SETTINGS
|
2009-10-28 11:48:47 +00:00
|
|
|
{
|
|
|
|
public:
|
2014-05-13 09:22:51 +00:00
|
|
|
// 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;
|
|
|
|
|
2014-05-13 09:22:51 +00:00
|
|
|
/// List of current netclasses. There is always the default netclass.
|
|
|
|
NETCLASSES m_NetClasses;
|
|
|
|
|
2012-02-02 07:23:00 +00:00
|
|
|
bool m_MicroViasAllowed; ///< true to allow micro vias
|
2013-08-28 16:14:39 +00:00
|
|
|
bool m_BlindBuriedViaAllowed; ///< true to allow blind/buried vias
|
2014-04-25 06:00:04 +00:00
|
|
|
VIATYPE_T m_CurrentViaType; ///< via type (VIA_BLIND_BURIED, VIA_THROUGH VIA_MICROVIA)
|
2011-09-23 13:57:12 +00:00
|
|
|
|
++PCBNew
* Removed Pcb_Frame argument from BOARD() constructor, since it precludes
having a BOARD being edited by more than one editor, it was a bad design.
And this meant removing m_PcbFrame from BOARD.
* removed BOARD::SetWindowFrame(), and BOARD::m_PcbFrame
* Removed the global BOARD_DESIGN_SETTINGS which was in class_board.cpp
* added BOARD_DESIGN_SETTINGS to the BOARD class, a full instance
* a couple dialogs now only change BOARD_DESIGN_SETTINGS when OK is pressed,
such as dialog_mask_clearance, dialog_drc, etc.
* Removed common/pcbcommon.cpp's int g_CurrentVersionPCB = 1 and replaced it
with build_version.h's #define BOARD_FILE_VERSION, although there may be a
better place for this constant.
* Made the public functions in PARAM_CFG_ARRAY be type const.
void SaveParam(..) const and void ReadParam(..) const
* PARAM_CFG_BASE now has virtual destructor since we have various way of
destroying the derived class and boost::ptr_vector must be told about this.
* Pass const PARAM_CFG_ARRAY& instead of PARAM_CFG_ARRAY so that we can use
an automatic PARAM_CFG_ARRAY which is on the stack.\
* PCB_EDIT_FRAME::GetProjectFileParameters() may no longer cache the array,
since it has to access the current BOARD and the BOARD can change.
Remember BOARD_DESIGN_SETTINGS are now in the BOARD.
* Made the m_BoundingBox member private, this was a brutally hard task,
and indicative of the lack of commitment to accessors and object oriented
design on the part of KiCad developers. We must do better.
Added BOARD::GetBoundingBox, SetBoundingBox(), ComputeBoundingBox().
* Added PCB_BASE_FRAME::GetBoardBoundingBox() which calls BOARD::ComputeBoundingBox()
2011-12-05 06:15:33 +00:00
|
|
|
/// if true, when creating a new track starting on an existing track, use this track width
|
2012-02-02 07:23:00 +00:00
|
|
|
bool m_UseConnectedTrackWidth;
|
|
|
|
int m_DrawSegmentWidth; ///< current graphic line width (not EDGE layer)
|
|
|
|
int m_EdgeSegmentWidth; ///< current graphic line width (EDGE layer only)
|
|
|
|
int m_PcbTextWidth; ///< current Pcb (not module) Text width
|
|
|
|
wxSize m_PcbTextSize; ///< current Pcb (not module) Text size
|
|
|
|
int m_TrackMinWidth; ///< track min value for width ((min copper size value
|
|
|
|
int m_ViasMinSize; ///< vias (not micro vias) min diameter
|
|
|
|
int m_ViasMinDrill; ///< vias (not micro vias) min drill diameter
|
|
|
|
int m_MicroViasMinSize; ///< micro vias (not vias) min diameter
|
|
|
|
int m_MicroViasMinDrill; ///< micro vias (not vias) min drill diameter
|
2011-09-23 13:57:12 +00:00
|
|
|
|
2009-11-04 19:08:08 +00:00
|
|
|
// Global mask margins:
|
2012-02-02 07:23:00 +00:00
|
|
|
int m_SolderMaskMargin; ///< Solder mask margin
|
2012-11-05 20:20:34 +00:00
|
|
|
int m_SolderMaskMinWidth; ///< Solder mask min width
|
|
|
|
// 2 areas near than m_SolderMaskMinWidth
|
|
|
|
// are merged
|
2012-02-02 07:23:00 +00:00
|
|
|
int m_SolderPasteMargin; ///< Solder paste margin absolute value
|
|
|
|
double m_SolderPasteMarginRatio; ///< Solder pask margin ratio value of pad size
|
|
|
|
///< The final margin is the sum of these 2 values
|
|
|
|
|
|
|
|
// Variables used in footprint handling
|
|
|
|
wxSize m_ModuleTextSize; ///< Default footprint texts size
|
|
|
|
int m_ModuleTextWidth;
|
|
|
|
int m_ModuleSegmentWidth;
|
2013-08-03 05:15:23 +00:00
|
|
|
wxPoint m_AuxOrigin; ///< origin for plot exports
|
|
|
|
wxPoint m_GridOrigin; ///< origin for grid offsets
|
2009-10-28 11:48:47 +00:00
|
|
|
|
2012-02-19 04:02:19 +00:00
|
|
|
D_PAD m_Pad_Master;
|
|
|
|
|
2010-01-31 20:01:46 +00:00
|
|
|
BOARD_DESIGN_SETTINGS();
|
2009-10-28 11:48:47 +00:00
|
|
|
|
2014-05-13 09:22:51 +00:00
|
|
|
/**
|
2014-05-15 08:51:08 +00:00
|
|
|
* Function GetDefault
|
|
|
|
* @return the default netclass.
|
2014-05-13 09:22:51 +00:00
|
|
|
*/
|
2014-05-20 09:29:37 +00:00
|
|
|
inline NETCLASSPTR GetDefault() const
|
2014-05-15 08:51:08 +00:00
|
|
|
{
|
|
|
|
return m_NetClasses.GetDefault();
|
|
|
|
}
|
2014-05-13 09:22:51 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function GetCurrentNetClassName
|
|
|
|
* @return the current net class name.
|
|
|
|
*/
|
2014-05-15 08:51:08 +00:00
|
|
|
const wxString& GetCurrentNetClassName() const
|
|
|
|
{
|
|
|
|
return m_currentNetClassName;
|
|
|
|
}
|
2014-05-13 09:22:51 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function SetCurrentNetClass
|
|
|
|
* Must be called after a netclass selection (or after a netclass parameter change
|
|
|
|
* Initialize vias and tracks values displayed in comb boxes of the auxiliary toolbar
|
|
|
|
* and some others parameters (netclass name ....)
|
|
|
|
* @param aNetClassName = the new netclass name
|
|
|
|
* @return true if lists of tracks and vias sizes are modified
|
|
|
|
*/
|
|
|
|
bool SetCurrentNetClass( const wxString& aNetClassName );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function GetBiggestClearanceValue
|
|
|
|
* @return the biggest clearance value found in NetClasses list
|
|
|
|
*/
|
|
|
|
int GetBiggestClearanceValue();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function GetSmallestClearanceValue
|
|
|
|
* @return the smallest clearance value found in NetClasses list
|
|
|
|
*/
|
|
|
|
int GetSmallestClearanceValue();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function GetCurrentMicroViaSize
|
|
|
|
* @return the current micro via size,
|
|
|
|
* that is the current netclass value
|
|
|
|
*/
|
|
|
|
int GetCurrentMicroViaSize();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function GetCurrentMicroViaDrill
|
|
|
|
* @return the current micro via drill,
|
|
|
|
* that is the current netclass value
|
|
|
|
*/
|
|
|
|
int GetCurrentMicroViaDrill();
|
|
|
|
|
2014-05-13 09:22:51 +00:00
|
|
|
/**
|
|
|
|
* 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;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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;
|
|
|
|
}
|
|
|
|
|
2009-10-28 11:48:47 +00:00
|
|
|
/**
|
|
|
|
* Function GetVisibleLayers
|
|
|
|
* returns a bit-mask of all the layers that are visible
|
|
|
|
* @return int - the visible layers in bit-mapped form.
|
|
|
|
*/
|
2014-05-13 09:22:51 +00:00
|
|
|
LAYER_MSK GetVisibleLayers() const
|
|
|
|
{
|
|
|
|
return m_visibleLayers;
|
|
|
|
}
|
2009-10-28 11:48:47 +00:00
|
|
|
|
2010-01-27 20:07:50 +00:00
|
|
|
/**
|
|
|
|
* Function SetVisibleAlls
|
2012-02-06 05:44:19 +00:00
|
|
|
* Set the bit-mask of all visible elements categories,
|
|
|
|
* including enabled layers
|
2010-01-27 20:07:50 +00:00
|
|
|
*/
|
2012-02-06 05:44:19 +00:00
|
|
|
void SetVisibleAlls();
|
2010-01-27 20:07:50 +00:00
|
|
|
|
2009-10-28 11:48:47 +00:00
|
|
|
/**
|
|
|
|
* Function SetVisibleLayers
|
|
|
|
* changes the bit-mask of visible layers
|
|
|
|
* @param aMask = The new bit-mask of visible layers
|
|
|
|
*/
|
2014-05-13 09:22:51 +00:00
|
|
|
void SetVisibleLayers( LAYER_MSK aMask )
|
|
|
|
{
|
|
|
|
m_visibleLayers = aMask & m_enabledLayers & FULL_LAYERS;
|
|
|
|
}
|
2009-10-28 11:48:47 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function IsLayerVisible
|
|
|
|
* tests whether a given layer is visible
|
2013-04-09 16:00:46 +00:00
|
|
|
* @param aLayer = The layer to be tested
|
2009-10-28 11:48:47 +00:00
|
|
|
* @return bool - true if the layer is visible.
|
|
|
|
*/
|
2013-04-09 16:00:46 +00:00
|
|
|
bool IsLayerVisible( LAYER_NUM aLayer ) const
|
2009-10-28 11:48:47 +00:00
|
|
|
{
|
|
|
|
// If a layer is disabled, it is automatically invisible
|
2014-05-13 09:22:51 +00:00
|
|
|
return m_visibleLayers & m_enabledLayers & GetLayerMask( aLayer );
|
2009-10-28 11:48:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function SetLayerVisibility
|
|
|
|
* changes the visibility of a given layer
|
2013-04-09 16:00:46 +00:00
|
|
|
* @param aLayer = The layer to be changed
|
2009-10-28 11:48:47 +00:00
|
|
|
* @param aNewState = The new visibility state of the layer
|
|
|
|
*/
|
2013-04-09 16:00:46 +00:00
|
|
|
void SetLayerVisibility( LAYER_NUM aLayer, bool aNewState );
|
2009-10-28 11:48:47 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function GetVisibleElements
|
|
|
|
* returns a bit-mask of all the element categories that are visible
|
|
|
|
* @return int - the visible element categories in bit-mapped form.
|
|
|
|
*/
|
2009-12-07 03:46:13 +00:00
|
|
|
int GetVisibleElements() const
|
2009-10-28 11:48:47 +00:00
|
|
|
{
|
2014-05-13 09:22:51 +00:00
|
|
|
return m_visibleElements;
|
2009-10-28 11:48:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function SetVisibleElements
|
|
|
|
* changes the bit-mask of visible element categories
|
|
|
|
* @param aMask = The new bit-mask of visible element categories
|
|
|
|
*/
|
2009-12-07 03:46:13 +00:00
|
|
|
void SetVisibleElements( int aMask )
|
2009-10-28 11:48:47 +00:00
|
|
|
{
|
2014-05-13 09:22:51 +00:00
|
|
|
m_visibleElements = aMask;
|
2009-10-28 11:48:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function IsElementVisible
|
2010-01-21 20:53:01 +00:00
|
|
|
* tests whether a given element category is visible. Keep this as an
|
|
|
|
* inline function.
|
2014-02-03 12:08:01 +00:00
|
|
|
* @param aElementCategory is from the enum by the same name
|
2009-10-28 11:48:47 +00:00
|
|
|
* @return bool - true if the element is visible.
|
2010-01-21 20:53:01 +00:00
|
|
|
* @see enum PCB_VISIBLE
|
2009-10-28 11:48:47 +00:00
|
|
|
*/
|
2014-02-03 12:08:01 +00:00
|
|
|
bool IsElementVisible( int aElementCategory ) const
|
2009-10-28 11:48:47 +00:00
|
|
|
{
|
2014-02-03 12:08:01 +00:00
|
|
|
assert( aElementCategory >= 0 && aElementCategory < END_PCB_VISIBLE_LIST );
|
|
|
|
|
2014-05-13 09:22:51 +00:00
|
|
|
return ( m_visibleElements & ( 1 << aElementCategory ) );
|
2009-10-28 11:48:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function SetElementVisibility
|
|
|
|
* changes the visibility of an element category
|
2014-02-03 12:08:01 +00:00
|
|
|
* @param aElementCategory is from the enum by the same name
|
2009-10-28 11:48:47 +00:00
|
|
|
* @param aNewState = The new visibility state of the element category
|
2010-01-21 20:53:01 +00:00
|
|
|
* @see enum PCB_VISIBLE
|
2009-10-28 11:48:47 +00:00
|
|
|
*/
|
2014-02-03 12:08:01 +00:00
|
|
|
void SetElementVisibility( int aElementCategory, bool aNewState );
|
2009-10-28 11:48:47 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function GetEnabledLayers
|
|
|
|
* returns a bit-mask of all the layers that are enabled
|
|
|
|
* @return int - the enabled layers in bit-mapped form.
|
|
|
|
*/
|
2013-03-30 17:24:04 +00:00
|
|
|
inline LAYER_MSK GetEnabledLayers() const
|
2009-10-28 11:48:47 +00:00
|
|
|
{
|
2014-05-13 09:22:51 +00:00
|
|
|
return m_enabledLayers;
|
2009-10-28 11:48:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function SetEnabledLayers
|
|
|
|
* changes the bit-mask of enabled layers
|
|
|
|
* @param aMask = The new bit-mask of enabled layers
|
|
|
|
*/
|
2013-03-30 17:24:04 +00:00
|
|
|
void SetEnabledLayers( LAYER_MSK aMask );
|
2009-10-28 11:48:47 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function IsLayerEnabled
|
|
|
|
* tests whether a given layer is enabled
|
2013-04-09 16:00:46 +00:00
|
|
|
* @param aLayer = The of the layer to be tested
|
2009-10-28 11:48:47 +00:00
|
|
|
* @return bool - true if the layer is enabled
|
|
|
|
*/
|
2013-04-09 16:00:46 +00:00
|
|
|
bool IsLayerEnabled( LAYER_NUM aLayer ) const
|
2009-10-28 11:48:47 +00:00
|
|
|
{
|
2014-05-13 09:22:51 +00:00
|
|
|
return m_enabledLayers & GetLayerMask( aLayer );
|
2009-10-28 11:48:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function GetCopperLayerCount
|
|
|
|
* @return int - the number of neabled copper layers
|
|
|
|
*/
|
2009-12-07 03:46:13 +00:00
|
|
|
int GetCopperLayerCount() const
|
2009-10-28 11:48:47 +00:00
|
|
|
{
|
2014-05-13 09:22:51 +00:00
|
|
|
return m_copperLayerCount;
|
2009-10-28 11:48:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function SetCopperLayerCount
|
|
|
|
* do what its name says...
|
|
|
|
* @param aNewLayerCount = The new number of enabled copper layers
|
|
|
|
*/
|
|
|
|
void SetCopperLayerCount( int aNewLayerCount );
|
|
|
|
|
2012-02-19 04:02:19 +00:00
|
|
|
/**
|
|
|
|
* Function AppendConfigs
|
|
|
|
* appends to @a aResult the configuration setting accessors which will later
|
|
|
|
* allow reading or writing of configuration file information directly into
|
|
|
|
* this object.
|
|
|
|
*/
|
|
|
|
void AppendConfigs( PARAM_CFG_ARRAY* aResult );
|
2009-10-28 11:48:47 +00:00
|
|
|
|
2012-06-09 17:00:13 +00:00
|
|
|
int GetBoardThickness() const { return m_boardThickness; }
|
|
|
|
void SetBoardThickness( int aThickness ) { m_boardThickness = aThickness; }
|
|
|
|
|
2012-02-06 05:44:19 +00:00
|
|
|
private:
|
2014-05-13 09:22:51 +00:00
|
|
|
/// 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;
|
|
|
|
|
2014-05-13 09:22:51 +00:00
|
|
|
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
|
|
|
|
int m_visibleElements; ///< Bit-mask for element category visibility
|
2013-03-30 17:24:04 +00:00
|
|
|
int m_boardThickness; ///< Board thickness for 3D viewer
|
2014-05-13 09:22:51 +00:00
|
|
|
|
|
|
|
/// Current net class name used to display netclass info.
|
|
|
|
/// This is also the last used netclass after starting a track.
|
|
|
|
wxString m_currentNetClassName;
|
|
|
|
|
|
|
|
void formatNetClass( NETCLASS* aNetClass, OUTPUTFORMATTER* aFormatter, int aNestLevel,
|
|
|
|
int aControlBits ) const throw( IO_ERROR );
|
2009-10-28 11:48:47 +00:00
|
|
|
};
|
2009-11-04 19:08:08 +00:00
|
|
|
|
2012-02-06 07:14:51 +00:00
|
|
|
#endif // BOARD_DESIGN_SETTINGS_H_
|