Pcbnew: load write board netlist to file tool action dynamically.
Loading this advanced configuration option statically will cause it to show up in the hotkey list even when the option is disabled. Creating the tool action at run time resolves this issue.
This commit is contained in:
parent
bcddc878e2
commit
38c849bde7
|
@ -142,8 +142,8 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
|
|||
submenuExport->Add( _( "Hyperlynx..." ), "",
|
||||
ID_GEN_EXPORT_FILE_HYPERLYNX, BITMAPS::export_step );
|
||||
|
||||
if( ADVANCED_CFG::GetCfg().m_ShowPcbnewExportNetlist )
|
||||
submenuExport->Add( PCB_ACTIONS::exportNetlist );
|
||||
if( ADVANCED_CFG::GetCfg().m_ShowPcbnewExportNetlist && m_exportNetlistAction )
|
||||
submenuExport->Add( *m_exportNetlistAction );
|
||||
|
||||
submenuExport->AppendSeparator();
|
||||
submenuExport->Add( _( "Footprints to Library..." ),
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <advanced_config.h>
|
||||
#include <kiface_i.h>
|
||||
#include <kiway.h>
|
||||
#include <pgm_base.h>
|
||||
|
@ -174,7 +175,8 @@ END_EVENT_TABLE()
|
|||
|
||||
PCB_EDIT_FRAME::PCB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
|
||||
PCB_BASE_EDIT_FRAME( aKiway, aParent, FRAME_PCB_EDITOR, wxT( "PCB Editor" ), wxDefaultPosition,
|
||||
wxDefaultSize, KICAD_DEFAULT_DRAWFRAME_STYLE, PCB_EDIT_FRAME_NAME )
|
||||
wxDefaultSize, KICAD_DEFAULT_DRAWFRAME_STYLE, PCB_EDIT_FRAME_NAME ),
|
||||
m_exportNetlistAction( nullptr )
|
||||
{
|
||||
m_maximizeByDefault = true;
|
||||
m_showBorderAndTitleBlock = true; // true to display sheet references
|
||||
|
@ -184,13 +186,19 @@ PCB_EDIT_FRAME::PCB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
|
|||
m_show_layer_manager_tools = true;
|
||||
m_hasAutoSave = true;
|
||||
|
||||
// We don't know what state board was in when it was lasat saved, so we have to
|
||||
// We don't know what state board was in when it was last saved, so we have to
|
||||
// assume dirty
|
||||
m_ZoneFillsDirty = true;
|
||||
|
||||
m_rotationAngle = 900;
|
||||
m_aboutTitle = _( "KiCad PCB Editor" );
|
||||
|
||||
// Must be created before the menus are created.
|
||||
if( ADVANCED_CFG::GetCfg().m_ShowPcbnewExportNetlist )
|
||||
m_exportNetlistAction = new TOOL_ACTION( "pcbnew.EditorControl.exportNetlist",
|
||||
AS_GLOBAL, 0, "", _( "Netlist..." ),
|
||||
_( "Export netlist used to update schematics" ) );
|
||||
|
||||
// Create GAL canvas
|
||||
auto canvas = new PCB_DRAW_PANEL_GAL( this, -1, wxPoint( 0, 0 ), m_frameSize,
|
||||
GetGalDisplayOptions(),
|
||||
|
@ -240,7 +248,8 @@ PCB_EDIT_FRAME::PCB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
|
|||
|
||||
unsigned int auiFlags = wxAUI_MGR_DEFAULT;
|
||||
#if !defined( _WIN32 )
|
||||
// Windows cannot redraw the UI fast enough during a live resize and may lead to all kinds of graphical glitches
|
||||
// Windows cannot redraw the UI fast enough during a live resize and may lead to all kinds
|
||||
// of graphical glitches.
|
||||
auiFlags |= wxAUI_MGR_LIVE_RESIZE;
|
||||
#endif
|
||||
m_auimgr.SetFlags( auiFlags );
|
||||
|
@ -530,8 +539,10 @@ void PCB_EDIT_FRAME::setupUIConditions()
|
|||
|
||||
mgr->SetConditions( ACTIONS::cut, ENABLE( cond.HasItems() ) );
|
||||
mgr->SetConditions( ACTIONS::copy, ENABLE( cond.HasItems() ) );
|
||||
mgr->SetConditions( ACTIONS::paste, ENABLE( SELECTION_CONDITIONS::Idle && cond.NoActiveTool() ) );
|
||||
mgr->SetConditions( ACTIONS::pasteSpecial, ENABLE( SELECTION_CONDITIONS::Idle && cond.NoActiveTool() ) );
|
||||
mgr->SetConditions( ACTIONS::paste,
|
||||
ENABLE( SELECTION_CONDITIONS::Idle && cond.NoActiveTool() ) );
|
||||
mgr->SetConditions( ACTIONS::pasteSpecial,
|
||||
ENABLE( SELECTION_CONDITIONS::Idle && cond.NoActiveTool() ) );
|
||||
mgr->SetConditions( ACTIONS::selectAll, ENABLE( cond.HasItems() ) );
|
||||
mgr->SetConditions( ACTIONS::doDelete, ENABLE( cond.HasItems() ) );
|
||||
mgr->SetConditions( ACTIONS::duplicate, ENABLE( cond.HasItems() ) );
|
||||
|
@ -693,7 +704,6 @@ void PCB_EDIT_FRAME::setupUIConditions()
|
|||
|
||||
mgr->SetConditions( PCB_ACTIONS::toggleLine45degMode, CHECK( cond.Line45degMode() ) );
|
||||
|
||||
|
||||
#define CURRENT_TOOL( action ) mgr->SetConditions( action, CHECK( cond.CurrentTool( action ) ) )
|
||||
|
||||
// These tools can be used at any time to inspect the board
|
||||
|
@ -1386,10 +1396,6 @@ bool PCB_EDIT_FRAME::TestStandalone()
|
|||
}
|
||||
|
||||
|
||||
//
|
||||
// Sends a Netlist packet to eeSchema.
|
||||
// The reply is in aNetlist so it is destroyed by this
|
||||
//
|
||||
bool PCB_EDIT_FRAME::ReannotateSchematic( std::string& aNetlist )
|
||||
{
|
||||
Kiway().ExpressMail( FRAME_SCH, MAIL_REANNOTATE, aNetlist, this );
|
||||
|
@ -1397,7 +1403,8 @@ bool PCB_EDIT_FRAME::ReannotateSchematic( std::string& aNetlist )
|
|||
}
|
||||
|
||||
|
||||
bool PCB_EDIT_FRAME::FetchNetlistFromSchematic( NETLIST& aNetlist, const wxString& aAnnotateMessage )
|
||||
bool PCB_EDIT_FRAME::FetchNetlistFromSchematic( NETLIST& aNetlist,
|
||||
const wxString& aAnnotateMessage )
|
||||
{
|
||||
if( !TestStandalone() )
|
||||
{
|
||||
|
@ -1441,11 +1448,13 @@ bool PCB_EDIT_FRAME::FetchNetlistFromSchematic( NETLIST& aNetlist, const wxStrin
|
|||
void PCB_EDIT_FRAME::RunEeschema()
|
||||
{
|
||||
wxString msg;
|
||||
wxFileName schematic( Prj().GetProjectPath(), Prj().GetProjectName(), KiCadSchematicFileExtension );
|
||||
wxFileName schematic( Prj().GetProjectPath(), Prj().GetProjectName(),
|
||||
KiCadSchematicFileExtension );
|
||||
|
||||
if( !schematic.FileExists() )
|
||||
{
|
||||
wxFileName legacySchematic( Prj().GetProjectPath(), Prj().GetProjectName(), LegacySchematicFileExtension );
|
||||
wxFileName legacySchematic( Prj().GetProjectPath(), Prj().GetProjectName(),
|
||||
LegacySchematicFileExtension );
|
||||
|
||||
if( legacySchematic.FileExists() )
|
||||
{
|
||||
|
@ -1472,7 +1481,7 @@ void PCB_EDIT_FRAME::RunEeschema()
|
|||
// Kiway.Player( FRAME_SCH, true )
|
||||
// therefore, the schematic editor is sometimes running, but the schematic project
|
||||
// is not loaded, if the library editor was called, and the dialog field editor was used.
|
||||
// On linux, it happens the first time the schematic editor is launched, if
|
||||
// On Linux, it happens the first time the schematic editor is launched, if
|
||||
// library editor was running, and the dialog field editor was open
|
||||
// On Windows, it happens always after the library editor was called,
|
||||
// and the dialog field editor was used
|
||||
|
@ -1498,7 +1507,7 @@ void PCB_EDIT_FRAME::RunEeschema()
|
|||
}
|
||||
|
||||
// On Windows, Raise() does not bring the window on screen, when iconized or not shown
|
||||
// On linux, Raise() brings the window on screen, but this code works fine
|
||||
// On Linux, Raise() brings the window on screen, but this code works fine
|
||||
if( frame->IsIconized() )
|
||||
{
|
||||
frame->Iconize( false );
|
||||
|
@ -1563,12 +1572,12 @@ void PCB_EDIT_FRAME::PythonSyncEnvironmentVariables()
|
|||
const ENV_VAR_MAP& vars = Pgm().GetLocalEnvVariables();
|
||||
|
||||
// Set the environment variables for python scripts
|
||||
// note: the strint will be encoded UTF8 for python env
|
||||
// note: the string will be encoded UTF8 for python env
|
||||
for( auto& var : vars )
|
||||
pcbnewUpdatePythonEnvVar( var.first, var.second.GetValue() );
|
||||
|
||||
// Because the env vars can de modifed by the python scripts (rewritten in UTF8),
|
||||
// regenerate them (in unicode) for our normal environment
|
||||
// Because the env vars can de modified by the python scripts (rewritten in UTF8),
|
||||
// regenerate them (in Unicode) for our normal environment
|
||||
for( auto& var : vars )
|
||||
wxSetEnv( var.first, var.second.GetValue() );
|
||||
#endif
|
||||
|
@ -1582,8 +1591,8 @@ void PCB_EDIT_FRAME::PythonSyncProjectName()
|
|||
wxGetEnv( PROJECT_VAR_NAME, &evValue );
|
||||
pcbnewUpdatePythonEnvVar( wxString( PROJECT_VAR_NAME ).ToStdString(), evValue );
|
||||
|
||||
// Because PROJECT_VAR_NAME can be modifed by the python scripts (rewritten in UTF8),
|
||||
// regenerate it (in unicode) for our normal environment
|
||||
// Because PROJECT_VAR_NAME can be modified by the python scripts (rewritten in UTF8),
|
||||
// regenerate it (in Unicode) for our normal environment
|
||||
wxSetEnv( PROJECT_VAR_NAME, evValue );
|
||||
#endif
|
||||
}
|
||||
|
@ -1602,7 +1611,7 @@ void PCB_EDIT_FRAME::ShowFootprintPropertiesDialog( FOOTPRINT* aFootprint )
|
|||
/*
|
||||
* retvalue =
|
||||
* FP_PROPS_UPDATE_FP to show Update Footprints dialog
|
||||
* FP_PROPS_CHANGE_FP to show Chanage Footprints dialog
|
||||
* FP_PROPS_CHANGE_FP to show Change Footprints dialog
|
||||
* FP_PROPS_OK for normal edit
|
||||
* FP_PROPS_CANCEL if aborted
|
||||
* FP_PROPS_EDIT_BOARD_FP to load board footprint into Footprint Editor
|
||||
|
|
|
@ -18,8 +18,8 @@
|
|||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef WXPCB_STRUCT_H_
|
||||
#define WXPCB_STRUCT_H_
|
||||
#ifndef __PCB_EDIT_FRAME_H__
|
||||
#define __PCB_EDIT_FRAME_H__
|
||||
|
||||
#include <unordered_map>
|
||||
#include <map>
|
||||
|
@ -30,7 +30,6 @@
|
|||
#include <map>
|
||||
#include <unordered_map>
|
||||
|
||||
/* Forward declarations of classes. */
|
||||
class ACTION_PLUGIN;
|
||||
class PCB_SCREEN;
|
||||
class BOARD;
|
||||
|
@ -59,6 +58,8 @@ class IO_ERROR;
|
|||
class FP_LIB_TABLE;
|
||||
class BOARD_NETLIST_UPDATER;
|
||||
class ACTION_MENU;
|
||||
class TOOL_ACTION;
|
||||
|
||||
enum LAST_PATH_TYPE : unsigned int;
|
||||
|
||||
namespace PCB { struct IFACE; } // KIFACE_I is in pcbnew.cpp
|
||||
|
@ -68,164 +69,9 @@ namespace PCB { struct IFACE; } // KIFACE_I is in pcbnew.cpp
|
|||
*
|
||||
* See also class PCB_BASE_FRAME(): Basic class for Pcbnew and GerbView.
|
||||
*/
|
||||
|
||||
|
||||
class PCB_EDIT_FRAME : public PCB_BASE_EDIT_FRAME
|
||||
{
|
||||
friend struct PCB::IFACE;
|
||||
friend class APPEARANCE_CONTROLS;
|
||||
|
||||
protected:
|
||||
|
||||
/**
|
||||
* Store the previous layer toolbar icon state information
|
||||
*/
|
||||
struct LAYER_TOOLBAR_ICON_VALUES
|
||||
{
|
||||
int previous_requested_scale;
|
||||
COLOR4D previous_Route_Layer_TOP_color;
|
||||
COLOR4D previous_Route_Layer_BOTTOM_color;
|
||||
COLOR4D previous_background_color;
|
||||
|
||||
LAYER_TOOLBAR_ICON_VALUES()
|
||||
: previous_requested_scale( 0 ),
|
||||
previous_Route_Layer_TOP_color( COLOR4D::UNSPECIFIED ),
|
||||
previous_Route_Layer_BOTTOM_color( COLOR4D::UNSPECIFIED ),
|
||||
previous_background_color( COLOR4D::UNSPECIFIED )
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
LAYER_TOOLBAR_ICON_VALUES m_prevIconVal;
|
||||
|
||||
// The Tool Framework initialization
|
||||
void setupTools();
|
||||
void setupUIConditions() override;
|
||||
|
||||
/**
|
||||
* Switch currently used canvas (Cairo / OpenGL).
|
||||
*
|
||||
* It also reinit the layers manager that slightly changes with canvases
|
||||
*/
|
||||
void SwitchCanvas( EDA_DRAW_PANEL_GAL::GAL_TYPE aCanvasType ) override;
|
||||
|
||||
#if defined(KICAD_SCRIPTING) && defined(KICAD_SCRIPTING_ACTION_MENU)
|
||||
/**
|
||||
* Fill action menu with all registered action plugins
|
||||
*/
|
||||
void buildActionPluginMenus( ACTION_MENU* aActionMenu );
|
||||
|
||||
/**
|
||||
* Append action plugin buttons to main toolbar
|
||||
*/
|
||||
void AddActionPluginTools();
|
||||
|
||||
/**
|
||||
* Execute action plugin's Run() method and updates undo buffer.
|
||||
*
|
||||
* @param aActionPlugin action plugin
|
||||
*/
|
||||
void RunActionPlugin( ACTION_PLUGIN* aActionPlugin );
|
||||
|
||||
/**
|
||||
* Launched by the menu when an action is called.
|
||||
*
|
||||
* @param aEvent sent by wx
|
||||
*/
|
||||
void OnActionPluginMenu( wxCommandEvent& aEvent);
|
||||
|
||||
/**
|
||||
* Launched by the button when an action is called.
|
||||
*
|
||||
* @param aEvent sent by wx
|
||||
*/
|
||||
void OnActionPluginButton( wxCommandEvent& aEvent );
|
||||
|
||||
/**
|
||||
* Refresh plugin list (reload Python plugins).
|
||||
*
|
||||
* @param aEvent sent by wx
|
||||
*/
|
||||
void OnActionPluginRefresh( wxCommandEvent& aEvent)
|
||||
{
|
||||
PythonPluginsReload();
|
||||
}
|
||||
|
||||
/**
|
||||
* Refresh plugin list (reload Python plugins).
|
||||
*
|
||||
* @param aEvent sent by wx
|
||||
*/
|
||||
void OnActionPluginShowFolder( wxCommandEvent& aEvent)
|
||||
{
|
||||
PythonPluginsShowFolder();
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Has meaning only if KICAD_SCRIPTING_WXPYTHON option is not defined.
|
||||
*
|
||||
* @return the frame name identifier for the python console frame.
|
||||
*/
|
||||
static const wxChar * pythonConsoleNameId()
|
||||
{
|
||||
return wxT( "PythonConsole" );
|
||||
}
|
||||
|
||||
/**
|
||||
* @return a pointer to the python console frame, or NULL if not exist
|
||||
*/
|
||||
static wxWindow * findPythonConsole()
|
||||
{
|
||||
return FindWindowByName( pythonConsoleNameId() );
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the state of the GUI after a new board is loaded or created.
|
||||
*/
|
||||
void onBoardLoaded();
|
||||
|
||||
/**
|
||||
* Perform auto save when the board has been modified and not saved within the
|
||||
* auto save interval.
|
||||
*
|
||||
* @return true if the auto save was successful.
|
||||
*/
|
||||
bool doAutoSave() override;
|
||||
|
||||
/**
|
||||
* Return true if the board has been modified.
|
||||
*/
|
||||
bool isAutoSaveRequired() const override;
|
||||
|
||||
/**
|
||||
* Load the given filename but sets the path to the current project path.
|
||||
*
|
||||
* @param full file path of file to be imported.
|
||||
* @param aFileType PCB_FILE_T value for file type
|
||||
*/
|
||||
bool importFile( const wxString& aFileName, int aFileType );
|
||||
|
||||
bool canCloseWindow( wxCloseEvent& aCloseEvent ) override;
|
||||
void doCloseWindow() override;
|
||||
|
||||
// protected so that PCB::IFACE::CreateWindow() is the only factory.
|
||||
PCB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent );
|
||||
|
||||
void onSize( wxSizeEvent& aEvent );
|
||||
|
||||
int inferLegacyEdgeClearance( BOARD* aBoard );
|
||||
|
||||
public:
|
||||
PCB_LAYER_BOX_SELECTOR* m_SelLayerBox; // a combo box to display and select active layer
|
||||
|
||||
wxChoice* m_SelTrackWidthBox; // a choice box to display and select current track width
|
||||
wxChoice* m_SelViaSizeBox; // a choice box to display and select current via diameter
|
||||
|
||||
bool m_show_layer_manager_tools;
|
||||
|
||||
bool m_ZoneFillsDirty; // Board has been modified since last zone fill.
|
||||
|
||||
virtual ~PCB_EDIT_FRAME();
|
||||
|
||||
/**
|
||||
|
@ -531,7 +377,7 @@ public:
|
|||
bool OpenProjectFiles( const std::vector<wxString>& aFileSet, int aCtl = 0 ) override;
|
||||
|
||||
/**
|
||||
* Writes the board data structures to \a a aFileName.
|
||||
* Write the board data structures to \a a aFileName.
|
||||
*
|
||||
* Create a backup when requested and update flags (modified and saved flags).
|
||||
*
|
||||
|
@ -611,7 +457,7 @@ public:
|
|||
void OnExportVRML( wxCommandEvent& event );
|
||||
|
||||
/**
|
||||
* Creates the file(s) exporting current BOARD to a VRML file.
|
||||
* Create the file(s) exporting current BOARD to a VRML file.
|
||||
*
|
||||
* @note When copying 3D shapes files, the new filename is build from the full path
|
||||
* name, changing the separators by underscore. This is needed because files
|
||||
|
@ -639,17 +485,17 @@ public:
|
|||
const wxString& a3D_Subdir, double aXRef, double aYRef );
|
||||
|
||||
/**
|
||||
* Will export the current BOARD to a IDFv3 board and lib files.
|
||||
* Export the current BOARD to a IDFv3 board and lib files.
|
||||
*/
|
||||
void OnExportIDF3( wxCommandEvent& event );
|
||||
|
||||
/**
|
||||
* Will export the current BOARD to a Hyperlynx HYP file.
|
||||
* Export the current BOARD to a Hyperlynx HYP file.
|
||||
*/
|
||||
void OnExportHyperlynx( wxCommandEvent& event );
|
||||
|
||||
/**
|
||||
* Creates an IDF3 compliant BOARD (*.emn) and LIBRARY (*.emp) file.
|
||||
* Create an IDF3 compliant BOARD (*.emn) and LIBRARY (*.emp) file.
|
||||
*
|
||||
* @param aPcb a pointer to the board to be exported to IDF.
|
||||
* @param aFullFileName the full filename of the export file.
|
||||
|
@ -780,7 +626,6 @@ public:
|
|||
*/
|
||||
void OnNetlistChanged( BOARD_NETLIST_UPDATER& aUpdater, bool* aRunDragCommand );
|
||||
|
||||
|
||||
#if defined( KICAD_SCRIPTING_WXPYTHON )
|
||||
/**
|
||||
* Enable or disable the scripting console.
|
||||
|
@ -836,7 +681,172 @@ public:
|
|||
|
||||
SELECTION& GetCurrentSelection() override;
|
||||
|
||||
TOOL_ACTION* GetExportNetlistAction() { return m_exportNetlistAction; }
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
|
||||
protected:
|
||||
/**
|
||||
* Store the previous layer toolbar icon state information
|
||||
*/
|
||||
struct LAYER_TOOLBAR_ICON_VALUES
|
||||
{
|
||||
int previous_requested_scale;
|
||||
COLOR4D previous_Route_Layer_TOP_color;
|
||||
COLOR4D previous_Route_Layer_BOTTOM_color;
|
||||
COLOR4D previous_background_color;
|
||||
|
||||
LAYER_TOOLBAR_ICON_VALUES()
|
||||
: previous_requested_scale( 0 ),
|
||||
previous_Route_Layer_TOP_color( COLOR4D::UNSPECIFIED ),
|
||||
previous_Route_Layer_BOTTOM_color( COLOR4D::UNSPECIFIED ),
|
||||
previous_background_color( COLOR4D::UNSPECIFIED )
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
LAYER_TOOLBAR_ICON_VALUES m_prevIconVal;
|
||||
|
||||
// The Tool Framework initialization
|
||||
void setupTools();
|
||||
void setupUIConditions() override;
|
||||
|
||||
/**
|
||||
* Switch currently used canvas (Cairo / OpenGL).
|
||||
*
|
||||
* It also reinit the layers manager that slightly changes with canvases
|
||||
*/
|
||||
void SwitchCanvas( EDA_DRAW_PANEL_GAL::GAL_TYPE aCanvasType ) override;
|
||||
|
||||
#if defined(KICAD_SCRIPTING) && defined(KICAD_SCRIPTING_ACTION_MENU)
|
||||
/**
|
||||
* Fill action menu with all registered action plugins
|
||||
*/
|
||||
void buildActionPluginMenus( ACTION_MENU* aActionMenu );
|
||||
|
||||
/**
|
||||
* Append action plugin buttons to main toolbar
|
||||
*/
|
||||
void AddActionPluginTools();
|
||||
|
||||
/**
|
||||
* Execute action plugin's Run() method and updates undo buffer.
|
||||
*
|
||||
* @param aActionPlugin action plugin
|
||||
*/
|
||||
void RunActionPlugin( ACTION_PLUGIN* aActionPlugin );
|
||||
|
||||
/**
|
||||
* Launched by the menu when an action is called.
|
||||
*
|
||||
* @param aEvent sent by wx
|
||||
*/
|
||||
void OnActionPluginMenu( wxCommandEvent& aEvent);
|
||||
|
||||
/**
|
||||
* Launched by the button when an action is called.
|
||||
*
|
||||
* @param aEvent sent by wx
|
||||
*/
|
||||
void OnActionPluginButton( wxCommandEvent& aEvent );
|
||||
|
||||
/**
|
||||
* Refresh plugin list (reload Python plugins).
|
||||
*
|
||||
* @param aEvent sent by wx
|
||||
*/
|
||||
void OnActionPluginRefresh( wxCommandEvent& aEvent)
|
||||
{
|
||||
PythonPluginsReload();
|
||||
}
|
||||
|
||||
/**
|
||||
* Refresh plugin list (reload Python plugins).
|
||||
*
|
||||
* @param aEvent sent by wx
|
||||
*/
|
||||
void OnActionPluginShowFolder( wxCommandEvent& aEvent)
|
||||
{
|
||||
PythonPluginsShowFolder();
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Has meaning only if KICAD_SCRIPTING_WXPYTHON option is not defined.
|
||||
*
|
||||
* @return the frame name identifier for the python console frame.
|
||||
*/
|
||||
static const wxChar * pythonConsoleNameId()
|
||||
{
|
||||
return wxT( "PythonConsole" );
|
||||
}
|
||||
|
||||
/**
|
||||
* @return a pointer to the python console frame, or NULL if not exist
|
||||
*/
|
||||
static wxWindow * findPythonConsole()
|
||||
{
|
||||
return FindWindowByName( pythonConsoleNameId() );
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the state of the GUI after a new board is loaded or created.
|
||||
*/
|
||||
void onBoardLoaded();
|
||||
|
||||
/**
|
||||
* Perform auto save when the board has been modified and not saved within the
|
||||
* auto save interval.
|
||||
*
|
||||
* @return true if the auto save was successful.
|
||||
*/
|
||||
bool doAutoSave() override;
|
||||
|
||||
/**
|
||||
* Return true if the board has been modified.
|
||||
*/
|
||||
bool isAutoSaveRequired() const override;
|
||||
|
||||
/**
|
||||
* Load the given filename but sets the path to the current project path.
|
||||
*
|
||||
* @param full file path of file to be imported.
|
||||
* @param aFileType PCB_FILE_T value for file type
|
||||
*/
|
||||
bool importFile( const wxString& aFileName, int aFileType );
|
||||
|
||||
bool canCloseWindow( wxCloseEvent& aCloseEvent ) override;
|
||||
void doCloseWindow() override;
|
||||
|
||||
// protected so that PCB::IFACE::CreateWindow() is the only factory.
|
||||
PCB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent );
|
||||
|
||||
void onSize( wxSizeEvent& aEvent );
|
||||
|
||||
int inferLegacyEdgeClearance( BOARD* aBoard );
|
||||
|
||||
public:
|
||||
PCB_LAYER_BOX_SELECTOR* m_SelLayerBox; // a combo box to display and select active layer
|
||||
|
||||
wxChoice* m_SelTrackWidthBox; // a choice box to display and select current track width
|
||||
wxChoice* m_SelViaSizeBox; // a choice box to display and select current via diameter
|
||||
|
||||
bool m_show_layer_manager_tools;
|
||||
|
||||
bool m_ZoneFillsDirty; // Board has been modified since last zone fill.
|
||||
|
||||
private:
|
||||
friend struct PCB::IFACE;
|
||||
friend class APPEARANCE_CONTROLS;
|
||||
|
||||
/**
|
||||
* The export board netlist tool action object.
|
||||
*
|
||||
* This is created at runtime rather than declared statically so it doesn't show up in
|
||||
* the list of assignable hot keys since it's only available as an advanced configuration
|
||||
* option.
|
||||
*/
|
||||
TOOL_ACTION* m_exportNetlistAction;
|
||||
};
|
||||
|
||||
#endif // WXPCB_STRUCT_H_
|
||||
#endif // __PCB_EDIT_FRAME_H__
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
* or you may write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
#include <advanced_config.h>
|
||||
#include "board_editor_control.h"
|
||||
#include "drawing_tool.h"
|
||||
#include "pcb_actions.h"
|
||||
|
@ -174,7 +175,8 @@ BOARD_EDITOR_CONTROL::BOARD_EDITOR_CONTROL() :
|
|||
PCB_TOOL_BASE( "pcbnew.EditorControl" ),
|
||||
m_frame( nullptr )
|
||||
{
|
||||
m_placeOrigin = std::make_unique<KIGFX::ORIGIN_VIEWITEM>( KIGFX::COLOR4D( 0.8, 0.0, 0.0, 1.0 ),
|
||||
m_placeOrigin = std::make_unique<KIGFX::ORIGIN_VIEWITEM>(
|
||||
KIGFX::COLOR4D( 0.8, 0.0, 0.0, 1.0 ),
|
||||
KIGFX::ORIGIN_VIEWITEM::CIRCLE_CROSS );
|
||||
}
|
||||
|
||||
|
@ -1485,7 +1487,11 @@ void BOARD_EDITOR_CONTROL::setTransitions()
|
|||
Go( &BOARD_EDITOR_CONTROL::ImportNetlist, PCB_ACTIONS::importNetlist.MakeEvent() );
|
||||
Go( &BOARD_EDITOR_CONTROL::ImportSpecctraSession, PCB_ACTIONS::importSpecctraSession.MakeEvent() );
|
||||
Go( &BOARD_EDITOR_CONTROL::ExportSpecctraDSN, PCB_ACTIONS::exportSpecctraDSN.MakeEvent() );
|
||||
Go( &BOARD_EDITOR_CONTROL::ExportNetlist, PCB_ACTIONS::exportNetlist.MakeEvent() );
|
||||
|
||||
if( ADVANCED_CFG::GetCfg().m_ShowPcbnewExportNetlist && m_frame &&
|
||||
m_frame->GetExportNetlistAction() )
|
||||
Go( &BOARD_EDITOR_CONTROL::ExportNetlist, m_frame->GetExportNetlistAction()->MakeEvent() );
|
||||
|
||||
Go( &BOARD_EDITOR_CONTROL::GenerateDrillFiles, PCB_ACTIONS::generateDrillFiles.MakeEvent() );
|
||||
Go( &BOARD_EDITOR_CONTROL::GenerateFabFiles, PCB_ACTIONS::generateGerbers.MakeEvent() );
|
||||
Go( &BOARD_EDITOR_CONTROL::GeneratePosFile, PCB_ACTIONS::generatePosFile.MakeEvent() );
|
||||
|
|
|
@ -567,10 +567,6 @@ TOOL_ACTION PCB_ACTIONS::exportSpecctraDSN( "pcbnew.EditorControl.exportSpecctra
|
|||
_( "Export Specctra DSN..." ), _( "Export Specctra DSN routing info" ),
|
||||
BITMAPS::export_dsn );
|
||||
|
||||
TOOL_ACTION PCB_ACTIONS::exportNetlist( "pcbnew.EditorControl.exportNetlist", AS_GLOBAL, 0, "",
|
||||
_( "Netlist..." ),
|
||||
_( "Export netlist used to update schematics" ) );
|
||||
|
||||
TOOL_ACTION PCB_ACTIONS::generateGerbers( "pcbnew.EditorControl.generateGerbers",
|
||||
AS_GLOBAL, 0, "",
|
||||
_( "Gerbers (.gbr)..." ), _( "Generate Gerbers for fabrication" ),
|
||||
|
|
|
@ -332,7 +332,6 @@ public:
|
|||
|
||||
static TOOL_ACTION importSpecctraSession;
|
||||
static TOOL_ACTION exportSpecctraDSN;
|
||||
static TOOL_ACTION exportNetlist;
|
||||
|
||||
static TOOL_ACTION generateGerbers;
|
||||
static TOOL_ACTION generateDrillFiles;
|
||||
|
|
Loading…
Reference in New Issue