Added a button to add Spice fields to a schematic component

This commit is contained in:
Maciej Suminski 2016-08-11 14:41:10 +02:00
parent 0d8c095215
commit b6eab191d0
6 changed files with 347 additions and 179 deletions

View File

@ -46,6 +46,7 @@
#include <sch_validators.h> #include <sch_validators.h>
#include <dialog_edit_component_in_schematic_fbp.h> #include <dialog_edit_component_in_schematic_fbp.h>
#include <netlist_exporter_pspice.h>
/** /**
@ -126,7 +127,7 @@ private:
void showButtonHandler( wxCommandEvent& event ); void showButtonHandler( wxCommandEvent& event );
void OnTestChipName( wxCommandEvent& event ); void OnTestChipName( wxCommandEvent& event );
void OnSelectChipName( wxCommandEvent& event ); void OnSelectChipName( wxCommandEvent& event );
void OnInitDlg( wxInitDialogEvent& event ) void OnInitDlg( wxInitDialogEvent& event )
{ {
TransferDataToWindow(); TransferDataToWindow();
@ -134,6 +135,8 @@ private:
FinishDialogSettings(); FinishDialogSettings();
} }
void EditSpiceFields( wxCommandEvent& event );
SCH_FIELD* findField( const wxString& aFieldName ); SCH_FIELD* findField( const wxString& aFieldName );
/** /**
@ -141,7 +144,7 @@ private:
* update the listbox showing fields, according to the fields texts * update the listbox showing fields, according to the fields texts
* must be called after a text change in fields, if this change is not an edition * must be called after a text change in fields, if this change is not an edition
*/ */
void updateDisplay( ) void updateDisplay()
{ {
for( unsigned ii = FIELD1; ii<m_FieldsBuf.size(); ii++ ) for( unsigned ii = FIELD1; ii<m_FieldsBuf.size(); ii++ )
setRowItem( ii, m_FieldsBuf[ii] ); setRowItem( ii, m_FieldsBuf[ii] );
@ -284,6 +287,33 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnSelectChipName( wxCommandEvent& event
} }
void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::EditSpiceFields( wxCommandEvent& event )
{
for( const auto& fieldName : NETLIST_EXPORTER_PSPICE::GetSpiceFields() )
{
SCH_FIELD* schField = findField( fieldName );
// @todo move everything to the bottom, so the fields are grouped and in the same order?
// Do not modify the existing value, just add missing fields with default values
if( schField == NULL )
{
unsigned fieldNdx = m_FieldsBuf.size();
SCH_FIELD newField( wxPoint(), fieldNdx, m_cmp, fieldName );
newField.SetOrientation( m_FieldsBuf[REFERENCE].GetOrientation() );
m_FieldsBuf.push_back( newField );
schField = &m_FieldsBuf.back();
}
if( schField->GetText().IsEmpty() )
{
schField->SetText( NETLIST_EXPORTER_PSPICE::GetSpiceFieldDefVal( fieldName, m_cmp ) );
}
}
updateDisplay();
}
void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnListItemSelected( wxListEvent& event ) void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnListItemSelected( wxListEvent& event )
{ {
DBG( printf( "OnListItemSelected()\n" ); ) DBG( printf( "OnListItemSelected()\n" ); )

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version May 21 2016) // C++ code generated with wxFormBuilder (version Jun 24 2016)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO "NOT" EDIT THIS FILE! // PLEASE DO "NOT" EDIT THIS FILE!
@ -12,287 +12,291 @@
DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style ) DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
{ {
this->SetSizeHints( wxDefaultSize, wxDefaultSize ); this->SetSizeHints( wxDefaultSize, wxDefaultSize );
wxBoxSizer* mainSizer; wxBoxSizer* mainSizer;
mainSizer = new wxBoxSizer( wxVERTICAL ); mainSizer = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* upperSizer; wxBoxSizer* upperSizer;
upperSizer = new wxBoxSizer( wxHORIZONTAL ); upperSizer = new wxBoxSizer( wxHORIZONTAL );
wxStaticBoxSizer* optionsSizer; wxStaticBoxSizer* optionsSizer;
optionsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Component") ), wxVERTICAL ); optionsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Component") ), wxVERTICAL );
m_staticTextUnit = new wxStaticText( optionsSizer->GetStaticBox(), wxID_ANY, _("Unit"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextUnit = new wxStaticText( optionsSizer->GetStaticBox(), wxID_ANY, _("Unit"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextUnit->Wrap( -1 ); m_staticTextUnit->Wrap( -1 );
optionsSizer->Add( m_staticTextUnit, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); optionsSizer->Add( m_staticTextUnit, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
wxArrayString unitChoiceChoices; wxArrayString unitChoiceChoices;
unitChoice = new wxChoice( optionsSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, unitChoiceChoices, 0 ); unitChoice = new wxChoice( optionsSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, unitChoiceChoices, 0 );
unitChoice->SetSelection( 0 ); unitChoice->SetSelection( 0 );
optionsSizer->Add( unitChoice, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); optionsSizer->Add( unitChoice, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
wxBoxSizer* bSizerUnitsInterchangeable; wxBoxSizer* bSizerUnitsInterchangeable;
bSizerUnitsInterchangeable = new wxBoxSizer( wxHORIZONTAL ); bSizerUnitsInterchangeable = new wxBoxSizer( wxHORIZONTAL );
unitsInterchageableText = new wxStaticText( optionsSizer->GetStaticBox(), wxID_ANY, _("Units are interchangeable:"), wxDefaultPosition, wxDefaultSize, 0 ); unitsInterchageableText = new wxStaticText( optionsSizer->GetStaticBox(), wxID_ANY, _("Units are interchangeable:"), wxDefaultPosition, wxDefaultSize, 0 );
unitsInterchageableText->Wrap( -1 ); unitsInterchageableText->Wrap( -1 );
bSizerUnitsInterchangeable->Add( unitsInterchageableText, 0, wxTOP|wxBOTTOM|wxLEFT, 5 ); bSizerUnitsInterchangeable->Add( unitsInterchageableText, 0, wxTOP|wxBOTTOM|wxLEFT, 5 );
unitsInterchageableLabel = new wxStaticText( optionsSizer->GetStaticBox(), wxID_ANY, _("Yes"), wxDefaultPosition, wxDefaultSize, 0 ); unitsInterchageableLabel = new wxStaticText( optionsSizer->GetStaticBox(), wxID_ANY, _("Yes"), wxDefaultPosition, wxDefaultSize, 0 );
unitsInterchageableLabel->Wrap( -1 ); unitsInterchageableLabel->Wrap( -1 );
bSizerUnitsInterchangeable->Add( unitsInterchageableLabel, 0, wxALL, 5 ); bSizerUnitsInterchangeable->Add( unitsInterchageableLabel, 0, wxALL, 5 );
optionsSizer->Add( bSizerUnitsInterchangeable, 0, wxEXPAND, 5 ); optionsSizer->Add( bSizerUnitsInterchangeable, 0, wxEXPAND, 5 );
wxString orientationRadioBoxChoices[] = { _("0"), _("+90"), _("180"), _("-90") }; wxString orientationRadioBoxChoices[] = { _("0"), _("+90"), _("180"), _("-90") };
int orientationRadioBoxNChoices = sizeof( orientationRadioBoxChoices ) / sizeof( wxString ); int orientationRadioBoxNChoices = sizeof( orientationRadioBoxChoices ) / sizeof( wxString );
orientationRadioBox = new wxRadioBox( optionsSizer->GetStaticBox(), wxID_ANY, _("Orientation (Degrees)"), wxDefaultPosition, wxDefaultSize, orientationRadioBoxNChoices, orientationRadioBoxChoices, 1, wxRA_SPECIFY_COLS ); orientationRadioBox = new wxRadioBox( optionsSizer->GetStaticBox(), wxID_ANY, _("Orientation (Degrees)"), wxDefaultPosition, wxDefaultSize, orientationRadioBoxNChoices, orientationRadioBoxChoices, 1, wxRA_SPECIFY_COLS );
orientationRadioBox->SetSelection( 0 ); orientationRadioBox->SetSelection( 0 );
orientationRadioBox->SetToolTip( _("Select if the component is to be rotated when drawn") ); orientationRadioBox->SetToolTip( _("Select if the component is to be rotated when drawn") );
optionsSizer->Add( orientationRadioBox, 0, wxEXPAND|wxALL, 5 ); optionsSizer->Add( orientationRadioBox, 0, wxEXPAND|wxALL, 5 );
wxString mirrorRadioBoxChoices[] = { _("Normal"), _("Mirror ---"), _("Mirror |") }; wxString mirrorRadioBoxChoices[] = { _("Normal"), _("Mirror ---"), _("Mirror |") };
int mirrorRadioBoxNChoices = sizeof( mirrorRadioBoxChoices ) / sizeof( wxString ); int mirrorRadioBoxNChoices = sizeof( mirrorRadioBoxChoices ) / sizeof( wxString );
mirrorRadioBox = new wxRadioBox( optionsSizer->GetStaticBox(), wxID_ANY, _("Mirror"), wxDefaultPosition, wxDefaultSize, mirrorRadioBoxNChoices, mirrorRadioBoxChoices, 1, wxRA_SPECIFY_COLS ); mirrorRadioBox = new wxRadioBox( optionsSizer->GetStaticBox(), wxID_ANY, _("Mirror"), wxDefaultPosition, wxDefaultSize, mirrorRadioBoxNChoices, mirrorRadioBoxChoices, 1, wxRA_SPECIFY_COLS );
mirrorRadioBox->SetSelection( 0 ); mirrorRadioBox->SetSelection( 0 );
mirrorRadioBox->SetToolTip( _("Pick the graphical transformation to be used when displaying the component, if any") ); mirrorRadioBox->SetToolTip( _("Pick the graphical transformation to be used when displaying the component, if any") );
optionsSizer->Add( mirrorRadioBox, 0, wxALL|wxEXPAND, 5 ); optionsSizer->Add( mirrorRadioBox, 0, wxALL|wxEXPAND, 5 );
convertCheckBox = new wxCheckBox( optionsSizer->GetStaticBox(), wxID_ANY, _("Converted Shape"), wxDefaultPosition, wxDefaultSize, 0 ); convertCheckBox = new wxCheckBox( optionsSizer->GetStaticBox(), wxID_ANY, _("Converted Shape"), wxDefaultPosition, wxDefaultSize, 0 );
convertCheckBox->SetToolTip( _("Use the alternate shape of this component.\nFor gates, this is the \"De Morgan\" conversion") ); convertCheckBox->SetToolTip( _("Use the alternate shape of this component.\nFor gates, this is the \"De Morgan\" conversion") );
optionsSizer->Add( convertCheckBox, 0, wxALL, 5 ); optionsSizer->Add( convertCheckBox, 0, wxALL, 5 );
wxStaticBoxSizer* sbSizerChipName; wxStaticBoxSizer* sbSizerChipName;
sbSizerChipName = new wxStaticBoxSizer( new wxStaticBox( optionsSizer->GetStaticBox(), wxID_ANY, _("Chip Name") ), wxVERTICAL ); sbSizerChipName = new wxStaticBoxSizer( new wxStaticBox( optionsSizer->GetStaticBox(), wxID_ANY, _("Chip Name") ), wxVERTICAL );
chipnameTextCtrl = new wxTextCtrl( sbSizerChipName->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); chipnameTextCtrl = new wxTextCtrl( sbSizerChipName->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
chipnameTextCtrl->SetToolTip( _("The name of the symbol in the library from which this component came") ); chipnameTextCtrl->SetToolTip( _("The name of the symbol in the library from which this component came") );
sbSizerChipName->Add( chipnameTextCtrl, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 ); sbSizerChipName->Add( chipnameTextCtrl, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 );
wxBoxSizer* bSizerChpinameButt; wxBoxSizer* bSizerChpinameButt;
bSizerChpinameButt = new wxBoxSizer( wxHORIZONTAL ); bSizerChpinameButt = new wxBoxSizer( wxHORIZONTAL );
m_buttonTestChipName = new wxButton( sbSizerChipName->GetStaticBox(), wxID_ANY, _("Test"), wxDefaultPosition, wxDefaultSize, 0 ); m_buttonTestChipName = new wxButton( sbSizerChipName->GetStaticBox(), wxID_ANY, _("Test"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerChpinameButt->Add( m_buttonTestChipName, 0, wxTOP|wxBOTTOM|wxRIGHT, 5 ); bSizerChpinameButt->Add( m_buttonTestChipName, 0, wxTOP|wxBOTTOM|wxRIGHT, 5 );
m_buttonSelectChipName = new wxButton( sbSizerChipName->GetStaticBox(), wxID_ANY, _("Select"), wxDefaultPosition, wxDefaultSize, 0 ); m_buttonSelectChipName = new wxButton( sbSizerChipName->GetStaticBox(), wxID_ANY, _("Select"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerChpinameButt->Add( m_buttonSelectChipName, 0, wxTOP|wxBOTTOM, 5 ); bSizerChpinameButt->Add( m_buttonSelectChipName, 0, wxTOP|wxBOTTOM, 5 );
sbSizerChipName->Add( bSizerChpinameButt, 1, wxEXPAND, 5 ); sbSizerChipName->Add( bSizerChpinameButt, 1, wxEXPAND, 5 );
optionsSizer->Add( sbSizerChipName, 0, wxEXPAND|wxALL, 5 ); optionsSizer->Add( sbSizerChipName, 0, wxEXPAND|wxALL, 5 );
m_staticTextTimeStamp = new wxStaticText( optionsSizer->GetStaticBox(), wxID_ANY, _("Timestamp"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextTimeStamp = new wxStaticText( optionsSizer->GetStaticBox(), wxID_ANY, _("Timestamp"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextTimeStamp->Wrap( -1 ); m_staticTextTimeStamp->Wrap( -1 );
optionsSizer->Add( m_staticTextTimeStamp, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); optionsSizer->Add( m_staticTextTimeStamp, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_textCtrlTimeStamp = new wxTextCtrl( optionsSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY ); m_textCtrlTimeStamp = new wxTextCtrl( optionsSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY );
m_textCtrlTimeStamp->SetToolTip( _("An unique ID (a time stamp) to identify the component.\nThis is an alternate identifier to the reference.") ); m_textCtrlTimeStamp->SetToolTip( _("An unique ID (a time stamp) to identify the component.\nThis is an alternate identifier to the reference.") );
optionsSizer->Add( m_textCtrlTimeStamp, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); optionsSizer->Add( m_textCtrlTimeStamp, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
m_staticline1 = new wxStaticLine( optionsSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); m_staticline1 = new wxStaticLine( optionsSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
optionsSizer->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 ); optionsSizer->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 );
spiceFieldsButton = new wxButton( optionsSizer->GetStaticBox(), wxID_ANY, _("Add Spice fields"), wxDefaultPosition, wxDefaultSize, 0 );
optionsSizer->Add( spiceFieldsButton, 0, wxALL|wxEXPAND, 5 );
defaultsButton = new wxButton( optionsSizer->GetStaticBox(), wxID_ANY, _("Reset to Library Defaults"), wxDefaultPosition, wxDefaultSize, 0 ); defaultsButton = new wxButton( optionsSizer->GetStaticBox(), wxID_ANY, _("Reset to Library Defaults"), wxDefaultPosition, wxDefaultSize, 0 );
defaultsButton->SetToolTip( _("Set position and style of fields and component orientation to default lib value.\nFields texts are not modified.") ); defaultsButton->SetToolTip( _("Set position and style of fields and component orientation to default lib value.\nFields texts are not modified.") );
optionsSizer->Add( defaultsButton, 0, wxALL|wxEXPAND, 5 ); optionsSizer->Add( defaultsButton, 0, wxALL|wxEXPAND, 5 );
upperSizer->Add( optionsSizer, 0, wxEXPAND|wxALL, 5 ); upperSizer->Add( optionsSizer, 0, wxEXPAND|wxALL, 5 );
wxStaticBoxSizer* fieldsSizer; wxStaticBoxSizer* fieldsSizer;
fieldsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Fields") ), wxHORIZONTAL ); fieldsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Fields") ), wxHORIZONTAL );
wxStaticBoxSizer* gridStaticBoxSizer; wxStaticBoxSizer* gridStaticBoxSizer;
gridStaticBoxSizer = new wxStaticBoxSizer( new wxStaticBox( fieldsSizer->GetStaticBox(), wxID_ANY, wxEmptyString ), wxVERTICAL ); gridStaticBoxSizer = new wxStaticBoxSizer( new wxStaticBox( fieldsSizer->GetStaticBox(), wxID_ANY, wxEmptyString ), wxVERTICAL );
fieldListCtrl = new wxListCtrl( gridStaticBoxSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_SINGLE_SEL|wxLC_VRULES ); fieldListCtrl = new wxListCtrl( gridStaticBoxSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_SINGLE_SEL|wxLC_VRULES );
fieldListCtrl->SetMinSize( wxSize( 220,-1 ) ); fieldListCtrl->SetMinSize( wxSize( 220,-1 ) );
gridStaticBoxSizer->Add( fieldListCtrl, 1, wxALL|wxEXPAND, 8 ); gridStaticBoxSizer->Add( fieldListCtrl, 1, wxALL|wxEXPAND, 8 );
addFieldButton = new wxButton( gridStaticBoxSizer->GetStaticBox(), wxID_ANY, _("Add Field"), wxDefaultPosition, wxDefaultSize, 0 ); addFieldButton = new wxButton( gridStaticBoxSizer->GetStaticBox(), wxID_ANY, _("Add Field"), wxDefaultPosition, wxDefaultSize, 0 );
addFieldButton->SetToolTip( _("Add a new custom field") ); addFieldButton->SetToolTip( _("Add a new custom field") );
gridStaticBoxSizer->Add( addFieldButton, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); gridStaticBoxSizer->Add( addFieldButton, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
deleteFieldButton = new wxButton( gridStaticBoxSizer->GetStaticBox(), wxID_ANY, _("Delete Field"), wxDefaultPosition, wxDefaultSize, 0 ); deleteFieldButton = new wxButton( gridStaticBoxSizer->GetStaticBox(), wxID_ANY, _("Delete Field"), wxDefaultPosition, wxDefaultSize, 0 );
deleteFieldButton->SetToolTip( _("Delete one of the optional fields") ); deleteFieldButton->SetToolTip( _("Delete one of the optional fields") );
gridStaticBoxSizer->Add( deleteFieldButton, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); gridStaticBoxSizer->Add( deleteFieldButton, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
moveUpButton = new wxButton( gridStaticBoxSizer->GetStaticBox(), wxID_ANY, _("Move Up"), wxDefaultPosition, wxDefaultSize, 0 ); moveUpButton = new wxButton( gridStaticBoxSizer->GetStaticBox(), wxID_ANY, _("Move Up"), wxDefaultPosition, wxDefaultSize, 0 );
moveUpButton->SetToolTip( _("Move the selected optional fields up one position") ); moveUpButton->SetToolTip( _("Move the selected optional fields up one position") );
gridStaticBoxSizer->Add( moveUpButton, 0, wxALL|wxEXPAND, 5 ); gridStaticBoxSizer->Add( moveUpButton, 0, wxALL|wxEXPAND, 5 );
fieldsSizer->Add( gridStaticBoxSizer, 3, wxEXPAND|wxRIGHT|wxLEFT, 8 ); fieldsSizer->Add( gridStaticBoxSizer, 3, wxEXPAND|wxRIGHT|wxLEFT, 8 );
wxBoxSizer* fieldEditBoxSizer; wxBoxSizer* fieldEditBoxSizer;
fieldEditBoxSizer = new wxBoxSizer( wxVERTICAL ); fieldEditBoxSizer = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* bSizerJustification; wxBoxSizer* bSizerJustification;
bSizerJustification = new wxBoxSizer( wxHORIZONTAL ); bSizerJustification = new wxBoxSizer( wxHORIZONTAL );
wxString m_FieldHJustifyCtrlChoices[] = { _("Left"), _("Center"), _("Right") }; wxString m_FieldHJustifyCtrlChoices[] = { _("Left"), _("Center"), _("Right") };
int m_FieldHJustifyCtrlNChoices = sizeof( m_FieldHJustifyCtrlChoices ) / sizeof( wxString ); int m_FieldHJustifyCtrlNChoices = sizeof( m_FieldHJustifyCtrlChoices ) / sizeof( wxString );
m_FieldHJustifyCtrl = new wxRadioBox( fieldsSizer->GetStaticBox(), wxID_ANY, _("Horiz. Justify"), wxDefaultPosition, wxDefaultSize, m_FieldHJustifyCtrlNChoices, m_FieldHJustifyCtrlChoices, 1, wxRA_SPECIFY_COLS ); m_FieldHJustifyCtrl = new wxRadioBox( fieldsSizer->GetStaticBox(), wxID_ANY, _("Horiz. Justify"), wxDefaultPosition, wxDefaultSize, m_FieldHJustifyCtrlNChoices, m_FieldHJustifyCtrlChoices, 1, wxRA_SPECIFY_COLS );
m_FieldHJustifyCtrl->SetSelection( 2 ); m_FieldHJustifyCtrl->SetSelection( 2 );
bSizerJustification->Add( m_FieldHJustifyCtrl, 1, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); bSizerJustification->Add( m_FieldHJustifyCtrl, 1, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
wxString m_FieldVJustifyCtrlChoices[] = { _("Bottom"), _("Center"), _("Top") }; wxString m_FieldVJustifyCtrlChoices[] = { _("Bottom"), _("Center"), _("Top") };
int m_FieldVJustifyCtrlNChoices = sizeof( m_FieldVJustifyCtrlChoices ) / sizeof( wxString ); int m_FieldVJustifyCtrlNChoices = sizeof( m_FieldVJustifyCtrlChoices ) / sizeof( wxString );
m_FieldVJustifyCtrl = new wxRadioBox( fieldsSizer->GetStaticBox(), wxID_ANY, _("Vert. Justify"), wxDefaultPosition, wxDefaultSize, m_FieldVJustifyCtrlNChoices, m_FieldVJustifyCtrlChoices, 1, wxRA_SPECIFY_COLS ); m_FieldVJustifyCtrl = new wxRadioBox( fieldsSizer->GetStaticBox(), wxID_ANY, _("Vert. Justify"), wxDefaultPosition, wxDefaultSize, m_FieldVJustifyCtrlNChoices, m_FieldVJustifyCtrlChoices, 1, wxRA_SPECIFY_COLS );
m_FieldVJustifyCtrl->SetSelection( 2 ); m_FieldVJustifyCtrl->SetSelection( 2 );
bSizerJustification->Add( m_FieldVJustifyCtrl, 1, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); bSizerJustification->Add( m_FieldVJustifyCtrl, 1, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
fieldEditBoxSizer->Add( bSizerJustification, 1, wxEXPAND|wxBOTTOM, 5 ); fieldEditBoxSizer->Add( bSizerJustification, 1, wxEXPAND|wxBOTTOM, 5 );
wxBoxSizer* bSizerStyle; wxBoxSizer* bSizerStyle;
bSizerStyle = new wxBoxSizer( wxHORIZONTAL ); bSizerStyle = new wxBoxSizer( wxHORIZONTAL );
wxStaticBoxSizer* visibilitySizer; wxStaticBoxSizer* visibilitySizer;
visibilitySizer = new wxStaticBoxSizer( new wxStaticBox( fieldsSizer->GetStaticBox(), wxID_ANY, _("Visibility") ), wxVERTICAL ); visibilitySizer = new wxStaticBoxSizer( new wxStaticBox( fieldsSizer->GetStaticBox(), wxID_ANY, _("Visibility") ), wxVERTICAL );
showCheckBox = new wxCheckBox( visibilitySizer->GetStaticBox(), wxID_ANY, _("Show"), wxDefaultPosition, wxDefaultSize, 0 ); showCheckBox = new wxCheckBox( visibilitySizer->GetStaticBox(), wxID_ANY, _("Show"), wxDefaultPosition, wxDefaultSize, 0 );
showCheckBox->SetToolTip( _("Check if you want this field visible") ); showCheckBox->SetToolTip( _("Check if you want this field visible") );
visibilitySizer->Add( showCheckBox, 0, wxALL, 5 ); visibilitySizer->Add( showCheckBox, 0, wxALL, 5 );
rotateCheckBox = new wxCheckBox( visibilitySizer->GetStaticBox(), wxID_ANY, _("Rotate"), wxDefaultPosition, wxDefaultSize, 0 ); rotateCheckBox = new wxCheckBox( visibilitySizer->GetStaticBox(), wxID_ANY, _("Rotate"), wxDefaultPosition, wxDefaultSize, 0 );
rotateCheckBox->SetToolTip( _("Check if you want this field's text rotated 90 degrees") ); rotateCheckBox->SetToolTip( _("Check if you want this field's text rotated 90 degrees") );
visibilitySizer->Add( rotateCheckBox, 0, wxALL, 5 ); visibilitySizer->Add( rotateCheckBox, 0, wxALL, 5 );
bSizerStyle->Add( visibilitySizer, 1, wxEXPAND|wxALL, 5 ); bSizerStyle->Add( visibilitySizer, 1, wxEXPAND|wxALL, 5 );
wxString m_StyleRadioBoxChoices[] = { _("Normal"), _("Italic"), _("Bold"), _("Bold Italic") }; wxString m_StyleRadioBoxChoices[] = { _("Normal"), _("Italic"), _("Bold"), _("Bold Italic") };
int m_StyleRadioBoxNChoices = sizeof( m_StyleRadioBoxChoices ) / sizeof( wxString ); int m_StyleRadioBoxNChoices = sizeof( m_StyleRadioBoxChoices ) / sizeof( wxString );
m_StyleRadioBox = new wxRadioBox( fieldsSizer->GetStaticBox(), wxID_ANY, _("Style:"), wxDefaultPosition, wxDefaultSize, m_StyleRadioBoxNChoices, m_StyleRadioBoxChoices, 1, wxRA_SPECIFY_COLS ); m_StyleRadioBox = new wxRadioBox( fieldsSizer->GetStaticBox(), wxID_ANY, _("Style:"), wxDefaultPosition, wxDefaultSize, m_StyleRadioBoxNChoices, m_StyleRadioBoxChoices, 1, wxRA_SPECIFY_COLS );
m_StyleRadioBox->SetSelection( 3 ); m_StyleRadioBox->SetSelection( 3 );
m_StyleRadioBox->SetToolTip( _("The style of the currently selected field's text in the schematic") ); m_StyleRadioBox->SetToolTip( _("The style of the currently selected field's text in the schematic") );
bSizerStyle->Add( m_StyleRadioBox, 1, wxEXPAND|wxALL, 5 ); bSizerStyle->Add( m_StyleRadioBox, 1, wxEXPAND|wxALL, 5 );
fieldEditBoxSizer->Add( bSizerStyle, 1, wxEXPAND|wxBOTTOM, 5 ); fieldEditBoxSizer->Add( bSizerStyle, 1, wxEXPAND|wxBOTTOM, 5 );
wxBoxSizer* fieldNameBoxSizer; wxBoxSizer* fieldNameBoxSizer;
fieldNameBoxSizer = new wxBoxSizer( wxVERTICAL ); fieldNameBoxSizer = new wxBoxSizer( wxVERTICAL );
fieldNameLabel = new wxStaticText( fieldsSizer->GetStaticBox(), wxID_ANY, _("Field Name"), wxDefaultPosition, wxDefaultSize, 0 ); fieldNameLabel = new wxStaticText( fieldsSizer->GetStaticBox(), wxID_ANY, _("Field Name"), wxDefaultPosition, wxDefaultSize, 0 );
fieldNameLabel->Wrap( -1 ); fieldNameLabel->Wrap( -1 );
fieldNameBoxSizer->Add( fieldNameLabel, 0, wxTOP, 5 ); fieldNameBoxSizer->Add( fieldNameLabel, 0, wxTOP, 5 );
fieldNameTextCtrl = new wxTextCtrl( fieldsSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); fieldNameTextCtrl = new wxTextCtrl( fieldsSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fieldNameTextCtrl->SetToolTip( _("The name of the currently selected field\nSome fixed fields names are not editable") ); fieldNameTextCtrl->SetToolTip( _("The name of the currently selected field\nSome fixed fields names are not editable") );
fieldNameBoxSizer->Add( fieldNameTextCtrl, 0, wxBOTTOM|wxEXPAND, 5 ); fieldNameBoxSizer->Add( fieldNameTextCtrl, 0, wxBOTTOM|wxEXPAND, 5 );
fieldValueLabel = new wxStaticText( fieldsSizer->GetStaticBox(), wxID_ANY, _("Field Value"), wxDefaultPosition, wxDefaultSize, 0 ); fieldValueLabel = new wxStaticText( fieldsSizer->GetStaticBox(), wxID_ANY, _("Field Value"), wxDefaultPosition, wxDefaultSize, 0 );
fieldValueLabel->Wrap( -1 ); fieldValueLabel->Wrap( -1 );
fieldNameBoxSizer->Add( fieldValueLabel, 0, wxALIGN_TOP|wxTOP, 5 ); fieldNameBoxSizer->Add( fieldValueLabel, 0, wxALIGN_TOP|wxTOP, 5 );
fieldValueTextCtrl = new wxTextCtrl( fieldsSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); fieldValueTextCtrl = new wxTextCtrl( fieldsSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fieldValueTextCtrl->SetToolTip( _("The name of the currently selected field\nSome fixed fields names are not editable") ); fieldValueTextCtrl->SetToolTip( _("The name of the currently selected field\nSome fixed fields names are not editable") );
fieldNameBoxSizer->Add( fieldValueTextCtrl, 0, wxEXPAND|wxBOTTOM, 5 ); fieldNameBoxSizer->Add( fieldValueTextCtrl, 0, wxEXPAND|wxBOTTOM, 5 );
m_show_datasheet_button = new wxButton( fieldsSizer->GetStaticBox(), wxID_ANY, _("Show in Browser"), wxDefaultPosition, wxDefaultSize, 0 ); m_show_datasheet_button = new wxButton( fieldsSizer->GetStaticBox(), wxID_ANY, _("Show in Browser"), wxDefaultPosition, wxDefaultSize, 0 );
m_show_datasheet_button->SetToolTip( _("If your datasheet is an http:// link or a complete file path, then it may show in your browser by pressing this button.") ); m_show_datasheet_button->SetToolTip( _("If your datasheet is an http:// link or a complete file path, then it may show in your browser by pressing this button.") );
fieldNameBoxSizer->Add( m_show_datasheet_button, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 ); fieldNameBoxSizer->Add( m_show_datasheet_button, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 );
fieldEditBoxSizer->Add( fieldNameBoxSizer, 0, wxBOTTOM|wxEXPAND, 5 ); fieldEditBoxSizer->Add( fieldNameBoxSizer, 0, wxBOTTOM|wxEXPAND, 5 );
wxFlexGridSizer* fgSizerPosSize; wxFlexGridSizer* fgSizerPosSize;
fgSizerPosSize = new wxFlexGridSizer( 3, 3, 0, 0 ); fgSizerPosSize = new wxFlexGridSizer( 3, 3, 0, 0 );
fgSizerPosSize->AddGrowableCol( 1 ); fgSizerPosSize->AddGrowableCol( 1 );
fgSizerPosSize->SetFlexibleDirection( wxBOTH ); fgSizerPosSize->SetFlexibleDirection( wxBOTH );
fgSizerPosSize->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); fgSizerPosSize->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
textSizeLabel = new wxStaticText( fieldsSizer->GetStaticBox(), wxID_ANY, _("Size"), wxDefaultPosition, wxDefaultSize, 0 ); textSizeLabel = new wxStaticText( fieldsSizer->GetStaticBox(), wxID_ANY, _("Size"), wxDefaultPosition, wxDefaultSize, 0 );
textSizeLabel->Wrap( -1 ); textSizeLabel->Wrap( -1 );
fgSizerPosSize->Add( textSizeLabel, 0, wxALIGN_CENTER_VERTICAL, 5 ); fgSizerPosSize->Add( textSizeLabel, 0, wxALIGN_CENTER_VERTICAL, 5 );
textSizeTextCtrl = new wxTextCtrl( fieldsSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); textSizeTextCtrl = new wxTextCtrl( fieldsSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
textSizeTextCtrl->SetToolTip( _("The size of the currently selected field's text in the schematic") ); textSizeTextCtrl->SetToolTip( _("The size of the currently selected field's text in the schematic") );
fgSizerPosSize->Add( textSizeTextCtrl, 0, wxEXPAND|wxBOTTOM, 5 ); fgSizerPosSize->Add( textSizeTextCtrl, 0, wxEXPAND|wxBOTTOM, 5 );
m_staticTextUnitSize = new wxStaticText( fieldsSizer->GetStaticBox(), wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextUnitSize = new wxStaticText( fieldsSizer->GetStaticBox(), wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextUnitSize->Wrap( -1 ); m_staticTextUnitSize->Wrap( -1 );
fgSizerPosSize->Add( m_staticTextUnitSize, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); fgSizerPosSize->Add( m_staticTextUnitSize, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
posXLabel = new wxStaticText( fieldsSizer->GetStaticBox(), wxID_ANY, _("PosX"), wxDefaultPosition, wxDefaultSize, 0 ); posXLabel = new wxStaticText( fieldsSizer->GetStaticBox(), wxID_ANY, _("PosX"), wxDefaultPosition, wxDefaultSize, 0 );
posXLabel->Wrap( -1 ); posXLabel->Wrap( -1 );
fgSizerPosSize->Add( posXLabel, 0, wxALIGN_CENTER_VERTICAL, 5 ); fgSizerPosSize->Add( posXLabel, 0, wxALIGN_CENTER_VERTICAL, 5 );
posXTextCtrl = new wxTextCtrl( fieldsSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); posXTextCtrl = new wxTextCtrl( fieldsSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
posXTextCtrl->SetToolTip( _("The X coordinate of the text relative to the component") ); posXTextCtrl->SetToolTip( _("The X coordinate of the text relative to the component") );
fgSizerPosSize->Add( posXTextCtrl, 0, wxEXPAND|wxTOP, 5 ); fgSizerPosSize->Add( posXTextCtrl, 0, wxEXPAND|wxTOP, 5 );
m_staticTextUnitPosX = new wxStaticText( fieldsSizer->GetStaticBox(), wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextUnitPosX = new wxStaticText( fieldsSizer->GetStaticBox(), wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextUnitPosX->Wrap( -1 ); m_staticTextUnitPosX->Wrap( -1 );
fgSizerPosSize->Add( m_staticTextUnitPosX, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); fgSizerPosSize->Add( m_staticTextUnitPosX, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
posYLabel = new wxStaticText( fieldsSizer->GetStaticBox(), wxID_ANY, _("PosY"), wxDefaultPosition, wxDefaultSize, 0 ); posYLabel = new wxStaticText( fieldsSizer->GetStaticBox(), wxID_ANY, _("PosY"), wxDefaultPosition, wxDefaultSize, 0 );
posYLabel->Wrap( -1 ); posYLabel->Wrap( -1 );
fgSizerPosSize->Add( posYLabel, 0, wxALIGN_CENTER_VERTICAL, 5 ); fgSizerPosSize->Add( posYLabel, 0, wxALIGN_CENTER_VERTICAL, 5 );
posYTextCtrl = new wxTextCtrl( fieldsSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); posYTextCtrl = new wxTextCtrl( fieldsSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
posYTextCtrl->SetToolTip( _("The Y coordinate of the text relative to the component") ); posYTextCtrl->SetToolTip( _("The Y coordinate of the text relative to the component") );
fgSizerPosSize->Add( posYTextCtrl, 0, wxEXPAND, 5 ); fgSizerPosSize->Add( posYTextCtrl, 0, wxEXPAND, 5 );
m_staticTextUnitPosY = new wxStaticText( fieldsSizer->GetStaticBox(), wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextUnitPosY = new wxStaticText( fieldsSizer->GetStaticBox(), wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextUnitPosY->Wrap( -1 ); m_staticTextUnitPosY->Wrap( -1 );
fgSizerPosSize->Add( m_staticTextUnitPosY, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); fgSizerPosSize->Add( m_staticTextUnitPosY, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
fieldEditBoxSizer->Add( fgSizerPosSize, 1, wxEXPAND|wxTOP, 5 ); fieldEditBoxSizer->Add( fgSizerPosSize, 1, wxEXPAND|wxTOP, 5 );
fieldsSizer->Add( fieldEditBoxSizer, 2, wxEXPAND, 5 ); fieldsSizer->Add( fieldEditBoxSizer, 2, wxEXPAND, 5 );
upperSizer->Add( fieldsSizer, 1, wxALL|wxEXPAND, 5 ); upperSizer->Add( fieldsSizer, 1, wxALL|wxEXPAND, 5 );
mainSizer->Add( upperSizer, 1, wxEXPAND, 5 ); mainSizer->Add( upperSizer, 1, wxEXPAND, 5 );
stdDialogButtonSizer = new wxStdDialogButtonSizer(); stdDialogButtonSizer = new wxStdDialogButtonSizer();
stdDialogButtonSizerOK = new wxButton( this, wxID_OK ); stdDialogButtonSizerOK = new wxButton( this, wxID_OK );
stdDialogButtonSizer->AddButton( stdDialogButtonSizerOK ); stdDialogButtonSizer->AddButton( stdDialogButtonSizerOK );
stdDialogButtonSizerCancel = new wxButton( this, wxID_CANCEL ); stdDialogButtonSizerCancel = new wxButton( this, wxID_CANCEL );
stdDialogButtonSizer->AddButton( stdDialogButtonSizerCancel ); stdDialogButtonSizer->AddButton( stdDialogButtonSizerCancel );
stdDialogButtonSizer->Realize(); stdDialogButtonSizer->Realize();
mainSizer->Add( stdDialogButtonSizer, 0, wxALL|wxEXPAND, 5 ); mainSizer->Add( stdDialogButtonSizer, 0, wxALL|wxEXPAND, 5 );
this->SetSizer( mainSizer ); this->SetSizer( mainSizer );
this->Layout(); this->Layout();
// Connect Events // Connect Events
this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::OnCloseDialog ) ); this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::OnCloseDialog ) );
this->Connect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::OnInitDlg ) ); this->Connect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::OnInitDlg ) );
m_buttonTestChipName->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::OnTestChipName ), NULL, this ); m_buttonTestChipName->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::OnTestChipName ), NULL, this );
m_buttonSelectChipName->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::OnSelectChipName ), NULL, this ); m_buttonSelectChipName->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::OnSelectChipName ), NULL, this );
spiceFieldsButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::EditSpiceFields ), NULL, this );
defaultsButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::SetInitCmp ), NULL, this ); defaultsButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::SetInitCmp ), NULL, this );
fieldListCtrl->Connect( wxEVT_COMMAND_LIST_ITEM_DESELECTED, wxListEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::OnListItemDeselected ), NULL, this ); fieldListCtrl->Connect( wxEVT_COMMAND_LIST_ITEM_DESELECTED, wxListEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::OnListItemDeselected ), NULL, this );
fieldListCtrl->Connect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::OnListItemSelected ), NULL, this ); fieldListCtrl->Connect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::OnListItemSelected ), NULL, this );
@ -311,6 +315,7 @@ DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::~DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP(
this->Disconnect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::OnInitDlg ) ); this->Disconnect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::OnInitDlg ) );
m_buttonTestChipName->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::OnTestChipName ), NULL, this ); m_buttonTestChipName->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::OnTestChipName ), NULL, this );
m_buttonSelectChipName->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::OnSelectChipName ), NULL, this ); m_buttonSelectChipName->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::OnSelectChipName ), NULL, this );
spiceFieldsButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::EditSpiceFields ), NULL, this );
defaultsButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::SetInitCmp ), NULL, this ); defaultsButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::SetInitCmp ), NULL, this );
fieldListCtrl->Disconnect( wxEVT_COMMAND_LIST_ITEM_DESELECTED, wxListEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::OnListItemDeselected ), NULL, this ); fieldListCtrl->Disconnect( wxEVT_COMMAND_LIST_ITEM_DESELECTED, wxListEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::OnListItemDeselected ), NULL, this );
fieldListCtrl->Disconnect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::OnListItemSelected ), NULL, this ); fieldListCtrl->Disconnect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::OnListItemSelected ), NULL, this );
@ -320,5 +325,5 @@ DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::~DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP(
m_show_datasheet_button->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::showButtonHandler ), NULL, this ); m_show_datasheet_button->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::showButtonHandler ), NULL, this );
stdDialogButtonSizerCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::OnCancelButtonClick ), NULL, this ); stdDialogButtonSizerCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::OnCancelButtonClick ), NULL, this );
stdDialogButtonSizerOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::OnOKButtonClick ), NULL, this ); stdDialogButtonSizerOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::OnOKButtonClick ), NULL, this );
} }

View File

@ -44,7 +44,7 @@
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP</property> <property name="name">DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP</property>
<property name="pos"></property> <property name="pos"></property>
<property name="size">688,586</property> <property name="size">928,741</property>
<property name="style">wxCAPTION|wxCLOSE_BOX|wxDEFAULT_DIALOG_STYLE|wxMAXIMIZE_BOX|wxMINIMIZE_BOX|wxRESIZE_BORDER|wxSYSTEM_MENU</property> <property name="style">wxCAPTION|wxCLOSE_BOX|wxDEFAULT_DIALOG_STYLE|wxMAXIMIZE_BOX|wxMINIMIZE_BOX|wxRESIZE_BORDER|wxSYSTEM_MENU</property>
<property name="subclass">DIALOG_SHIM; dialog_shim.h</property> <property name="subclass">DIALOG_SHIM; dialog_shim.h</property>
<property name="title">Component Properties</property> <property name="title">Component Properties</property>
@ -286,11 +286,11 @@
<event name="OnUpdateUI"></event> <event name="OnUpdateUI"></event>
</object> </object>
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="0">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxEXPAND</property> <property name="flag">wxEXPAND</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxBoxSizer" expanded="1"> <object class="wxBoxSizer" expanded="0">
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">bSizerUnitsInterchangeable</property> <property name="name">bSizerUnitsInterchangeable</property>
<property name="orient">wxHORIZONTAL</property> <property name="orient">wxHORIZONTAL</property>
@ -378,11 +378,11 @@
<event name="OnUpdateUI"></event> <event name="OnUpdateUI"></event>
</object> </object>
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="0">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALL</property> <property name="flag">wxALL</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxStaticText" expanded="1"> <object class="wxStaticText" expanded="0">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
<property name="LeftDockable">1</property> <property name="LeftDockable">1</property>
<property name="RightDockable">1</property> <property name="RightDockable">1</property>
@ -731,11 +731,11 @@
<event name="OnUpdateUI"></event> <event name="OnUpdateUI"></event>
</object> </object>
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="0">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxEXPAND|wxALL</property> <property name="flag">wxEXPAND|wxALL</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxStaticBoxSizer" expanded="1"> <object class="wxStaticBoxSizer" expanded="0">
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="label">Chip Name</property> <property name="label">Chip Name</property>
<property name="minimum_size"></property> <property name="minimum_size"></property>
@ -835,20 +835,20 @@
<event name="OnUpdateUI"></event> <event name="OnUpdateUI"></event>
</object> </object>
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="0">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxEXPAND</property> <property name="flag">wxEXPAND</property>
<property name="proportion">1</property> <property name="proportion">1</property>
<object class="wxBoxSizer" expanded="1"> <object class="wxBoxSizer" expanded="0">
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">bSizerChpinameButt</property> <property name="name">bSizerChpinameButt</property>
<property name="orient">wxHORIZONTAL</property> <property name="orient">wxHORIZONTAL</property>
<property name="permission">none</property> <property name="permission">none</property>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="0">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxTOP|wxBOTTOM|wxRIGHT</property> <property name="flag">wxTOP|wxBOTTOM|wxRIGHT</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxButton" expanded="1"> <object class="wxButton" expanded="0">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
<property name="LeftDockable">1</property> <property name="LeftDockable">1</property>
<property name="RightDockable">1</property> <property name="RightDockable">1</property>
@ -932,11 +932,11 @@
<event name="OnUpdateUI"></event> <event name="OnUpdateUI"></event>
</object> </object>
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="0">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxTOP|wxBOTTOM</property> <property name="flag">wxTOP|wxBOTTOM</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxButton" expanded="1"> <object class="wxButton" expanded="0">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
<property name="LeftDockable">1</property> <property name="LeftDockable">1</property>
<property name="RightDockable">1</property> <property name="RightDockable">1</property>
@ -1024,11 +1024,11 @@
</object> </object>
</object> </object>
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="0">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxTOP|wxRIGHT|wxLEFT</property> <property name="flag">wxTOP|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxStaticText" expanded="1"> <object class="wxStaticText" expanded="0">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
<property name="LeftDockable">1</property> <property name="LeftDockable">1</property>
<property name="RightDockable">1</property> <property name="RightDockable">1</property>
@ -1107,11 +1107,11 @@
<event name="OnUpdateUI"></event> <event name="OnUpdateUI"></event>
</object> </object>
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="0">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND</property> <property name="flag">wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxTextCtrl" expanded="1"> <object class="wxTextCtrl" expanded="0">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
<property name="LeftDockable">1</property> <property name="LeftDockable">1</property>
<property name="RightDockable">1</property> <property name="RightDockable">1</property>
@ -1198,11 +1198,11 @@
<event name="OnUpdateUI"></event> <event name="OnUpdateUI"></event>
</object> </object>
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="0">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxEXPAND | wxALL</property> <property name="flag">wxEXPAND | wxALL</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxStaticLine" expanded="1"> <object class="wxStaticLine" expanded="0">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
<property name="LeftDockable">1</property> <property name="LeftDockable">1</property>
<property name="RightDockable">1</property> <property name="RightDockable">1</property>
@ -1279,6 +1279,94 @@
<event name="OnUpdateUI"></event> <event name="OnUpdateUI"></event>
</object> </object>
</object> </object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxButton" 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="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default">0</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">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Add Spice fields</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">spiceFieldsButton</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"></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="OnButtonClick">EditSpiceFields</event>
<event name="OnChar"></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 class="sizeritem" expanded="0"> <object class="sizeritem" expanded="0">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property> <property name="flag">wxALL|wxEXPAND</property>
@ -1386,7 +1474,7 @@
<property name="border">8</property> <property name="border">8</property>
<property name="flag">wxEXPAND|wxRIGHT|wxLEFT</property> <property name="flag">wxEXPAND|wxRIGHT|wxLEFT</property>
<property name="proportion">3</property> <property name="proportion">3</property>
<object class="wxStaticBoxSizer" expanded="1"> <object class="wxStaticBoxSizer" expanded="0">
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="label"></property> <property name="label"></property>
<property name="minimum_size"></property> <property name="minimum_size"></property>
@ -1770,16 +1858,16 @@
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxEXPAND</property> <property name="flag">wxEXPAND</property>
<property name="proportion">2</property> <property name="proportion">2</property>
<object class="wxBoxSizer" expanded="1"> <object class="wxBoxSizer" expanded="0">
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">fieldEditBoxSizer</property> <property name="name">fieldEditBoxSizer</property>
<property name="orient">wxVERTICAL</property> <property name="orient">wxVERTICAL</property>
<property name="permission">none</property> <property name="permission">none</property>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="0">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxEXPAND|wxBOTTOM</property> <property name="flag">wxEXPAND|wxBOTTOM</property>
<property name="proportion">1</property> <property name="proportion">1</property>
<object class="wxBoxSizer" expanded="1"> <object class="wxBoxSizer" expanded="0">
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">bSizerJustification</property> <property name="name">bSizerJustification</property>
<property name="orient">wxHORIZONTAL</property> <property name="orient">wxHORIZONTAL</property>
@ -1966,20 +2054,20 @@
</object> </object>
</object> </object>
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="0">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxEXPAND|wxBOTTOM</property> <property name="flag">wxEXPAND|wxBOTTOM</property>
<property name="proportion">1</property> <property name="proportion">1</property>
<object class="wxBoxSizer" expanded="1"> <object class="wxBoxSizer" expanded="0">
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">bSizerStyle</property> <property name="name">bSizerStyle</property>
<property name="orient">wxHORIZONTAL</property> <property name="orient">wxHORIZONTAL</property>
<property name="permission">none</property> <property name="permission">none</property>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="0">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxEXPAND|wxALL</property> <property name="flag">wxEXPAND|wxALL</property>
<property name="proportion">1</property> <property name="proportion">1</property>
<object class="wxStaticBoxSizer" expanded="1"> <object class="wxStaticBoxSizer" expanded="0">
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="label">Visibility</property> <property name="label">Visibility</property>
<property name="minimum_size"></property> <property name="minimum_size"></property>
@ -2258,11 +2346,11 @@
</object> </object>
</object> </object>
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="0">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxBOTTOM|wxEXPAND</property> <property name="flag">wxBOTTOM|wxEXPAND</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxBoxSizer" expanded="1"> <object class="wxBoxSizer" expanded="0">
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">fieldNameBoxSizer</property> <property name="name">fieldNameBoxSizer</property>
<property name="orient">wxVERTICAL</property> <property name="orient">wxVERTICAL</property>

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version May 21 2016) // C++ code generated with wxFormBuilder (version Jun 24 2016)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO "NOT" EDIT THIS FILE! // PLEASE DO "NOT" EDIT THIS FILE!
@ -40,7 +40,7 @@ class DIALOG_SHIM;
class DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP : public DIALOG_SHIM class DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP : public DIALOG_SHIM
{ {
private: private:
protected: protected:
wxStaticText* m_staticTextUnit; wxStaticText* m_staticTextUnit;
wxChoice* unitChoice; wxChoice* unitChoice;
@ -55,6 +55,7 @@ class DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP : public DIALOG_SHIM
wxStaticText* m_staticTextTimeStamp; wxStaticText* m_staticTextTimeStamp;
wxTextCtrl* m_textCtrlTimeStamp; wxTextCtrl* m_textCtrlTimeStamp;
wxStaticLine* m_staticline1; wxStaticLine* m_staticline1;
wxButton* spiceFieldsButton;
wxButton* defaultsButton; wxButton* defaultsButton;
wxListCtrl* fieldListCtrl; wxListCtrl* fieldListCtrl;
wxButton* addFieldButton; wxButton* addFieldButton;
@ -82,12 +83,13 @@ class DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP : public DIALOG_SHIM
wxStdDialogButtonSizer* stdDialogButtonSizer; wxStdDialogButtonSizer* stdDialogButtonSizer;
wxButton* stdDialogButtonSizerOK; wxButton* stdDialogButtonSizerOK;
wxButton* stdDialogButtonSizerCancel; wxButton* stdDialogButtonSizerCancel;
// Virtual event handlers, overide them in your derived class // Virtual event handlers, overide them in your derived class
virtual void OnCloseDialog( wxCloseEvent& event ) { event.Skip(); } virtual void OnCloseDialog( wxCloseEvent& event ) { event.Skip(); }
virtual void OnInitDlg( wxInitDialogEvent& event ) { event.Skip(); } virtual void OnInitDlg( wxInitDialogEvent& event ) { event.Skip(); }
virtual void OnTestChipName( wxCommandEvent& event ) { event.Skip(); } virtual void OnTestChipName( wxCommandEvent& event ) { event.Skip(); }
virtual void OnSelectChipName( wxCommandEvent& event ) { event.Skip(); } virtual void OnSelectChipName( wxCommandEvent& event ) { event.Skip(); }
virtual void EditSpiceFields( wxCommandEvent& event ) { event.Skip(); }
virtual void SetInitCmp( wxCommandEvent& event ) { event.Skip(); } virtual void SetInitCmp( wxCommandEvent& event ) { event.Skip(); }
virtual void OnListItemDeselected( wxListEvent& event ) { event.Skip(); } virtual void OnListItemDeselected( wxListEvent& event ) { event.Skip(); }
virtual void OnListItemSelected( wxListEvent& event ) { event.Skip(); } virtual void OnListItemSelected( wxListEvent& event ) { event.Skip(); }
@ -97,13 +99,13 @@ class DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP : public DIALOG_SHIM
virtual void showButtonHandler( wxCommandEvent& event ) { event.Skip(); } virtual void showButtonHandler( wxCommandEvent& event ) { event.Skip(); }
virtual void OnCancelButtonClick( wxCommandEvent& event ) { event.Skip(); } virtual void OnCancelButtonClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnOKButtonClick( wxCommandEvent& event ) { event.Skip(); } virtual void OnOKButtonClick( wxCommandEvent& event ) { event.Skip(); }
public: public:
DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Component Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 688,586 ), long style = wxCAPTION|wxCLOSE_BOX|wxDEFAULT_DIALOG_STYLE|wxMAXIMIZE_BOX|wxMINIMIZE_BOX|wxRESIZE_BORDER|wxSYSTEM_MENU ); DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Component Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 928,741 ), long style = wxCAPTION|wxCLOSE_BOX|wxDEFAULT_DIALOG_STYLE|wxMAXIMIZE_BOX|wxMINIMIZE_BOX|wxRESIZE_BORDER|wxSYSTEM_MENU );
~DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP(); ~DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP();
}; };
#endif //__DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP_H__ #endif //__DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP_H__

View File

@ -49,7 +49,6 @@ bool NETLIST_EXPORTER_PSPICE::Format( OUTPUTFORMATTER* formatter, int aCtl )
std::vector<int> pinSequence; // numeric indices into m_SortedComponentPinList std::vector<int> pinSequence; // numeric indices into m_SortedComponentPinList
wxArrayString stdPinNameArray; // Array containing Standard Pin Names wxArrayString stdPinNameArray; // Array containing Standard Pin Names
const wxString delimiters( "{:,; }" ); const wxString delimiters( "{:,; }" );
const wxString disableStr( "N" );
// Prepare list of nets generation (not used here, but... // Prepare list of nets generation (not used here, but...
for( unsigned ii = 0; ii < m_masterList->size(); ii++ ) for( unsigned ii = 0; ii < m_masterList->size(); ii++ )
@ -85,7 +84,6 @@ bool NETLIST_EXPORTER_PSPICE::Format( OUTPUTFORMATTER* formatter, int aCtl )
while( tokenizer.HasMoreTokens() ) while( tokenizer.HasMoreTokens() )
{ {
wxString directive( tokenizer.GetNextToken() ); wxString directive( tokenizer.GetNextToken() );
wxLogDebug( "Directive found: '%s'\n", (const char *) directive.c_str() );
// Fix paths for .include directives // Fix paths for .include directives
if( m_paths && directive.StartsWith( ".inc" ) ) if( m_paths && directive.StartsWith( ".inc" ) )
@ -122,56 +120,41 @@ bool NETLIST_EXPORTER_PSPICE::Format( OUTPUTFORMATTER* formatter, int aCtl )
// Reset NodeSeqIndex Count: // Reset NodeSeqIndex Count:
pinSequence.clear(); pinSequence.clear();
// Obtain Spice fields
SCH_FIELD* spicePrimitiveType = comp->FindField( wxT( "Spice_Primitive" ) ); SCH_FIELD* spicePrimitiveType = comp->FindField( wxT( "Spice_Primitive" ) );
SCH_FIELD* spiceModel = comp->FindField( wxT( "Spice_Model" ) ); SCH_FIELD* spiceModel = comp->FindField( wxT( "Spice_Model" ) );
SCH_FIELD* netlistEnabledField = comp->FindField( wxT( "Spice_Netlist_Enabled" ) );
SCH_FIELD* spiceSeqField = comp->FindField( wxT( "Spice_Node_Sequence" ) );
wxString RefName = comp->GetRef( &sheetList[sheet_idx] ); wxString model = spiceModel ? spiceModel->GetText()
wxString CompValue = comp->GetField( VALUE )->GetText(); : GetSpiceFieldDefVal( "Spice_Model", comp );
wxString model( "" ); wxString primType = spicePrimitiveType ? spicePrimitiveType->GetText()
wxString primType( "X" ); : GetSpiceFieldDefVal( "Spice_Primitive", comp );
if( spicePrimitiveType ) const wxString& RefName = comp->GetRef( &sheetList[sheet_idx] );
{
primType = spicePrimitiveType->GetText();
}
else
{
// Convert ceratin modules to subcircuits
if( RefName.StartsWith( "IC" ) || RefName.StartsWith( "U" ) )
primType = "X";
else
primType = RefName.GetChar( 0 );
}
if( spiceModel )
model = spiceModel->GetText();
else
model = CompValue;
// Check to see if component should be removed from Spice Netlist: // Check to see if component should be removed from Spice Netlist:
SCH_FIELD* netlistEnabledField = comp->FindField( wxT( "Spice_Netlist_Enabled" ) );
if( netlistEnabledField ) if( netlistEnabledField )
{ {
wxString netlistEnabled = netlistEnabledField->GetText(); wxString netlistEnabled = netlistEnabledField->GetText();
if( netlistEnabled.CmpNoCase( disableStr ) == 0 ) if( netlistEnabled.CmpNoCase( "N" ) == 0
|| netlistEnabled.CmpNoCase( "F" ) == 0
|| netlistEnabled == "0" )
continue; continue;
} }
// Check if Alternative Pin Sequence is Available: // Check if an alternative pin sequence is available:
SCH_FIELD* spiceSeqField = comp->FindField( wxT( "Spice_Node_Sequence" ) );
if( spiceSeqField ) if( spiceSeqField )
{ {
// Get String containing the Sequence of Nodes: // Get the string containing the sequence of nodes:
wxString nodeSeqIndexLineStr = spiceSeqField->GetText(); wxString nodeSeqIndexLineStr = spiceSeqField->GetText();
// Verify Field Exists and is not empty: // Verify field exists and is not empty:
if( !nodeSeqIndexLineStr.IsEmpty() ) if( !nodeSeqIndexLineStr.IsEmpty() )
{ {
// Create an Array of Standard Pin Names from part definition: // Create an array of standard pin names from part definition:
stdPinNameArray.Clear(); stdPinNameArray.Clear();
for( unsigned ii = 0; ii < m_SortedComponentPinList.size(); ii++ ) for( unsigned ii = 0; ii < m_SortedComponentPinList.size(); ii++ )
@ -193,7 +176,7 @@ bool NETLIST_EXPORTER_PSPICE::Format( OUTPUTFORMATTER* formatter, int aCtl )
int seq; int seq;
// Find PinName In Standard List assign Standard List Index to Name: // Find PinName In Standard List assign Standard List Index to Name:
seq = stdPinNameArray.Index(pinIndex); seq = stdPinNameArray.Index( pinIndex );
if( seq != wxNOT_FOUND ) if( seq != wxNOT_FOUND )
pinSequence.push_back( seq ); pinSequence.push_back( seq );
@ -221,9 +204,6 @@ bool NETLIST_EXPORTER_PSPICE::Format( OUTPUTFORMATTER* formatter, int aCtl )
} }
#endif #endif
wxLogDebug( "Ref %s primType %s model/value '%s'\n",
TO_UTF8( RefName ), (const char*) primType.c_str(), (const char*) model.c_str() );
int activePinIndex = 0; int activePinIndex = 0;
formatter->Print( 0, "%s%s ", (const char*) primType.c_str(), (const char*) RefName.c_str() ); formatter->Print( 0, "%s%s ", (const char*) primType.c_str(), (const char*) RefName.c_str() );
@ -247,6 +227,7 @@ bool NETLIST_EXPORTER_PSPICE::Format( OUTPUTFORMATTER* formatter, int aCtl )
{ {
// Case of Alt Pin Sequence in control Bad Index or not using all // Case of Alt Pin Sequence in control Bad Index or not using all
// pins for simulation: // pins for simulation:
wxASSERT_MSG( false, "Used an invalid pin number in node sequence" );
continue; continue;
} }
} }
@ -328,3 +309,55 @@ bool NETLIST_EXPORTER_PSPICE::Format( OUTPUTFORMATTER* formatter, int aCtl )
return ret >= 0; return ret >= 0;
} }
wxString NETLIST_EXPORTER_PSPICE::GetSpiceFieldDefVal( const wxString& aField,
SCH_COMPONENT* aComponent )
{
if( aField == "Spice_Primitive" )
{
wxString RefName = aComponent->GetField( REFERENCE )->GetText();
// Convert ICs to subcircuits
if( RefName.StartsWith( "IC" ) || RefName.StartsWith( "U" ) )
return wxString( "X" );
else
return RefName.GetChar( 0 );
}
if( aField == "Spice_Model" )
{
return aComponent->GetField( VALUE )->GetText();
}
if( aField == "Spice_Netlist_Enabled" )
{
return wxString( "Y" );
}
if( aField == "Spice_Node_Sequence" )
{
wxString nodeSeq;
std::vector<LIB_PIN*> pins;
aComponent->GetPins( pins );
for( auto pin : pins )
nodeSeq += pin->GetNumberString() + " ";
nodeSeq.Trim();
return nodeSeq;
}
wxASSERT_MSG( "Missing default value definition for a Spice field: %s" , aField );
return wxString( "<unknown>" );
}
const std::vector<wxString> NETLIST_EXPORTER_PSPICE::m_spiceFields = {
"Spice_Primitive",
"Spice_Model",
"Spice_Netlist_Enabled",
"Spice_Node_Sequence"
};

View File

@ -3,7 +3,7 @@
* *
* Copyright (C) 1992-2013 jp.charras at wanadoo.fr * Copyright (C) 1992-2013 jp.charras at wanadoo.fr
* Copyright (C) 2013 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com> * Copyright (C) 2013 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 1992-2015 KiCad Developers * Copyright (C) 1992-2016 KiCad Developers
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
@ -64,10 +64,20 @@ public:
return m_probes; return m_probes;
} }
static const std::vector<wxString>& GetSpiceFields()
{
return m_spiceFields;
}
static wxString GetSpiceFieldDefVal( const wxString& aField, SCH_COMPONENT* aComponent );
private: private:
NET_INDEX_MAP m_netMap; NET_INDEX_MAP m_netMap;
PROBE_LIST m_probes; PROBE_LIST m_probes;
SEARCH_STACK* m_paths; SEARCH_STACK* m_paths;
// Fields that are used during netlist export & simulation
static const std::vector<wxString> m_spiceFields;
}; };
#endif #endif