KiCad PCB EDA Suite
Loading...
Searching...
No Matches
tuner_slider.h
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 The KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * @author Maciej Suminski <[email protected]>
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 3
12 * of the License, or (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, you may find one here:
21 * https://www.gnu.org/licenses/gpl-3.0.html
22 * or you may search the http://www.gnu.org website for the version 3 license,
23 * or you may write to the Free Software Foundation, Inc.,
24 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
25 */
26
27#ifndef TUNER_SLIDER_H
28#define TUNER_SLIDER_H
29
30#include "tuner_slider_base.h"
31
32#include <sim/spice_value.h>
33#include <sim/spice_generator.h>
34
35#include <wx/timer.h>
36
38class SCH_SYMBOL;
39
44{
45public:
46 enum class RUN_MODE
47 {
50 };
51
52 TUNER_SLIDER( SIMULATOR_FRAME_UI* aPanel, wxWindow* aParent, const SCH_SHEET_PATH& aSheetPath,
53 SCH_SYMBOL* aSymbol );
54
55 wxString GetSymbolRef() const
56 {
57 return m_ref;
58 }
59
61 {
62 return m_runMode;
63 }
64
65 int GetStepCount() const;
66
67 const SPICE_VALUE& GetMin() const
68 {
69 return m_min;
70 }
71
72 const SPICE_VALUE& GetMax() const
73 {
74 return m_max;
75 }
76
77 const SPICE_VALUE& GetValue() const
78 {
79 return m_value;
80 }
81
82 KIID GetSymbol( SCH_SHEET_PATH* aSheetPath ) const
83 {
84 *aSheetPath = m_sheetPath;
85 return m_symbol;
86 }
87
88 bool SetValue( const SPICE_VALUE& aVal );
89 bool SetMin( const SPICE_VALUE& aVal );
90 bool SetMax( const SPICE_VALUE& aVal );
91
93
94private:
96 void updateSlider();
97 void updateValueText();
98
99 void updateModeControls();
100
101 void updateMax();
102 void updateValue();
103 void updateMin();
104
105 void onESeries( wxCommandEvent& event ) override;
106 void onRunModeChanged( wxCommandEvent& event ) override;
107 void onClose( wxCommandEvent& event ) override;
108 void onSave( wxCommandEvent& event ) override;
109 void onSliderScroll( wxScrollEvent& event ) override;
110 void onSliderChanged( wxScrollEvent& event ) override;
111
112 void onMaxKillFocus( wxFocusEvent& event ) override;
113 void onValueKillFocus( wxFocusEvent& event ) override;
114 void onMinKillFocus( wxFocusEvent& event ) override;
115
116 void onMaxTextEnter( wxCommandEvent& event ) override;
117 void onValueTextEnter( wxCommandEvent& event ) override;
118 void onMinTextEnter( wxCommandEvent& event ) override;
119 void onStepsChanged( wxSpinEvent& event ) override;
120 void onStepsTextEnter( wxCommandEvent& event ) override;
121
122private:
125 wxString m_ref;
126
130
133};
134
135#endif /* TUNER_SLIDER_H */
Definition kiid.h:49
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
Schematic symbol object.
Definition sch_symbol.h:75
The SIMULATOR_FRAME_UI holds the main user-interface for running simulations.
Helper class to recognize Spice formatted values.
Definition spice_value.h:56
TUNER_SLIDER_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxBORDER_NONE|wxTAB_TRAVERSAL, const wxString &name=wxEmptyString)
void onESeries(wxCommandEvent &event) override
bool SetMin(const SPICE_VALUE &aVal)
int GetStepCount() const
KIID GetSymbol(SCH_SHEET_PATH *aSheetPath) const
const SPICE_VALUE & GetValue() const
void onStepsTextEnter(wxCommandEvent &event) override
const SPICE_VALUE & GetMax() const
void onRunModeChanged(wxCommandEvent &event) override
void onValueTextEnter(wxCommandEvent &event) override
void onMinKillFocus(wxFocusEvent &event) override
wxString m_ref
void onValueKillFocus(wxFocusEvent &event) override
RUN_MODE GetRunMode() const
bool SetValue(const SPICE_VALUE &aVal)
void onSave(wxCommandEvent &event) override
void onStepsChanged(wxSpinEvent &event) override
TUNER_SLIDER(SIMULATOR_FRAME_UI *aPanel, wxWindow *aParent, const SCH_SHEET_PATH &aSheetPath, SCH_SYMBOL *aSymbol)
wxString GetSymbolRef() const
SPICE_VALUE m_max
void onMaxTextEnter(wxCommandEvent &event) override
void updateComponentValue()
bool SetMax(const SPICE_VALUE &aVal)
void updateValueText()
void onMaxKillFocus(wxFocusEvent &event) override
void onSliderScroll(wxScrollEvent &event) override
const SPICE_VALUE & GetMin() const
SCH_SHEET_PATH m_sheetPath
void onMinTextEnter(wxCommandEvent &event) override
void onClose(wxCommandEvent &event) override
SIMULATOR_FRAME_UI * m_frame
SPICE_VALUE m_value
SPICE_VALUE m_min
RUN_MODE m_runMode
void onSliderChanged(wxScrollEvent &event) override
void ShowChangedLanguage()
void updateModeControls()