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 (C) 2021-2023 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 TUNER_SLIDER( SIMULATOR_FRAME_UI* aPanel, wxWindow* aParent, const SCH_SHEET_PATH& aSheetPath,
47 SCH_SYMBOL* aSymbol );
48
49 wxString GetSymbolRef() const
50 {
51 return m_ref;
52 }
53
54 const SPICE_VALUE& GetMin() const
55 {
56 return m_min;
57 }
58
59 const SPICE_VALUE& GetMax() const
60 {
61 return m_max;
62 }
63
64 const SPICE_VALUE& GetValue() const
65 {
66 return m_value;
67 }
68
69 KIID GetSymbol( SCH_SHEET_PATH* aSheetPath ) const
70 {
71 *aSheetPath = m_sheetPath;
72 return m_symbol;
73 }
74
75 bool SetValue( const SPICE_VALUE& aVal );
76 bool SetMin( const SPICE_VALUE& aVal );
77 bool SetMax( const SPICE_VALUE& aVal );
78
80
81private:
83 void updateSlider();
84 void updateValueText();
85
86 void updateMax();
87 void updateValue();
88 void updateMin();
89
90 void onESeries( wxCommandEvent& event ) override;
91 void onClose( wxCommandEvent& event ) override;
92 void onSave( wxCommandEvent& event ) override;
93 void onSliderScroll( wxScrollEvent& event ) override;
94 void onSliderChanged( wxScrollEvent& event ) override;
95
96 void onMaxKillFocus( wxFocusEvent& event ) override;
97 void onValueKillFocus( wxFocusEvent& event ) override;
98 void onMinKillFocus( wxFocusEvent& event ) override;
99
100 void onMaxTextEnter( wxCommandEvent& event ) override;
101 void onValueTextEnter( wxCommandEvent& event ) override;
102 void onMinTextEnter( wxCommandEvent& event ) override;
103
104private:
107 wxString m_ref;
108
112
114};
115
116#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:109
The SIMULATOR_FRAME_UI holds the main user-interface for running simulations.
Helper class to recognize Spice formatted values.
Definition: spice_value.h:56
Class TUNER_SLIDER_BASE.
Custom widget to handle quick component values modification and simulation on the fly.
Definition: tuner_slider.h:44
void onESeries(wxCommandEvent &event) override
bool SetMin(const SPICE_VALUE &aVal)
KIID GetSymbol(SCH_SHEET_PATH *aSheetPath) const
Definition: tuner_slider.h:69
const SPICE_VALUE & GetValue() const
Definition: tuner_slider.h:64
void updateSlider()
const SPICE_VALUE & GetMax() const
Definition: tuner_slider.h:59
void updateValue()
void onValueTextEnter(wxCommandEvent &event) override
void onMinKillFocus(wxFocusEvent &event) override
wxString m_ref
Definition: tuner_slider.h:107
void onValueKillFocus(wxFocusEvent &event) override
bool SetValue(const SPICE_VALUE &aVal)
void onSave(wxCommandEvent &event) override
wxString GetSymbolRef() const
Definition: tuner_slider.h:49
SPICE_VALUE m_max
Definition: tuner_slider.h:110
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
Definition: tuner_slider.h:54
SCH_SHEET_PATH m_sheetPath
Definition: tuner_slider.h:106
void onMinTextEnter(wxCommandEvent &event) override
void onClose(wxCommandEvent &event) override
SIMULATOR_FRAME_UI * m_frame
Definition: tuner_slider.h:113
SPICE_VALUE m_value
Definition: tuner_slider.h:111
SPICE_VALUE m_min
Definition: tuner_slider.h:109
void onSliderChanged(wxScrollEvent &event) override
void ShowChangedLanguage()