2020-04-15 01:51:58 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2016 CERN
|
2021-07-27 12:22:27 +00:00
|
|
|
* Copyright (C) 2021 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"
|
2020-04-15 01:51:58 +00:00
|
|
|
#include "sim_panel_base.h"
|
|
|
|
|
|
|
|
#include "sim_plot_frame.h"
|
2022-12-07 00:23:18 +00:00
|
|
|
#include "ngspice_circuit_model.h"
|
2020-04-15 01:51:58 +00:00
|
|
|
|
|
|
|
|
2021-01-25 21:29:13 +00:00
|
|
|
SIM_PANEL_BASE::SIM_PANEL_BASE() : m_simCommand( wxEmptyString )
|
2020-04-15 01:51:58 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-07-27 12:22:27 +00:00
|
|
|
SIM_PANEL_BASE::SIM_PANEL_BASE( const wxString& aCommand ) : m_simCommand( aCommand )
|
2020-04-15 01:51:58 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-07-27 12:22:27 +00:00
|
|
|
SIM_PANEL_BASE::SIM_PANEL_BASE( const wxString& aCommand, wxWindow* parent, wxWindowID id,
|
2021-01-25 21:29:13 +00:00
|
|
|
const wxPoint& pos, const wxSize& size, long style,
|
|
|
|
const wxString& name ) :
|
|
|
|
wxWindow( parent, id, pos, size, style, name ),
|
|
|
|
m_simCommand( aCommand )
|
2020-04-15 01:51:58 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
SIM_PANEL_BASE::~SIM_PANEL_BASE()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool SIM_PANEL_BASE::IsPlottable( SIM_TYPE aSimType )
|
|
|
|
{
|
|
|
|
switch( aSimType )
|
|
|
|
{
|
|
|
|
case ST_AC:
|
|
|
|
case ST_DC:
|
|
|
|
case ST_TRANSIENT:
|
|
|
|
return true;
|
|
|
|
|
|
|
|
default:
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-01-25 21:29:13 +00:00
|
|
|
SIM_TYPE SIM_PANEL_BASE::GetType() const
|
|
|
|
{
|
2022-03-05 23:49:25 +00:00
|
|
|
return NGSPICE_CIRCUIT_MODEL::CommandToSimType( m_simCommand );
|
2021-01-25 21:29:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-07-27 12:22:27 +00:00
|
|
|
SIM_NOPLOT_PANEL::SIM_NOPLOT_PANEL( const wxString& aCommand, wxWindow* parent, wxWindowID id,
|
2021-01-25 21:29:13 +00:00
|
|
|
const wxPoint& pos, const wxSize& size, long style,
|
|
|
|
const wxString& name ) :
|
|
|
|
SIM_PANEL_BASE( aCommand, parent, id, pos, size, style, name )
|
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,
|
|
|
|
wxDefaultSize, wxALL | wxEXPAND | wxALIGN_CENTER_HORIZONTAL );
|
|
|
|
m_textInfo->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT,
|
|
|
|
wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) );
|
|
|
|
m_textInfo->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_GRAYTEXT ) );
|
|
|
|
m_textInfo->SetLabel(
|
2021-05-24 20:17:29 +00:00
|
|
|
_( "This simulation provide 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 );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
SIM_NOPLOT_PANEL::~SIM_NOPLOT_PANEL()
|
|
|
|
{
|
|
|
|
}
|