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 CERN
5  * Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors.
6  * @author Sylwester Kocjan <s.kocjan@o2.pl>
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 "sim_plot_frame.h"
31 
32 
33 SIM_PANEL_BASE::SIM_PANEL_BASE() : m_simCommand( wxEmptyString )
34 {
35 }
36 
37 
38 SIM_PANEL_BASE::SIM_PANEL_BASE( const wxString& aCommand ) : m_simCommand( aCommand )
39 {
40 }
41 
42 
43 SIM_PANEL_BASE::SIM_PANEL_BASE( const wxString& aCommand, wxWindow* parent, wxWindowID id,
44  const wxPoint& pos, const wxSize& size, long style,
45  const wxString& name ) :
46  wxWindow( parent, id, pos, size, style, name ),
47  m_simCommand( aCommand )
48 {
49 }
50 
51 
53 {
54 }
55 
56 
58 {
59  switch( aSimType )
60  {
61  case ST_AC:
62  case ST_DC:
63  case ST_TRANSIENT:
64  return true;
65 
66  default:
67  return false;
68  }
69 }
70 
71 
73 {
75 }
76 
77 
78 SIM_NOPLOT_PANEL::SIM_NOPLOT_PANEL( const wxString& aCommand, wxWindow* parent, wxWindowID id,
79  const wxPoint& pos, const wxSize& size, long style,
80  const wxString& name ) :
81  SIM_PANEL_BASE( aCommand, parent, id, pos, size, style, name )
82 {
83  m_sizer = new wxBoxSizer( wxVERTICAL );
84  m_sizer->Add( 0, 1, 1, wxEXPAND, 5 );
85 
86  m_textInfo = new wxStaticText( dynamic_cast<wxWindow*>( this ), wxID_ANY, "", wxDefaultPosition,
87  wxDefaultSize, wxALL | wxEXPAND | wxALIGN_CENTER_HORIZONTAL );
88  m_textInfo->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT,
89  wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) );
90  m_textInfo->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_GRAYTEXT ) );
91  m_textInfo->SetLabel(
92  _( "This simulation provide no plots. Please refer to console window 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 }
SIM_NOPLOT_PANEL(const wxString &aCommand, wxWindow *parent, wxWindowID id, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=0, const wxString &name=wxPanelNameStr)
This file is part of the common library.
static bool IsPlottable(SIM_TYPE aSimType)
static SIM_TYPE CommandToSimType(const wxString &aCmd)
Return simulation type basing on a simulation command directive.
wxString m_simCommand
SIM_TYPE
< Possible simulation types
Definition: sim_types.h:31
#define _(s)
Subclass of SIM_PLOT_FRAME_BASE, which is generated by wxFormBuilder.
SIM_TYPE GetType() const
const char * name
Definition: DXF_plotter.cpp:56
virtual ~SIM_NOPLOT_PANEL()
wxStaticText * m_textInfo
virtual ~SIM_PANEL_BASE()