KiCad PCB EDA Suite
panel_regulator_base.cpp
Go to the documentation of this file.
1
2// C++ code generated with wxFormBuilder (version 3.10.0-4761b0c5)
3// http://www.wxformbuilder.org/
4//
5// PLEASE DO *NOT* EDIT THIS FILE!
7
9
11
12PANEL_REGULATOR_BASE::PANEL_REGULATOR_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : CALCULATOR_PANEL( parent, id, pos, size, style, name )
13{
14 wxBoxSizer* bSizerMainReg;
15 bSizerMainReg = new wxBoxSizer( wxVERTICAL );
16
17 wxBoxSizer* bSizerColBalancer;
18 bSizerColBalancer = new wxBoxSizer( wxHORIZONTAL );
19
20 wxBoxSizer* bSizeLeftpReg;
21 bSizeLeftpReg = new wxBoxSizer( wxVERTICAL );
22
23 bSizeLeftpReg->SetMinSize( wxSize( 400,-1 ) );
24 wxBoxSizer* bSizerType;
25 bSizerType = new wxBoxSizer( wxHORIZONTAL );
26
27 m_staticTextRegType = new wxStaticText( this, wxID_ANY, _("Type:"), wxDefaultPosition, wxDefaultSize, 0 );
28 m_staticTextRegType->Wrap( -1 );
29 m_staticTextRegType->SetToolTip( _("Type of the regulator.\nThere are 2 types:\n- regulators which have a dedicated sense pin for the voltage regulation.\n- 3 terminal pins.") );
30
31 bSizerType->Add( m_staticTextRegType, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
32
33 wxString m_choiceRegTypeChoices[] = { _("Standard Type"), _("3 Terminal Type") };
34 int m_choiceRegTypeNChoices = sizeof( m_choiceRegTypeChoices ) / sizeof( wxString );
35 m_choiceRegType = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceRegTypeNChoices, m_choiceRegTypeChoices, 0 );
36 m_choiceRegType->SetSelection( 0 );
37 bSizerType->Add( m_choiceRegType, 1, wxEXPAND|wxLEFT|wxRIGHT, 5 );
38
39
40 bSizeLeftpReg->Add( bSizerType, 0, wxEXPAND|wxALL, 5 );
41
42
43 bSizeLeftpReg->Add( 0, 10, 0, wxEXPAND, 5 );
44
45 m_bitmapRegul4pins = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
46 bSizeLeftpReg->Add( m_bitmapRegul4pins, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 10 );
47
48 m_bitmapRegul3pins = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
49 bSizeLeftpReg->Add( m_bitmapRegul3pins, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 10 );
50
51
52 bSizeLeftpReg->Add( 0, 0, 1, wxEXPAND, 5 );
53
54 wxStaticBoxSizer* sbSizerRegFormula;
55 sbSizerRegFormula = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Formula") ), wxVERTICAL );
56
57 m_RegulFormula = new wxStaticText( sbSizerRegFormula->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
58 m_RegulFormula->Wrap( -1 );
59 m_RegulFormula->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxEmptyString ) );
60
61 sbSizerRegFormula->Add( m_RegulFormula, 0, wxALIGN_CENTER_HORIZONTAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
62
63
64 bSizeLeftpReg->Add( sbSizerRegFormula, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
65
66
67 bSizerColBalancer->Add( bSizeLeftpReg, 0, wxTOP|wxRIGHT|wxEXPAND, 6 );
68
69
70 bSizerColBalancer->Add( 10, 0, 0, wxEXPAND, 5 );
71
72 wxBoxSizer* bSizerRegulRight;
73 bSizerRegulRight = new wxBoxSizer( wxVERTICAL );
74
75 wxFlexGridSizer* fgSizerRegParams;
76 fgSizerRegParams = new wxFlexGridSizer( 6, 4, 4, 0 );
77 fgSizerRegParams->AddGrowableCol( 2 );
78 fgSizerRegParams->SetFlexibleDirection( wxBOTH );
79 fgSizerRegParams->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
80
81 m_rbRegulR1 = new wxRadioButton( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
82 m_rbRegulR1->SetValue( true );
83 fgSizerRegParams->Add( m_rbRegulR1, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
84
85 m_labelRegultR1 = new wxStaticText( this, wxID_ANY, _("R1:"), wxDefaultPosition, wxDefaultSize, 0 );
86 m_labelRegultR1->Wrap( -1 );
87 fgSizerRegParams->Add( m_labelRegultR1, 0, wxALIGN_CENTER_VERTICAL, 5 );
88
89 m_RegulR1Value = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
90 fgSizerRegParams->Add( m_RegulR1Value, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
91
92 m_r1Units = new wxStaticText( this, wxID_ANY, _("kOhm"), wxDefaultPosition, wxDefaultSize, 0 );
93 m_r1Units->Wrap( -1 );
94 fgSizerRegParams->Add( m_r1Units, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
95
96 m_rbRegulR2 = new wxRadioButton( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
97 fgSizerRegParams->Add( m_rbRegulR2, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
98
99 m_labelRegultR2 = new wxStaticText( this, wxID_ANY, _("R2:"), wxDefaultPosition, wxDefaultSize, 0 );
100 m_labelRegultR2->Wrap( -1 );
101 fgSizerRegParams->Add( m_labelRegultR2, 0, wxALIGN_CENTER_VERTICAL, 5 );
102
103 m_RegulR2Value = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
104 fgSizerRegParams->Add( m_RegulR2Value, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
105
106 m_r2Units = new wxStaticText( this, wxID_ANY, _("kOhm"), wxDefaultPosition, wxDefaultSize, 0 );
107 m_r2Units->Wrap( -1 );
108 fgSizerRegParams->Add( m_r2Units, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
109
110 m_rbRegulVout = new wxRadioButton( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
111 fgSizerRegParams->Add( m_rbRegulVout, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
112
113 m_labelVout = new wxStaticText( this, wxID_ANY, _("Vout:"), wxDefaultPosition, wxDefaultSize, 0 );
114 m_labelVout->Wrap( -1 );
115 fgSizerRegParams->Add( m_labelVout, 0, wxALIGN_CENTER_VERTICAL, 5 );
116
117 m_RegulVoutValue = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
118 fgSizerRegParams->Add( m_RegulVoutValue, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
119
120 m_unitsVout = new wxStaticText( this, wxID_ANY, _("V"), wxDefaultPosition, wxDefaultSize, 0 );
121 m_unitsVout->Wrap( -1 );
122 fgSizerRegParams->Add( m_unitsVout, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
123
124
125 fgSizerRegParams->Add( 0, 0, 1, wxEXPAND, 5 );
126
127 m_labelVRef = new wxStaticText( this, wxID_ANY, _("Vref:"), wxDefaultPosition, wxDefaultSize, 0 );
128 m_labelVRef->Wrap( -1 );
129 m_labelVRef->SetToolTip( _("The internal reference voltage of the regulator.\nShould not be 0.") );
130
131 fgSizerRegParams->Add( m_labelVRef, 0, wxALIGN_CENTER_VERTICAL, 5 );
132
133 m_RegulVrefValue = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
134 fgSizerRegParams->Add( m_RegulVrefValue, 0, wxEXPAND|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 );
135
136 m_unitsVref = new wxStaticText( this, wxID_ANY, _("V"), wxDefaultPosition, wxDefaultSize, 0 );
137 m_unitsVref->Wrap( -1 );
138 fgSizerRegParams->Add( m_unitsVref, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
139
140
141 fgSizerRegParams->Add( 0, 0, 1, wxEXPAND, 5 );
142
143 m_RegulIadjTitle = new wxStaticText( this, wxID_ANY, _("Iadj:"), wxDefaultPosition, wxDefaultSize, 0 );
144 m_RegulIadjTitle->Wrap( -1 );
145 m_RegulIadjTitle->SetToolTip( _("For 3 terminal regulators only, the Adjust pin current.") );
146
147 fgSizerRegParams->Add( m_RegulIadjTitle, 0, wxALIGN_CENTER_VERTICAL, 5 );
148
149 m_RegulIadjValue = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
150 fgSizerRegParams->Add( m_RegulIadjValue, 0, wxEXPAND|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 );
151
152 m_IadjUnitLabel = new wxStaticText( this, wxID_ANY, _("uA"), wxDefaultPosition, wxDefaultSize, 0 );
153 m_IadjUnitLabel->Wrap( -1 );
154 fgSizerRegParams->Add( m_IadjUnitLabel, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
155
156
157 bSizerRegulRight->Add( fgSizerRegParams, 0, wxEXPAND|wxBOTTOM|wxRIGHT, 5 );
158
159 wxBoxSizer* bSizerRegulButtonCalcReset;
160 bSizerRegulButtonCalcReset = new wxBoxSizer( wxHORIZONTAL );
161
162
163 bSizerRegulButtonCalcReset->Add( 0, 0, 3, wxEXPAND, 5 );
164
165 m_buttonCalculate = new wxButton( this, wxID_ANY, _("Calculate"), wxDefaultPosition, wxDefaultSize, 0 );
166 bSizerRegulButtonCalcReset->Add( m_buttonCalculate, 6, wxTOP, 10 );
167
168
169 bSizerRegulButtonCalcReset->Add( 0, 0, 2, wxEXPAND, 5 );
170
171 m_buttonRegulReset = new wxButton( this, wxID_ANY, _("Reset to Defaults"), wxDefaultPosition, wxDefaultSize, 0 );
172 bSizerRegulButtonCalcReset->Add( m_buttonRegulReset, 6, wxTOP, 10 );
173
174
175 bSizerRegulButtonCalcReset->Add( 0, 0, 3, wxEXPAND, 5 );
176
177
178 bSizerRegulRight->Add( bSizerRegulButtonCalcReset, 0, wxEXPAND|wxLEFT, 30 );
179
180 m_RegulMessage = new wxStaticText( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
181 m_RegulMessage->Wrap( -1 );
182 bSizerRegulRight->Add( m_RegulMessage, 0, wxALL, 10 );
183
184 wxStaticBoxSizer* sbSizerRegulatorsChooser;
185 sbSizerRegulatorsChooser = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Regulator") ), wxVERTICAL );
186
187 wxArrayString m_choiceRegulatorSelectorChoices;
188 m_choiceRegulatorSelector = new wxChoice( sbSizerRegulatorsChooser->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceRegulatorSelectorChoices, 0 );
189 m_choiceRegulatorSelector->SetSelection( 0 );
190 sbSizerRegulatorsChooser->Add( m_choiceRegulatorSelector, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
191
192 m_staticTextRegFile = new wxStaticText( sbSizerRegulatorsChooser->GetStaticBox(), wxID_ANY, _("Regulators data file:"), wxDefaultPosition, wxDefaultSize, 0 );
193 m_staticTextRegFile->Wrap( -1 );
194 m_staticTextRegFile->SetToolTip( _("The name of the data file which stores known regulators parameters.") );
195
196 sbSizerRegulatorsChooser->Add( m_staticTextRegFile, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
197
198 wxBoxSizer* bSizerDataFile;
199 bSizerDataFile = new wxBoxSizer( wxHORIZONTAL );
200
201 m_regulators_fileNameCtrl = new wxTextCtrl( sbSizerRegulatorsChooser->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
202 bSizerDataFile->Add( m_regulators_fileNameCtrl, 1, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
203
204 m_buttonDataFile = new wxButton( sbSizerRegulatorsChooser->GetStaticBox(), wxID_ANY, _("Browse"), wxDefaultPosition, wxDefaultSize, 0 );
205 bSizerDataFile->Add( m_buttonDataFile, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
206
207
208 sbSizerRegulatorsChooser->Add( bSizerDataFile, 1, wxEXPAND, 5 );
209
210 wxBoxSizer* bSizerReulBtn;
211 bSizerReulBtn = new wxBoxSizer( wxHORIZONTAL );
212
213 m_buttonEditItem = new wxButton( sbSizerRegulatorsChooser->GetStaticBox(), wxID_ANY, _("Edit Regulator"), wxDefaultPosition, wxDefaultSize, 0 );
214 m_buttonEditItem->SetToolTip( _("Edit the current selected regulator.") );
215
216 bSizerReulBtn->Add( m_buttonEditItem, 1, wxALL, 5 );
217
218 m_buttonAddItem = new wxButton( sbSizerRegulatorsChooser->GetStaticBox(), wxID_ANY, _("Add Regulator"), wxDefaultPosition, wxDefaultSize, 0 );
219 m_buttonAddItem->SetToolTip( _("Enter a new item to the current list of available regulators") );
220
221 bSizerReulBtn->Add( m_buttonAddItem, 1, wxALL, 5 );
222
223 m_buttonRemoveItem = new wxButton( sbSizerRegulatorsChooser->GetStaticBox(), wxID_ANY, _("Remove Regulator"), wxDefaultPosition, wxDefaultSize, 0 );
224 m_buttonRemoveItem->SetToolTip( _("Remove an item from the current list of available regulators") );
225
226 bSizerReulBtn->Add( m_buttonRemoveItem, 1, wxALL, 5 );
227
228
229 sbSizerRegulatorsChooser->Add( bSizerReulBtn, 1, wxEXPAND, 5 );
230
231
232 bSizerRegulRight->Add( sbSizerRegulatorsChooser, 0, wxEXPAND|wxRIGHT, 10 );
233
234
235 bSizerColBalancer->Add( bSizerRegulRight, 1, wxEXPAND|wxTOP|wxLEFT, 10 );
236
237
238 bSizerMainReg->Add( bSizerColBalancer, 0, wxEXPAND, 5 );
239
240
241 this->SetSizer( bSizerMainReg );
242 this->Layout();
243
244 // Connect Events
245 m_choiceRegType->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( PANEL_REGULATOR_BASE::OnRegulTypeSelection ), NULL, this );
246 m_buttonCalculate->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_REGULATOR_BASE::OnRegulatorCalcButtonClick ), NULL, this );
247 m_buttonRegulReset->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_REGULATOR_BASE::OnRegulatorResetButtonClick ), NULL, this );
248 m_choiceRegulatorSelector->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( PANEL_REGULATOR_BASE::OnRegulatorSelection ), NULL, this );
249 m_buttonDataFile->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_REGULATOR_BASE::OnDataFileSelection ), NULL, this );
250 m_buttonEditItem->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_REGULATOR_BASE::OnEditRegulator ), NULL, this );
251 m_buttonAddItem->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_REGULATOR_BASE::OnAddRegulator ), NULL, this );
252 m_buttonRemoveItem->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_REGULATOR_BASE::OnRemoveRegulator ), NULL, this );
253}
254
256{
257 // Disconnect Events
258 m_choiceRegType->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( PANEL_REGULATOR_BASE::OnRegulTypeSelection ), NULL, this );
259 m_buttonCalculate->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_REGULATOR_BASE::OnRegulatorCalcButtonClick ), NULL, this );
260 m_buttonRegulReset->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_REGULATOR_BASE::OnRegulatorResetButtonClick ), NULL, this );
261 m_choiceRegulatorSelector->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( PANEL_REGULATOR_BASE::OnRegulatorSelection ), NULL, this );
262 m_buttonDataFile->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_REGULATOR_BASE::OnDataFileSelection ), NULL, this );
263 m_buttonEditItem->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_REGULATOR_BASE::OnEditRegulator ), NULL, this );
264 m_buttonAddItem->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_REGULATOR_BASE::OnAddRegulator ), NULL, this );
265 m_buttonRemoveItem->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_REGULATOR_BASE::OnRemoveRegulator ), NULL, this );
266
267}
const char * name
Definition: DXF_plotter.cpp:56
wxStaticText * m_RegulFormula
virtual void OnRegulatorSelection(wxCommandEvent &event)
virtual void OnRemoveRegulator(wxCommandEvent &event)
virtual void OnRegulTypeSelection(wxCommandEvent &event)
wxStaticText * m_RegulMessage
wxStaticText * m_IadjUnitLabel
wxStaticText * m_labelRegultR1
wxStaticText * m_staticTextRegType
wxStaticText * m_staticTextRegFile
wxStaticText * m_RegulIadjTitle
wxTextCtrl * m_regulators_fileNameCtrl
wxRadioButton * m_rbRegulVout
wxStaticBitmap * m_bitmapRegul4pins
wxChoice * m_choiceRegulatorSelector
wxStaticBitmap * m_bitmapRegul3pins
wxStaticText * m_labelRegultR2
virtual void OnEditRegulator(wxCommandEvent &event)
virtual void OnAddRegulator(wxCommandEvent &event)
virtual void OnRegulatorCalcButtonClick(wxCommandEvent &event)
virtual void OnRegulatorResetButtonClick(wxCommandEvent &event)
virtual void OnDataFileSelection(wxCommandEvent &event)
wxRadioButton * m_rbRegulR2
wxRadioButton * m_rbRegulR1
PANEL_REGULATOR_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(688, 436), long style=wxTAB_TRAVERSAL, const wxString &name=wxEmptyString)
#define _(s)