2013-09-18 17:55:16 +00:00
|
|
|
/*
|
|
|
|
* KiRouter - a push-and-(sometimes-)shove PCB router
|
|
|
|
*
|
2014-05-14 13:53:54 +00:00
|
|
|
* Copyright (C) 2013-2014 CERN
|
2013-09-18 17:55:16 +00:00
|
|
|
* Author: Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
|
2013-09-26 21:53:54 +00:00
|
|
|
*
|
2013-09-18 17:55:16 +00:00
|
|
|
* 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.
|
2013-09-26 21:53:54 +00:00
|
|
|
*
|
2013-09-18 17:55:16 +00:00
|
|
|
* 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.
|
2013-09-26 21:53:54 +00:00
|
|
|
*
|
2013-09-18 17:55:16 +00:00
|
|
|
* You should have received a copy of the GNU General Public License along
|
2014-05-14 13:53:54 +00:00
|
|
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
2013-09-18 17:55:16 +00:00
|
|
|
*/
|
2013-09-26 21:53:54 +00:00
|
|
|
|
2014-05-14 13:53:54 +00:00
|
|
|
#ifndef __PNS_ROUTING_SETTINGS
|
|
|
|
#define __PNS_ROUTING_SETTINGS
|
2013-09-18 17:55:16 +00:00
|
|
|
|
2014-05-14 13:53:54 +00:00
|
|
|
#include "time_limit.h"
|
2014-07-09 13:02:56 +00:00
|
|
|
|
|
|
|
class DIRECTION_45;
|
2014-05-14 13:53:54 +00:00
|
|
|
|
2013-09-18 17:55:16 +00:00
|
|
|
///> Routing modes
|
2013-09-26 21:53:54 +00:00
|
|
|
enum PNS_MODE
|
|
|
|
{
|
2014-05-14 13:53:54 +00:00
|
|
|
RM_MarkObstacles = 0, ///> Ignore collisions, mark obstacles
|
|
|
|
RM_Shove, ///> Only shove
|
|
|
|
RM_Walkaround, ///> Only walkaround
|
|
|
|
RM_Smart ///> Guess what's better, try to make least mess on the PCB
|
2013-09-18 17:55:16 +00:00
|
|
|
};
|
|
|
|
|
2014-05-14 13:53:54 +00:00
|
|
|
///> Optimization effort
|
|
|
|
enum PNS_OPTIMIZATION_EFFORT
|
|
|
|
{
|
2014-05-16 11:37:31 +00:00
|
|
|
OE_LOW = 0,
|
|
|
|
OE_MEDIUM = 1,
|
|
|
|
OE_FULL = 2
|
2014-05-14 13:53:54 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Class PNS_ROUTING_SETTINGS
|
|
|
|
*
|
|
|
|
* Contains all persistent settings of the router, such as the mode, optimization effort, etc.
|
|
|
|
*/
|
|
|
|
|
2013-09-26 21:53:54 +00:00
|
|
|
class PNS_ROUTING_SETTINGS
|
2013-09-18 17:55:16 +00:00
|
|
|
{
|
2013-09-26 21:53:54 +00:00
|
|
|
public:
|
2014-05-14 13:53:54 +00:00
|
|
|
PNS_ROUTING_SETTINGS();
|
|
|
|
|
|
|
|
///> Returns the routing mode.
|
|
|
|
PNS_MODE Mode() const { return m_routingMode; }
|
|
|
|
|
|
|
|
///> Sets the routing mode.
|
|
|
|
void SetMode( PNS_MODE aMode ) { m_routingMode = aMode; }
|
|
|
|
|
|
|
|
///> Returns the optimizer effort. Bigger means cleaner traces, but slower routing.
|
|
|
|
PNS_OPTIMIZATION_EFFORT OptimizerEffort() const { return m_optimizerEffort; }
|
|
|
|
|
|
|
|
///> Sets the optimizer effort. Bigger means cleaner traces, but slower routing.
|
|
|
|
void SetOptimizerEffort( PNS_OPTIMIZATION_EFFORT aEffort ) { m_optimizerEffort = aEffort; }
|
|
|
|
|
|
|
|
///> Returns true if shoving vias is enbled.
|
|
|
|
bool ShoveVias() const { return m_shoveVias; }
|
|
|
|
|
|
|
|
///> Enables/disables shoving vias.
|
|
|
|
void SetShoveVias( bool aShoveVias ) { m_shoveVias = aShoveVias; }
|
|
|
|
|
|
|
|
///> Returns true if loop (redundant track) removal is on.
|
|
|
|
bool RemoveLoops() const { return m_removeLoops; }
|
|
|
|
|
|
|
|
///> Enables/disables loop (redundant track) removal.
|
|
|
|
void SetRemoveLoops( bool aRemoveLoops ) { m_removeLoops = aRemoveLoops; }
|
|
|
|
|
|
|
|
///> Returns true if suggesting the finish of currently placed track is on.
|
|
|
|
bool SuggestFinish() { return m_suggestFinish; }
|
|
|
|
|
|
|
|
///> Enables displaying suggestions for finishing the currently placed track.
|
|
|
|
void SetSuggestFinish( bool aSuggestFinish ) { m_suggestFinish = aSuggestFinish; }
|
|
|
|
|
|
|
|
///> Returns true if Smart Pads (automatic neckdown) is enabled.
|
|
|
|
bool SmartPads () const { return m_smartPads; }
|
2013-09-18 17:55:16 +00:00
|
|
|
|
2014-05-14 13:53:54 +00:00
|
|
|
///> Enables/disables Smart Pads (automatic neckdown).
|
|
|
|
void SetSmartPads( bool aSmartPads ) { m_smartPads = aSmartPads; }
|
|
|
|
|
|
|
|
///> Returns true if follow mouse mode is active (permanently on for the moment).
|
|
|
|
bool FollowMouse() const
|
|
|
|
{
|
2014-05-16 11:37:31 +00:00
|
|
|
return m_followMouse && !( Mode() == RM_MarkObstacles );
|
2014-05-14 13:53:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
///> Returns true if smoothing segments durign dragging is enabled.
|
|
|
|
bool SmoothDraggedSegments() const { return m_smoothDraggedSegments; }
|
|
|
|
|
|
|
|
///> Enables/disabled smoothing segments during dragging.
|
|
|
|
void SetSmoothDraggedSegments( bool aSmooth ) { m_smoothDraggedSegments = aSmooth; }
|
|
|
|
|
|
|
|
///> Returns true if jumping over unmovable obstacles is on.
|
|
|
|
bool JumpOverObstacles() const { return m_jumpOverObstacles; }
|
|
|
|
|
|
|
|
///> Enables/disables jumping over unmovable obstacles.
|
|
|
|
void SetJumpOverObstacles( bool aJumpOverObstacles ) { m_jumpOverObstacles = aJumpOverObstacles; }
|
|
|
|
|
|
|
|
void SetStartDiagonal(bool aStartDiagonal) { m_startDiagonal = aStartDiagonal; }
|
|
|
|
|
|
|
|
bool CanViolateDRC() const { return m_canViolateDRC; }
|
|
|
|
void SetCanViolateDRC( bool aViolate ) { m_canViolateDRC = aViolate; }
|
|
|
|
|
|
|
|
void SetTrackWidth( int aWidth ) { m_trackWidth = aWidth; }
|
|
|
|
int GetTrackWidth() const { return m_trackWidth; }
|
|
|
|
void SetViaDiameter( int aDiameter ) { m_viaDiameter = aDiameter; }
|
|
|
|
int GetViaDiameter() const { return m_viaDiameter; }
|
|
|
|
void SetViaDrill( int aDrill ) { m_viaDrill = aDrill; }
|
|
|
|
int GetViaDrill() const { return m_viaDrill; }
|
|
|
|
|
2014-07-09 13:02:56 +00:00
|
|
|
const DIRECTION_45 InitialDirection() const;
|
2014-05-14 13:53:54 +00:00
|
|
|
|
|
|
|
int ShoveIterationLimit() const;
|
|
|
|
TIME_LIMIT ShoveTimeLimit() const;
|
|
|
|
|
|
|
|
int WalkaroundIterationLimit() const { return m_walkaroundIterationLimit; };
|
|
|
|
TIME_LIMIT WalkaroundTimeLimit() const;
|
|
|
|
|
|
|
|
private:
|
|
|
|
bool m_shoveVias;
|
|
|
|
bool m_startDiagonal;
|
2013-09-26 21:53:54 +00:00
|
|
|
bool m_removeLoops;
|
|
|
|
bool m_smartPads;
|
2014-05-14 13:53:54 +00:00
|
|
|
bool m_suggestFinish;
|
2013-09-26 21:53:54 +00:00
|
|
|
bool m_followMouse;
|
2014-05-14 13:53:54 +00:00
|
|
|
bool m_jumpOverObstacles;
|
|
|
|
bool m_smoothDraggedSegments;
|
|
|
|
bool m_canViolateDRC;
|
2013-09-18 17:55:16 +00:00
|
|
|
|
2014-05-14 13:53:54 +00:00
|
|
|
PNS_MODE m_routingMode;
|
|
|
|
PNS_OPTIMIZATION_EFFORT m_optimizerEffort;
|
|
|
|
|
|
|
|
int m_trackWidth;
|
2013-09-26 21:53:54 +00:00
|
|
|
int m_viaDiameter;
|
|
|
|
int m_viaDrill;
|
2014-05-14 13:53:54 +00:00
|
|
|
|
2013-09-26 21:53:54 +00:00
|
|
|
int m_preferredLayer;
|
|
|
|
int m_walkaroundIterationLimit;
|
|
|
|
int m_shoveIterationLimit;
|
2014-05-14 13:53:54 +00:00
|
|
|
TIME_LIMIT m_shoveTimeLimit;
|
|
|
|
TIME_LIMIT m_walkaroundTimeLimit;
|
2013-09-18 17:55:16 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|