33#include <wx/wfstream.h>
35#include <wx/filename.h>
57 wxFileInputStream stream( aFileName );
59 if( !stream.IsOk() || stream.GetLength() < 8 )
65 if( stream.LastRead() < 8 )
78 const std::map<std::string, UTF8>* aProperties,
87 m_board->SetFileName( aFileName );
106 if( !rules.IsEmpty() )
108 wxFileName drcPath( aFileName );
109 drcPath.SetExt( wxT(
"kicad_dru" ) );
111 wxFile drcFile( drcPath.GetFullPath(), wxFile::write );
113 if( drcFile.IsOpened() )
114 drcFile.Write( rules );
116 wxLogWarning(
_(
"DipTrace import: could not write design rules to '%s'; "
117 "imported board is missing DipTrace-specific clearance rules." ),
118 drcPath.GetFullPath() );
Information pertinent to a Pcbnew printed circuit board.
Parses a DipTrace .dip binary board file and populates a KiCad BOARD.
wxString GenerateDesignRules() const
Build a KiCad custom design-rule (.kicad_dru) document for the per-zone DipTrace properties that have...
void Parse()
Parse the file and populate the board. Throws IO_ERROR on failure.
PROGRESS_REPORTER * m_progressReporter
Progress reporter to track the progress of the operation, may be nullptr.
BOARD * LoadBoard(const wxString &aFileName, BOARD *aAppendToMe, const std::map< std::string, UTF8 > *aProperties=nullptr, PROJECT *aProject=nullptr) override
Load information from some input file format that this PCB_IO implementation knows about into either ...
bool CanReadBoard(const wxString &aFileName) const override
Checks if this PCB_IO can read the specified board file.
BOARD * m_board
The board BOARD being worked on, no ownership here.
virtual bool CanReadBoard(const wxString &aFileName) const
Checks if this PCB_IO can read the specified board file.
PCB_IO(const wxString &aName)
const std::map< std::string, UTF8 > * m_props
Properties passed via Save() or Load(), no ownership, may be NULL.
Container for project specific data.
Parser for DipTrace binary .dip board files.
#define THROW_IO_ERROR(msg)
macro which captures the "call site" values of FILE_, __FUNCTION & LINE
Pcbnew PCB_IO for DipTrace binary .dip board files.
std::vector< std::string > header