2014-11-14 18:15:58 +00:00
|
|
|
/*
|
|
|
|
* KiRouter - a push-and-(sometimes-)shove PCB router
|
|
|
|
*
|
|
|
|
* Copyright (C) 2014 CERN
|
2016-08-29 14:38:11 +00:00
|
|
|
* Copyright (C) 2016 KiCad Developers, see AUTHORS.txt for contributors.
|
2014-11-14 18:15:58 +00:00
|
|
|
* Author: Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU General Public License as published by the
|
|
|
|
* Free Software Foundation, either version 3 of the License, or (at your
|
|
|
|
* option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __PNS_SIZES_SETTINGS_H
|
|
|
|
#define __PNS_SIZES_SETTINGS_H
|
|
|
|
|
|
|
|
#include <map>
|
2022-08-25 22:50:47 +00:00
|
|
|
#include <optional>
|
2014-11-14 18:15:58 +00:00
|
|
|
|
2021-06-11 21:07:02 +00:00
|
|
|
#include "pcb_track.h" // for VIATYPE_T
|
2014-11-14 18:15:58 +00:00
|
|
|
|
|
|
|
class BOARD;
|
|
|
|
class BOARD_DESIGN_SETTINGS;
|
2016-08-29 14:38:11 +00:00
|
|
|
|
|
|
|
namespace PNS {
|
|
|
|
|
2016-08-29 17:31:13 +00:00
|
|
|
class ITEM;
|
2014-11-14 18:15:58 +00:00
|
|
|
|
2021-01-04 23:47:23 +00:00
|
|
|
class SIZES_SETTINGS
|
|
|
|
{
|
2014-11-14 18:15:58 +00:00
|
|
|
public:
|
2021-01-04 23:47:23 +00:00
|
|
|
SIZES_SETTINGS() :
|
2021-04-23 16:50:41 +00:00
|
|
|
m_minClearance( 0 ),
|
2021-01-04 23:47:23 +00:00
|
|
|
m_trackWidth( 155000 ),
|
2021-06-07 00:18:09 +00:00
|
|
|
m_trackWidthIsExplicit( true ),
|
2021-01-05 00:03:14 +00:00
|
|
|
m_viaType( VIATYPE::THROUGH ),
|
|
|
|
m_viaDiameter( 600000 ),
|
|
|
|
m_viaDrill( 250000 ),
|
2021-01-04 23:47:23 +00:00
|
|
|
m_diffPairWidth( 125000 ),
|
|
|
|
m_diffPairGap( 180000 ),
|
|
|
|
m_diffPairViaGap( 180000 ),
|
|
|
|
m_diffPairViaGapSameAsTraceGap( true ),
|
2022-10-07 12:20:56 +00:00
|
|
|
m_holeToHole( 0 )
|
2021-01-04 23:47:23 +00:00
|
|
|
{};
|
2014-11-14 18:15:58 +00:00
|
|
|
|
2016-08-29 17:31:13 +00:00
|
|
|
~SIZES_SETTINGS() {};
|
2014-11-14 18:15:58 +00:00
|
|
|
|
|
|
|
void ClearLayerPairs();
|
|
|
|
void AddLayerPair( int aL1, int aL2 );
|
|
|
|
|
2021-03-30 18:48:36 +00:00
|
|
|
int MinClearance() const { return m_minClearance; }
|
|
|
|
void SetMinClearance( int aClearance ) { m_minClearance = aClearance; }
|
|
|
|
|
2014-11-14 18:15:58 +00:00
|
|
|
int TrackWidth() const { return m_trackWidth; }
|
|
|
|
void SetTrackWidth( int aWidth ) { m_trackWidth = aWidth; }
|
|
|
|
|
2021-06-07 00:18:09 +00:00
|
|
|
bool TrackWidthIsExplicit() const { return m_trackWidthIsExplicit; }
|
|
|
|
void SetTrackWidthIsExplicit( bool aIsExplicit ) { m_trackWidthIsExplicit = aIsExplicit; }
|
|
|
|
|
2014-11-14 18:15:58 +00:00
|
|
|
int DiffPairWidth() const { return m_diffPairWidth; }
|
|
|
|
int DiffPairGap() const { return m_diffPairGap; }
|
2015-02-18 16:53:46 +00:00
|
|
|
|
2021-01-04 23:47:23 +00:00
|
|
|
int DiffPairViaGap() const
|
|
|
|
{
|
2021-02-24 17:33:05 +00:00
|
|
|
return m_diffPairViaGapSameAsTraceGap ? m_diffPairGap : m_diffPairViaGap;
|
2015-02-18 00:29:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool DiffPairViaGapSameAsTraceGap() const { return m_diffPairViaGapSameAsTraceGap; }
|
|
|
|
|
|
|
|
void SetDiffPairWidth( int aWidth ) { m_diffPairWidth = aWidth; }
|
|
|
|
void SetDiffPairGap( int aGap ) { m_diffPairGap = aGap; }
|
|
|
|
void SetDiffPairViaGapSameAsTraceGap ( bool aEnable ) { m_diffPairViaGapSameAsTraceGap = aEnable; }
|
|
|
|
void SetDiffPairViaGap( int aGap ) { m_diffPairViaGap = aGap; }
|
2014-11-14 18:15:58 +00:00
|
|
|
|
|
|
|
int ViaDiameter() const { return m_viaDiameter; }
|
2015-09-24 16:34:22 +00:00
|
|
|
void SetViaDiameter( int aDiameter ) { m_viaDiameter = aDiameter; }
|
2014-11-14 18:15:58 +00:00
|
|
|
|
|
|
|
int ViaDrill() const { return m_viaDrill; }
|
|
|
|
void SetViaDrill( int aDrill ) { m_viaDrill = aDrill; }
|
|
|
|
|
2022-08-25 22:50:47 +00:00
|
|
|
std::optional<int> PairedLayer( int aLayerId )
|
2014-11-14 18:15:58 +00:00
|
|
|
{
|
|
|
|
if( m_layerPairs.find(aLayerId) == m_layerPairs.end() )
|
2022-08-25 22:50:47 +00:00
|
|
|
return std::optional<int>();
|
2014-11-14 18:15:58 +00:00
|
|
|
|
2015-02-18 16:53:46 +00:00
|
|
|
return m_layerPairs[aLayerId];
|
2014-11-14 18:15:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int GetLayerTop() const;
|
|
|
|
int GetLayerBottom() const;
|
|
|
|
|
2021-01-05 00:03:14 +00:00
|
|
|
void SetHoleToHole( int aHoleToHole ) { m_holeToHole = aHoleToHole; }
|
|
|
|
int GetHoleToHole() const { return m_holeToHole; }
|
|
|
|
|
2021-01-04 23:47:23 +00:00
|
|
|
void SetViaType( VIATYPE aViaType ) { m_viaType = aViaType; }
|
|
|
|
VIATYPE ViaType() const { return m_viaType; }
|
2014-11-14 18:15:58 +00:00
|
|
|
|
2022-10-07 12:20:56 +00:00
|
|
|
wxString GetClearanceSource() const { return m_clearanceSource; }
|
|
|
|
void SetClearanceSource( const wxString& aSource ) { m_clearanceSource = aSource; }
|
|
|
|
|
2021-07-03 17:21:51 +00:00
|
|
|
wxString GetWidthSource() const { return m_widthSource; }
|
|
|
|
void SetWidthSource( const wxString& aSource ) { m_widthSource = aSource; }
|
|
|
|
|
2022-10-07 12:20:56 +00:00
|
|
|
wxString GetDiffPairWidthSource() const { return m_diffPairWidthSource; }
|
|
|
|
void SetDiffPairWidthSource( const wxString& aSource ) { m_diffPairWidthSource = aSource; }
|
|
|
|
|
|
|
|
wxString GetDiffPairGapSource() const { return m_diffPairGapSource; }
|
|
|
|
void SetDiffPairGapSource( const wxString& aSource ) { m_diffPairGapSource = aSource; }
|
|
|
|
|
2014-11-14 18:15:58 +00:00
|
|
|
private:
|
2021-03-30 18:48:36 +00:00
|
|
|
int m_minClearance;
|
2021-01-04 23:47:23 +00:00
|
|
|
int m_trackWidth;
|
2021-06-07 00:18:09 +00:00
|
|
|
bool m_trackWidthIsExplicit;
|
2021-01-05 00:03:14 +00:00
|
|
|
|
|
|
|
VIATYPE m_viaType;
|
|
|
|
int m_viaDiameter;
|
|
|
|
int m_viaDrill;
|
|
|
|
|
2021-01-04 23:47:23 +00:00
|
|
|
int m_diffPairWidth;
|
|
|
|
int m_diffPairGap;
|
|
|
|
int m_diffPairViaGap;
|
|
|
|
bool m_diffPairViaGapSameAsTraceGap;
|
2015-02-18 00:29:54 +00:00
|
|
|
|
2021-01-05 00:03:14 +00:00
|
|
|
int m_holeToHole;
|
2014-11-14 18:15:58 +00:00
|
|
|
|
|
|
|
std::map<int, int> m_layerPairs;
|
2021-07-03 17:21:51 +00:00
|
|
|
|
2022-10-07 12:20:56 +00:00
|
|
|
wxString m_clearanceSource;
|
2021-07-03 17:21:51 +00:00
|
|
|
wxString m_widthSource;
|
2022-10-07 12:20:56 +00:00
|
|
|
wxString m_diffPairWidthSource;
|
|
|
|
wxString m_diffPairGapSource;
|
2014-11-14 18:15:58 +00:00
|
|
|
};
|
|
|
|
|
2021-02-25 16:18:13 +00:00
|
|
|
}
|
2016-08-29 14:38:11 +00:00
|
|
|
|
2014-11-14 18:15:58 +00:00
|
|
|
#endif // __PNS_SIZES_SETTINGS_H
|