2020-04-15 01:51:58 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
2023-01-04 18:06:04 +00:00
|
|
|
* Copyright (C) 2016-2023 CERN
|
2024-01-23 01:02:50 +00:00
|
|
|
* Copyright (C) 2021-2024 KiCad Developers, see AUTHORS.txt for contributors.
|
2020-04-15 01:51:58 +00:00
|
|
|
* @author Sylwester Kocjan <s.kocjan@o2.pl>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 3
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, you may find one here:
|
|
|
|
* https://www.gnu.org/licenses/gpl-3.0.html
|
|
|
|
* or you may search the http://www.gnu.org website for the version 3 license,
|
|
|
|
* or you may write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
2021-05-26 18:15:16 +00:00
|
|
|
#include "confirm.h"
|
2023-07-09 22:00:25 +00:00
|
|
|
#include "sim_tab.h"
|
2020-04-15 01:51:58 +00:00
|
|
|
|
2023-03-03 22:36:07 +00:00
|
|
|
#include "simulator_frame.h"
|
2023-07-14 09:21:58 +00:00
|
|
|
#include "spice_circuit_model.h"
|
2020-04-15 01:51:58 +00:00
|
|
|
|
|
|
|
|
2023-07-09 22:00:25 +00:00
|
|
|
SIM_TAB::SIM_TAB() :
|
2023-01-14 00:17:33 +00:00
|
|
|
m_simCommand( wxEmptyString ),
|
|
|
|
m_simOptions( NETLIST_EXPORTER_SPICE::OPTION_DEFAULT_FLAGS )
|
2020-04-15 01:51:58 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2023-07-19 15:25:57 +00:00
|
|
|
SIM_TAB::SIM_TAB( const wxString& aSimCommand, wxWindow* parent ) :
|
2023-07-05 17:25:52 +00:00
|
|
|
wxWindow( parent, wxID_ANY ),
|
|
|
|
m_simCommand( aSimCommand ),
|
2023-07-19 15:25:57 +00:00
|
|
|
m_simOptions( NETLIST_EXPORTER_SPICE::OPTION_DEFAULT_FLAGS )
|
2020-04-15 01:51:58 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2023-07-09 22:00:25 +00:00
|
|
|
SIM_TAB::~SIM_TAB()
|
2020-04-15 01:51:58 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2023-07-09 22:00:25 +00:00
|
|
|
bool SIM_TAB::IsPlottable( SIM_TYPE aSimType )
|
2020-04-15 01:51:58 +00:00
|
|
|
{
|
|
|
|
switch( aSimType )
|
|
|
|
{
|
|
|
|
case ST_AC:
|
|
|
|
case ST_DC:
|
2023-07-05 17:25:52 +00:00
|
|
|
case ST_SP:
|
|
|
|
case ST_TRAN:
|
2023-07-03 22:11:43 +00:00
|
|
|
case ST_NOISE:
|
2023-07-05 17:25:52 +00:00
|
|
|
case ST_FFT:
|
2020-04-15 01:51:58 +00:00
|
|
|
return true;
|
|
|
|
|
|
|
|
default:
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-01-23 01:02:50 +00:00
|
|
|
void SIM_TAB::ApplyPreferences( const SIM_PREFERENCES& /*aPrefs*/ )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2020-04-15 01:51:58 +00:00
|
|
|
|
2023-07-09 22:00:25 +00:00
|
|
|
SIM_TYPE SIM_TAB::GetSimType() const
|
2021-01-25 21:29:13 +00:00
|
|
|
{
|
2023-07-14 09:21:58 +00:00
|
|
|
return SPICE_CIRCUIT_MODEL::CommandToSimType( m_simCommand );
|
2021-01-25 21:29:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2023-07-19 15:25:57 +00:00
|
|
|
SIM_NOPLOT_TAB::SIM_NOPLOT_TAB( const wxString& aSimCommand, wxWindow* parent ) :
|
|
|
|
SIM_TAB( aSimCommand, parent )
|
2020-04-15 01:51:58 +00:00
|
|
|
{
|
|
|
|
m_sizer = new wxBoxSizer( wxVERTICAL );
|
|
|
|
m_sizer->Add( 0, 1, 1, wxEXPAND, 5 );
|
|
|
|
|
|
|
|
m_textInfo = new wxStaticText( dynamic_cast<wxWindow*>( this ), wxID_ANY, "", wxDefaultPosition,
|
2023-03-03 22:36:07 +00:00
|
|
|
wxDefaultSize, wxALL | wxEXPAND | wxALIGN_CENTER_HORIZONTAL );
|
|
|
|
m_textInfo->SetFont( KIUI::GetControlFont( this ).Bold() );
|
2020-04-15 01:51:58 +00:00
|
|
|
m_textInfo->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_GRAYTEXT ) );
|
2023-01-04 18:06:04 +00:00
|
|
|
m_textInfo->SetLabel( _( "Simulation provided no plots. Please refer to console window "
|
|
|
|
"for results." ) );
|
2020-04-15 01:51:58 +00:00
|
|
|
|
|
|
|
m_sizer->Add( m_textInfo, 1, wxALL | wxEXPAND, 5 );
|
|
|
|
m_sizer->Add( 0, 1, 1, wxEXPAND, 5 );
|
|
|
|
|
|
|
|
dynamic_cast<wxWindow*>( this )->SetSizer( m_sizer );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2023-07-09 22:00:25 +00:00
|
|
|
SIM_NOPLOT_TAB::~SIM_NOPLOT_TAB()
|
2020-04-15 01:51:58 +00:00
|
|
|
{
|
|
|
|
}
|
2023-01-04 18:06:04 +00:00
|
|
|
|
|
|
|
|
2023-07-09 22:00:25 +00:00
|
|
|
void SIM_NOPLOT_TAB::OnLanguageChanged()
|
2023-01-04 18:06:04 +00:00
|
|
|
{
|
|
|
|
m_textInfo->SetLabel( _( "Simulation provided no plots. Please refer to console window "
|
|
|
|
"for results." ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
|