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, see <https://www.gnu.org/licenses/>.
21 */
22
23#ifndef TUNER_SLIDER_H
24#define TUNER_SLIDER_H
25
26#include "tuner_slider_base.h"
27
28#include <sim/spice_value.h>
29#include <sim/spice_generator.h>
30
31#include <wx/timer.h>
32
34class SCH_SYMBOL;
35
40{
41public:
42 enum class RUN_MODE
43 {
46 };
47
48 TUNER_SLIDER( SIMULATOR_FRAME_UI* aPanel, wxWindow* aParent, const SCH_SHEET_PATH& aSheetPath,
49 SCH_SYMBOL* aSymbol );
50
51 wxString GetSymbolRef() const
52 {
53 return m_ref;
54 }
55
57 {
58 return m_runMode;
59 }
60
61 int GetStepCount() const;
62
63 const SPICE_VALUE& GetMin() const
64 {
65 return m_min;
66 }
67
68 const SPICE_VALUE& GetMax() const
69 {
70 return m_max;
71 }
72
73 const SPICE_VALUE& GetValue() const
74 {
75 return m_value;
76 }
77
78 KIID GetSymbol( SCH_SHEET_PATH* aSheetPath ) const
79 {
80 *aSheetPath = m_sheetPath;
81 return m_symbol;
82 }
83
84 bool SetValue( const SPICE_VALUE& aVal );
85 bool SetMin( const SPICE_VALUE& aVal );
86 bool SetMax( const SPICE_VALUE& aVal );
87
89
90private:
92 void updateSlider();
93 void updateValueText();
94
95 void updateModeControls();
96
97 void updateMax();
98 void updateValue();
99 void updateMin();
100
101 void onESeries( wxCommandEvent& event ) override;
102 void onRunModeChanged( wxCommandEvent& event ) override;
103 void onClose( wxCommandEvent& event ) override;
104 void onSave( wxCommandEvent& event ) override;
105 void onSliderScroll( wxScrollEvent& event ) override;
106 void onSliderChanged( wxScrollEvent& event ) override;
107
108 void onMaxKillFocus( wxFocusEvent& event ) override;
109 void onValueKillFocus( wxFocusEvent& event ) override;
110 void onMinKillFocus( wxFocusEvent& event ) override;
111
112 void onMaxTextEnter( wxCommandEvent& event ) override;
113 void onValueTextEnter( wxCommandEvent& event ) override;
114 void onMinTextEnter( wxCommandEvent& event ) override;
115 void onStepsChanged( wxSpinEvent& event ) override;
116 void onStepsTextEnter( wxCommandEvent& event ) override;
117
118private:
121 wxString m_ref;
122
126
129};
130
131#endif /* TUNER_SLIDER_H */
Definition kiid.h:44
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:69
The SIMULATOR_FRAME_UI holds the main user-interface for running simulations.
Helper class to recognize Spice formatted values.
Definition spice_value.h:52
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()