From 84fa4532b97531fba6ca651098b4d121eef403ce Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Mon, 21 Aug 2023 09:36:25 +0200 Subject: [PATCH] DIALOG_EXPORT_STEP: fix some issues: - add missing inits (the zones were never created) - fix a incorrect tool tip - minor enhancements (add afew messages during export) --- pcbnew/dialogs/dialog_export_step.cpp | 2 + pcbnew/dialogs/dialog_export_step_base.cpp | 9 ++- pcbnew/dialogs/dialog_export_step_base.fbp | 84 +++++++++++++++++++++- pcbnew/dialogs/dialog_export_step_base.h | 4 +- pcbnew/exporters/step/step_pcb_model.cpp | 4 ++ 5 files changed, 97 insertions(+), 6 deletions(-) diff --git a/pcbnew/dialogs/dialog_export_step.cpp b/pcbnew/dialogs/dialog_export_step.cpp index 13b3f30867..c733afce67 100644 --- a/pcbnew/dialogs/dialog_export_step.cpp +++ b/pcbnew/dialogs/dialog_export_step.cpp @@ -275,6 +275,7 @@ DIALOG_EXPORT_STEP::~DIALOG_EXPORT_STEP() m_toleranceLastChoice = m_choiceTolerance->GetSelection(); m_exportTracks = m_cbExportTracks->GetValue(); + m_exportZones = m_cbExportZones->GetValue(); } @@ -342,6 +343,7 @@ void DIALOG_EXPORT_STEP::onExportButton( wxCommandEvent& aEvent ) double tolerance; // default value in mm m_toleranceLastChoice = m_choiceTolerance->GetSelection(); m_exportTracks = m_cbExportTracks->GetValue(); + m_exportZones = m_cbExportZones->GetValue(); switch( m_choiceTolerance->GetSelection() ) { diff --git a/pcbnew/dialogs/dialog_export_step_base.cpp b/pcbnew/dialogs/dialog_export_step_base.cpp index e266163533..778985a46e 100644 --- a/pcbnew/dialogs/dialog_export_step_base.cpp +++ b/pcbnew/dialogs/dialog_export_step_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b3) +// C++ code generated with wxFormBuilder (version 3.10.1-282-g1fa54006) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -125,15 +125,18 @@ DIALOG_EXPORT_STEP_BASE::DIALOG_EXPORT_STEP_BASE( wxWindow* parent, wxWindowID i m_cbOverwriteFile = new wxCheckBox( sbOtherOptions->GetStaticBox(), wxID_ANY, _("Overwrite old file"), wxDefaultPosition, wxDefaultSize, 0 ); sbOtherOptions->Add( m_cbOverwriteFile, 0, wxBOTTOM|wxRIGHT, 5 ); + m_staticline1 = new wxStaticLine( sbOtherOptions->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + sbOtherOptions->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 ); + m_cbExportTracks = new wxCheckBox( sbOtherOptions->GetStaticBox(), wxID_ANY, _("Export tracks (time consuming)"), wxDefaultPosition, wxDefaultSize, 0 ); m_cbExportTracks->SetToolTip( _("Export tracks and vias on external copper layers.\nWarning: this is *extremely* time consuming.") ); sbOtherOptions->Add( m_cbExportTracks, 0, wxTOP|wxBOTTOM|wxRIGHT, 5 ); m_cbExportZones = new wxCheckBox( sbOtherOptions->GetStaticBox(), wxID_ANY, _("Export zones (time consuming)"), wxDefaultPosition, wxDefaultSize, 0 ); - m_cbExportZones->SetToolTip( _("Export tracks and vias on external copper layers.\nWarning: this is *extremely* time consuming.") ); + m_cbExportZones->SetToolTip( _("Export zones on external copper layers.\nWarning: this is *extremely* time consuming.") ); - sbOtherOptions->Add( m_cbExportZones, 0, wxBOTTOM|wxRIGHT|wxTOP, 5 ); + sbOtherOptions->Add( m_cbExportZones, 0, wxBOTTOM|wxRIGHT, 5 ); m_staticTextTolerance = new wxStaticText( sbOtherOptions->GetStaticBox(), wxID_ANY, _("Board outline chaining tolerance:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextTolerance->Wrap( -1 ); diff --git a/pcbnew/dialogs/dialog_export_step_base.fbp b/pcbnew/dialogs/dialog_export_step_base.fbp index 891dcf3991..b0f8339b32 100644 --- a/pcbnew/dialogs/dialog_export_step_base.fbp +++ b/pcbnew/dialogs/dialog_export_step_base.fbp @@ -36,6 +36,7 @@ wxBOTH 1 + 0 1 impl_virtual @@ -95,6 +96,7 @@ Dock 0 Left + 0 1 1 @@ -156,6 +158,7 @@ Dock 0 Left + 0 1 1 @@ -244,6 +247,7 @@ Dock 0 Left + 0 1 1 @@ -308,6 +312,7 @@ Dock 0 Left + 0 1 1 @@ -372,6 +377,7 @@ Dock 0 Left + 0 1 1 @@ -436,6 +442,7 @@ Dock 0 Left + 0 1 1 @@ -530,6 +537,7 @@ Dock 0 Left + 0 1 1 @@ -592,6 +600,7 @@ Dock 0 Left + 0 1 1 @@ -656,6 +665,7 @@ Dock 0 Left + 0 1 1 @@ -717,6 +727,7 @@ Dock 0 Left + 0 1 1 @@ -782,6 +793,7 @@ Dock 0 Left + 0 1 1 @@ -843,6 +855,7 @@ Dock 0 Left + 0 1 1 @@ -925,6 +938,7 @@ Dock 0 Left + 0 1 1 @@ -989,6 +1003,7 @@ Dock 0 Left + 0 1 1 @@ -1053,6 +1068,7 @@ Dock 0 Left + 0 1 1 @@ -1117,6 +1133,7 @@ Dock 0 Left + 0 1 1 @@ -1155,6 +1172,65 @@ + + 5 + wxEXPAND | wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_staticline1 + 1 + + + protected + 1 + + Resizable + 1 + + wxLI_HORIZONTAL + ; ; forward_declare + 0 + + + + + + 5 wxTOP|wxBOTTOM|wxRIGHT @@ -1181,6 +1257,7 @@ Dock 0 Left + 0 1 1 @@ -1221,7 +1298,7 @@ 5 - wxBOTTOM|wxRIGHT|wxTOP + wxBOTTOM|wxRIGHT 0 1 @@ -1245,6 +1322,7 @@ Dock 0 Left + 0 1 1 @@ -1273,7 +1351,7 @@ ; ; forward_declare 0 - Export tracks and vias on external copper layers. Warning: this is *extremely* time consuming. + Export zones on external copper layers. Warning: this is *extremely* time consuming. wxFILTER_NONE wxDefaultValidator @@ -1308,6 +1386,7 @@ Dock 0 Left + 0 1 1 @@ -1370,6 +1449,7 @@ Dock 0 Left + 0 1 1 diff --git a/pcbnew/dialogs/dialog_export_step_base.h b/pcbnew/dialogs/dialog_export_step_base.h index 7880fa0bb6..c95ebe1684 100644 --- a/pcbnew/dialogs/dialog_export_step_base.h +++ b/pcbnew/dialogs/dialog_export_step_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b3) +// C++ code generated with wxFormBuilder (version 3.10.1-282-g1fa54006) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -27,6 +27,7 @@ class TEXT_CTRL_EVAL; #include #include #include +#include #include #include @@ -58,6 +59,7 @@ class DIALOG_EXPORT_STEP_BASE : public DIALOG_SHIM wxCheckBox* m_cbRemoveUnspecified; wxCheckBox* m_cbSubstModels; wxCheckBox* m_cbOverwriteFile; + wxStaticLine* m_staticline1; wxCheckBox* m_cbExportTracks; wxCheckBox* m_cbExportZones; wxStaticText* m_staticTextTolerance; diff --git a/pcbnew/exporters/step/step_pcb_model.cpp b/pcbnew/exporters/step/step_pcb_model.cpp index 4d1c8c854e..730524606d 100644 --- a/pcbnew/exporters/step/step_pcb_model.cpp +++ b/pcbnew/exporters/step/step_pcb_model.cpp @@ -642,6 +642,10 @@ bool STEP_PCB_MODEL::CreatePCB( SHAPE_POLY_SET& aOutline, VECTOR2D aOrigin ) int cnt = 0; for( TopoDS_Shape& shape : aShapesList ) { + if( cnt == 0 ) + ReportMessage( wxString::Format( _( "Build holes for %s\n" ), aWhat ) ); + + cnt++; if( cnt % 10 == 0 )