KiCad PCB EDA Suite
Loading...
Searching...
No Matches
sim_tab.cpp
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2016-2023 CERN
5 * Copyright (C) 2021-2024 KiCad Developers, see AUTHORS.txt for contributors.
6 * @author Sylwester Kocjan <[email protected]>
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 3
11 * of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, you may find one here:
20 * https://www.gnu.org/licenses/gpl-3.0.html
21 * or you may search the http://www.gnu.org website for the version 3 license,
22 * or you may write to the Free Software Foundation, Inc.,
23 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24 */
25
26#include "confirm.h"
27#include "sim_tab.h"
28
29#include "simulator_frame.h"
30#include "spice_circuit_model.h"
31
32
34 m_simCommand( wxEmptyString ),
35 m_simOptions( NETLIST_EXPORTER_SPICE::OPTION_DEFAULT_FLAGS )
36{
37}
38
39
40SIM_TAB::SIM_TAB( const wxString& aSimCommand, wxWindow* parent ) :
41 wxWindow( parent, wxID_ANY ),
42 m_simCommand( aSimCommand ),
43 m_simOptions( NETLIST_EXPORTER_SPICE::OPTION_DEFAULT_FLAGS )
44{
45}
46
47
49{
50}
51
52
54{
55 switch( aSimType )
56 {
57 case ST_AC:
58 case ST_DC:
59 case ST_SP:
60 case ST_TRAN:
61 case ST_NOISE:
62 case ST_FFT:
63 return true;
64
65 default:
66 return false;
67 }
68}
69
71{
72}
73
74
76{
78}
79
80
81SIM_NOPLOT_TAB::SIM_NOPLOT_TAB( const wxString& aSimCommand, wxWindow* parent ) :
82 SIM_TAB( aSimCommand, parent )
83{
84 m_sizer = new wxBoxSizer( wxVERTICAL );
85 m_sizer->Add( 0, 1, 1, wxEXPAND, 5 );
86
87 m_textInfo = new wxStaticText( dynamic_cast<wxWindow*>( this ), wxID_ANY, "", wxDefaultPosition,
88 wxDefaultSize, wxALL | wxEXPAND | wxALIGN_CENTER_HORIZONTAL );
89 m_textInfo->SetFont( KIUI::GetControlFont( this ).Bold() );
90 m_textInfo->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_GRAYTEXT ) );
91 m_textInfo->SetLabel( _( "Simulation provided no plots. Please refer to console window "
92 "for results." ) );
93
94 m_sizer->Add( m_textInfo, 1, wxALL | wxEXPAND, 5 );
95 m_sizer->Add( 0, 1, 1, wxEXPAND, 5 );
96
97 dynamic_cast<wxWindow*>( this )->SetSizer( m_sizer );
98}
99
100
102{
103}
104
105
107{
108 m_textInfo->SetLabel( _( "Simulation provided no plots. Please refer to console window "
109 "for results." ) );
110}
111
112
SIM_NOPLOT_TAB(const wxString &aSimCommand, wxWindow *parent)
Definition: sim_tab.cpp:81
wxStaticText * m_textInfo
Definition: sim_tab.h:83
wxSizer * m_sizer
Definition: sim_tab.h:82
void OnLanguageChanged() override
Definition: sim_tab.cpp:106
virtual ~SIM_NOPLOT_TAB()
Definition: sim_tab.cpp:101
SIM_TAB()
Definition: sim_tab.cpp:33
SIM_TYPE GetSimType() const
Definition: sim_tab.cpp:75
wxString m_simCommand
Definition: sim_tab.h:65
static bool IsPlottable(SIM_TYPE aSimType)
Definition: sim_tab.cpp:53
virtual void ApplyPreferences(const SIM_PREFERENCES &aPrefs)
Definition: sim_tab.cpp:70
virtual ~SIM_TAB()
Definition: sim_tab.cpp:48
static SIM_TYPE CommandToSimType(const wxString &aCmd)
Return simulation type basing on a simulation command directive.
This file is part of the common library.
#define _(s)
KICOMMON_API wxFont GetControlFont(wxWindow *aWindow)
Definition: ui_common.cpp:157
SIM_TYPE
< Possible simulation types
Definition: sim_types.h:32
@ ST_SP
Definition: sim_types.h:43
@ ST_TRAN
Definition: sim_types.h:42
@ ST_NOISE
Definition: sim_types.h:37
@ ST_AC
Definition: sim_types.h:34
@ ST_DC
Definition: sim_types.h:35
@ ST_FFT
Definition: sim_types.h:44
Contains preferences pertaining to the simulator.