Browse Source

Don't report filepath messages for jobs.

(They'll just point to temp files anyway.)

Also moves schematic netlist fetching to
MAIL_SCH_GET_NETLIST.
Eeschema's generateSchematicNetlist() hasn't
worked in some time.

Also suppresses parity error counts when parity
not run due to failure to find or load schematic.

Also writes out ERC/DRC reports even when they're
set to fail the job.

Also improves adding/removing netlist exporters to
select an appropriate tab in the dialog (either
the newly-created one or the one preceeding the
deleted one).
pcb_db
Jeff Young 9 months ago
parent
commit
b6d03255f0
  1. 20
      common/dialogs/dialog_rc_job_base.cpp
  2. 256
      common/dialogs/dialog_rc_job_base.fbp
  3. 6
      common/dialogs/dialog_rc_job_base.h
  4. 206
      eeschema/dialogs/dialog_export_netlist.cpp
  5. 10
      eeschema/dialogs/dialog_export_netlist_base.cpp
  6. 48
      eeschema/dialogs/dialog_export_netlist_base.fbp
  7. 10
      eeschema/dialogs/dialog_export_netlist_base.h

20
common/dialogs/dialog_rc_job_base.cpp

@ -22,6 +22,15 @@ DIALOG_RC_JOB_BASE::DIALOG_RC_JOB_BASE( wxWindow* parent, wxWindowID id, const w
fgSizer1->SetFlexibleDirection( wxBOTH );
fgSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_textOutputPath = new wxStaticText( this, wxID_ANY, _("Output file:"), wxDefaultPosition, wxDefaultSize, 0 );
m_textOutputPath->Wrap( -1 );
fgSizer1->Add( m_textOutputPath, 0, wxALIGN_CENTER, 5 );
m_textCtrlOutputPath = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_textCtrlOutputPath->SetMinSize( wxSize( 350,-1 ) );
fgSizer1->Add( m_textCtrlOutputPath, 1, wxALIGN_CENTER_VERTICAL, 5 );
m_staticText18 = new wxStaticText( this, wxID_ANY, _("Format:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText18->Wrap( -1 );
fgSizer1->Add( m_staticText18, 0, wxALIGN_CENTER_VERTICAL, 5 );
@ -50,15 +59,6 @@ DIALOG_RC_JOB_BASE::DIALOG_RC_JOB_BASE( wxWindow* parent, wxWindowID id, const w
fgSizer1->Add( bSizer2, 1, wxEXPAND|wxTOP|wxBOTTOM, 4 );
m_textOutputPath = new wxStaticText( this, wxID_ANY, _("Output file:"), wxDefaultPosition, wxDefaultSize, 0 );
m_textOutputPath->Wrap( -1 );
fgSizer1->Add( m_textOutputPath, 0, wxALIGN_CENTER, 5 );
m_textCtrlOutputPath = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_textCtrlOutputPath->SetMinSize( wxSize( 350,-1 ) );
fgSizer1->Add( m_textCtrlOutputPath, 1, wxALIGN_CENTER_VERTICAL, 5 );
bSizerMain->Add( fgSizer1, 1, wxALL|wxEXPAND, 10 );
@ -81,7 +81,7 @@ DIALOG_RC_JOB_BASE::DIALOG_RC_JOB_BASE( wxWindow* parent, wxWindowID id, const w
bSizerBottom->Add( m_cbSchParity, 0, wxBOTTOM|wxLEFT, 5 );
bSizerMain->Add( bSizerBottom, 0, wxEXPAND|wxRIGHT, 5 );
bSizerMain->Add( bSizerBottom, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
m_sdbSizer1 = new wxStdDialogButtonSizer();
m_sdbSizer1OK = new wxButton( this, wxID_OK );

256
common/dialogs/dialog_rc_job_base.fbp

@ -80,6 +80,133 @@
<property name="permission">none</property>
<property name="rows">0</property>
<property name="vgap">5</property>
<object class="sizeritem" expanded="false">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="false">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</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="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="drag_accept_files">0</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">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Output file:</property>
<property name="markup">0</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_textOutputPath</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">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
</object>
</object>
<object class="sizeritem" expanded="false">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL</property>
<property name="proportion">1</property>
<object class="wxTextCtrl" expanded="false">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</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="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="drag_accept_files">0</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">0</property>
<property name="id">wxID_ANY</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="maxlength">0</property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size">350,-1</property>
<property name="moveable">1</property>
<property name="name">m_textCtrlOutputPath</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">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></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="value"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
</object>
</object>
<object class="sizeritem" expanded="false">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL</property>
@ -421,138 +548,11 @@
</object>
</object>
</object>
<object class="sizeritem" expanded="false">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="false">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</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="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="drag_accept_files">0</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">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Output file:</property>
<property name="markup">0</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_textOutputPath</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">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
</object>
</object>
<object class="sizeritem" expanded="false">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL</property>
<property name="proportion">1</property>
<object class="wxTextCtrl" expanded="false">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</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="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="drag_accept_files">0</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">0</property>
<property name="id">wxID_ANY</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="maxlength">0</property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size">350,-1</property>
<property name="moveable">1</property>
<property name="name">m_textCtrlOutputPath</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">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></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="value"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
</object>
</object>
</object>
</object>
<object class="sizeritem" expanded="true">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxRIGHT</property>
<property name="flag">wxEXPAND|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxBoxSizer" expanded="true">
<property name="minimum_size"></property>

6
common/dialogs/dialog_rc_job_base.h

@ -17,10 +17,10 @@
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/textctrl.h>
#include <wx/choice.h>
#include <wx/checkbox.h>
#include <wx/sizer.h>
#include <wx/textctrl.h>
#include <wx/button.h>
#include <wx/dialog.h>
@ -36,13 +36,13 @@ class KICOMMON_API DIALOG_RC_JOB_BASE : public DIALOG_SHIM
private:
protected:
wxStaticText* m_textOutputPath;
wxTextCtrl* m_textCtrlOutputPath;
wxStaticText* m_staticText18;
wxChoice* m_choiceFormat;
wxStaticText* m_staticText10;
wxCheckBox* m_cbViolationErrors;
wxCheckBox* m_cbViolationWarnings;
wxStaticText* m_textOutputPath;
wxTextCtrl* m_textCtrlOutputPath;
wxCheckBox* m_cbHaltOutput;
wxCheckBox* m_cbAllTrackViolations;
wxCheckBox* m_cbSchParity;

206
eeschema/dialogs/dialog_export_netlist.cpp

@ -162,19 +162,19 @@ enum id_netlist {
EXPORT_NETLIST_PAGE::EXPORT_NETLIST_PAGE( wxNotebook* aParent, const wxString& aTitle,
NETLIST_TYPE_ID aIdNetType, bool aCustom ) :
wxPanel( aParent, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL )
wxPanel( aParent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL )
{
m_IdNetType = aIdNetType;
m_pageNetFmtName = aTitle;
m_CommandStringCtrl = nullptr;
m_CurSheetAsRoot = nullptr;
m_TitleStringCtrl = nullptr;
m_SaveAllVoltages = nullptr;
m_SaveAllCurrents = nullptr;
m_SaveAllDissipations = nullptr;
m_SaveAllEvents = nullptr;
m_IdNetType = aIdNetType;
m_pageNetFmtName = aTitle;
m_CommandStringCtrl = nullptr;
m_CurSheetAsRoot = nullptr;
m_TitleStringCtrl = nullptr;
m_SaveAllVoltages = nullptr;
m_SaveAllCurrents = nullptr;
m_SaveAllDissipations = nullptr;
m_SaveAllEvents = nullptr;
m_RunExternalSpiceCommand = nullptr;
m_custom = aCustom;
m_custom = aCustom;
aParent->AddPage( this, aTitle, false );
@ -182,13 +182,13 @@ EXPORT_NETLIST_PAGE::EXPORT_NETLIST_PAGE( wxNotebook* aParent, const wxString& a
SetSizer( MainBoxSizer );
wxBoxSizer* UpperBoxSizer = new wxBoxSizer( wxHORIZONTAL );
m_LowBoxSizer = new wxBoxSizer( wxVERTICAL );
MainBoxSizer->Add( UpperBoxSizer, 0, wxGROW | wxALL, 5 );
MainBoxSizer->Add( m_LowBoxSizer, 0, wxGROW | wxALL, 5 );
MainBoxSizer->Add( UpperBoxSizer, 0, wxEXPAND | wxALL, 5 );
MainBoxSizer->Add( m_LowBoxSizer, 0, wxEXPAND | wxALL, 5 );
m_LeftBoxSizer = new wxBoxSizer( wxVERTICAL );
m_RightBoxSizer = new wxBoxSizer( wxVERTICAL );
m_RightOptionsBoxSizer = new wxBoxSizer( wxVERTICAL );
UpperBoxSizer->Add( m_LeftBoxSizer, 0, wxGROW | wxALL, 5 );
UpperBoxSizer->Add( m_LeftBoxSizer, 0, wxEXPAND | wxALL, 5 );
UpperBoxSizer->Add( m_RightBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
UpperBoxSizer->Add( m_RightOptionsBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
}
@ -197,7 +197,6 @@ EXPORT_NETLIST_PAGE::EXPORT_NETLIST_PAGE( wxNotebook* aParent, const wxString& a
DIALOG_EXPORT_NETLIST::DIALOG_EXPORT_NETLIST( SCH_EDIT_FRAME* aEditFrame ) :
DIALOG_EXPORT_NETLIST( aEditFrame, aEditFrame )
{
}
@ -299,78 +298,80 @@ DIALOG_EXPORT_NETLIST::DIALOG_EXPORT_NETLIST( SCH_EDIT_FRAME* aEditFrame, wxWind
void DIALOG_EXPORT_NETLIST::InstallPageSpice()
{
EXPORT_NETLIST_PAGE* page = m_PanelNetType[PANELSPICE] =
new EXPORT_NETLIST_PAGE( m_NoteBook, wxT( "SPICE" ), NET_TYPE_SPICE, false );
auto* pg = m_PanelNetType[PANELSPICE] = new EXPORT_NETLIST_PAGE( m_NoteBook, wxT( "SPICE" ),
NET_TYPE_SPICE, false );
SCHEMATIC_SETTINGS& settings = m_editFrame->Schematic().Settings();
wxStaticText* label = new wxStaticText( page, wxID_ANY, _( "Export netlist in SPICE format" ) );
page->m_LeftBoxSizer->Add( label, 0, wxBOTTOM, 10 );
page->m_CurSheetAsRoot = new wxCheckBox( page, ID_CUR_SHEET_AS_ROOT,
_( "Use current sheet as root" ) );
page->m_CurSheetAsRoot->SetToolTip( _( "Export netlist only for the current sheet" ) );
page->m_CurSheetAsRoot->SetValue( settings.m_SpiceCurSheetAsRoot );
page->m_LeftBoxSizer->Add( page->m_CurSheetAsRoot, 0, wxGROW | wxBOTTOM | wxRIGHT, 5 );
page->m_SaveAllVoltages = new wxCheckBox( page, ID_SAVE_ALL_VOLTAGES,
_( "Save all voltages" ) );
page->m_SaveAllVoltages->SetToolTip( _( "Write a directive to save all voltages (.save all)" ) );
page->m_SaveAllVoltages->SetValue( settings.m_SpiceSaveAllVoltages );
page->m_LeftBoxSizer->Add( page->m_SaveAllVoltages, 0, wxBOTTOM | wxRIGHT, 5 );
page->m_SaveAllCurrents = new wxCheckBox( page, ID_SAVE_ALL_CURRENTS,
_( "Save all currents" ) );
page->m_SaveAllCurrents->SetToolTip( _( "Write a directive to save all currents (.probe alli)" ) );
page->m_SaveAllCurrents->SetValue( settings.m_SpiceSaveAllCurrents );
page->m_LeftBoxSizer->Add( page->m_SaveAllCurrents, 0, wxBOTTOM | wxRIGHT, 5 );
page->m_SaveAllDissipations = new wxCheckBox( page, ID_SAVE_ALL_DISSIPATIONS,
_( "Save all power dissipations" ) );
page->m_SaveAllDissipations->SetToolTip( _( "Write directives to save power dissipation of all items (.probe p(<item>))" ) );
page->m_SaveAllDissipations->SetValue( settings.m_SpiceSaveAllDissipations );
page->m_LeftBoxSizer->Add( page->m_SaveAllDissipations, 0, wxBOTTOM | wxRIGHT, 5 );
page->m_SaveAllEvents = new wxCheckBox( page, ID_SAVE_ALL_EVENTS,
_( "Save all digital event data" ) );
page->m_SaveAllEvents->SetToolTip( _( "If not set, write a directive to prevent the saving of digital event data (esave none)" ) );
page->m_SaveAllEvents->SetValue( settings.m_SpiceSaveAllEvents );
page->m_LeftBoxSizer->Add( page->m_SaveAllEvents, 0, wxBOTTOM | wxRIGHT, 5 );
page->m_RunExternalSpiceCommand = new wxCheckBox( page, ID_RUN_SIMULATOR,
_( "Run external simulator command:" ) );
wxStaticText* label = new wxStaticText( pg, wxID_ANY, _( "Export netlist in SPICE format" ) );
pg->m_LeftBoxSizer->Add( label, 0, wxBOTTOM, 10 );
pg->m_CurSheetAsRoot = new wxCheckBox( pg, ID_CUR_SHEET_AS_ROOT,
_( "Use current sheet as root" ) );
pg->m_CurSheetAsRoot->SetToolTip( _( "Export netlist only for the current sheet" ) );
pg->m_CurSheetAsRoot->SetValue( settings.m_SpiceCurSheetAsRoot );
pg->m_LeftBoxSizer->Add( pg->m_CurSheetAsRoot, 0, wxGROW | wxBOTTOM | wxRIGHT, 5 );
pg->m_SaveAllVoltages = new wxCheckBox( pg, ID_SAVE_ALL_VOLTAGES, _( "Save all voltages" ) );
pg->m_SaveAllVoltages->SetToolTip( _( "Write a directive to save all voltages (.save all)" ) );
pg->m_SaveAllVoltages->SetValue( settings.m_SpiceSaveAllVoltages );
pg->m_LeftBoxSizer->Add( pg->m_SaveAllVoltages, 0, wxBOTTOM | wxRIGHT, 5 );
pg->m_SaveAllCurrents = new wxCheckBox( pg, ID_SAVE_ALL_CURRENTS, _( "Save all currents" ) );
pg->m_SaveAllCurrents->SetToolTip( _( "Write a directive to save all currents (.probe alli)" ) );
pg->m_SaveAllCurrents->SetValue( settings.m_SpiceSaveAllCurrents );
pg->m_LeftBoxSizer->Add( pg->m_SaveAllCurrents, 0, wxBOTTOM | wxRIGHT, 5 );
pg->m_SaveAllDissipations = new wxCheckBox( pg, ID_SAVE_ALL_DISSIPATIONS,
_( "Save all power dissipations" ) );
pg->m_SaveAllDissipations->SetToolTip( _( "Write directives to save power dissipation of all "
"items (.probe p(<item>))" ) );
pg->m_SaveAllDissipations->SetValue( settings.m_SpiceSaveAllDissipations );
pg->m_LeftBoxSizer->Add( pg->m_SaveAllDissipations, 0, wxBOTTOM | wxRIGHT, 5 );
pg->m_SaveAllEvents = new wxCheckBox( pg, ID_SAVE_ALL_EVENTS,
_( "Save all digital event data" ) );
pg->m_SaveAllEvents->SetToolTip( _( "If not set, write a directive to prevent the saving of "
"digital event data (esave none)" ) );
pg->m_SaveAllEvents->SetValue( settings.m_SpiceSaveAllEvents );
pg->m_LeftBoxSizer->Add( pg->m_SaveAllEvents, 0, wxBOTTOM | wxRIGHT, 5 );
pg->m_RunExternalSpiceCommand = new wxCheckBox( pg, ID_RUN_SIMULATOR,
_( "Run external simulator command:" ) );
wxString simulatorCommand = settings.m_SpiceCommandString;
page->m_RunExternalSpiceCommand->SetToolTip( _( "Enter the command line to run SPICE\n"
"Usually '<path to SPICE binary> \"%I\"'\n"
"%I will be replaced by the netlist filepath" ) );
page->m_LowBoxSizer->Add( page->m_RunExternalSpiceCommand, 0,
wxGROW | wxLEFT | wxRIGHT | wxBOTTOM, 5 );
page->m_CommandStringCtrl = new wxTextCtrl( page, -1, simulatorCommand,
wxDefaultPosition, wxDefaultSize );
page->m_CommandStringCtrl->SetInsertionPoint( 1 );
page->m_LowBoxSizer->Add( page->m_CommandStringCtrl, 0,
wxGROW | wxLEFT | wxRIGHT | wxBOTTOM, 5 );
pg->m_RunExternalSpiceCommand->SetToolTip( _( "Enter the command line to run SPICE\n"
"Usually '<path to SPICE binary> \"%I\"'\n"
"%I will be replaced by the netlist filepath" ) );
pg->m_LowBoxSizer->Add( pg->m_RunExternalSpiceCommand, 0,
wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, 5 );
pg->m_CommandStringCtrl = new wxTextCtrl( pg, -1, simulatorCommand,
wxDefaultPosition, wxDefaultSize );
pg->m_CommandStringCtrl->SetInsertionPoint( 1 );
pg->m_LowBoxSizer->Add( pg->m_CommandStringCtrl, 0, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, 5 );
}
void DIALOG_EXPORT_NETLIST::InstallPageSpiceModel()
{
EXPORT_NETLIST_PAGE* page = m_PanelNetType[PANELSPICEMODEL] =
new EXPORT_NETLIST_PAGE( m_NoteBook, wxT( "SPICE Model" ), NET_TYPE_SPICE_MODEL, false );
auto* pg = m_PanelNetType[PANELSPICEMODEL] = new EXPORT_NETLIST_PAGE( m_NoteBook,
wxT( "SPICE Model" ),
NET_TYPE_SPICE_MODEL,
false );
SCHEMATIC_SETTINGS& settings = m_editFrame->Schematic().Settings();
wxStaticText* label = new wxStaticText( page, wxID_ANY, _( "Export netlist as a SPICE .subckt model" ) );
page->m_LeftBoxSizer->Add( label, 0, wxBOTTOM, 10 );
wxStaticText* label = new wxStaticText( pg, wxID_ANY,
_( "Export netlist as a SPICE .subckt model" ) );
pg->m_LeftBoxSizer->Add( label, 0, wxBOTTOM, 10 );
page->m_CurSheetAsRoot = new wxCheckBox( page, ID_CUR_SHEET_AS_ROOT,
_( "Use current sheet as root" ) );
page->m_CurSheetAsRoot->SetToolTip( _( "Export netlist only for the current sheet" ) );
page->m_CurSheetAsRoot->SetValue( settings.m_SpiceModelCurSheetAsRoot );
page->m_LeftBoxSizer->Add( page->m_CurSheetAsRoot, 0, wxGROW | wxBOTTOM | wxRIGHT, 5 );
pg->m_CurSheetAsRoot = new wxCheckBox( pg, ID_CUR_SHEET_AS_ROOT,
_( "Use current sheet as root" ) );
pg->m_CurSheetAsRoot->SetToolTip( _( "Export netlist only for the current sheet" ) );
pg->m_CurSheetAsRoot->SetValue( settings.m_SpiceModelCurSheetAsRoot );
pg->m_LeftBoxSizer->Add( pg->m_CurSheetAsRoot, 0, wxEXPAND | wxBOTTOM | wxRIGHT, 5 );
}
@ -396,29 +397,31 @@ EXPORT_NETLIST_PAGE* DIALOG_EXPORT_NETLIST::AddOneCustomPage( const wxString& aT
const wxString& aCommandString,
NETLIST_TYPE_ID aNetTypeId )
{
EXPORT_NETLIST_PAGE* currPage = new EXPORT_NETLIST_PAGE( m_NoteBook, aTitle, aNetTypeId, true );
EXPORT_NETLIST_PAGE* pg = new EXPORT_NETLIST_PAGE( m_NoteBook, aTitle, aNetTypeId, true );
currPage->m_LowBoxSizer->Add( new wxStaticText( currPage, -1, _( "Title:" ) ), 0,
wxGROW | wxLEFT | wxRIGHT | wxTOP, 5 );
pg->m_LowBoxSizer->Add( new wxStaticText( pg, wxID_ANY, _( "Title:" ) ), 0,
wxEXPAND | wxLEFT | wxRIGHT | wxTOP, 5 );
currPage->m_TitleStringCtrl = new wxTextCtrl( currPage, -1, aTitle,
wxDefaultPosition, wxDefaultSize );
pg->m_LowBoxSizer->AddSpacer( 2 );
currPage->m_TitleStringCtrl->SetInsertionPoint( 1 );
currPage->m_LowBoxSizer->Add( currPage->m_TitleStringCtrl, 0,
wxGROW | wxTOP | wxLEFT | wxRIGHT | wxBOTTOM, 5 );
pg->m_TitleStringCtrl = new wxTextCtrl( pg, wxID_ANY, aTitle );
currPage->m_LowBoxSizer->Add( new wxStaticText( currPage, -1, _( "Netlist command:" ) ), 0,
wxGROW | wxLEFT | wxRIGHT | wxTOP, 5 );
pg->m_TitleStringCtrl->SetInsertionPoint( 1 );
pg->m_LowBoxSizer->Add( pg->m_TitleStringCtrl, 0, wxEXPAND | wxLEFT | wxRIGHT, 5 );
currPage->m_CommandStringCtrl = new wxTextCtrl( currPage, -1, aCommandString,
wxDefaultPosition, wxDefaultSize );
pg->m_LowBoxSizer->AddSpacer( 10 );
currPage->m_CommandStringCtrl->SetInsertionPoint( 1 );
currPage->m_LowBoxSizer->Add( currPage->m_CommandStringCtrl, 0,
wxGROW | wxTOP | wxLEFT | wxRIGHT | wxBOTTOM, 5 );
pg->m_LowBoxSizer->Add( new wxStaticText( pg, wxID_ANY, _( "Netlist command:" ) ), 0,
wxEXPAND | wxLEFT | wxRIGHT | wxTOP, 5 );
return currPage;
pg->m_LowBoxSizer->AddSpacer( 2 );
pg->m_CommandStringCtrl = new wxTextCtrl( pg, wxID_ANY, aCommandString );
pg->m_CommandStringCtrl->SetInsertionPoint( 1 );
pg->m_LowBoxSizer->Add( pg->m_CommandStringCtrl, 0, wxEXPAND | wxLEFT | wxRIGHT, 5 );
return pg;
}
@ -491,7 +494,6 @@ bool DIALOG_EXPORT_NETLIST::TransferDataFromWindow()
wxString fileExt;
wxString title = _( "Save Netlist File" );
if (m_job)
{
NetlistUpdateOpt();
@ -503,7 +505,6 @@ bool DIALOG_EXPORT_NETLIST::TransferDataFromWindow()
m_editFrame->OnModify();
}
EXPORT_NETLIST_PAGE* currPage;
currPage = (EXPORT_NETLIST_PAGE*) m_NoteBook->GetCurrentPage();
@ -561,11 +562,9 @@ bool DIALOG_EXPORT_NETLIST::TransferDataFromWindow()
break;
default: // custom, NET_TYPE_CUSTOM1 and greater
{
title.Printf( _( "%s Export" ), currPage->m_TitleStringCtrl->GetValue() );
break;
}
}
wxString fullpath;
@ -781,6 +780,10 @@ void DIALOG_EXPORT_NETLIST::OnDelGenerator( wxCommandEvent& event )
WriteCurrentNetlistSetup();
// Override m_NetFormatName written in WriteCurrentNetlistSetup()
SCHEMATIC_SETTINGS& settings = m_editFrame->Schematic().Settings();
settings.m_NetFormatName = m_NoteBook->GetPageText( m_NoteBook->GetSelection() - 1 );
if( IsQuasiModal() )
EndQuasiModal( NET_PLUGIN_CHANGE );
else
@ -823,8 +826,13 @@ void DIALOG_EXPORT_NETLIST::OnAddGenerator( wxCommandEvent& event )
}
m_PanelNetType[netTypeId] = AddOneCustomPage( title, cmd, (NETLIST_TYPE_ID)netTypeId );
WriteCurrentNetlistSetup();
// Override m_NetFormatName written in WriteCurrentNetlistSetup()
SCHEMATIC_SETTINGS& settings = m_editFrame->Schematic().Settings();
settings.m_NetFormatName = title;
if( IsQuasiModal() )
EndQuasiModal( NET_PLUGIN_CHANGE );
else
@ -836,8 +844,10 @@ NETLIST_DIALOG_ADD_GENERATOR::NETLIST_DIALOG_ADD_GENERATOR( DIALOG_EXPORT_NETLIS
NETLIST_DIALOG_ADD_GENERATOR_BASE( parent )
{
m_Parent = parent;
m_initialFocusTarget = m_textCtrlName;
SetupStandardButtons();
GetSizer()->SetSizeHints( this );
finishDialogSettings();
}
@ -846,12 +856,6 @@ bool NETLIST_DIALOG_ADD_GENERATOR::TransferDataFromWindow()
if( !wxDialog::TransferDataFromWindow() )
return false;
if( m_textCtrlCommand->GetValue() == wxEmptyString )
{
wxMessageBox( _( "You must provide a netlist generator command string" ) );
return false;
}
if( m_textCtrlName->GetValue() == wxEmptyString )
{
wxMessageBox( _( "You must provide a netlist generator title" ) );

10
eeschema/dialogs/dialog_export_netlist_base.cpp

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version 4.0.0-0-g0efcecf)
// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@ -31,7 +31,7 @@ DIALOG_EXPORT_NETLIST_BASE::DIALOG_EXPORT_NETLIST_BASE( wxWindow* parent, wxWind
m_outputPath = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_outputPath->SetMinSize( wxSize( 450,-1 ) );
bSizer8->Add( m_outputPath, 0, wxALL, 5 );
bSizer8->Add( m_outputPath, 1, wxALL, 5 );
bUpperSizer->Add( bSizer8, 1, wxEXPAND, 5 );
@ -49,15 +49,15 @@ DIALOG_EXPORT_NETLIST_BASE::DIALOG_EXPORT_NETLIST_BASE( wxWindow* parent, wxWind
bSizerMsgPanel->Add( m_MessagesBox, 1, wxEXPAND|wxTOP, 5 );
bUpperSizer->Add( bSizerMsgPanel, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 );
bUpperSizer->Add( bSizerMsgPanel, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
bMainSizer->Add( bUpperSizer, 1, wxEXPAND, 5 );
bMainSizer->Add( bUpperSizer, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 );
m_buttonSizer = new wxBoxSizer( wxHORIZONTAL );
m_buttonAddGenerator = new wxButton( this, ID_ADD_PLUGIN, _("Add Exporter..."), wxDefaultPosition, wxDefaultSize, 0 );
m_buttonSizer->Add( m_buttonAddGenerator, 0, wxALIGN_CENTER_VERTICAL, 5 );
m_buttonSizer->Add( m_buttonAddGenerator, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
m_buttonDelGenerator = new wxButton( this, ID_DEL_PLUGIN, _("Remove Exporter"), wxDefaultPosition, wxDefaultSize, 0 );
m_buttonSizer->Add( m_buttonDelGenerator, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 );

48
eeschema/dialogs/dialog_export_netlist_base.fbp

@ -1,34 +1,36 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<wxFormBuilder_Project>
<FileVersion major="1" minor="17"/>
<FileVersion major="1" minor="18"/>
<object class="Project" expanded="true">
<property name="class_decoration">; </property>
<property name="code_generation">C++</property>
<property name="disconnect_events">1</property>
<property name="disconnect_mode">source_name</property>
<property name="disconnect_php_events">0</property>
<property name="disconnect_python_events">0</property>
<property name="cpp_class_decoration">; </property>
<property name="cpp_disconnect_events">1</property>
<property name="cpp_event_generation">connect</property>
<property name="cpp_help_provider">none</property>
<property name="cpp_namespace"></property>
<property name="cpp_precompiled_header"></property>
<property name="cpp_use_array_enum">0</property>
<property name="cpp_use_enum">0</property>
<property name="embedded_files_path">res</property>
<property name="encoding">UTF-8</property>
<property name="event_generation">connect</property>
<property name="file">dialog_export_netlist_base</property>
<property name="first_id">1000</property>
<property name="help_provider">none</property>
<property name="image_path_wrapper_function_name"></property>
<property name="indent_with_spaces"></property>
<property name="first_id">6000</property>
<property name="internationalize">1</property>
<property name="lua_skip_events">1</property>
<property name="lua_ui_table">UI</property>
<property name="name">DIALOG_EXPORT_NETLIST_BASE</property>
<property name="namespace"></property>
<property name="path">.</property>
<property name="precompiled_header"></property>
<property name="php_disconnect_events">0</property>
<property name="php_disconnect_mode">source_name</property>
<property name="php_skip_events">1</property>
<property name="python_disconnect_events">0</property>
<property name="python_disconnect_mode">source_name</property>
<property name="python_image_path_wrapper_function_name"></property>
<property name="python_indent_with_spaces"></property>
<property name="python_skip_events">1</property>
<property name="relative_path">1</property>
<property name="skip_lua_events">1</property>
<property name="skip_php_events">1</property>
<property name="skip_python_events">1</property>
<property name="ui_table">UI</property>
<property name="use_array_enum">0</property>
<property name="use_enum">0</property>
<property name="use_microsoft_bom">0</property>
<property name="use_native_eol">0</property>
<object class="Dialog" expanded="true">
<property name="aui_managed">0</property>
<property name="aui_manager_style">wxAUI_MGR_DEFAULT</property>
@ -64,7 +66,7 @@
<property name="permission">none</property>
<object class="sizeritem" expanded="true">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="flag">wxEXPAND|wxRIGHT|wxLEFT</property>
<property name="proportion">1</property>
<object class="wxBoxSizer" expanded="true">
<property name="minimum_size"></property>
@ -145,7 +147,7 @@
<object class="sizeritem" expanded="true">
<property name="border">5</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<property name="proportion">1</property>
<object class="wxTextCtrl" expanded="true">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
@ -272,7 +274,7 @@
</object>
<object class="sizeritem" expanded="true">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxRIGHT|wxLEFT</property>
<property name="flag">wxEXPAND|wxTOP|wxRIGHT|wxLEFT</property>
<property name="proportion">1</property>
<object class="wxBoxSizer" expanded="true">
<property name="minimum_size"></property>
@ -352,7 +354,7 @@
<property name="permission">protected</property>
<object class="sizeritem" expanded="false">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxButton" expanded="false">
<property name="BottomDockable">1</property>

10
eeschema/dialogs/dialog_export_netlist_base.h

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version 4.0.0-0-g0efcecf)
// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@ -31,10 +31,10 @@ class WX_HTML_REPORT_PANEL;
///////////////////////////////////////////////////////////////////////////
#define ID_CHANGE_NOTEBOOK_PAGE 1000
#define ID_ADD_PLUGIN 1001
#define ID_DEL_PLUGIN 1002
#define wxID_BROWSE_PLUGINS 1003
#define ID_CHANGE_NOTEBOOK_PAGE 6000
#define ID_ADD_PLUGIN 6001
#define ID_DEL_PLUGIN 6002
#define wxID_BROWSE_PLUGINS 6003
///////////////////////////////////////////////////////////////////////////////
/// Class DIALOG_EXPORT_NETLIST_BASE

Loading…
Cancel
Save