KiCad PCB EDA Suite
dialog_bom.cpp
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KiCad, a free EDA CAD application.
3  *
4  * Copyright (C) 2015 Jean-Pierre Charras, jp.charras@wanadoo.fr
5  * Copyright (C) 1992-2015 KiCad Developers, see AUTHORS.txt for contributors.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, you may find one here:
19  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20  * or you may search the http://www.gnu.org website for the version 2 license,
21  * or you may write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23  */
24 
31 #include <fctsys.h>
32 #include <pgm_base.h>
33 #include <kiface_i.h>
34 #include <confirm.h>
35 #include <gestfich.h>
36 #include <schframe.h>
37 #include <wx/dynarray.h>
38 
39 #include <netlist.h>
41 #include <sch_sheet.h>
42 #include <invoke_sch_dialog.h>
43 #include <dialog_helpers.h>
44 #include <dialog_bom_base.h>
45 #include <html_messagebox.h>
46 #include <reporter.h>
47 
48 #define BOM_PLUGINS_KEY wxT("bom_plugins")
49 #define BOM_PLUGIN_SELECTED_KEY wxT("bom_plugin_selected")
50 
51 const char * s_bomHelpInfo =
52 #include <dialog_bom_help_html.h>
53 ;
54 
55 #include <dialog_bom_cfg_lexer.h>
56 
57 using namespace T_BOMCFG_T;
58 
63 struct BOM_PLUGIN
64 {
65  wxString Name;
66  wxString Command;
67  wxArrayString Options;
68 };
69 
73 WX_DECLARE_OBJARRAY( BOM_PLUGIN, BOM_PLUGIN_ARRAY );
74 #include <wx/arrimpl.cpp>
75 WX_DEFINE_OBJARRAY( BOM_PLUGIN_ARRAY );
76 
83 {
84  BOM_PLUGIN_ARRAY* m_pluginsList;
85 
86 public:
87  BOM_CFG_READER_PARSER( BOM_PLUGIN_ARRAY* aPlugins,
88  const char* aData, const wxString& aSource );
89  void Parse() throw( PARSE_ERROR, IO_ERROR );
90 
91 private:
92  void parsePlugin() throw( IO_ERROR, PARSE_ERROR );
93 };
94 
95 // PCB_PLOT_PARAMS_PARSER
96 
97 BOM_CFG_READER_PARSER::BOM_CFG_READER_PARSER( BOM_PLUGIN_ARRAY* aPlugins,
98  const char* aLine,
99  const wxString& aSource ) :
100  DIALOG_BOM_CFG_LEXER( aLine, aSource )
101 {
102  m_pluginsList = aPlugins;
103 }
104 
105 
107 {
108  T token;
109 
110  while( ( token = NextTok() ) != T_RIGHT )
111  {
112  if( token == T_EOF)
113  break;
114 
115  if( token == T_LEFT )
116  token = NextTok();
117 
118  if( token == T_plugins )
119  continue;
120 
121  switch( token )
122  {
123  case T_plugin: // Defines a new plugin
124  parsePlugin();
125  break;
126 
127  default:
128 // Unexpected( CurText() );
129  break;
130  }
131  }
132 }
133 
135 {
136  BOM_PLUGIN plugin;
137 
138  NeedSYMBOLorNUMBER();
139  plugin.Name = FromUTF8();
140 
141  T token;
142  while( ( token = NextTok() ) != T_RIGHT )
143  {
144  if( token == T_EOF)
145  break;
146 
147  switch( token )
148  {
149  case T_LEFT:
150  break;
151 
152  case T_cmd:
153  NeedSYMBOLorNUMBER();
154  plugin.Command = FromUTF8();
155  NeedRIGHT();
156  break;
157 
158  case T_opts:
159  NeedSYMBOLorNUMBER();
160  plugin.Options.Add( FromUTF8() );
161  NeedRIGHT();
162  break;
163 
164  default:
165  Unexpected( CurText() );
166  break;
167  }
168  }
169 
170  if( ! plugin.Name.IsEmpty() )
171  m_pluginsList->Add( plugin );
172 }
173 
174 // The main dialog frame to run scripts to build bom
176 {
177 private:
179  BOM_PLUGIN_ARRAY m_plugins;
180  wxConfigBase* m_config; // to store the "plugins"
181 
182 public:
183  // Constructor and destructor
184  DIALOG_BOM( SCH_EDIT_FRAME* parent );
185  ~DIALOG_BOM();
186 
187 private:
188  void OnPluginSelected( wxCommandEvent& event ) override;
189  void OnRunPlugin( wxCommandEvent& event ) override;
190  void OnCancelClick( wxCommandEvent& event ) override;
191  void OnHelp( wxCommandEvent& event ) override;
192  void OnAddPlugin( wxCommandEvent& event ) override;
193  void OnRemovePlugin( wxCommandEvent& event ) override;
194  void OnEditPlugin( wxCommandEvent& event ) override;
195  void OnCommandLineEdited( wxCommandEvent& event ) override;
196  void OnNameEdited( wxCommandEvent& event ) override;
197  void OnShowConsoleChanged( wxCommandEvent& event ) override;
198 
199  void pluginInit();
200  void installPluginsList();
201 
206  wxString getPluginFileName( const wxString& aCommand );
207 
213  void displayPluginInfo( FILE * aFile, const wxString& aFilename );
214 
219  wxString choosePlugin();
220 };
221 
222 // Create and show DIALOG_BOM.
224 {
225  DIALOG_BOM dlg( aCaller );
226  return dlg.ShowModal();
227 }
228 
230  DIALOG_BOM_BASE( parent )
231 {
232  m_parent = parent;
235 
236 #ifdef __WINDOWS__
237  m_checkBoxShowConsole->Show( true );
238 #endif
239 
240  // Now all widgets have the size fixed, call FinishDialogSettings
242 }
243 
245 {
246  // Save the plugin descriptions in config.
247  // the config stores only one string.
248  // plugins are saved inside a S expr:
249  // ( plugins
250  // ( plugin "plugin name 1" (cmd "command line 1") )
251  // ( plugin "plugin name 2" (cmd "command line 2") (opts "option1") (opts "option2") )
252  // ....
253  // )
254 
255  STRING_FORMATTER writer;
256  writer.Print( 0, "(plugins" );
257 
258  for( unsigned ii = 0; ii < m_plugins.GetCount(); ii++ )
259  {
260  writer.Print( 1, "(plugin %s (cmd %s)",
261  writer.Quotew( m_plugins.Item( ii ).Name ).c_str(),
262  writer.Quotew( m_plugins.Item( ii ).Command ).c_str() );
263 
264  for( unsigned jj = 0; jj < m_plugins.Item( ii ).Options.GetCount(); jj++ )
265  {
266  writer.Print( 1, "(opts %s)",
267  writer.Quotew( m_plugins.Item( ii ).Options.Item( jj ) ).c_str() );
268  }
269 
270  writer.Print( 0, ")" );
271  }
272 
273  writer.Print( 0, ")" );
274 
275  wxString list( FROM_UTF8( writer.GetString().c_str() ) );
276 
277  m_config->Write( BOM_PLUGINS_KEY, list );
278 
279  wxString active_plugin_name = m_lbPlugins->GetStringSelection( );
280  m_config->Write( BOM_PLUGIN_SELECTED_KEY, active_plugin_name );
281 
282 }
283 
284 /* Read the initialized plugins in config and fill the list
285  * of names
286  */
288 {
289  wxString list, active_plugin_name;
290  m_config->Read( BOM_PLUGINS_KEY, &list );
291  m_config->Read( BOM_PLUGIN_SELECTED_KEY, &active_plugin_name );
292 
293  if( !list.IsEmpty() )
294  {
295  BOM_CFG_READER_PARSER cfg_parser( &m_plugins, TO_UTF8( list ),
296  wxT( "plugins" ) );
297  try
298  {
299  cfg_parser.Parse();
300  }
301  catch( const IO_ERROR& )
302  {
303 // wxLogMessage( ioe.What() );
304  }
305  }
306 
307  // Populate list box
308  for( unsigned ii = 0; ii < m_plugins.GetCount(); ii++ )
309  {
310  m_lbPlugins->Append( m_plugins.Item( ii ).Name );
311 
312  if( active_plugin_name == m_plugins.Item( ii ).Name )
313  m_lbPlugins->SetSelection( ii );
314  }
315 
316  pluginInit();
317 }
318 
319 void DIALOG_BOM::OnPluginSelected( wxCommandEvent& event )
320 {
321  pluginInit();
322 }
323 
324 #include <wx/ffile.h>
326 {
327  int ii = m_lbPlugins->GetSelection();
328 
329  if( ii < 0 )
330  {
331  m_textCtrlName->SetValue( wxEmptyString );
332  m_textCtrlCommand->SetValue( wxEmptyString );
333  return;
334  }
335 
336  m_textCtrlName->SetValue( m_plugins.Item( ii ).Name );
337  m_textCtrlCommand->SetValue( m_plugins.Item( ii ).Command );
338 
339 #ifdef __WINDOWS__
340  if( m_plugins.Item( ii ).Options.Index( wxT( "show_console" ) ) == wxNOT_FOUND )
341  m_checkBoxShowConsole->SetValue( false );
342  else
343  m_checkBoxShowConsole->SetValue( true );
344 #endif
345 
346  wxString pluginName = getPluginFileName( m_textCtrlCommand->GetValue() );
347 
348  if( pluginName.IsEmpty() )
349  return;
350 
351  FILE* pluginFile = wxFopen( pluginName, "rt" );
352 
353  if( pluginFile == NULL )
354  {
355  wxString msg;
356  msg.Printf( _( "Failed to open file '%s'" ), GetChars( pluginName ) );
357  DisplayError( this, msg );
358  return;
359  }
360 
361  displayPluginInfo( pluginFile, pluginName );
362 }
363 
364 
365 void DIALOG_BOM::displayPluginInfo( FILE * aFile, const wxString& aFilename )
366 {
367  m_Messages->Clear();
368 
369  // display (when exists) the text found between the keyword "@package"
370  // (compatible with doxygen comments)
371  // and the end of comment block (""" in python", --> in xml)
372 
373  wxString data;
374  wxFFile fdata( aFile ); // dtor will close the file
375 
376  if( !fdata.ReadAll( &data ) )
377  return;
378 
379  wxString header( wxT( "@package" ) );
380  wxString endsection( wxT( "-->" ) ); // For xml
381 
382  wxFileName fn( aFilename );
383 
384  if( fn.GetExt().IsSameAs( wxT("py"), false ) )
385  endsection = wxT( "\"\"\"" );
386  else if( !fn.GetExt().IsSameAs( wxT("xsl"), false ) )
387  // If this is not a python file, we know nothing about file
388  // and the info cannot be found
389  return;
390 
391  // Extract substring between @package and """
392  int strstart = data.Find( header );
393 
394  if( strstart == wxNOT_FOUND )
395  return;
396 
397  strstart += header.Length();
398  int strend = data.find( endsection, strstart );
399 
400  if( strend == wxNOT_FOUND)
401  return;
402 
403  // Remove empty line if any
404  while( data[strstart] < ' ' )
405  strstart++;
406 
407  m_Messages->SetValue( data.SubString( strstart, strend-1 ) );
408 }
409 
414 void DIALOG_BOM::OnRunPlugin( wxCommandEvent& event )
415 {
416  wxFileName fn;
417 
418  // Calculate the xml netlist filename
419  fn = g_RootSheet->GetScreen()->GetFileName();
420 
421  fn.SetPath( wxPathOnly( Prj().GetProjectFullName() ) );
422 
423  fn.ClearExt();
424  wxString fullfilename = fn.GetFullPath();
426 
427  wxString reportmsg;
428  WX_STRING_REPORTER reporter( &reportmsg );
430 
431 #ifdef __WINDOWS__
432  if( m_checkBoxShowConsole->IsChecked() )
433  m_parent->SetExecFlags( wxEXEC_SHOW_CONSOLE );
434 #endif
435 
436  m_parent->CreateNetlist( -1, fullfilename, 0, &reporter );
437 
438  m_Messages->SetValue( reportmsg );
439 }
440 
441 
442 void DIALOG_BOM::OnCancelClick( wxCommandEvent& event )
443 {
444  EndModal( wxID_CANCEL );
445 }
446 
447 
452 void DIALOG_BOM::OnRemovePlugin( wxCommandEvent& event )
453 {
454  int ii = m_lbPlugins->GetSelection();
455 
456  if( ii < 0 )
457  return;
458 
459  m_lbPlugins->Delete( ii );
460 
461  m_plugins.RemoveAt( ii );
462 
463  // Select the next item, if exists
464  if( (int)m_lbPlugins->GetCount() >= ii )
465  ii = m_lbPlugins->GetCount() - 1;
466 
467  if( ii >= 0 )
468  m_lbPlugins->SetSelection( ii );
469 
470  pluginInit();
471 }
472 
477 void DIALOG_BOM::OnAddPlugin( wxCommandEvent& event )
478 {
479  wxString cmdLine = choosePlugin();
480  BOM_PLUGIN newPlugin;
481 
482  if( cmdLine.IsEmpty() )
483  return;
484 
485  // Creates a new plugin entry
486  wxFileName fn( getPluginFileName( cmdLine ) );
487 
488  wxString defaultName = fn.GetName();
489  wxString name = wxGetTextFromUser( _("Plugin name in plugin list") ,
490  _("Plugin name"), defaultName );
491 
492  if( name.IsEmpty() )
493  return;
494 
495  // Verify if it does not exists
496  for( unsigned ii = 0; ii < m_plugins.GetCount(); ii++ )
497  {
498  if( name == m_plugins.Item( ii ).Name )
499  {
500  wxMessageBox( _("This name already exists. Abort") );
501  return;
502  }
503  }
504 
505  // Append the new plugin
506  newPlugin.Name = name;
507  newPlugin.Command = wxEmptyString;
508  m_plugins.Add( newPlugin );
509  m_lbPlugins->SetSelection( m_lbPlugins->GetCount() - 1 );
510  m_lbPlugins->Append( name );
511  m_lbPlugins->SetSelection( m_lbPlugins->GetCount() - 1 );
512  m_textCtrlCommand->SetValue( cmdLine );
513 
514  pluginInit();
515 }
516 
517 /*
518  * Browse plugin files, and set m_CommandStringCtrl field
519  */
521 {
522  wxString mask = wxT( "*" );
523 #ifndef __WXMAC__
524  wxString path = Pgm().GetExecutablePath();
525 #else
526  wxString path = GetOSXKicadDataDir() + wxT( "/plugins" );
527 #endif
528 
529  wxString fullFileName = EDA_FILE_SELECTOR( _( "Plugin files:" ),
530  path,
531  wxEmptyString,
532  wxEmptyString,
533  mask,
534  this,
535  wxFD_OPEN,
536  true );
537  if( fullFileName.IsEmpty() )
538  return wxEmptyString;
539 
540  // Creates a default command line,
541  // suitable to run the external tool xslproc or python
542  // The default command line depending on plugin extension, currently
543  // "xsl" or "exe" or "py" or "pyw"
544  wxString cmdLine;
545  wxFileName fn( fullFileName );
546  wxString ext = fn.GetExt();
547 
548  if( ext == wxT("xsl" ) )
549  cmdLine.Printf(wxT("xsltproc -o \"%%O\" \"%s\" \"%%I\""), GetChars( fullFileName ) );
550  else if( ext == wxT("exe" ) || ext.IsEmpty() )
551  cmdLine.Printf(wxT("\"%s\" < \"%%I\" > \"%%O\""), GetChars( fullFileName ) );
552  else if( ext == wxT("py" ) || ext.IsEmpty() )
553  cmdLine.Printf(wxT("python \"%s\" \"%%I\" \"%%O\""), GetChars( fullFileName ) );
554  else if( ext == wxT("pyw" ) || ext.IsEmpty() )
555 #ifdef __WINDOWS__
556  cmdLine.Printf(wxT("pythonw \"%s\" \"%%I\" \"%%O\""), GetChars( fullFileName ) );
557 #else
558  cmdLine.Printf(wxT("python \"%s\" \"%%I\" \"%%O\""), GetChars( fullFileName ) );
559 #endif
560  else
561  cmdLine.Printf(wxT("\"%s\""), GetChars( fullFileName ) );
562 
563  return cmdLine;
564 }
565 
566 
567 wxString DIALOG_BOM::getPluginFileName( const wxString& aCommand )
568 {
569  wxString pluginName;
570 
571  // Try to find the plugin name.
572  // This is possible if the name ends by .py or .pyw or .xsl or .exe
573  int pos = -1;
574 
575  if( (pos = aCommand.Find( wxT(".pyw") )) != wxNOT_FOUND )
576  pos += 3;
577  else if( (pos = aCommand.Find( wxT(".py") )) != wxNOT_FOUND )
578  pos += 2;
579  else if( (pos = aCommand.Find( wxT(".xsl") )) != wxNOT_FOUND )
580  pos += 3;
581  else if( (pos = aCommand.Find( wxT(".exe") )) != wxNOT_FOUND )
582  pos += 3;
583 
584  // the end of plugin name is at position pos.
585  if( pos > 0 )
586  {
587  // Be sure this is the end of the name: the next char is " or space
588  int eos = aCommand[pos+1];
589 
590  if( eos == ' '|| eos == '\"' )
591  {
592  // search for the starting point of the name
593  int jj = pos-1;
594  while( jj >= 0 )
595  if( aCommand[jj] != eos )
596  jj--;
597  else
598  break;
599 
600  // extract the name
601  if( jj >= 0 )
602  {
603  eos = aCommand[jj];
604 
605  if( eos == ' '|| eos == '\"' ) // do not include delimiters
606  jj++;
607 
608  pluginName = aCommand.SubString( jj, pos );
609  }
610  }
611  }
612 
613  // Using a format like %P is possible in plugin name, so expand it
614  wxString prj_dir = Prj().GetProjectPath();
615 
616  if( prj_dir.EndsWith( '/' ) || prj_dir.EndsWith( '\\' ) )
617  prj_dir.RemoveLast();
618 
619  pluginName.Replace( wxT( "%P" ), prj_dir.GetData(), true );
620 
621  return pluginName;
622 }
623 
624 void DIALOG_BOM::OnEditPlugin( wxCommandEvent& event )
625 {
626  wxString pluginName = getPluginFileName( m_textCtrlCommand->GetValue() );
627 
628  if( pluginName.Length() <= 2 ) // if name != ""
629  {
630  wxMessageBox( _("Plugin file name not found. Cannot edit plugin file") );
631  return;
632  }
633 
634  AddDelimiterString( pluginName );
635  wxString editorname = Pgm().GetEditorName();
636 
637  if( !editorname.IsEmpty() )
638  ExecuteFile( this, editorname, pluginName );
639  else
640  wxMessageBox( _("No text editor selected in KiCad. Please choose it") );
641 }
642 
643 void DIALOG_BOM::OnHelp( wxCommandEvent& event )
644 {
645  HTML_MESSAGE_BOX help_Dlg( this, _("Bom Generation Help"),
646  wxDefaultPosition, wxSize( 750,550 ) );
647 
648  wxString msg = FROM_UTF8(s_bomHelpInfo);
649  help_Dlg.m_htmlWindow->AppendToPage( msg );
650  help_Dlg.ShowModal();
651 }
652 
653 void DIALOG_BOM::OnCommandLineEdited( wxCommandEvent& event )
654 {
655  int ii = m_lbPlugins->GetSelection();
656 
657  if( ii < 0 )
658  return;
659 
660  m_plugins.Item( ii ).Command = m_textCtrlCommand->GetValue();
661 }
662 
663 void DIALOG_BOM::OnNameEdited( wxCommandEvent& event )
664 {
665  int ii = m_lbPlugins->GetSelection();
666 
667  if( ii < 0 )
668  return;
669 
670  m_plugins.Item( ii ).Name = m_textCtrlName->GetValue();
671  m_lbPlugins->SetString( ii, m_plugins.Item( ii ).Name );
672 }
673 
674 void DIALOG_BOM::OnShowConsoleChanged( wxCommandEvent& event )
675 {
676 #ifdef __WINDOWS__
677  int ii = m_lbPlugins->GetSelection();
678 
679  if( ii < 0 )
680  return;
681 
682  if( m_checkBoxShowConsole->IsChecked() )
683  {
684  if( m_plugins.Item( ii ).Options.Index( wxT( "show_console" ) ) == wxNOT_FOUND )
685  m_plugins.Item( ii ).Options.Add( wxT( "show_console" ) );
686  }
687  else
688  {
689  m_plugins.Item( ii ).Options.Remove( wxT( "show_console" ) );
690  }
691 #endif
692 }
Definition of the SCH_SHEET class for Eeschema.
void OnPluginSelected(wxCommandEvent &event) override
Definition: dialog_bom.cpp:319
T
enum T contains all this lexer's tokens.
void OnCommandLineEdited(wxCommandEvent &event) override
Definition: dialog_bom.cpp:653
wxArrayString Options
Definition: dialog_bom.cpp:67
static wxString FROM_UTF8(const char *cstring)
function FROM_UTF8 converts a UTF8 encoded C string to a wxString for all wxWidgets build modes...
Definition: macros.h:53
This file is part of the common library TODO brief description.
DIALOG_BOM(SCH_EDIT_FRAME *parent)
Definition: dialog_bom.cpp:229
Structure BOM_PLUGIN holds data of the BOM plugin.
Definition: dialog_bom.cpp:63
This file is part of the common library.
VTBL_ENTRY const wxString & GetExecutablePath() const
Definition: pgm_base.h:173
const char * s_bomHelpInfo
Definition: dialog_bom.cpp:51
#define BOM_PLUGIN_SELECTED_KEY
Definition: dialog_bom.cpp:49
wxString getPluginFileName(const wxString &aCommand)
Definition: dialog_bom.cpp:567
const wxString & GetFileName() const
void FinishDialogSettings()
In all dialogs, we must call the same functions to fix minimal dlg size, the default position and per...
PGM_BASE & Pgm()
The global Program "get" accessor.
Definition: kicad.cpp:65
Schematic editor (Eeschema) main window.
Definition: schframe.h:117
int InvokeDialogCreateBOM(SCH_EDIT_FRAME *aCaller)
Create and show DIALOG_BOM and return whatever DIALOG_BOM::ShowModal() returns.
Definition: dialog_bom.cpp:223
void OnRunPlugin(wxCommandEvent &event) override
Function RunPlugin run the plugin command line.
Definition: dialog_bom.cpp:414
SCH_SCREEN * GetScreen()
Definition: sch_sheet.h:286
WX_DECLARE_OBJARRAY(BOM_PLUGIN, BOM_PLUGIN_ARRAY)
Define wxArray of BOM_PLUGIN.
void OnRemovePlugin(wxCommandEvent &event) override
Function OnRemovePlugin Remove a plugin from the list.
Definition: dialog_bom.cpp:452
KIFACE_I & Kiface()
Global KIFACE_I "get" accessor.
Definition: kicad.cpp:52
void OnHelp(wxCommandEvent &event) override
Definition: dialog_bom.cpp:643
wxListBox * m_lbPlugins
#define TO_UTF8(wxstring)
Macro TO_UTF8 converts a wxString to a UTF8 encoded C string for all wxWidgets build modes...
Definition: macros.h:47
PROJECT & Prj() const
Function Prj returns a reference to the PROJECT "associated with" this KIWAY.
void OnCancelClick(wxCommandEvent &event) override
Definition: dialog_bom.cpp:442
wxString Name
Definition: dialog_bom.cpp:65
BOM_PLUGIN_ARRAY * m_pluginsList
Definition: dialog_bom.cpp:84
wxTextCtrl * m_textCtrlName
SCH_SHEET * g_RootSheet
Definition: eeschema.cpp:54
wxCheckBox * m_checkBoxShowConsole
void OnNameEdited(wxCommandEvent &event) override
Definition: dialog_bom.cpp:663
bool CreateNetlist(int aFormat, const wxString &aFullFileName, unsigned aNetlistOptions, REPORTER *aReporter=NULL)
Function CreateNetlist.
Subclass of DIALOG_DISPLAY_HTML_TEXT_BASE, which is generated by wxFormBuilder.
wxString EDA_FILE_SELECTOR(const wxString &aTitle, const wxString &aPath, const wxString &aFileName, const wxString &aExtension, const wxString &aWildcard, wxWindow *aParent, int aStyle, const bool aKeepWorkingDirectory, const wxPoint &aPosition, wxString *aMruPath)
Function EDA_FILE_SELECTOR.
Definition: gestfich.cpp:82
Class DIALOG_BOM_CFG_LEXER is an automatically generated class using the TokenList2DnsLexer.cmake technology, based on keywords provided by file: /home/kicad/workspace/kicad-doxygen/eeschema/dialogs/dialog_bom_cfg.keywords.
wxTextCtrl * m_textCtrlCommand
void OnEditPlugin(wxCommandEvent &event) override
Definition: dialog_bom.cpp:624
Helper dialog and control classes.
wxString choosePlugin()
Browse plugin files, and set m_CommandStringCtrl field.
Definition: dialog_bom.cpp:520
wxConfigBase * KifaceSettings() const
Definition: kiface_i.h:101
void AddDelimiterString(wxString &string)
Function AddDelimiterString Add un " to the start and the end of string (if not already done)...
Definition: gestfich.cpp:44
#define BOM_PLUGINS_KEY
Definition: dialog_bom.cpp:48
const std::string & GetString()
Definition: richio.h:475
std::string Quotew(const wxString &aWrapee)
Definition: richio.cpp:486
Class HTML_MESSAGE_BOX.
wxTextCtrl * m_Messages
Class WX_STRING_REPORTER is a wrapper for reporting to a wxString object.
Definition: reporter.h:114
Class BOM_CFG_READER_PARSER holds data and functions pertinent to parsing a S-expression file for a W...
Definition: dialog_bom.cpp:82
BOM_PLUGIN_ARRAY m_plugins
Definition: dialog_bom.cpp:179
void OnAddPlugin(wxCommandEvent &event) override
Function OnAddPlugin Add a new panel for a new netlist plugin.
Definition: dialog_bom.cpp:477
Struct PARSE_ERROR contains a filename or source description, a problem input line, a line number, a byte offset, and an error message which contains the the caller's report and his call site information: CPP source file, function, and line number.
Definition: ki_exception.h:94
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:92
see class PGM_BASE
void displayPluginInfo(FILE *aFile, const wxString &aFilename)
display (when exists) the text found between the keyword "@package" (compatible with doxygen comments...
Definition: dialog_bom.cpp:365
wxString Command
Definition: dialog_bom.cpp:66
Class DIALOG_BOM_BASE.
VTBL_ENTRY const wxString GetProjectPath() const
Function GetProjectPath returns the full path of the project.
Definition: project.cpp:102
void installPluginsList()
Definition: dialog_bom.cpp:287
SCH_EDIT_FRAME * m_parent
Definition: dialog_bom.cpp:178
VTBL_ENTRY const wxString & GetEditorName(bool aCanShowFileChooser=true)
Return the preferred editor name.
Definition: pgm_base.cpp:336
C++ does not put enum values in separate namespaces unless the enum itself is in a separate namespace...
WX_DEFINE_OBJARRAY(BOM_PLUGIN_ARRAY)
int PRINTF_FUNC Print(int nestLevel, const char *fmt,...)
Function Print formats and writes text to the output stream.
Definition: richio.cpp:408
wxConfigBase * m_config
Definition: dialog_bom.cpp:180
Class STRING_FORMATTER implements OUTPUTFORMATTER to a memory buffer.
Definition: richio.h:445
int ExecuteFile(wxWindow *frame, const wxString &ExecFile, const wxString &param, wxProcess *callback)
Function ExecuteFile calls the executable file ExecFile with the command line parameters param...
Definition: gestfich.cpp:208
void SetExecFlags(const int aFlags)
Function SetExecFlags sets (adds) specified flags for next execution of external generator of the net...
Definition: schframe.h:1388
void DisplayError(wxWindow *parent, const wxString &text, int displaytime)
Function DisplayError displays an error or warning message box with aMessage.
Definition: confirm.cpp:69
Struct IO_ERROR is a class used to hold an error message and may be used when throwing exceptions con...
Definition: ki_exception.h:47
void SetNetListerCommand(const wxString &aCommand)
Definition: schframe.h:1373
void ClearMsgPanel(void)
Clear all messages from the message panel.
Definition: draw_frame.cpp:742
void pluginInit()
Definition: dialog_bom.cpp:325
void OnShowConsoleChanged(wxCommandEvent &event) override
Definition: dialog_bom.cpp:674