KiCad PCB EDA Suite
sim_panel_base.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-2023 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_panel_base.h"
28
29#include "simulator_frame.h"
31
32
34 m_simCommand( wxEmptyString ),
35 m_simOptions( NETLIST_EXPORTER_SPICE::OPTION_DEFAULT_FLAGS )
36{
37}
38
39
40SIM_PANEL_BASE::SIM_PANEL_BASE( const wxString& aCommand, int aOptions, wxWindow* parent,
41 wxWindowID id, const wxPoint& pos, const wxSize& size, long style,
42 const wxString& name ) :
43 wxWindow( parent, id, pos, size, style, name ),
44 m_simCommand( aCommand ),
45 m_simOptions( aOptions )
46{
47}
48
49
51{
52}
53
54
56{
57 switch( aSimType )
58 {
59 case ST_AC:
60 case ST_DC:
61 case ST_TRANSIENT:
62 return true;
63
64 default:
65 return false;
66 }
67}
68
69
71{
73}
74
75
76SIM_NOPLOT_PANEL::SIM_NOPLOT_PANEL( const wxString& aCommand, int aOptions, wxWindow* parent,
77 wxWindowID id, const wxPoint& pos, const wxSize& size,
78 long style, const wxString& name ) :
79 SIM_PANEL_BASE( aCommand, aOptions, parent, id, pos, size, style, name )
80{
81 m_sizer = new wxBoxSizer( wxVERTICAL );
82 m_sizer->Add( 0, 1, 1, wxEXPAND, 5 );
83
84 m_textInfo = new wxStaticText( dynamic_cast<wxWindow*>( this ), wxID_ANY, "", wxDefaultPosition,
85 wxDefaultSize, wxALL | wxEXPAND | wxALIGN_CENTER_HORIZONTAL );
86 m_textInfo->SetFont( KIUI::GetControlFont( this ).Bold() );
87 m_textInfo->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_GRAYTEXT ) );
88 m_textInfo->SetLabel( _( "Simulation provided no plots. Please refer to console window "
89 "for results." ) );
90
91 m_sizer->Add( m_textInfo, 1, wxALL | wxEXPAND, 5 );
92 m_sizer->Add( 0, 1, 1, wxEXPAND, 5 );
93
94 dynamic_cast<wxWindow*>( this )->SetSizer( m_sizer );
95}
96
97
99{
100}
101
102
104{
105 m_textInfo->SetLabel( _( "Simulation provided no plots. Please refer to console window "
106 "for results." ) );
107}
108
109
const char * name
Definition: DXF_plotter.cpp:56
static SIM_TYPE CommandToSimType(const wxString &aCmd)
Return simulation type basing on a simulation command directive.
wxStaticText * m_textInfo
SIM_NOPLOT_PANEL(const wxString &aCommand, int aOptions, wxWindow *parent, wxWindowID id, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=0, const wxString &name=wxPanelNameStr)
virtual ~SIM_NOPLOT_PANEL()
void OnLanguageChanged() override
static bool IsPlottable(SIM_TYPE aSimType)
virtual ~SIM_PANEL_BASE()
SIM_TYPE GetType() const
wxString m_simCommand
This file is part of the common library.
#define _(s)
wxFont GetControlFont(wxWindow *aWindow)
Definition: ui_common.cpp:162
SIM_TYPE
< Possible simulation types
Definition: sim_types.h:32
@ ST_TRANSIENT
Definition: sim_types.h:42
@ ST_AC
Definition: sim_types.h:34
@ ST_DC
Definition: sim_types.h:35