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 The 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, see <https://www.gnu.org/licenses/>.
20 */
21
22#include "confirm.h"
23#include "sim_tab.h"
24
25#include "simulator_frame.h"
26#include "spice_circuit_model.h"
27
28
30 m_simCommand( wxEmptyString ),
31 m_simOptions( NETLIST_EXPORTER_SPICE::OPTION_DEFAULT_FLAGS )
32{
33}
34
35
36SIM_TAB::SIM_TAB( const wxString& aSimCommand, wxWindow* parent ) :
37 wxWindow( parent, wxID_ANY ),
38 m_simCommand( aSimCommand ),
39 m_simOptions( NETLIST_EXPORTER_SPICE::OPTION_DEFAULT_FLAGS )
40{
41}
42
43
47
48
50{
51 switch( aSimType )
52 {
53 case ST_AC:
54 case ST_DC:
55 case ST_SP:
56 case ST_TRAN:
57 case ST_NOISE:
58 case ST_FFT:
59 return true;
60
61 default:
62 return false;
63 }
64}
65
67{
68}
69
70
75
76
77SIM_NOPLOT_TAB::SIM_NOPLOT_TAB( const wxString& aSimCommand, wxWindow* parent ) :
78 SIM_TAB( aSimCommand, parent )
79{
80 m_sizer = new wxBoxSizer( wxVERTICAL );
81 m_sizer->Add( 0, 1, 1, wxEXPAND, 5 );
82
83 m_textInfo = new wxStaticText( dynamic_cast<wxWindow*>( this ), wxID_ANY, "", wxDefaultPosition,
84 wxDefaultSize, wxALL | wxEXPAND | wxALIGN_CENTER_HORIZONTAL );
85 m_textInfo->SetFont( KIUI::GetControlFont( this ).Bold() );
86 m_textInfo->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_GRAYTEXT ) );
87 m_textInfo->SetLabel( _( "Simulation provided no plots. Please refer to console window "
88 "for results." ) );
89
90 m_sizer->Add( m_textInfo, 1, wxALL | wxEXPAND, 5 );
91 m_sizer->Add( 0, 1, 1, wxEXPAND, 5 );
92
93 dynamic_cast<wxWindow*>( this )->SetSizer( m_sizer );
94}
95
96
100
101
103{
104 m_textInfo->SetLabel( _( "Simulation provided no plots. Please refer to console window "
105 "for results." ) );
106}
107
108
SIM_NOPLOT_TAB(const wxString &aSimCommand, wxWindow *parent)
Definition sim_tab.cpp:77
wxStaticText * m_textInfo
Definition sim_tab.h:79
wxSizer * m_sizer
Definition sim_tab.h:78
void OnLanguageChanged() override
Definition sim_tab.cpp:102
virtual ~SIM_NOPLOT_TAB()
Definition sim_tab.cpp:97
SIM_TAB()
Definition sim_tab.cpp:29
unsigned m_simOptions
Definition sim_tab.h:62
SIM_TYPE GetSimType() const
Definition sim_tab.cpp:71
wxString m_simCommand
Definition sim_tab.h:61
static bool IsPlottable(SIM_TYPE aSimType)
Definition sim_tab.cpp:49
virtual void ApplyPreferences(const SIM_PREFERENCES &aPrefs)
Definition sim_tab.cpp:66
virtual ~SIM_TAB()
Definition sim_tab.cpp:44
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)
SIM_TYPE
< Possible simulation types
Definition sim_types.h:28
@ ST_SP
Definition sim_types.h:39
@ ST_TRAN
Definition sim_types.h:38
@ ST_NOISE
Definition sim_types.h:33
@ ST_AC
Definition sim_types.h:30
@ ST_DC
Definition sim_types.h:31
@ ST_FFT
Definition sim_types.h:40
Contains preferences pertaining to the simulator.