mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-04-21 22:13:44 +00:00
Push PCB_IOs to use the base progress reporter instead of per-function
This commit is contained in:
parent
4a67761d29
commit
d7fe668d79
pcbnew
dialogs
files.cppkicad_clipboard.cppkicad_clipboard.hpcb_io
altium
pcb_io_altium_circuit_maker.cpppcb_io_altium_circuit_maker.hpcb_io_altium_circuit_studio.cpppcb_io_altium_circuit_studio.hpcb_io_altium_designer.cpppcb_io_altium_designer.hpcb_io_solidworks.cpppcb_io_solidworks.h
cadstar
eagle
easyeda
easyedapro
fabmaster
ipc2581
kicad_legacy
kicad_sexpr
pcad
pcb_io.cpppcb_io.hpcb_io_mgr.cpptools
@ -291,8 +291,9 @@ void DIALOG_BOARD_SETUP::onAuxiliaryAction( wxCommandEvent& aEvent )
|
||||
{
|
||||
WX_PROGRESS_REPORTER progressReporter( this, _( "Loading PCB" ), 1 );
|
||||
|
||||
otherBoard = pi->LoadBoard( boardFn.GetFullPath(), nullptr, nullptr, nullptr,
|
||||
&progressReporter );
|
||||
pi->SetProgressReporter( &progressReporter );
|
||||
|
||||
otherBoard = pi->LoadBoard( boardFn.GetFullPath(), nullptr );
|
||||
|
||||
if( importDlg.m_LayersOpt->GetValue() )
|
||||
{
|
||||
|
@ -675,7 +675,8 @@ bool PCB_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, in
|
||||
unsigned startTime = GetRunningMicroSecs();
|
||||
#endif
|
||||
|
||||
loadedBoard = pi->LoadBoard( fullFileName, nullptr, &props, &Prj(), &progressReporter );
|
||||
pi->SetProgressReporter( &progressReporter );
|
||||
loadedBoard = pi->LoadBoard( fullFileName, nullptr, &props, &Prj() );
|
||||
|
||||
#if USE_INSTRUMENTATION
|
||||
unsigned stopTime = GetRunningMicroSecs();
|
||||
@ -1273,8 +1274,8 @@ void PCB_EDIT_FRAME::GenIPC2581File( wxCommandEvent& event )
|
||||
try
|
||||
{
|
||||
PCB_IO::RELEASER pi( PCB_IO_MGR::PluginFind( PCB_IO_MGR::IPC2581 ) );
|
||||
|
||||
pi->SaveBoard( tempFile, GetBoard(), &props, &reporter );
|
||||
pi->SetProgressReporter( &reporter );
|
||||
pi->SaveBoard( tempFile, GetBoard(), &props );
|
||||
return true;
|
||||
}
|
||||
catch( const IO_ERROR& ioe )
|
||||
|
@ -330,8 +330,7 @@ BOARD_ITEM* CLIPBOARD_IO::Parse()
|
||||
|
||||
|
||||
void CLIPBOARD_IO::SaveBoard( const wxString& aFileName, BOARD* aBoard,
|
||||
const STRING_UTF8_MAP* aProperties,
|
||||
PROGRESS_REPORTER* aProgressReporter )
|
||||
const STRING_UTF8_MAP* aProperties )
|
||||
{
|
||||
init( aProperties );
|
||||
|
||||
@ -376,8 +375,7 @@ void CLIPBOARD_IO::SaveBoard( const wxString& aFileName, BOARD* aBoard,
|
||||
|
||||
|
||||
BOARD* CLIPBOARD_IO::LoadBoard( const wxString& aFileName, BOARD* aAppendToMe,
|
||||
const STRING_UTF8_MAP* aProperties, PROJECT* aProject,
|
||||
PROGRESS_REPORTER* aProgressReporter )
|
||||
const STRING_UTF8_MAP* aProperties, PROJECT* aProject )
|
||||
{
|
||||
std::string result;
|
||||
|
||||
|
@ -48,8 +48,7 @@ public:
|
||||
* Saves the entire board to the clipboard formatted using the PCB_IO_KICAD_SEXPR formatting
|
||||
*/
|
||||
void SaveBoard( const wxString& aFileName, BOARD* aBoard,
|
||||
const STRING_UTF8_MAP* aProperties = nullptr,
|
||||
PROGRESS_REPORTER* aProgressReporter = nullptr ) override;
|
||||
const STRING_UTF8_MAP* aProperties = nullptr ) override;
|
||||
|
||||
/*
|
||||
* Write all the settings of the BOARD* set by setBoard() and then adds all the
|
||||
@ -60,8 +59,7 @@ public:
|
||||
BOARD_ITEM* Parse();
|
||||
|
||||
BOARD* LoadBoard( const wxString& aFileName, BOARD* aAppendToMe,
|
||||
const STRING_UTF8_MAP* aProperties = nullptr, PROJECT* aProject = nullptr,
|
||||
PROGRESS_REPORTER* aProgressReporter = nullptr ) override;
|
||||
const STRING_UTF8_MAP* aProperties = nullptr, PROJECT* aProject = nullptr ) override;
|
||||
|
||||
void SetBoard( BOARD* aBoard );
|
||||
|
||||
|
@ -60,8 +60,7 @@ bool PCB_IO_ALTIUM_CIRCUIT_MAKER::CanReadBoard( const wxString& aFileName ) cons
|
||||
|
||||
BOARD* PCB_IO_ALTIUM_CIRCUIT_MAKER::LoadBoard( const wxString& aFileName, BOARD* aAppendToMe,
|
||||
const STRING_UTF8_MAP* aProperties,
|
||||
PROJECT* aProject,
|
||||
PROGRESS_REPORTER* aProgressReporter )
|
||||
PROJECT* aProject )
|
||||
{
|
||||
m_props = aProperties;
|
||||
|
||||
@ -101,7 +100,7 @@ BOARD* PCB_IO_ALTIUM_CIRCUIT_MAKER::LoadBoard( const wxString& aFileName, BOARD*
|
||||
try
|
||||
{
|
||||
// Parse File
|
||||
ALTIUM_PCB pcb( m_board, aProgressReporter );
|
||||
ALTIUM_PCB pcb( m_board, m_progressReporter );
|
||||
pcb.Parse( altiumPcbFile, mapping );
|
||||
}
|
||||
catch( CFB::CFBException& exception )
|
||||
|
@ -46,8 +46,7 @@ public:
|
||||
bool CanReadBoard( const wxString& aFileName ) const override;
|
||||
|
||||
BOARD* LoadBoard( const wxString& aFileName, BOARD* aAppendToMe,
|
||||
const STRING_UTF8_MAP* aProperties, PROJECT* aProject = nullptr,
|
||||
PROGRESS_REPORTER* aProgressReporter = nullptr ) override;
|
||||
const STRING_UTF8_MAP* aProperties, PROJECT* aProject = nullptr ) override;
|
||||
|
||||
long long GetLibraryTimestamp( const wxString& aLibraryPath ) const override
|
||||
{
|
||||
|
@ -60,8 +60,7 @@ bool PCB_IO_ALTIUM_CIRCUIT_STUDIO::CanReadBoard( const wxString& aFileName ) con
|
||||
|
||||
BOARD* PCB_IO_ALTIUM_CIRCUIT_STUDIO::LoadBoard( const wxString& aFileName, BOARD* aAppendToMe,
|
||||
const STRING_UTF8_MAP* aProperties,
|
||||
PROJECT* aProject,
|
||||
PROGRESS_REPORTER* aProgressReporter )
|
||||
PROJECT* aProject )
|
||||
{
|
||||
m_props = aProperties;
|
||||
|
||||
@ -101,7 +100,7 @@ BOARD* PCB_IO_ALTIUM_CIRCUIT_STUDIO::LoadBoard( const wxString& aFileName, BOARD
|
||||
try
|
||||
{
|
||||
// Parse File
|
||||
ALTIUM_PCB pcb( m_board, aProgressReporter );
|
||||
ALTIUM_PCB pcb( m_board, m_progressReporter );
|
||||
pcb.Parse( altiumPcbFile, mapping );
|
||||
}
|
||||
catch( CFB::CFBException& exception )
|
||||
|
@ -45,8 +45,7 @@ public:
|
||||
bool CanReadBoard( const wxString& aFileName ) const override;
|
||||
|
||||
BOARD* LoadBoard( const wxString& aFileName, BOARD* aAppendToMe,
|
||||
const STRING_UTF8_MAP* aProperties, PROJECT* aProject,
|
||||
PROGRESS_REPORTER* aProgressReporter = nullptr ) override;
|
||||
const STRING_UTF8_MAP* aProperties, PROJECT* aProject ) override;
|
||||
|
||||
long long GetLibraryTimestamp( const wxString& aLibraryPath ) const override
|
||||
{
|
||||
|
@ -75,8 +75,7 @@ bool PCB_IO_ALTIUM_DESIGNER::CanReadLibrary( const wxString& aFileName ) const
|
||||
|
||||
|
||||
BOARD* PCB_IO_ALTIUM_DESIGNER::LoadBoard( const wxString& aFileName, BOARD* aAppendToMe,
|
||||
const STRING_UTF8_MAP* aProperties, PROJECT* aProject,
|
||||
PROGRESS_REPORTER* aProgressReporter )
|
||||
const STRING_UTF8_MAP* aProperties, PROJECT* aProject )
|
||||
{
|
||||
m_props = aProperties;
|
||||
|
||||
@ -117,7 +116,7 @@ BOARD* PCB_IO_ALTIUM_DESIGNER::LoadBoard( const wxString& aFileName, BOARD* aApp
|
||||
try
|
||||
{
|
||||
// Parse File
|
||||
ALTIUM_PCB pcb( m_board, aProgressReporter );
|
||||
ALTIUM_PCB pcb( m_board, m_progressReporter );
|
||||
pcb.Parse( altiumPcbFile, mapping );
|
||||
}
|
||||
catch( CFB::CFBException& exception )
|
||||
|
@ -52,8 +52,7 @@ public:
|
||||
bool CanReadLibrary( const wxString& aFileName ) const override;
|
||||
|
||||
BOARD* LoadBoard( const wxString& aFileName, BOARD* aAppendToMe,
|
||||
const STRING_UTF8_MAP* aProperties, PROJECT* aProject = nullptr,
|
||||
PROGRESS_REPORTER* aProgressReporter = nullptr ) override;
|
||||
const STRING_UTF8_MAP* aProperties, PROJECT* aProject = nullptr ) override;
|
||||
|
||||
long long GetLibraryTimestamp( const wxString& aLibraryPath ) const override;
|
||||
|
||||
|
@ -50,8 +50,7 @@ bool PCB_IO_SOLIDWORKS::CanReadBoard( const wxString& aFileName ) const
|
||||
|
||||
|
||||
BOARD* PCB_IO_SOLIDWORKS::LoadBoard( const wxString& aFileName, BOARD* aAppendToMe,
|
||||
const STRING_UTF8_MAP* aProperties, PROJECT* aProject,
|
||||
PROGRESS_REPORTER* aProgressReporter )
|
||||
const STRING_UTF8_MAP* aProperties, PROJECT* aProject )
|
||||
{
|
||||
m_props = aProperties;
|
||||
|
||||
@ -120,7 +119,7 @@ BOARD* PCB_IO_SOLIDWORKS::LoadBoard( const wxString& aFileName, BOARD* aAppendTo
|
||||
try
|
||||
{
|
||||
// Parse File
|
||||
ALTIUM_PCB pcb( m_board, aProgressReporter );
|
||||
ALTIUM_PCB pcb( m_board, m_progressReporter );
|
||||
pcb.Parse( altiumPcbFile, mapping );
|
||||
}
|
||||
catch( CFB::CFBException& exception )
|
||||
|
@ -40,8 +40,7 @@ public:
|
||||
bool CanReadBoard( const wxString& aFileName ) const override;
|
||||
|
||||
BOARD* LoadBoard( const wxString& aFileName, BOARD* aAppendToMe,
|
||||
const STRING_UTF8_MAP* aProperties, PROJECT* aProject = nullptr,
|
||||
PROGRESS_REPORTER* aProgressReporter = nullptr ) override;
|
||||
const STRING_UTF8_MAP* aProperties, PROJECT* aProject = nullptr ) override;
|
||||
|
||||
long long GetLibraryTimestamp( const wxString& aLibraryPath ) const override
|
||||
{
|
||||
|
@ -94,15 +94,14 @@ std::vector<FOOTPRINT*> PCB_IO_CADSTAR_ARCHIVE::GetImportedCachedLibraryFootprin
|
||||
|
||||
|
||||
BOARD* PCB_IO_CADSTAR_ARCHIVE::LoadBoard( const wxString& aFileName, BOARD* aAppendToMe,
|
||||
const STRING_UTF8_MAP* aProperties, PROJECT* aProject,
|
||||
PROGRESS_REPORTER* aProgressReporter )
|
||||
const STRING_UTF8_MAP* aProperties, PROJECT* aProject )
|
||||
{
|
||||
m_props = aProperties;
|
||||
m_board = aAppendToMe ? aAppendToMe : new BOARD();
|
||||
clearLoadedFootprints();
|
||||
|
||||
CADSTAR_PCB_ARCHIVE_LOADER tempPCB( aFileName, m_layer_mapping_handler,
|
||||
m_show_layer_mapping_warnings, aProgressReporter );
|
||||
m_show_layer_mapping_warnings, m_progressReporter );
|
||||
tempPCB.Load( m_board, aProject );
|
||||
|
||||
//center the board:
|
||||
|
@ -44,8 +44,7 @@ public:
|
||||
bool CanReadFootprint( const wxString& aFileName ) const override;
|
||||
|
||||
BOARD* LoadBoard( const wxString& aFileName, BOARD* aAppendToMe,
|
||||
const STRING_UTF8_MAP* aProperties = nullptr, PROJECT* aProject = nullptr,
|
||||
PROGRESS_REPORTER* aProgressReporter = nullptr ) override;
|
||||
const STRING_UTF8_MAP* aProperties = nullptr, PROJECT* aProject = nullptr ) override;
|
||||
|
||||
std::vector<FOOTPRINT*> GetImportedCachedLibraryFootprints() override;
|
||||
|
||||
|
@ -321,8 +321,7 @@ VECTOR2I inline PCB_IO_EAGLE::kicad_fontsize( const ECOORD& d, int aTextThicknes
|
||||
|
||||
|
||||
BOARD* PCB_IO_EAGLE::LoadBoard( const wxString& aFileName, BOARD* aAppendToMe,
|
||||
const STRING_UTF8_MAP* aProperties, PROJECT* aProject,
|
||||
PROGRESS_REPORTER* aProgressReporter )
|
||||
const STRING_UTF8_MAP* aProperties, PROJECT* aProject )
|
||||
{
|
||||
LOCALE_IO toggle; // toggles on, then off, the C locale.
|
||||
wxXmlNode* doc;
|
||||
@ -330,7 +329,6 @@ BOARD* PCB_IO_EAGLE::LoadBoard( const wxString& aFileName, BOARD* aAppendToMe,
|
||||
init( aProperties );
|
||||
|
||||
m_board = aAppendToMe ? aAppendToMe : new BOARD();
|
||||
m_progressReporter = aProgressReporter;
|
||||
|
||||
// Give the filename to the board if it's new
|
||||
if( !aAppendToMe )
|
||||
|
@ -146,8 +146,7 @@ public:
|
||||
bool CanReadFootprint( const wxString& aFileName ) const override;
|
||||
|
||||
BOARD* LoadBoard( const wxString& aFileName, BOARD* aAppendToMe,
|
||||
const STRING_UTF8_MAP* aProperties = nullptr, PROJECT* aProject = nullptr,
|
||||
PROGRESS_REPORTER* aProgressReporter = nullptr ) override;
|
||||
const STRING_UTF8_MAP* aProperties = nullptr, PROJECT* aProject = nullptr ) override;
|
||||
|
||||
std::vector<FOOTPRINT*> GetImportedCachedLibraryFootprints() override;
|
||||
|
||||
|
@ -133,8 +133,7 @@ bool PCB_IO_EASYEDA::CanReadLibrary( const wxString& aFileName ) const
|
||||
|
||||
|
||||
BOARD* PCB_IO_EASYEDA::LoadBoard( const wxString& aFileName, BOARD* aAppendToMe,
|
||||
const STRING_UTF8_MAP* aProperties, PROJECT* aProject,
|
||||
PROGRESS_REPORTER* aProgressReporter )
|
||||
const STRING_UTF8_MAP* aProperties, PROJECT* aProject )
|
||||
{
|
||||
m_loadedFootprints.clear();
|
||||
|
||||
@ -145,11 +144,11 @@ BOARD* PCB_IO_EASYEDA::LoadBoard( const wxString& aFileName, BOARD* aAppendToMe,
|
||||
if( !aAppendToMe )
|
||||
m_board->SetFileName( aFileName );
|
||||
|
||||
if( aProgressReporter )
|
||||
if( m_progressReporter )
|
||||
{
|
||||
aProgressReporter->Report( wxString::Format( _( "Loading %s..." ), aFileName ) );
|
||||
m_progressReporter->Report( wxString::Format( _( "Loading %s..." ), aFileName ) );
|
||||
|
||||
if( !aProgressReporter->KeepRefreshing() )
|
||||
if( !m_progressReporter->KeepRefreshing() )
|
||||
THROW_IO_ERROR( _( "Open cancelled by user." ) );
|
||||
}
|
||||
|
||||
|
@ -48,8 +48,7 @@ public:
|
||||
bool CanReadLibrary( const wxString& aFileName ) const override;
|
||||
|
||||
BOARD* LoadBoard( const wxString& aFileName, BOARD* aAppendToMe,
|
||||
const STRING_UTF8_MAP* aProperties = nullptr, PROJECT* aProject = nullptr,
|
||||
PROGRESS_REPORTER* aProgressReporter = nullptr ) override;
|
||||
const STRING_UTF8_MAP* aProperties = nullptr, PROJECT* aProject = nullptr ) override;
|
||||
|
||||
long long GetLibraryTimestamp( const wxString& aLibraryPath ) const override;
|
||||
|
||||
|
@ -98,8 +98,7 @@ bool PCB_IO_EASYEDAPRO::CanReadBoard( const wxString& aFileName ) const
|
||||
|
||||
|
||||
BOARD* PCB_IO_EASYEDAPRO::LoadBoard( const wxString& aFileName, BOARD* aAppendToMe,
|
||||
const STRING_UTF8_MAP* aProperties, PROJECT* aProject,
|
||||
PROGRESS_REPORTER* aProgressReporter )
|
||||
const STRING_UTF8_MAP* aProperties, PROJECT* aProject )
|
||||
{
|
||||
m_props = aProperties;
|
||||
|
||||
@ -109,11 +108,11 @@ BOARD* PCB_IO_EASYEDAPRO::LoadBoard( const wxString& aFileName, BOARD* aAppendTo
|
||||
if( !aAppendToMe )
|
||||
m_board->SetFileName( aFileName );
|
||||
|
||||
if( aProgressReporter )
|
||||
if( m_progressReporter )
|
||||
{
|
||||
aProgressReporter->Report( wxString::Format( _( "Loading %s..." ), aFileName ) );
|
||||
m_progressReporter->Report( wxString::Format( _( "Loading %s..." ), aFileName ) );
|
||||
|
||||
if( !aProgressReporter->KeepRefreshing() )
|
||||
if( !m_progressReporter->KeepRefreshing() )
|
||||
THROW_IO_ERROR( _( "Open cancelled by user." ) );
|
||||
}
|
||||
|
||||
|
@ -55,8 +55,7 @@ public:
|
||||
bool CanReadBoard( const wxString& aFileName ) const override;
|
||||
|
||||
BOARD* LoadBoard( const wxString& aFileName, BOARD* aAppendToMe,
|
||||
const STRING_UTF8_MAP* aProperties = nullptr, PROJECT* aProject = nullptr,
|
||||
PROGRESS_REPORTER* aProgressReporter = nullptr ) override;
|
||||
const STRING_UTF8_MAP* aProperties = nullptr, PROJECT* aProject = nullptr ) override;
|
||||
|
||||
long long GetLibraryTimestamp( const wxString& aLibraryPath ) const override;
|
||||
|
||||
|
@ -44,8 +44,7 @@ PCB_IO_FABMASTER::~PCB_IO_FABMASTER()
|
||||
|
||||
|
||||
BOARD* PCB_IO_FABMASTER::LoadBoard( const wxString& aFileName, BOARD* aAppendToMe,
|
||||
const STRING_UTF8_MAP* aProperties, PROJECT* aProject,
|
||||
PROGRESS_REPORTER* aProgressReporter )
|
||||
const STRING_UTF8_MAP* aProperties, PROJECT* aProject )
|
||||
{
|
||||
m_props = aProperties;
|
||||
|
||||
@ -55,11 +54,11 @@ BOARD* PCB_IO_FABMASTER::LoadBoard( const wxString& aFileName, BOARD* aAppendToM
|
||||
if( !aAppendToMe )
|
||||
m_board->SetFileName( aFileName );
|
||||
|
||||
if( aProgressReporter )
|
||||
if( m_progressReporter )
|
||||
{
|
||||
aProgressReporter->Report( wxString::Format( _( "Loading %s..." ), aFileName ) );
|
||||
m_progressReporter->Report( wxString::Format( _( "Loading %s..." ), aFileName ) );
|
||||
|
||||
if( !aProgressReporter->KeepRefreshing() )
|
||||
if( !m_progressReporter->KeepRefreshing() )
|
||||
THROW_IO_ERROR( _( "Open cancelled by user." ) );
|
||||
}
|
||||
|
||||
@ -72,7 +71,7 @@ BOARD* PCB_IO_FABMASTER::LoadBoard( const wxString& aFileName, BOARD* aAppendToM
|
||||
}
|
||||
|
||||
m_fabmaster.Process();
|
||||
m_fabmaster.LoadBoard( m_board, aProgressReporter );
|
||||
m_fabmaster.LoadBoard( m_board, m_progressReporter );
|
||||
|
||||
return m_board;
|
||||
}
|
||||
|
@ -45,8 +45,7 @@ public:
|
||||
}
|
||||
|
||||
BOARD* LoadBoard( const wxString& aFileName, BOARD* aAppendToMe,
|
||||
const STRING_UTF8_MAP* aProperties = nullptr, PROJECT* aProject = nullptr,
|
||||
PROGRESS_REPORTER* aProgressReporter = nullptr ) override;
|
||||
const STRING_UTF8_MAP* aProperties = nullptr, PROJECT* aProject = nullptr ) override;
|
||||
|
||||
long long GetLibraryTimestamp( const wxString& aLibraryPath ) const override
|
||||
{
|
||||
|
@ -301,8 +301,8 @@ wxXmlNode* PCB_IO_IPC2581::generateXmlHeader()
|
||||
|
||||
wxXmlNode* PCB_IO_IPC2581::generateContentSection()
|
||||
{
|
||||
if( m_progress_reporter )
|
||||
m_progress_reporter->AdvancePhase( _( "Generating content section" ) );
|
||||
if( m_progressReporter )
|
||||
m_progressReporter->AdvancePhase( _( "Generating content section" ) );
|
||||
|
||||
wxXmlNode* contentNode = appendNode( m_xml_root, "Content" );
|
||||
addAttribute( contentNode, "roleRef", "Owner" );
|
||||
@ -1116,8 +1116,8 @@ wxXmlNode* PCB_IO_IPC2581::generateLogisticSection()
|
||||
|
||||
wxXmlNode* PCB_IO_IPC2581::generateHistorySection()
|
||||
{
|
||||
if( m_progress_reporter )
|
||||
m_progress_reporter->AdvancePhase( _( "Generating history section" ) );
|
||||
if( m_progressReporter )
|
||||
m_progressReporter->AdvancePhase( _( "Generating history section" ) );
|
||||
|
||||
wxXmlNode* historyNode = appendNode( m_xml_root, "HistoryRecord" );
|
||||
addAttribute( historyNode, "number", "1" );
|
||||
@ -1143,8 +1143,8 @@ wxXmlNode* PCB_IO_IPC2581::generateHistorySection()
|
||||
|
||||
wxXmlNode* PCB_IO_IPC2581::generateBOMSection( wxXmlNode* aEcadNode )
|
||||
{
|
||||
if( m_progress_reporter )
|
||||
m_progress_reporter->AdvancePhase( _( "Generating BOM section" ) );
|
||||
if( m_progressReporter )
|
||||
m_progressReporter->AdvancePhase( _( "Generating BOM section" ) );
|
||||
|
||||
struct REFDES
|
||||
{
|
||||
@ -1307,8 +1307,8 @@ wxXmlNode* PCB_IO_IPC2581::generateBOMSection( wxXmlNode* aEcadNode )
|
||||
|
||||
wxXmlNode* PCB_IO_IPC2581::generateEcadSection()
|
||||
{
|
||||
if( m_progress_reporter )
|
||||
m_progress_reporter->AdvancePhase( _( "Generating CAD data" ) );
|
||||
if( m_progressReporter )
|
||||
m_progressReporter->AdvancePhase( _( "Generating CAD data" ) );
|
||||
|
||||
wxXmlNode* ecadNode = appendNode( m_xml_root, "Ecad" );
|
||||
addAttribute( ecadNode, "name", "Design" );
|
||||
@ -2339,20 +2339,20 @@ void PCB_IO_IPC2581::generateLayerFeatures( wxXmlNode* aStepNode )
|
||||
|
||||
for( PCB_LAYER_ID layer : layers )
|
||||
{
|
||||
if( m_progress_reporter )
|
||||
m_progress_reporter->SetMaxProgress( nets.GetNetCount() * layers.size() );
|
||||
if( m_progressReporter )
|
||||
m_progressReporter->SetMaxProgress( nets.GetNetCount() * layers.size() );
|
||||
|
||||
wxXmlNode* layerNode = appendNode( aStepNode, "LayerFeature" );
|
||||
addAttribute( layerNode, "layerRef", m_layer_name_map[layer] );
|
||||
|
||||
for( const NETINFO_ITEM* net : nets )
|
||||
{
|
||||
if( m_progress_reporter )
|
||||
if( m_progressReporter )
|
||||
{
|
||||
m_progress_reporter->Report( wxString::Format( _( "Exporting Layer %s, Net %s" ),
|
||||
m_progressReporter->Report( wxString::Format( _( "Exporting Layer %s, Net %s" ),
|
||||
m_board->GetLayerName( layer ),
|
||||
net->GetNetname() ) );
|
||||
m_progress_reporter->AdvanceProgress();
|
||||
m_progressReporter->AdvanceProgress();
|
||||
}
|
||||
|
||||
std::vector<BOARD_ITEM*>& vec = elements[layer][net->GetNetCode()];
|
||||
@ -2735,8 +2735,8 @@ void PCB_IO_IPC2581::generateLayerSetNet( wxXmlNode* aLayerNode, PCB_LAYER_ID aL
|
||||
|
||||
wxXmlNode* PCB_IO_IPC2581::generateAvlSection()
|
||||
{
|
||||
if( m_progress_reporter )
|
||||
m_progress_reporter->AdvancePhase( _( "Generating BOM section" ) );
|
||||
if( m_progressReporter )
|
||||
m_progressReporter->AdvancePhase( _( "Generating BOM section" ) );
|
||||
|
||||
wxXmlNode* avl = appendNode( m_xml_root, "Avl" );
|
||||
addAttribute( avl, "name", "Primary_Vendor_List" );
|
||||
@ -2827,14 +2827,12 @@ wxXmlNode* PCB_IO_IPC2581::generateAvlSection()
|
||||
|
||||
|
||||
void PCB_IO_IPC2581::SaveBoard( const wxString& aFileName, BOARD* aBoard,
|
||||
const STRING_UTF8_MAP* aProperties,
|
||||
PROGRESS_REPORTER* aProgressReporter )
|
||||
const STRING_UTF8_MAP* aProperties )
|
||||
{
|
||||
m_board = aBoard;
|
||||
m_units_str = "MILLIMETER";
|
||||
m_scale = 1.0 / PCB_IU_PER_MM;
|
||||
m_sigfig = 4;
|
||||
m_progress_reporter = aProgressReporter;
|
||||
|
||||
if( auto it = aProperties->find( "units" ); it != aProperties->end() )
|
||||
{
|
||||
@ -2889,11 +2887,11 @@ void PCB_IO_IPC2581::SaveBoard( const wxString& aFileName, BOARD* aBoard,
|
||||
|
||||
generateContentSection();
|
||||
|
||||
if( m_progress_reporter )
|
||||
if( m_progressReporter )
|
||||
{
|
||||
m_progress_reporter->SetNumPhases( 7 );
|
||||
m_progress_reporter->BeginPhase( 1 );
|
||||
m_progress_reporter->Report( _( "Generating logistic section" ) );
|
||||
m_progressReporter->SetNumPhases( 7 );
|
||||
m_progressReporter->BeginPhase( 1 );
|
||||
m_progressReporter->Report( _( "Generating logistic section" ) );
|
||||
}
|
||||
|
||||
generateLogisticSection();
|
||||
@ -2903,9 +2901,9 @@ void PCB_IO_IPC2581::SaveBoard( const wxString& aFileName, BOARD* aBoard,
|
||||
generateBOMSection( ecad_node );
|
||||
generateAvlSection();
|
||||
|
||||
if( m_progress_reporter )
|
||||
if( m_progressReporter )
|
||||
{
|
||||
m_progress_reporter->AdvancePhase( _( "Saving file" ) );
|
||||
m_progressReporter->AdvancePhase( _( "Saving file" ) );
|
||||
}
|
||||
|
||||
wxFileOutputStreamWithProgress out_stream( aFileName );
|
||||
@ -2922,13 +2920,13 @@ void PCB_IO_IPC2581::SaveBoard( const wxString& aFileName, BOARD* aBoard,
|
||||
written_bytes += aBytes;
|
||||
double percent = written_bytes / static_cast<double>( m_total_bytes );
|
||||
|
||||
if( m_progress_reporter )
|
||||
if( m_progressReporter )
|
||||
{
|
||||
// Only update every percent
|
||||
if( last_yield + 0.01 < percent )
|
||||
{
|
||||
last_yield = percent;
|
||||
m_progress_reporter->SetCurrentProgress( percent );
|
||||
m_progressReporter->SetCurrentProgress( percent );
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -78,12 +78,10 @@ public:
|
||||
*
|
||||
*/
|
||||
// BOARD* LoadBoard( const wxString& aFileName, BOARD* aAppendToMe,
|
||||
// const STRING_UTF8_MAP* aProperties = nullptr, PROJECT* aProject = nullptr,
|
||||
// PROGRESS_REPORTER* aProgressReporter = nullptr ) override;
|
||||
// const STRING_UTF8_MAP* aProperties = nullptr, PROJECT* aProject = nullptr ) override;
|
||||
|
||||
void SaveBoard( const wxString& aFileName, BOARD* aBoard,
|
||||
const STRING_UTF8_MAP* aProperties = nullptr,
|
||||
PROGRESS_REPORTER* aProgressReporter = nullptr ) override;
|
||||
const STRING_UTF8_MAP* aProperties = nullptr ) override;
|
||||
|
||||
const IO_BASE::IO_FILE_DESC GetBoardFileDesc() const override
|
||||
{
|
||||
|
@ -466,8 +466,7 @@ bool PCB_IO_KICAD_LEGACY::CanReadFootprint( const wxString& aFileName ) const
|
||||
|
||||
|
||||
BOARD* PCB_IO_KICAD_LEGACY::LoadBoard( const wxString& aFileName, BOARD* aAppendToMe,
|
||||
const STRING_UTF8_MAP* aProperties, PROJECT* aProject,
|
||||
PROGRESS_REPORTER* aProgressReporter )
|
||||
const STRING_UTF8_MAP* aProperties, PROJECT* aProject )
|
||||
{
|
||||
LOCALE_IO toggle; // toggles on, then off, the C locale.
|
||||
|
||||
@ -492,7 +491,6 @@ BOARD* PCB_IO_KICAD_LEGACY::LoadBoard( const wxString& aFileName, BOARD* aAppend
|
||||
FILE_LINE_READER reader( aFileName );
|
||||
|
||||
m_reader = &reader;
|
||||
m_progressReporter = aProgressReporter;
|
||||
|
||||
m_loading_format_version = getVersion( m_reader );
|
||||
m_board->SetFileFormatVersionAtLoad( m_loading_format_version );
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user