56#define RESOLVE_PAGE( T, pageIndex ) static_cast<T*>( m_treebook->ResolvePage( pageIndex ) )
59 PAGED_DIALOG( aParentWindow ? aParentWindow : aFrame,
_(
"Board Setup" ), false, false,
60 _(
"Import Settings from Another Board..." ), wxSize( 980, 600 ) ),
83 SetEvtHandlerEnabled(
false );
99 [
this]( wxWindow* aParent ) -> wxWindow*
102 },
_(
"Board Editor Layers" ) );
106 [
this]( wxWindow* aParent ) -> wxWindow*
111 },
_(
"Physical Stackup" ) );
115 [
this]( wxWindow* aParent ) -> wxWindow*
118 },
_(
"Board Finish" ) );
122 [
this]( wxWindow* aParent ) -> wxWindow*
125 },
_(
"Solder Mask/Paste" ) );
131 [
this]( wxWindow* aParent ) -> wxWindow*
134 },
_(
"Defaults" ) );
138 [
this]( wxWindow* aParent ) -> wxWindow*
141 },
_(
"Formatting" ) );
144 [
this]( wxWindow* aParent ) -> wxWindow*
147 },
_(
"Text Variables" ) );
153 [
this]( wxWindow* aParent ) -> wxWindow*
156 },
_(
"Constraints" ) );
160 [
this]( wxWindow* aParent ) -> wxWindow*
163 },
_(
"Pre-defined Sizes" ) );
167 [
this]( wxWindow* aParent ) -> wxWindow*
170 },
_(
"Teardrops" ) );
174 [
this]( wxWindow* aParent ) -> wxWindow*
182 },
_(
"Length-tuning Patterns" ) );
186 [
this]( wxWindow* aParent ) -> wxWindow*
190 m_frame->Prj().GetProjectFile().NetSettings(),
193 },
_(
"Net Classes" ) );
197 [
this]( wxWindow* aParent ) -> wxWindow*
201 aParent,
m_frame,
m_frame->Prj().GetProjectFile().ComponentClassSettings(),
204 _(
"Component Classes" ) );
208 [
this]( wxWindow* aParent ) -> wxWindow*
212 aParent,
m_frame, board,
m_frame->Prj().GetProjectFile().TimeDomainParameters() );
214 _(
"Time Domain Parameters" ) );
218 [
this]( wxWindow* aParent ) -> wxWindow*
222 _(
"Custom Rules" ) );
226 [
this]( wxWindow* aParent ) -> wxWindow*
232 _(
"Violation Severity" ) );
237 [
this]( wxWindow* aParent ) -> wxWindow*
241 _(
"Embedded Files" ) );
243 for(
size_t i = 0; i <
m_treebook->GetPageCount(); ++i )
246 SetEvtHandlerEnabled(
true );
250 if(
Prj().IsReadOnly() )
252 m_infoBar->ShowMessage(
_(
"Project is missing or read-only. Some settings will not "
257 wxBookCtrlEvent evt( wxEVT_TREEBOOK_PAGE_CHANGED, wxID_ANY, 0 );
272 size_t page = aEvent.GetSelection();
307 if(
Prj().IsReadOnly() )
321 if( importDlg.
ShowModal() == wxID_CANCEL )
325 wxFileName projectFn( boardFn );
329 if( !
m_frame->GetSettingsManager()->LoadProject( projectFn.GetFullPath(),
false ) )
331 wxString msg = wxString::Format(
_(
"Error importing settings from board:\n"
332 "Associated project file %s could not be loaded" ),
333 projectFn.GetFullPath() );
345 bool okToProceed =
true;
347 PROJECT* otherPrj =
m_frame->GetSettingsManager()->GetProject( projectFn.GetFullPath() );
350 BOARD* otherBoard =
nullptr;
356 pi->SetProgressReporter( &progressReporter );
358 otherBoard = pi->LoadBoard( boardFn.GetFullPath(),
nullptr );
365 okToProceed =
m_layers->CheckCopperLayerCount( loadedBoard, otherBoard );
375 if( ioe.
Problem() != wxT(
"CANCEL" ) )
377 wxString msg = wxString::Format(
_(
"Error loading board file:\n%s" ),
378 boardFn.GetFullPath() );
382 if( otherPrj != &
m_frame->Prj() )
383 m_frame->GetSettingsManager()->UnloadProject( otherPrj,
false );
403 m_layers->ImportSettingsFrom( otherBoard );
487 if( otherPrj != &
m_frame->Prj() )
492 if( otherPrj != &
m_frame->Prj() )
493 m_frame->GetSettingsManager()->UnloadProject( otherPrj,
false );
Container for design settings for a BOARD object.
std::map< int, SEVERITY > m_DRCSeverities
PNS::MEANDER_SETTINGS m_DiffPairMeanderSettings
PNS::MEANDER_SETTINGS m_SingleTrackMeanderSettings
PNS::MEANDER_SETTINGS m_SkewMeanderSettings
Information pertinent to a Pcbnew printed circuit board.
std::set< wxString > GetNetClassAssignmentCandidates() const
Return the set of netname candidates for netclass assignment.
void SetProject(PROJECT *aProject, bool aReferenceOnly=false)
Link a board to a given project.
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
size_t m_embeddedFilesPage
DIALOG_BOARD_SETUP(PCB_EDIT_FRAME *aFrame, wxWindow *aWindow=nullptr)
size_t m_tracksAndViasPage
size_t m_textAndGraphicsPage
size_t m_physicalStackupPage
void onAuxiliaryAction(wxCommandEvent &aEvent) override
size_t m_tuningPatternsPage
PANEL_SETUP_BOARD_STACKUP * m_physicalStackup
PANEL_SETUP_BOARD_FINISH * m_boardFinish
PANEL_SETUP_LAYERS * m_layers
PANEL_SETUP_TIME_DOMAIN_PARAMETERS * m_timeDomainParameters
size_t m_componentClassesPage
size_t m_timeDomainParametersPage
void onPageChanged(wxBookCtrlEvent &aEvent) override
PANEL_SETUP_NETCLASSES * m_netClasses
wxCheckBox * m_CustomRulesOpt
wxCheckBox * m_MaskAndPasteOpt
wxCheckBox * m_ConstraintsOpt
wxCheckBox * m_ComponentClassesOpt
wxCheckBox * m_TuningPatternsOpt
wxCheckBox * m_SeveritiesOpt
wxCheckBox * m_TextAndGraphicsOpt
wxCheckBox * m_FormattingOpt
wxCheckBox * m_TeardropsOpt
wxCheckBox * m_TimeDomainParametersOpt
wxCheckBox * m_TracksAndViasOpt
wxCheckBox * m_NetclassesOpt
void finishDialogSettings()
In all dialogs, we must call the same functions to fix minimal dlg size, the default position and per...
static std::vector< std::reference_wrapper< RC_ITEM > > GetItemsWithSeverities()
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
virtual const wxString What() const
A composite of Problem() and Where()
virtual const wxString Problem() const
what was the problem?
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
WX_TREEBOOK * GetTreebook()
PAGED_DIALOG(wxWindow *aParent, const wxString &aTitle, bool aShowReset, bool aShowOpenFolder, const wxString &aAuxiliaryAction=wxEmptyString, const wxSize &aInitialSize=wxDefaultSize)
virtual void onPageChanged(wxBookCtrlEvent &aEvent)
The main frame for Pcbnew.
static PCB_IO * PluginFind(PCB_FILE_T aFileType)
Return a #PLUGIN which the caller can use to import, export, save, or load design documents.
@ KICAD_SEXP
S-expression Pcbnew file format.
The backing store for a PROJECT, in JSON format.
std::shared_ptr< NET_SETTINGS > m_NetSettings
Net settings for this project (owned here)
std::shared_ptr< TIME_DOMAIN_PARAMETERS > & TimeDomainParameters()
std::shared_ptr< COMPONENT_CLASS_SETTINGS > m_ComponentClassSettings
Component class settings for the project (owned here)
Container for project specific data.
virtual PROJECT_FILE & GetProjectFile() const
Multi-thread safe progress reporter dialog, intended for use of tasks that parallel reporting back of...
void DisplayErrorMessage(wxWindow *aParent, const wxString &aText, const wxString &aExtraInfo)
Display an error message with aMessage.
This file is part of the common library.
#define RESOLVE_PAGE(T, pageIndex)
static const std::string ProjectFileExtension
std::unique_ptr< T > IO_RELEASER
Helper to hold and release an IO_BASE object when exceptions are thrown.
KICOMMON_API void Disable(wxWindow *aWindow)
Makes a window read-only.
Definition of file extensions used in Kicad.