KiCad PCB EDA Suite
Loading...
Searching...
No Matches
dialog_pns_settings.cpp
Go to the documentation of this file.
1/*
2 * KiRouter - a push-and-(sometimes-)shove PCB router
3 *
4 * Copyright (C) 2014 CERN
5 * Copyright (C) 2016 KiCad Developers, see AUTHORS.txt for contributors.
6 * Author: Maciej Suminski <[email protected]>
7 *
8 * This program is free software: you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation, either version 3 of the License, or (at your
11 * option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with this program. If not, see <http://www.gnu.or/licenses/>.
20 */
21
26#include "dialog_pns_settings.h"
28
30 DIALOG_PNS_SETTINGS_BASE( aParent ),
31 m_settings( aSettings )
32{
33 // Load widgets' values from settings
34 switch( m_settings.Mode() )
35 {
36 case PNS::RM_MarkObstacles: m_rbMarkObstacles->SetValue( true ); break;
37 case PNS::RM_Shove: m_rbShove->SetValue( true ); break;
38 case PNS::RM_Walkaround: m_rbWalkaround->SetValue( true ); break;
39 }
40
41 m_shoveVias->SetValue( m_settings.ShoveVias() );
45 m_smartPads->SetValue( m_settings.SmartPads() );
52
53 // Enable/disable some options
54 wxCommandEvent event;
55 onModeChange( event );
56
57 // Don't show options that are not implemented
58 m_suggestEnding->Hide();
59
61
63}
64
65
67{
68 // Save widgets' values to settings
70 else if( m_rbShove->GetValue() ) m_settings.SetMode( PNS::RM_Shove );
71 else if( m_rbWalkaround->GetValue() ) m_settings.SetMode( PNS::RM_Walkaround );
72
73 m_settings.SetShoveVias( m_shoveVias->GetValue() );
77 m_settings.SetSmartPads( m_smartPads->GetValue() );
84
85 return true;
86}
87
88
89void DIALOG_PNS_SETTINGS::onModeChange( wxCommandEvent& aEvent )
90{
91 m_freeAngleMode->Enable( m_rbMarkObstacles->GetValue() );
92 m_violateDrc->Enable( m_rbMarkObstacles->GetValue() );
93
94 m_shoveVias->Enable( m_rbShove->GetValue() );
95 m_backPressure->Enable( m_rbShove->GetValue() );
96}
Class DIALOG_PNS_SETTINGS_BASE.
virtual void onModeChange(wxCommandEvent &aEvent) override
bool TransferDataFromWindow() override
PNS::ROUTING_SETTINGS & m_settings
DIALOG_PNS_SETTINGS(wxWindow *aParent, PNS::ROUTING_SETTINGS &aSettings)
Push and Shove router settings dialog.
void SetupStandardButtons(std::map< int, wxString > aLabels={})
void finishDialogSettings()
In all dialogs, we must call the same functions to fix minimal dlg size, the default position and per...
Contain all persistent settings of the router, such as the mode, optimization effort,...
bool GetOptimizeEntireDraggedTrack() const
bool RemoveLoops() const
Enable/disable loop (redundant track) removal.
void SetShoveVias(bool aShoveVias)
Return true if loop (redundant track) removal is on.
bool SmoothDraggedSegments() const
Enable/disable smoothing segments during dragging.
void SetAutoPosture(bool aEnable)
void SetSmoothDraggedSegments(bool aSmooth)
Return true if jumping over unmovable obstacles is on.
void SetOptimizeEntireDraggedTrack(bool aEnable)
bool ShoveVias() const
Enable/disable shoving vias.
bool SmartPads() const
Enable/disable Smart Pads (optimized connections).
void SetSuggestFinish(bool aSuggestFinish)
Return true if Smart Pads (optimized connections) is enabled.
bool SuggestFinish()
Enable displaying suggestions for finishing the currently placed track.
void SetMode(PNS_MODE aMode)
Return the optimizer effort. Bigger means cleaner traces, but slower routing.
void SetAllowDRCViolations(bool aViolate)
void SetJumpOverObstacles(bool aJump)
void SetFreeAngleMode(bool aEnable)
bool GetAllowDRCViolationsSetting() const
PNS_MODE Mode() const
Set the routing mode.
void SetSmartPads(bool aSmartPads)
Return true if follow mouse mode is active (permanently on for the moment).
void SetFixAllSegments(bool aEnable)
void SetRemoveLoops(bool aRemoveLoops)
Return true if suggesting the finish of currently placed track is on.
@ RM_MarkObstacles
Ignore collisions, mark obstacles.
@ RM_Walkaround
Only walk around.
@ RM_Shove
Only shove.