kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #23928
Re: Trouble with BOM plugin execution on Windows
New patch where new methods are with comments.
Regards, Konstantin.
2016-03-30 19:27 GMT+03:00 jp charras <jp.charras@xxxxxxxxxx>:
> Le 30/03/2016 09:20, Константин Барановский a écrit :
> > Can you find a minute to comment my previous patch?
> >
> > Regards, Konstantin.
>
> It is much better, now.
>
> Could you add comments for the new methods:
> DefaultExecFlags(), SetExecFlags(), ClearExecFlags()
> in schframe.h ?
>
> Thanks.
>
>
> >
> > 2016-03-24 11:14 GMT+02:00 Константин Барановский <
> > baranovskiykonstantin@xxxxxxxxx>:
> >
> >> Hi.
> >>
> >> I propose new patch. It takes much more changes, but works fine and
> looks
> >> good for me. Anyway I need your comments on this.
> >> Main things:
> >> - added a new option to BOM dialog that shown on Windows only;
> >> - changed code of processing the BOM plugins;
> >> - added interface to manipulate of the wxExecute flags;
> >> - added ability to automatically processing the .pyw scripts (like it
> done
> >> with .py, .xsl);
> >> - added info to the help page.
> >>
> >> Regards, Konstantin.
> >>
>
>
>
> --
> Jean-Pierre CHARRAS
>
> _______________________________________________
> Mailing list: https://launchpad.net/~kicad-developers
> Post to : kicad-developers@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help : https://help.launchpad.net/ListHelp
>
=== modified file 'eeschema/dialogs/dialog_bom.cpp'
--- eeschema/dialogs/dialog_bom.cpp 2015-09-25 19:38:09 +0000
+++ eeschema/dialogs/dialog_bom.cpp 2016-03-30 16:37:05 +0000
@@ -34,6 +34,7 @@
#include <confirm.h>
#include <gestfich.h>
#include <schframe.h>
+#include <wx/dynarray.h>
#include <netlist.h>
#include <netlist_exporter_generic.h>
@@ -56,16 +57,34 @@
using namespace T_BOMCFG_T;
/**
+ * Structure BOM_PLUGIN
+ * holds data of the BOM plugin.
+ */
+struct BOM_PLUGIN
+{
+ wxString Name;
+ wxString Command;
+ wxArrayString Options;
+};
+
+/**
+ * Define wxArray of BOM_PLUGIN.
+ */
+WX_DECLARE_OBJARRAY( BOM_PLUGIN, BOM_PLUGIN_ARRAY );
+#include <wx/arrimpl.cpp>
+WX_DEFINE_OBJARRAY( BOM_PLUGIN_ARRAY );
+
+/**
* Class BOM_CFG_READER_PARSER
* holds data and functions pertinent to parsing a S-expression file
* for a WORKSHEET_LAYOUT.
*/
class BOM_CFG_READER_PARSER : public DIALOG_BOM_CFG_LEXER
{
- wxArrayString* m_pluginsList;
+ BOM_PLUGIN_ARRAY* m_pluginsList;
public:
- BOM_CFG_READER_PARSER( wxArrayString* aPlugins,
+ BOM_CFG_READER_PARSER( BOM_PLUGIN_ARRAY* aPlugins,
const char* aData, const wxString& aSource );
void Parse() throw( PARSE_ERROR, IO_ERROR );
@@ -75,7 +94,7 @@
// PCB_PLOT_PARAMS_PARSER
-BOM_CFG_READER_PARSER::BOM_CFG_READER_PARSER( wxArrayString* aPlugins,
+BOM_CFG_READER_PARSER::BOM_CFG_READER_PARSER( BOM_PLUGIN_ARRAY* aPlugins,
const char* aLine,
const wxString& aSource ) :
DIALOG_BOM_CFG_LEXER( aLine, aSource )
@@ -114,10 +133,10 @@
void BOM_CFG_READER_PARSER::parsePlugin() throw( IO_ERROR, PARSE_ERROR )
{
- wxString title, command;
+ BOM_PLUGIN plugin;
NeedSYMBOLorNUMBER();
- title = FromUTF8();
+ plugin.Name = FromUTF8();
T token;
while( ( token = NextTok() ) != T_RIGHT )
@@ -132,12 +151,14 @@
case T_cmd:
NeedSYMBOLorNUMBER();
- command = FromUTF8();
+ plugin.Command = FromUTF8();
NeedRIGHT();
break;
case T_opts:
- while( ( token = NextTok() ) != T_RIGHT && token != T_EOF );
+ NeedSYMBOLorNUMBER();
+ plugin.Options.Add( FromUTF8() );
+ NeedRIGHT();
break;
default:
@@ -146,23 +167,16 @@
}
}
- if( ! title.IsEmpty() )
- {
- m_pluginsList->Add( title );
- m_pluginsList->Add( command );
- }
+ if( ! plugin.Name.IsEmpty() )
+ m_pluginsList->Add( plugin );
}
-// The main dialog frame tu run scripts to build bom
+// The main dialog frame to run scripts to build bom
class DIALOG_BOM : public DIALOG_BOM_BASE
{
private:
SCH_EDIT_FRAME* m_parent;
- // The list of scripts (or plugins):
- // a script descr uses 2 lines:
- // the first is the title
- // the second is the command line
- wxArrayString m_plugins;
+ BOM_PLUGIN_ARRAY m_plugins;
wxConfigBase* m_config; // to store the "plugins"
public:
@@ -180,6 +194,7 @@
void OnEditPlugin( wxCommandEvent& event );
void OnCommandLineEdited( wxCommandEvent& event );
void OnNameEdited( wxCommandEvent& event );
+ void OnShowConsoleChanged( wxCommandEvent& event );
void pluginInit();
void installPluginsList();
@@ -218,6 +233,10 @@
m_config = Kiface().KifaceSettings();
installPluginsList();
+#ifdef __WINDOWS__
+ m_checkBoxShowConsole->Show( true );
+#endif
+
GetSizer()->Fit( this );
Centre();
}
@@ -228,18 +247,27 @@
// the config stores only one string.
// plugins are saved inside a S expr:
// ( plugins
- // ( plugin "plugin name" (cmd "command line") )
+ // ( plugin "plugin name 1" (cmd "command line 1") )
+ // ( plugin "plugin name 2" (cmd "command line 2") (opts "option1") (opts "option2") )
// ....
// )
STRING_FORMATTER writer;
writer.Print( 0, "(plugins" );
- for( unsigned ii = 0; ii < m_plugins.GetCount(); ii += 2 )
+ for( unsigned ii = 0; ii < m_plugins.GetCount(); ii++ )
{
- writer.Print( 1, "(plugin %s (cmd %s))",
- writer.Quotew( m_plugins[ii] ).c_str(),
- writer.Quotew( m_plugins[ii+1] ).c_str() );
+ writer.Print( 1, "(plugin %s (cmd %s)",
+ writer.Quotew( m_plugins.Item( ii ).Name ).c_str(),
+ writer.Quotew( m_plugins.Item( ii ).Command ).c_str() );
+
+ for( unsigned jj = 0; jj < m_plugins.Item( ii ).Options.GetCount(); jj++ )
+ {
+ writer.Print( 1, "(opts %s)",
+ writer.Quotew( m_plugins.Item( ii ).Options.Item( jj ) ).c_str() );
+ }
+
+ writer.Print( 0, ")" );
}
writer.Print( 0, ")" );
@@ -277,12 +305,12 @@
}
// Populate list box
- for( unsigned ii = 0; ii < m_plugins.GetCount(); ii+=2 )
+ for( unsigned ii = 0; ii < m_plugins.GetCount(); ii++ )
{
- m_lbPlugins->Append( m_plugins[ii] );
+ m_lbPlugins->Append( m_plugins.Item( ii ).Name );
- if( active_plugin_name == m_plugins[ii] )
- m_lbPlugins->SetSelection( ii/2 );
+ if( active_plugin_name == m_plugins.Item( ii ).Name )
+ m_lbPlugins->SetSelection( ii );
}
pluginInit();
@@ -305,8 +333,15 @@
return;
}
- m_textCtrlName->SetValue( m_plugins[2 * ii] );
- m_textCtrlCommand->SetValue( m_plugins[(2 * ii)+1] );
+ m_textCtrlName->SetValue( m_plugins.Item( ii ).Name );
+ m_textCtrlCommand->SetValue( m_plugins.Item( ii ).Command );
+
+#ifdef __WINDOWS__
+ if( m_plugins.Item( ii ).Options.Index( wxT( "show_console" ) ) == wxNOT_FOUND )
+ m_checkBoxShowConsole->SetValue( false );
+ else
+ m_checkBoxShowConsole->SetValue( true );
+#endif
wxString pluginName = getPluginFileName( m_textCtrlCommand->GetValue() );
@@ -392,6 +427,12 @@
wxString reportmsg;
WX_STRING_REPORTER reporter( &reportmsg );
m_parent->SetNetListerCommand( m_textCtrlCommand->GetValue() );
+
+#ifdef __WINDOWS__
+ if( m_checkBoxShowConsole->IsChecked() )
+ m_parent->SetExecFlags( wxEXEC_SHOW_CONSOLE );
+#endif
+
m_parent->CreateNetlist( -1, fullfilename, 0, &reporter );
m_Messages->SetValue( reportmsg );
@@ -417,7 +458,7 @@
m_lbPlugins->Delete( ii );
- m_plugins.RemoveAt( 2*ii, 2 ); // Remove title and command line
+ m_plugins.RemoveAt( ii );
// Select the next item, if exists
if( (int)m_lbPlugins->GetCount() >= ii )
@@ -436,6 +477,7 @@
void DIALOG_BOM::OnAddPlugin( wxCommandEvent& event )
{
wxString cmdLine = choosePlugin();
+ BOM_PLUGIN newPlugin;
if( cmdLine.IsEmpty() )
return;
@@ -451,18 +493,19 @@
return;
// Verify if it does not exists
- for( unsigned ii = 0; ii < m_plugins.GetCount(); ii += 2 )
+ for( unsigned ii = 0; ii < m_plugins.GetCount(); ii++ )
{
- if( name == m_plugins[ii] )
+ if( name == m_plugins.Item( ii ).Name )
{
wxMessageBox( _("This name already exists. Abort") );
return;
}
}
- // Eppend the new plugin
- m_plugins.Add( name );
- m_plugins.Add( wxEmptyString );
+ // Append the new plugin
+ newPlugin.Name = name;
+ newPlugin.Command = wxEmptyString;
+ m_plugins.Add( newPlugin );
m_lbPlugins->SetSelection( m_lbPlugins->GetCount() - 1 );
m_lbPlugins->Append( name );
m_lbPlugins->SetSelection( m_lbPlugins->GetCount() - 1 );
@@ -497,7 +540,7 @@
// Creates a default command line,
// suitable to run the external tool xslproc or python
// The default command line depending on plugin extension, currently
- // "xsl" or "exe" or "py"
+ // "xsl" or "exe" or "py" or "pyw"
wxString cmdLine;
wxFileName fn( fullFileName );
wxString ext = fn.GetExt();
@@ -508,6 +551,12 @@
cmdLine.Printf(wxT("\"%s\" < \"%%I\" > \"%%O\""), GetChars( fullFileName ) );
else if( ext == wxT("py" ) || ext.IsEmpty() )
cmdLine.Printf(wxT("python \"%s\" \"%%I\" \"%%O\""), GetChars( fullFileName ) );
+ else if( ext == wxT("pyw" ) || ext.IsEmpty() )
+#ifdef __WINDOWS__
+ cmdLine.Printf(wxT("pythonw \"%s\" \"%%I\" \"%%O\""), GetChars( fullFileName ) );
+#else
+ cmdLine.Printf(wxT("python \"%s\" \"%%I\" \"%%O\""), GetChars( fullFileName ) );
+#endif
else
cmdLine.Printf(wxT("\"%s\""), GetChars( fullFileName ) );
@@ -520,13 +569,17 @@
wxString pluginName;
// Try to find the plugin name.
- // This is possible if the name ends by .py or .xsl
+ // This is possible if the name ends by .py or .pyw or .xsl or .exe
int pos = -1;
- if( (pos = aCommand.Find( wxT(".py") )) != wxNOT_FOUND )
+ if( (pos = aCommand.Find( wxT(".pyw") )) != wxNOT_FOUND )
+ pos += 3;
+ else if( (pos = aCommand.Find( wxT(".py") )) != wxNOT_FOUND )
pos += 2;
else if( (pos = aCommand.Find( wxT(".xsl") )) != wxNOT_FOUND )
pos += 3;
+ else if( (pos = aCommand.Find( wxT(".exe") )) != wxNOT_FOUND )
+ pos += 3;
// the end of plugin name is at position pos.
if( pos > 0 )
@@ -604,7 +657,7 @@
if( ii < 0 )
return;
- m_plugins[(2 * ii)+1] = m_textCtrlCommand->GetValue();
+ m_plugins.Item( ii ).Command = m_textCtrlCommand->GetValue();
}
void DIALOG_BOM::OnNameEdited( wxCommandEvent& event )
@@ -614,6 +667,26 @@
if( ii < 0 )
return;
- m_plugins[2 * ii] = m_textCtrlName->GetValue();
- m_lbPlugins->SetString( ii, m_plugins[2 * ii] );
+ m_plugins.Item( ii ).Name = m_textCtrlName->GetValue();
+ m_lbPlugins->SetString( ii, m_plugins.Item( ii ).Name );
+}
+
+void DIALOG_BOM::OnShowConsoleChanged( wxCommandEvent& event )
+{
+#ifdef __WINDOWS__
+ int ii = m_lbPlugins->GetSelection();
+
+ if( ii < 0 )
+ return;
+
+ if( m_checkBoxShowConsole->IsChecked() )
+ {
+ if( m_plugins.Item( ii ).Options.Index( wxT( "show_console" ) ) == wxNOT_FOUND )
+ m_plugins.Item( ii ).Options.Add( wxT( "show_console" ) );
+ }
+ else
+ {
+ m_plugins.Item( ii ).Options.Remove( wxT( "show_console" ) );
+ }
+#endif
}
=== modified file 'eeschema/dialogs/dialog_bom_base.cpp'
--- eeschema/dialogs/dialog_bom_base.cpp 2016-02-19 23:25:03 +0000
+++ eeschema/dialogs/dialog_bom_base.cpp 2016-03-30 16:37:05 +0000
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// C++ code generated with wxFormBuilder (version Mar 28 2015)
+// C++ code generated with wxFormBuilder (version Mar 22 2016)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
@@ -19,6 +19,7 @@
EVT_BUTTON( ID_REMOVEL_PLUGIN, DIALOG_BOM_BASE::_wxFB_OnRemovePlugin )
EVT_BUTTON( wxID_ANY, DIALOG_BOM_BASE::_wxFB_OnEditPlugin )
EVT_TEXT( ID_CMDLINE, DIALOG_BOM_BASE::_wxFB_OnCommandLineEdited )
+ EVT_CHECKBOX( wxID_ANY, DIALOG_BOM_BASE::_wxFB_OnShowConsoleChanged )
END_EVENT_TABLE()
DIALOG_BOM_BASE::DIALOG_BOM_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
@@ -46,7 +47,6 @@
bLeftSizer->Add( m_staticTextName, 0, wxRIGHT|wxLEFT, 5 );
m_textCtrlName = new wxTextCtrl( this, IN_NAMELINE, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
- m_textCtrlName->SetMaxLength( 0 );
bLeftSizer->Add( m_textCtrlName, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
@@ -91,11 +91,16 @@
bbottomSizer->Add( m_staticTextCmd, 0, wxRIGHT|wxLEFT, 5 );
m_textCtrlCommand = new wxTextCtrl( this, ID_CMDLINE, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
- m_textCtrlCommand->SetMaxLength( 0 );
m_textCtrlCommand->SetMinSize( wxSize( 380,-1 ) );
bbottomSizer->Add( m_textCtrlCommand, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
+ m_checkBoxShowConsole = new wxCheckBox( this, wxID_ANY, _("Show console window"), wxDefaultPosition, wxDefaultSize, 0 );
+ m_checkBoxShowConsole->Hide();
+ m_checkBoxShowConsole->SetToolTip( _("By default, command line runs with hidden console window and output is redirected to \"Plugin info\" field. Set this option to show the window of the running command.") );
+
+ bbottomSizer->Add( m_checkBoxShowConsole, 0, wxBOTTOM|wxLEFT, 5 );
+
bMainSizer->Add( bbottomSizer, 0, wxEXPAND, 5 );
=== modified file 'eeschema/dialogs/dialog_bom_base.fbp'
--- eeschema/dialogs/dialog_bom_base.fbp 2015-06-15 13:54:58 +0000
+++ eeschema/dialogs/dialog_bom_base.fbp 2016-03-30 16:37:05 +0000
@@ -1263,6 +1263,94 @@
<event name="OnUpdateUI"></event>
</object>
</object>
+ <object class="sizeritem" expanded="1">
+ <property name="border">5</property>
+ <property name="flag">wxBOTTOM|wxLEFT</property>
+ <property name="proportion">0</property>
+ <object class="wxCheckBox" expanded="1">
+ <property name="BottomDockable">1</property>
+ <property name="LeftDockable">1</property>
+ <property name="RightDockable">1</property>
+ <property name="TopDockable">1</property>
+ <property name="aui_layer"></property>
+ <property name="aui_name"></property>
+ <property name="aui_position"></property>
+ <property name="aui_row"></property>
+ <property name="best_size"></property>
+ <property name="bg"></property>
+ <property name="caption"></property>
+ <property name="caption_visible">1</property>
+ <property name="center_pane">0</property>
+ <property name="checked">0</property>
+ <property name="close_button">1</property>
+ <property name="context_help"></property>
+ <property name="context_menu">1</property>
+ <property name="default_pane">0</property>
+ <property name="dock">Dock</property>
+ <property name="dock_fixed">0</property>
+ <property name="docking">Left</property>
+ <property name="enabled">1</property>
+ <property name="fg"></property>
+ <property name="floatable">1</property>
+ <property name="font"></property>
+ <property name="gripper">0</property>
+ <property name="hidden">1</property>
+ <property name="id">wxID_ANY</property>
+ <property name="label">Show console window</property>
+ <property name="max_size"></property>
+ <property name="maximize_button">0</property>
+ <property name="maximum_size"></property>
+ <property name="min_size"></property>
+ <property name="minimize_button">0</property>
+ <property name="minimum_size"></property>
+ <property name="moveable">1</property>
+ <property name="name">m_checkBoxShowConsole</property>
+ <property name="pane_border">1</property>
+ <property name="pane_position"></property>
+ <property name="pane_size"></property>
+ <property name="permission">protected</property>
+ <property name="pin_button">1</property>
+ <property name="pos"></property>
+ <property name="resize">Resizable</property>
+ <property name="show">1</property>
+ <property name="size"></property>
+ <property name="style"></property>
+ <property name="subclass"></property>
+ <property name="toolbar_pane">0</property>
+ <property name="tooltip">By default, command line runs with hidden console window and output is redirected to "Plugin info" field. Set this option to show the window of the running command.</property>
+ <property name="validator_data_type"></property>
+ <property name="validator_style">wxFILTER_NONE</property>
+ <property name="validator_type">wxDefaultValidator</property>
+ <property name="validator_variable"></property>
+ <property name="window_extra_style"></property>
+ <property name="window_name"></property>
+ <property name="window_style"></property>
+ <event name="OnChar"></event>
+ <event name="OnCheckBox">OnShowConsoleChanged</event>
+ <event name="OnEnterWindow"></event>
+ <event name="OnEraseBackground"></event>
+ <event name="OnKeyDown"></event>
+ <event name="OnKeyUp"></event>
+ <event name="OnKillFocus"></event>
+ <event name="OnLeaveWindow"></event>
+ <event name="OnLeftDClick"></event>
+ <event name="OnLeftDown"></event>
+ <event name="OnLeftUp"></event>
+ <event name="OnMiddleDClick"></event>
+ <event name="OnMiddleDown"></event>
+ <event name="OnMiddleUp"></event>
+ <event name="OnMotion"></event>
+ <event name="OnMouseEvents"></event>
+ <event name="OnMouseWheel"></event>
+ <event name="OnPaint"></event>
+ <event name="OnRightDClick"></event>
+ <event name="OnRightDown"></event>
+ <event name="OnRightUp"></event>
+ <event name="OnSetFocus"></event>
+ <event name="OnSize"></event>
+ <event name="OnUpdateUI"></event>
+ </object>
+ </object>
</object>
</object>
<object class="sizeritem" expanded="1">
@@ -1383,7 +1471,7 @@
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
- <property name="maxlength"></property>
+ <property name="maxlength">0</property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
=== modified file 'eeschema/dialogs/dialog_bom_base.h'
--- eeschema/dialogs/dialog_bom_base.h 2016-02-19 23:25:03 +0000
+++ eeschema/dialogs/dialog_bom_base.h 2016-03-30 16:37:05 +0000
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// C++ code generated with wxFormBuilder (version Mar 28 2015)
+// C++ code generated with wxFormBuilder (version Mar 22 2016)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
@@ -25,6 +25,7 @@
#include <wx/sizer.h>
#include <wx/button.h>
#include <wx/statline.h>
+#include <wx/checkbox.h>
#include <wx/dialog.h>
///////////////////////////////////////////////////////////////////////////
@@ -47,6 +48,7 @@
void _wxFB_OnRemovePlugin( wxCommandEvent& event ){ OnRemovePlugin( event ); }
void _wxFB_OnEditPlugin( wxCommandEvent& event ){ OnEditPlugin( event ); }
void _wxFB_OnCommandLineEdited( wxCommandEvent& event ){ OnCommandLineEdited( event ); }
+ void _wxFB_OnShowConsoleChanged( wxCommandEvent& event ){ OnShowConsoleChanged( event ); }
protected:
@@ -73,6 +75,7 @@
wxButton* m_buttonEdit;
wxStaticText* m_staticTextCmd;
wxTextCtrl* m_textCtrlCommand;
+ wxCheckBox* m_checkBoxShowConsole;
wxStaticText* m_staticTextInfo;
wxTextCtrl* m_Messages;
@@ -86,6 +89,7 @@
virtual void OnRemovePlugin( wxCommandEvent& event ) { event.Skip(); }
virtual void OnEditPlugin( wxCommandEvent& event ) { event.Skip(); }
virtual void OnCommandLineEdited( wxCommandEvent& event ) { event.Skip(); }
+ virtual void OnShowConsoleChanged( wxCommandEvent& event ) { event.Skip(); }
public:
=== modified file 'eeschema/dialogs/dialog_bom_help.html'
--- eeschema/dialogs/dialog_bom_help.html 2015-06-29 16:34:31 +0000
+++ eeschema/dialogs/dialog_bom_help.html 2016-03-30 16:37:05 +0000
@@ -109,6 +109,10 @@
command line to launch the converter (usually a script).</font></font></p>
</ul>
<p lang="en-US" class="western" style="margin-bottom: 0cm; widows: 0; orphans: 0; page-break-before: auto; page-break-after: auto">
+<font face="Times New Roman, serif"><font size="3" style="font-size: 12pt"><b><i>Note (Windows only):</i></b></font></font></p>
+<p lang="en-US" class="western" style="margin-bottom: 0cm; margin-top: 0cm; margin-left: 1cm; widows: 0; orphans: 0; page-break-before: auto; page-break-after: auto">
+<font face="Times New Roman, serif"><font size="3" style="font-size: 12pt"><i>By default, command line runs with hidden console window and output is redirected to "Plugin info" field. To show the window of the running command, set the checkbox "Show console window".</i></font></font></p>
+<p lang="en-US" class="western" style="margin-bottom: 0cm; widows: 0; orphans: 0; page-break-before: auto; page-break-after: auto">
<font face="Times New Roman, serif"><font size="3" style="font-size: 12pt">Once
you click on the generate button the following will happen:</font></font></p>
<ol>
=== modified file 'eeschema/netform.cpp'
--- eeschema/netform.cpp 2015-07-01 10:55:41 +0000
+++ eeschema/netform.cpp 2016-03-30 16:37:05 +0000
@@ -104,7 +104,7 @@
if( aReporter )
{
wxArrayString output, errors;
- int diag = wxExecute( commandLine, output, errors, wxEXEC_SYNC );
+ int diag = wxExecute( commandLine, output, errors, m_exec_flags );
wxString msg;
@@ -142,7 +142,9 @@
}
}
else
- ProcessExecute( commandLine, wxEXEC_SYNC );
+ ProcessExecute( commandLine, m_exec_flags );
+
+ DefaultExecFlags(); // Reset flags to default after executing
}
return res;
=== modified file 'eeschema/schframe.cpp'
--- eeschema/schframe.cpp 2016-03-06 21:22:01 +0000
+++ eeschema/schframe.cpp 2016-03-30 16:37:05 +0000
@@ -420,6 +420,9 @@
GetScreen()->SetZoom( BestZoom() );
Zoom_Automatique( false );
+
+ // Net list generator
+ DefaultExecFlags();
}
=== modified file 'eeschema/schframe.h'
--- eeschema/schframe.h 2016-03-23 12:16:27 +0000
+++ eeschema/schframe.h 2016-03-30 18:08:39 +0000
@@ -145,6 +145,8 @@
///< simulator (gnucap, spice, ...)
wxString m_netListerCommand; ///< Command line to call a custom net list
///< generator.
+ int m_exec_flags; ///< Flags of the wxExecute() function
+ ///< to call a custom net list generator.
bool m_forceHVLines; ///< force H or V directions for wires, bus, line
@@ -522,7 +524,7 @@
bool CreateNetlist( int aFormat,
const wxString& aFullFileName,
unsigned aNetlistOptions,
- REPORTER* aReporter = NULL );
+ REPORTER* aReporter = NULL );
/**
* Function WriteNetListFile
@@ -1353,6 +1355,29 @@
void SetNetListerCommand( const wxString& aCommand ) { m_netListerCommand = aCommand; }
+ /**
+ * Function DefaultExecFlags
+ * resets the execution flags to defaults for external netlist and
+ * bom generators.
+ */
+ void DefaultExecFlags() { m_exec_flags = wxEXEC_SYNC; }
+
+ /**
+ * Function SetExecFlags
+ * sets (adds) specified flags for next execution of external
+ * generator of the netlist or bom.
+ * @param aFlags = wxEXEC_* flags, see wxExecute docs.
+ */
+ void SetExecFlags( const int aFlags ) { m_exec_flags |= aFlags; }
+
+ /**
+ * Function ClearExecFlags
+ * clears (removes) specified flags that not needed for next execution
+ * of external generator of the netlist or bom.
+ * @param aFlags = wxEXEC_* flags, see wxExecute docs.
+ */
+ void ClearExecFlags( const int aFlags ) { m_exec_flags &= ~( aFlags ); }
+
wxString GetNetListerCommand() const { return m_netListerCommand; }
DECLARE_EVENT_TABLE()
Follow ups
References
-
Re: Trouble with BOM plugin execution on Windows
From: Константин Барановский, 2016-03-14
-
Re: Trouble with BOM plugin execution on Windows
From: Wayne Stambaugh, 2016-03-14
-
Re: Trouble with BOM plugin execution on Windows
From: Константин Барановский, 2016-03-18
-
Re: Trouble with BOM plugin execution on Windows
From: Wayne Stambaugh, 2016-03-18
-
Re: Trouble with BOM plugin execution on Windows
From: Константин Барановский, 2016-03-18
-
Re: Trouble with BOM plugin execution on Windows
From: jp charras, 2016-03-18
-
Re: Trouble with BOM plugin execution on Windows
From: Константин Барановский, 2016-03-18
-
Re: Trouble with BOM plugin execution on Windows
From: jp charras, 2016-03-19
-
Re: Trouble with BOM plugin execution on Windows
From: Константин Барановский, 2016-03-19
-
Re: Trouble with BOM plugin execution on Windows
From: Wayne Stambaugh, 2016-03-21
-
Re: Trouble with BOM plugin execution on Windows
From: Chris Pavlina, 2016-03-21
-
Re: Trouble with BOM plugin execution on Windows
From: Константин Барановский, 2016-03-24
-
Re: Trouble with BOM plugin execution on Windows
From: Константин Барановский, 2016-03-30
-
Re: Trouble with BOM plugin execution on Windows
From: jp charras, 2016-03-30