39#include <wx/snglinst.h>
68#include <wx/stdpaths.h>
69#include <wx/filedlg.h>
70#include <wx/txtstrm.h>
72#include "widgets/filedlg_hook_save_project.h"
75#define USE_INSTRUMENTATION 0
89 std::vector<PLUGIN_FILE_DESC> descriptions;
103 wxCHECK( pi,
false );
110 descriptions.emplace_back( desc );
113 wxString fileFiltersStr;
114 std::vector<std::string> allExtensions;
115 std::set<wxString> allWildcardsSet;
119 if( !fileFiltersStr.IsEmpty() )
120 fileFiltersStr += wxChar(
'|' );
122 fileFiltersStr += desc.FileFilter();
124 for(
const std::string& ext : desc.m_FileExtensions )
126 allExtensions.emplace_back( ext );
131 wxString allWildcardsStr;
133 for(
const wxString& wildcard : allWildcardsSet )
134 allWildcardsStr << wildcard;
142 fileFiltersStr =
_(
"All supported formats" ) + wxT(
"|" ) + allWildcardsStr + wxT(
"|" )
146 wxFileName fileName( *aFileName );
150 if( fileName.FileExists() )
152 path = fileName.GetPath();
153 name = fileName.GetFullName();
164 wxFileDialog dlg( aParent,
166 :
_(
"Import Non KiCad Board File" ),
167 path,
name, fileFiltersStr, wxFD_OPEN | wxFD_FILE_MUST_EXIST );
169 if( dlg.ShowModal() == wxID_OK )
171 *aFileName = dlg.GetPath();
172 aParent->
SetMruPath( wxFileName( dlg.GetPath() ).GetPath() );
194 wxFileName fn = *aFileName;
198 wxFileDialog dlg( aParent,
_(
"Save Board File As" ), fn.GetPath(), fn.GetFullName(), wildcard,
199 wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
205 dlg.SetCustomizeHook( newProjectHook );
207 if( dlg.ShowModal() != wxID_OK )
210 *aFileName = dlg.GetPath();
216 *aCreateProject =
true;
228 if( !wxFileName::IsFileReadable( fn ) )
247 int id =
event.GetId();
279 wxFileName fn = currfn;
282 fn.SetName( rec_name );
284 if( !fn.FileExists() )
286 msg.Printf(
_(
"Recovery file '%s' not found." ), fn.GetFullPath() );
291 msg.Printf(
_(
"OK to load recovery file '%s'?" ), fn.GetFullPath() );
293 if( !
IsOK(
this, msg ) )
313 msg.Printf(
_(
"Revert '%s' to last version saved?" ), fn.GetFullPath() );
315 if( !
IsOK(
this, msg ) )
330 wxString saveMsg =
_(
"Current board will be closed, save changes to '%s' before "
336 return Files_io_from_id( ID_SAVE_BOARD );
344 if( !
IsOK(
this,
_(
"Current Board will be closed. Continue?" ) ) )
367 if( !
GetBoard()->GetFileName().IsEmpty() )
386 wxFileName::SplitPath(
GetBoard()->GetFileName(),
nullptr,
nullptr, &orig_name,
nullptr );
388 if( orig_name.IsEmpty() )
391 wxFileName savePath(
Prj().GetProjectFullName() );
393 if( !savePath.IsOk() || !savePath.IsDirWritable() )
397 if( !savePath.IsOk() || !savePath.IsDirWritable() )
402 wxString filename = fn.GetFullPath();
403 bool createProject =
false;
404 bool success =
false;
414 success =
SavePcbFile( filename, addToHistory, createProject );
440 for(
int i = 0; i < collector.
GetCount(); i++ )
444 int itemWidth =
static_cast<PCB_SHAPE*
>( collector[i] )->GetWidth();
446 if( edgeWidth != -1 && edgeWidth != itemWidth )
449 edgeWidth = std::max( edgeWidth, itemWidth );
453 edgeWidth = itemWidth;
461 DisplayInfoMessage(
this,
_(
"If the zones on this board are refilled the Copper Edge Clearance "
462 "setting will be used (see Board Setup > Design Rules > Constraints).\n"
463 "This may result in different fills from previous KiCad versions which "
464 "used the line thicknesses of the board boundary on the Edge Cuts "
468 return std::max( 0, edgeWidth / 2 );
475 if( aFileSet.size() != 1 )
477 UTF8 msg =
StrPrintf(
"Pcbnew:%s() takes a single filename", __func__ );
482 wxString fullFileName( aFileSet[0] );
483 wxFileName wx_filename( fullFileName );
490 wxASSERT_MSG( wx_filename.IsAbsolute(), wxT(
"Path is not absolute!" ) );
492 std::unique_ptr<LOCKFILE> lock = std::make_unique<LOCKFILE>( fullFileName );
494 if( !lock->Valid() && lock->IsLockedByMe() )
501 if( !
Pgm().SingleInstance()->IsAnotherRunning() )
502 lock->OverrideLock();
507 msg.Printf(
_(
"PCB '%s' is already open by '%s' at '%s'." ), wx_filename.GetFullName(),
508 lock->GetUsername(), lock->GetHostname() );
513 lock->OverrideLock();
528 wxFileName pro = fullFileName;
531 bool is_new = !wxFileName::IsFileReadable( fullFileName );
537 msg.Printf(
_(
"PCB '%s' does not exist. Do you wish to create it?" ), fullFileName );
539 if( !
IsOK(
this, msg ) )
547 :
_(
"Loading PCB" ), 1 );
597 BOARD* loadedBoard =
nullptr;
603 if( layerRemappablePlugin )
612 bool failedLoad =
false;
629 [&]( wxString aTitle,
int aIcon, wxString aMessage, wxString aAction ) ->
bool
631 KIDIALOG dlg(
nullptr, aMessage, aTitle, wxOK | wxCANCEL | aIcon );
633 if( !aAction.IsEmpty() )
634 dlg.SetOKLabel( aAction );
641#if USE_INSTRUMENTATION
646 loadedBoard = pi->
LoadBoard( fullFileName,
nullptr, &props, &
Prj(), &progressReporter );
648#if USE_INSTRUMENTATION
650 printf(
"PLUGIN::Load(): %u usecs\n", stopTime - startTime );
655 msg.Printf(
_(
"Error loading PCB '%s'." ), fullFileName );
656 progressReporter.Hide();
663 if( ioe.
Problem() != wxT(
"CANCEL" ) )
665 msg.Printf(
_(
"Error loading PCB '%s'." ), fullFileName );
666 progressReporter.Hide();
672 catch(
const std::bad_alloc& )
674 msg.Printf(
_(
"Memory exhausted loading PCB '%s'" ), fullFileName );
675 progressReporter.Hide();
681 if( failedLoad || !loadedBoard )
695 SetBoard( loadedBoard,
false, &progressReporter );
743 && loadedBoard->
GetGenerator().Lower() != wxT(
"gerbview" ) ) )
748 "It will be converted to the new format when saved." ),
758 wxFileName loadedBoardFn( fullFileName );
759 wxString libNickName = loadedBoardFn.GetName();
770 if( newLibPath.Length() > 0 )
774 for(
FOOTPRINT* footprint : loadedFootprints )
778 if( !footprint->GetFPID().GetLibItemName().empty() )
780 footprint->SetReference(
"REF**" );
787 wxLogError(
_(
"Error saving footprint %s to project specific library." )
789 footprint->GetFPID().GetUniStringLibItemName(),
796 wxString rel_path, env_path;
798 wxASSERT_MSG( wxGetEnv( project_env, &env_path ),
799 wxT(
"There is no project variable?" ) );
801 wxString result( newLibPath );
803 if( result.Replace( env_path, wxT(
"$(" ) + project_env + wxT(
")" ) ) )
807 wxT(
"KiCad" ), wxEmptyString );
818 wxLogError(
_(
"Error saving project specific footprint library table." )
826 LIB_ID libId = footprint->GetFPID();
832 footprint->SetFPID( libId );
839 wxFileName fn = fullFileName;
844 wxString fname = fn.GetFullPath();
857 std::vector<ZONE*> toFill;
873#if 0 && defined(DEBUG)
897 bool aChangeProject )
900 wxFileName pcbFileName = aFileName;
910 wxString msg = wxString::Format(
_(
"Insufficient permissions to write file '%s'." ),
911 pcbFileName.GetFullPath() );
918 wxFileName projectFile( pcbFileName );
919 wxFileName rulesFile( pcbFileName );
925 if( projectFile.FileExists() )
929 else if( aChangeProject )
937 if( currentRules.FileExists() && !rulesFile.FileExists() && aChangeProject )
938 KiCopyFile( currentRules.GetFullPath(), rulesFile.GetFullPath(), msg );
942 DisplayError(
this, wxString::Format(
_(
"Error saving custom rules file '%s'." ),
943 rulesFile.GetFullPath() ) );
946 if( projectFile.FileExists() )
956 wxString tempFile = wxFileName::CreateTempFileName( wxS(
"pcbnew" ) );
968 DisplayError(
this, wxString::Format(
_(
"Error saving board file '%s'.\n%s" ),
969 pcbFileName.GetFullPath(),
972 lowerTxt.Printf(
_(
"Failed to create temporary file '%s'." ), tempFile );
977 wxRemoveFile( tempFile );
986 if( !wxRenameFile( tempFile, pcbFileName.GetFullPath() ) )
988 DisplayError(
this, wxString::Format(
_(
"Error saving board file '%s'.\n"
989 "Failed to rename temporary file '%s." ),
990 pcbFileName.GetFullPath(),
993 lowerTxt.Printf(
_(
"Failed to rename temporary file '%s'." ),
1001 if( !
Kiface().IsSingle() )
1012 LockFile( pcbFileName.GetFullPath() );
1019 wxFileName autoSaveFileName = pcbFileName;
1023 if( autoSaveFileName.FileExists() )
1024 wxRemoveFile( autoSaveFileName.GetFullPath() );
1026 lowerTxt.Printf(
_(
"File '%s' saved." ), pcbFileName.GetFullPath() );
1028 SetStatusText( lowerTxt, 0 );
1049 DisplayError(
this, wxString::Format(
_(
"Insufficient permissions to write file '%s'." ),
1050 pcbFileName.GetFullPath() ) );
1064 wxASSERT( pcbFileName.IsAbsolute() );
1070 DisplayError(
this, wxString::Format(
_(
"Error saving board file '%s'.\n%s" ),
1071 pcbFileName.GetFullPath(),
1077 wxFileName projectFile( pcbFileName );
1078 wxFileName rulesFile( pcbFileName );
1084 if( aCreateProject && !projectFile.FileExists() )
1089 if( aCreateProject && currentRules.FileExists() && !rulesFile.FileExists() )
1090 KiCopyFile( currentRules.GetFullPath(), rulesFile.GetFullPath(), msg );
1092 if( !msg.IsEmpty() )
1094 DisplayError(
this, wxString::Format(
_(
"Error saving custom rules file '%s'." ),
1095 rulesFile.GetFullPath() ) );
1099 pcbFileName.GetFullPath() ) );
1107 wxFileName tmpFileName;
1113 wxString title = GetTitle();
1115 if(
GetBoard()->GetFileName().IsEmpty() )
1126 wxFileName autoSaveFileName = tmpFileName;
1131 if( !autoSaveFileName.IsOk() )
1136 if( !autoSaveFileName.IsDirWritable() )
1138 autoSaveFileName.SetPath( wxFileName::GetTempDir() );
1140 if( !autoSaveFileName.IsOk() || !autoSaveFileName.IsDirWritable() )
1145 wxT(
"Creating auto save file <" ) + autoSaveFileName.GetFullPath() + wxT(
">" ) );
1147 if(
SavePcbFile( autoSaveFileName.GetFullPath(),
false,
false ) )
1155 if( !
Kiface().IsSingle() &&
KIFACE_BASE & Kiface()
Global KIFACE_BASE "get" accessor.
Pcbnew PLUGIN for CADSTAR PCB Archive (*.cpa) format: an ASCII format based on S-expressions.
void SetContentModified(bool aModified=true)
int m_CopperEdgeClearance
Information pertinent to a Pcbnew printed circuit board.
bool m_LegacyDesignSettingsLoaded
True if the legacy board design settings were loaded from a file.
GAL_SET m_LegacyVisibleItems
void SetFileName(const wxString &aFileName)
bool BuildConnectivity(PROGRESS_REPORTER *aReporter=nullptr)
Build or rebuild the board connectivity database for the board, especially the list of connected item...
void SynchronizeNetsAndNetClasses(bool aResetTrackAndViaSizes)
Copy NETCLASS info to each NET, based on NET membership in a NETCLASS.
LSET m_LegacyVisibleLayers
Visibility settings stored in board prior to 6.0, only used for loading legacy files.
void SetProject(PROJECT *aProject, bool aReferenceOnly=false)
Link a board to a given project.
const wxString & GetFileName() const
int GetFileFormatVersionAtLoad() const
const wxString & GetGenerator() const
Adds an item to the container.
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
void SynchronizeProperties()
Copy the current project's text variables into the boards property cache.
bool m_LegacyCopperEdgeClearanceLoaded
int GetCount() const
Return the number of objects in the list.
static std::map< wxString, PCB_LAYER_ID > GetMapModal(wxWindow *aParent, const std::vector< INPUT_LAYER_DESC > &aLayerDesc)
Create and show a dialog (modal) and returns the data from it after completion.
Create and handle a window for the 3d viewer connected to a Kiway and a pcbboard.
void NewDisplay(bool aForceImmediateRedraw=false)
Reload and refresh (rebuild) the 3D scene.
virtual void CheckForAutoSaveFile(const wxFileName &aFileName)
Check if an auto save file exists for aFileName and takes the appropriate action depending on the use...
void UpdateFileHistory(const wxString &FullFileName, FILE_HISTORY *aFileHistory=nullptr)
Update the list of recently opened files.
void ClearFileHistory(FILE_HISTORY *aFileHistory=nullptr)
Removes all files from the file history.
wxString GetMruPath() const
bool IsWritable(const wxFileName &aFileName, bool aVerbose=true)
Checks if aFileName can be written.
wxString GetFileFromHistory(int cmdId, const wxString &type, FILE_HISTORY *aFileHistory=nullptr)
Fetches the file name from the file history list.
static wxString GetAutoSaveFilePrefix()
void SetMruPath(const wxString &aPath)
WX_INFOBAR * GetInfoBar()
void ReleaseFile()
Release the current file marked in use.
std::unique_ptr< LOCKFILE > m_file_checker
void SetMsgPanel(const std::vector< MSG_PANEL_ITEM > &aList)
Clear the message panel and populates it with the contents of aList.
bool LockFile(const wxString &aFileName)
Mark a schematic file as being in use.
bool GetCreateNewProject() const
Gets if this hook has attached controls to a dialog box.
bool IsAttachedToDialog() const
Hold a record identifying a library accessed by the appropriate footprint library PLUGIN object in th...
static const std::vector< KICAD_T > AllBoardItems
A scan list for all editable board items.
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?
static PLUGIN_REGISTRY * Instance()
PCB_FILE_T
The set of file types that the IO_MGR knows about, and for which there has been a plugin written,...
@ LEGACY
Legacy Pcbnew file formats prior to s-expression.
@ KICAD_SEXP
S-expression Pcbnew file format.
static PCB_FILE_T FindPluginTypeFromBoardPath(const wxString &aFileName, int aCtl=0)
Return a plugin type given a path for a board file.
static PLUGIN * PluginFind(PCB_FILE_T aFileType)
Return a PLUGIN which the caller can use to import, export, save, or load design documents.
Helper class to create more flexible dialogs, including 'do not show again' checkbox handling.
void DoNotShowCheckbox(wxString file, int line)
Checks the 'do not show again' setting for the dialog.
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
Plugin class for import plugins that support remappable layers.
virtual void RegisterLayerMappingCallback(LAYER_MAPPING_HANDLER aLayerMappingHandler)
Register a different handler to be called when mapping of input layers to KiCad layers occurs.
A logical library item identifier and consists of various portions much like a URI.
int SetLibNickname(const UTF8 &aNickname)
Override the logical library name portion of the LIB_ID to aNickname.
const UTF8 & GetLibItemName() const
bool InsertRow(LIB_TABLE_ROW *aRow, bool doReplace=false)
Adds aRow if it does not already exist or if doReplace is true.
void Save(const wxString &aFileName) const
Write this library table to aFileName in s-expression form.
static REPORTER & GetInstance()
static wxString GetDefaultUserProjectsPath()
Gets the default path we point users to create projects.
static TOOL_ACTION repairBoard
wxString GetDesignRulesPath()
Return the absolute path to the design rules file for the currently-loaded board.
wxString CreateNewProjectLibrary(const wxString &aLibName=wxEmptyString, const wxString &aProposedName=wxEmptyString)
const VECTOR2I GetPageSizeIU() const override
Works off of GetPageSettings() to return the size of the paper page in the internal units of this par...
PCB_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
PCB_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
EDA_3D_VIEWER_FRAME * Get3DViewerFrame()
The main frame for Pcbnew.
void ResolveDRCExclusions(bool aCreateMarkers)
If aCreateMarkers then create DRC exclusion markers from the serialized data.
void SetBoard(BOARD *aBoard, PROGRESS_REPORTER *aReporter=nullptr) override
Set the #m_Pcb member in such as way as to ensure deleting any previous BOARD.
bool doAutoSave() override
Perform auto save when the board has been modified and not saved within the auto save interval.
void OnModify() override
Must be called after a board change to set the modified flag.
void OnClearFileHistory(wxCommandEvent &aEvent)
bool SavePcbCopy(const wxString &aFileName, bool aCreateProject=false)
Write the board data structures to aFileName.
bool OpenProjectFiles(const std::vector< wxString > &aFileSet, int aCtl=0) override
Load a KiCad board (.kicad_pcb) from aFileName.
bool importFile(const wxString &aFileName, int aFileType)
Load the given filename but sets the path to the current project path.
void onBoardLoaded()
Update the state of the GUI after a new board is loaded or created.
void SaveProjectLocalSettings() override
Save changes to the project local settings.
bool Files_io_from_id(int aId)
Read and write board files according to aId.
bool IsContentModified() const override
Get if the current board has been modified but not saved.
bool LoadProjectSettings()
Load the current project's file configuration settings which are pertinent to this PCB_EDIT_FRAME ins...
bool Clear_Pcb(bool doAskAboutUnsavedChanges, bool aFinal=false)
Delete all and reinitialize the current board.
void Files_io(wxCommandEvent &event)
Call Files_io_from_id with the wxCommandEvent id.
void UpdateTitle()
Set the main window title bar text.
int inferLegacyEdgeClearance(BOARD *aBoard)
bool SavePcbFile(const wxString &aFileName, bool addToHistory=true, bool aChangeProject=true)
Write the board data structures to a aFileName.
void saveProjectSettings() override
Saves any design-related project settings associated with this frame.
void OnFileHistory(wxCommandEvent &event)
Collect all BOARD_ITEM objects on a given layer.
void Collect(BOARD_ITEM *aBoard, const std::vector< KICAD_T > &aTypes)
Test a BOARD_ITEM using this class's Inspector method, which does the collection.
void SetLayerId(PCB_LAYER_ID aLayerId)
Releases a PLUGIN in the context of a potential thrown exception through its destructor.
A base class that BOARD loading and saving plugins should derive from.
virtual void SetQueryUserCallback(std::function< bool(wxString aTitle, int aIcon, wxString aMessage, wxString aAction)> aCallback)
Registers a KIDIALOG callback for collecting info from the user.
virtual PLUGIN_FILE_DESC GetBoardFileDesc() const
Returns board file description for the PLUGIN.
virtual void FootprintSave(const wxString &aLibraryPath, const FOOTPRINT *aFootprint, const STRING_UTF8_MAP *aProperties=nullptr)
Write aFootprint to an existing library located at aLibraryPath.
virtual std::vector< FOOTPRINT * > GetImportedCachedLibraryFootprints()
Return a container with the cached library footprints generated in the last call to Load.
virtual void SaveBoard(const wxString &aFileName, BOARD *aBoard, const STRING_UTF8_MAP *aProperties=nullptr)
Write aBoard to a storage file in a format that this PLUGIN implementation knows about or it can be u...
virtual BOARD * LoadBoard(const wxString &aFileName, BOARD *aAppendToMe, const STRING_UTF8_MAP *aProperties=nullptr, PROJECT *aProject=nullptr, PROGRESS_REPORTER *aProgressReporter=nullptr)
Load information from some input file format that this PLUGIN implementation knows about into either ...
LSET m_VisibleLayers
Board settings.
GAL_SET m_VisibleItems
The GAL layers (aka items) that are turned on for viewing (.
static FP_LIB_TABLE * PcbFootprintLibs(PROJECT *aProject)
Return the table of footprint libraries without Kiway.
virtual void SetReadOnly(bool aReadOnly=true)
virtual const wxString GetProjectFullName() const
Return the full path and name of the project.
virtual PROJECT_LOCAL_SETTINGS & GetLocalSettings() const
virtual const wxString FootprintLibTblName() const
Returns the path and filename of this project's footprint library table.
virtual const wxString AbsolutePath(const wxString &aFileName) const
Fix up aFileName if it is relative to the project's directory to be an absolute path and filename.
virtual bool IsNullProject() const
Check if this project is a null project (i.e.
void SaveProjectAs(const wxString &aFullPath, PROJECT *aProject=nullptr)
Sets the currently loaded project path and saves it (pointers remain valid) Note that this will not m...
void SaveProjectCopy(const wxString &aFullPath, PROJECT *aProject=nullptr)
Saves a copy of the current project under the given path.
bool SaveProject(const wxString &aFullPath=wxEmptyString, PROJECT *aProject=nullptr)
Saves a loaded project.
bool LoadProject(const wxString &aFullPath, bool aSetActive=true)
Loads a project or sets up a new project with a specified path.
bool UnloadProject(PROJECT *aProject, bool aSave=true)
Saves, unloads and unregisters the given PROJECT.
bool TriggerBackupIfNeeded(REPORTER &aReporter) const
Calls BackupProject if a new backup is needed according to the current backup policy.
PROJECT & Prj() const
A helper while we are not MDI-capable – return the one and only project.
A name/value tuple with unique names and optional values.
An 8 bit string that is assuredly encoded in UTF8, and supplies special conversion support to and fro...
static void ResolvePossibleSymlinks(wxFileName &aFilename)
void RemoveAllButtons()
Remove all the buttons that have been added by the user.
bool HasCloseButton() const
@ OUTDATED_SAVE
OUTDATED_SAVE Messages that should be cleared on save.
void Dismiss() override
Dismisses the infobar and updates the containing layout and AUI manager (if one is provided).
void AddCloseButton(const wxString &aTooltip=_("Hide this message."))
Add the default close button to the infobar on the right side.
MESSAGE_TYPE GetMessageType() const
void ShowMessage(const wxString &aMessage, int aFlags=wxICON_INFORMATION) override
Show the info bar with the provided message and icon.
Multi-thread safe progress reporter dialog, intended for use of tasks that parallel reporting back of...
A wrapper for reporting to a wxString object.
wxString EnsureFileExtension(const wxString &aFilename, const wxString &aExtension)
It's annoying to throw up nag dialogs when the extension isn't right.
bool AskOverrideLock(wxWindow *aParent, const wxString &aMessage)
Display a dialog indicating the file is already open, with an option to reset the lock.
bool IsOK(wxWindow *aParent, const wxString &aMessage)
Display a yes/no dialog with aMessage and returns the user response.
void DisplayError(wxWindow *aParent, const wxString &aText, int aDisplayTime)
Display an error or warning message box with aMessage.
void DisplayInfoMessage(wxWindow *aParent, const wxString &aMessage, const wxString &aExtraInfo)
Display an informational message box with aMessage.
bool HandleUnsavedChanges(wxWindow *aParent, const wxString &aMessage, const std::function< bool()> &aSaveFunction)
Display a dialog with Save, Cancel and Discard Changes buttons.
void DisplayErrorMessage(wxWindow *aParent, const wxString &aText, const wxString &aExtraInfo)
Display an error message with aMessage.
This file is part of the common library.
Declaration of the eda_3d_viewer class.
void KiCopyFile(const wxString &aSrcPath, const wxString &aDestPath, wxString &aErrors)
#define WIN_STRING_DIR_SEP
#define UNIX_STRING_DIR_SEP
const std::string LegacyPcbFileExtension
wxString AddFileExtListToFilter(const std::vector< std::string > &aExts)
Build the wildcard extension file dialog wildcard filter to add to the base message dialog.
wxString formatWildcardExt(const wxString &aWildcard)
Format wildcard extension to support case sensitive file dialogs.
const std::string KiCadPcbFileExtension
const std::string ProjectFileExtension
const std::string DesignRulesFileExtension
wxString PcbFileWildcard()
const wxChar *const traceAutoSave
Flag to enable auto save feature debug tracing.
#define THROW_IO_ERROR(msg)
#define KICTL_CREATE
caller thinks requested project files may not exist.
#define KICTL_IMPORT_LIB
import all footprints into a project library.
#define KICTL_KICAD_ONLY
chosen file is from KiCad according to user
#define KICTL_NONKICAD_ONLY
chosen file is non-KiCad according to user
@ GAL_LAYER_ID_BITMASK_END
This is the end of the layers used for visibility bit masks in legacy board files.
#define GAL_LAYER_INDEX(x)
Use this macro to convert a GAL layer to a 0-indexed offset from LAYER_VIAS.
This file contains miscellaneous commonly used macros and functions.
#define KI_FALLTHROUGH
The KI_FALLTHROUGH macro is to be used when switch statement cases should purposely fallthrough from ...
#define SEXPR_BOARD_FILE_VERSION
Current s-expression file format version. 2 was the last legacy format version.
bool AskLoadBoardFileName(PCB_EDIT_FRAME *aParent, wxString *aFileName, int aCtl=0)
Show a wxFileDialog asking for a BOARD filename to open.
bool AskSaveBoardFileName(PCB_EDIT_FRAME *aParent, wxString *aFileName, bool *aCreateProject)
Put up a wxFileDialog asking for a BOARD filename to save.
@ ID_IMPORT_NON_KICAD_BOARD
@ ID_MENU_RECOVER_BOARD_AUTOSAVE
SETTINGS_MANAGER * GetSettingsManager()
unsigned GetRunningMicroSecs()
An alternate way to calculate an elapsed time (in microsecondes) to class PROF_COUNTER.
#define PROJECT_VAR_NAME
A variable name whose value holds the current project directory.
#define NAMELESS_PROJECT
default name for nameless projects
int StrPrintf(std::string *result, const char *format,...)
This is like sprintf() but the output is appended to a std::string instead of to a character array.
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Container that describes file type info.
std::vector< std::string > m_FileExtensions
Filter used for file pickers if m_IsFile is true.
wxLogTrace helper definitions.
@ PCB_SHAPE_T
class PCB_SHAPE, a segment not on copper layers
Definition of file extensions used in Kicad.