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.1-0-g8feb16b)
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, wxLEFT|wxRIGHT|wxALIGN_CENTER_VERTICAL, 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, 10, 0, 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 wxBoxSizer* bSizer9;
76 bSizer9 = new wxBoxSizer( wxVERTICAL );
77
78 wxStaticBoxSizer* sbSizerRegulatorsChooser;
79 sbSizerRegulatorsChooser = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Regulator") ), wxVERTICAL );
80
81 wxArrayString m_choiceRegulatorSelectorChoices;
82 m_choiceRegulatorSelector = new wxChoice( sbSizerRegulatorsChooser->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceRegulatorSelectorChoices, 0 );
83 m_choiceRegulatorSelector->SetSelection( 0 );
84 sbSizerRegulatorsChooser->Add( m_choiceRegulatorSelector, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
85
86 m_staticTextRegFile = new wxStaticText( sbSizerRegulatorsChooser->GetStaticBox(), wxID_ANY, _("Regulators data file:"), wxDefaultPosition, wxDefaultSize, 0 );
87 m_staticTextRegFile->Wrap( -1 );
88 m_staticTextRegFile->SetToolTip( _("The name of the data file which stores known regulators parameters.") );
89
90 sbSizerRegulatorsChooser->Add( m_staticTextRegFile, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
91
92 wxBoxSizer* bSizerDataFile;
93 bSizerDataFile = new wxBoxSizer( wxHORIZONTAL );
94
95 m_regulators_fileNameCtrl = new wxTextCtrl( sbSizerRegulatorsChooser->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
96 bSizerDataFile->Add( m_regulators_fileNameCtrl, 1, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
97
98 m_buttonDataFile = new wxButton( sbSizerRegulatorsChooser->GetStaticBox(), wxID_ANY, _("Browse"), wxDefaultPosition, wxDefaultSize, 0 );
99 bSizerDataFile->Add( m_buttonDataFile, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
100
101
102 sbSizerRegulatorsChooser->Add( bSizerDataFile, 1, wxEXPAND, 5 );
103
104 wxBoxSizer* bSizerReulBtn;
105 bSizerReulBtn = new wxBoxSizer( wxHORIZONTAL );
106
107 m_buttonEditItem = new wxButton( sbSizerRegulatorsChooser->GetStaticBox(), wxID_ANY, _("Edit Regulator"), wxDefaultPosition, wxDefaultSize, 0 );
108 m_buttonEditItem->SetToolTip( _("Edit the current selected regulator.") );
109
110 bSizerReulBtn->Add( m_buttonEditItem, 1, wxALL, 5 );
111
112 m_buttonAddItem = new wxButton( sbSizerRegulatorsChooser->GetStaticBox(), wxID_ANY, _("Add Regulator"), wxDefaultPosition, wxDefaultSize, 0 );
113 m_buttonAddItem->SetToolTip( _("Enter a new item to the current list of available regulators") );
114
115 bSizerReulBtn->Add( m_buttonAddItem, 1, wxALL, 5 );
116
117 m_buttonRemoveItem = new wxButton( sbSizerRegulatorsChooser->GetStaticBox(), wxID_ANY, _("Remove Regulator"), wxDefaultPosition, wxDefaultSize, 0 );
118 m_buttonRemoveItem->SetToolTip( _("Remove an item from the current list of available regulators") );
119
120 bSizerReulBtn->Add( m_buttonRemoveItem, 1, wxALL, 5 );
121
122
123 sbSizerRegulatorsChooser->Add( bSizerReulBtn, 1, wxEXPAND, 5 );
124
125
126 bSizer9->Add( sbSizerRegulatorsChooser, 0, wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT, 5 );
127
128
129 bSizer9->Add( 0, 10, 1, wxEXPAND, 5 );
130
131 wxFlexGridSizer* fgSizerRegParams;
132 fgSizerRegParams = new wxFlexGridSizer( 6, 4, 4, 0 );
133 fgSizerRegParams->AddGrowableCol( 2 );
134 fgSizerRegParams->SetFlexibleDirection( wxBOTH );
135 fgSizerRegParams->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
136
137 m_rbRegulR1 = new wxRadioButton( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
138 m_rbRegulR1->SetValue( true );
139 fgSizerRegParams->Add( m_rbRegulR1, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
140
141 m_labelRegultR1 = new wxStaticText( this, wxID_ANY, _("R1:"), wxDefaultPosition, wxDefaultSize, 0 );
142 m_labelRegultR1->Wrap( -1 );
143 fgSizerRegParams->Add( m_labelRegultR1, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
144
145 m_RegulR1Value = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
146 fgSizerRegParams->Add( m_RegulR1Value, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
147
148 m_r1Units = new wxStaticText( this, wxID_ANY, _("kOhm"), wxDefaultPosition, wxDefaultSize, 0 );
149 m_r1Units->Wrap( -1 );
150 fgSizerRegParams->Add( m_r1Units, 0, wxALIGN_CENTER_VERTICAL, 5 );
151
152 m_rbRegulR2 = new wxRadioButton( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
153 fgSizerRegParams->Add( m_rbRegulR2, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
154
155 m_labelRegultR2 = new wxStaticText( this, wxID_ANY, _("R2:"), wxDefaultPosition, wxDefaultSize, 0 );
156 m_labelRegultR2->Wrap( -1 );
157 fgSizerRegParams->Add( m_labelRegultR2, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
158
159 m_RegulR2Value = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
160 fgSizerRegParams->Add( m_RegulR2Value, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
161
162 m_r2Units = new wxStaticText( this, wxID_ANY, _("kOhm"), wxDefaultPosition, wxDefaultSize, 0 );
163 m_r2Units->Wrap( -1 );
164 fgSizerRegParams->Add( m_r2Units, 0, wxALIGN_CENTER_VERTICAL, 5 );
165
166 m_rbRegulVout = new wxRadioButton( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
167 fgSizerRegParams->Add( m_rbRegulVout, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
168
169 m_labelVout = new wxStaticText( this, wxID_ANY, _("Vout:"), wxDefaultPosition, wxDefaultSize, 0 );
170 m_labelVout->Wrap( -1 );
171 fgSizerRegParams->Add( m_labelVout, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
172
173 m_RegulVoutValue = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
174 fgSizerRegParams->Add( m_RegulVoutValue, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
175
176 m_unitsVout = new wxStaticText( this, wxID_ANY, _("V"), wxDefaultPosition, wxDefaultSize, 0 );
177 m_unitsVout->Wrap( -1 );
178 fgSizerRegParams->Add( m_unitsVout, 0, wxALIGN_CENTER_VERTICAL, 5 );
179
180
181 fgSizerRegParams->Add( 0, 0, 1, wxEXPAND, 5 );
182
183 m_labelVRef = new wxStaticText( this, wxID_ANY, _("Vref:"), wxDefaultPosition, wxDefaultSize, 0 );
184 m_labelVRef->Wrap( -1 );
185 m_labelVRef->SetToolTip( _("The internal reference voltage of the regulator.\nShould not be 0.") );
186
187 fgSizerRegParams->Add( m_labelVRef, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
188
189 m_RegulVrefValue = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
190 fgSizerRegParams->Add( m_RegulVrefValue, 0, wxEXPAND|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 );
191
192 m_unitsVref = new wxStaticText( this, wxID_ANY, _("V"), wxDefaultPosition, wxDefaultSize, 0 );
193 m_unitsVref->Wrap( -1 );
194 fgSizerRegParams->Add( m_unitsVref, 0, wxALIGN_CENTER_VERTICAL, 5 );
195
196
197 fgSizerRegParams->Add( 0, 0, 1, wxEXPAND, 5 );
198
199 m_RegulIadjTitle = new wxStaticText( this, wxID_ANY, _("Iadj:"), wxDefaultPosition, wxDefaultSize, 0 );
200 m_RegulIadjTitle->Wrap( -1 );
201 m_RegulIadjTitle->SetToolTip( _("For 3 terminal regulators only, the Adjust pin current.") );
202
203 fgSizerRegParams->Add( m_RegulIadjTitle, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
204
205 m_RegulIadjValue = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
206 fgSizerRegParams->Add( m_RegulIadjValue, 0, wxEXPAND|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 );
207
208 m_IadjUnitLabel = new wxStaticText( this, wxID_ANY, _("uA"), wxDefaultPosition, wxDefaultSize, 0 );
209 m_IadjUnitLabel->Wrap( -1 );
210 fgSizerRegParams->Add( m_IadjUnitLabel, 0, wxALIGN_CENTER_VERTICAL, 5 );
211
212
213 bSizer9->Add( fgSizerRegParams, 0, wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT, 10 );
214
215
216 bSizerRegulRight->Add( bSizer9, 0, 0, 5 );
217
218 wxBoxSizer* bSizerRegulButtonCalcReset;
219 bSizerRegulButtonCalcReset = new wxBoxSizer( wxHORIZONTAL );
220
221 m_buttonCalculate = new wxButton( this, wxID_ANY, _("Calculate"), wxDefaultPosition, wxDefaultSize, 0 );
222 m_buttonCalculate->SetMinSize( wxSize( 120,-1 ) );
223
224 bSizerRegulButtonCalcReset->Add( m_buttonCalculate, 0, wxTOP, 5 );
225
226
227 bSizerRegulRight->Add( bSizerRegulButtonCalcReset, 0, wxEXPAND|wxLEFT, 5 );
228
229 m_RegulMessage = new wxStaticText( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
230 m_RegulMessage->Wrap( -1 );
231 bSizerRegulRight->Add( m_RegulMessage, 0, wxALL, 10 );
232
233
234 bSizerRegulRight->Add( 0, 0, 1, wxEXPAND, 5 );
235
236 m_buttonRegulReset = new wxButton( this, wxID_ANY, _("Reset to Defaults"), wxDefaultPosition, wxDefaultSize, 0 );
237 bSizerRegulRight->Add( m_buttonRegulReset, 0, wxALIGN_RIGHT|wxTOP|wxBOTTOM|wxRIGHT, 10 );
238
239
240 bSizerColBalancer->Add( bSizerRegulRight, 1, wxEXPAND|wxLEFT, 10 );
241
242
243 bSizerMainReg->Add( bSizerColBalancer, 1, wxEXPAND, 5 );
244
245
246 this->SetSizer( bSizerMainReg );
247 this->Layout();
248 bSizerMainReg->Fit( this );
249
250 // Connect Events
251 m_choiceRegType->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( PANEL_REGULATOR_BASE::OnRegulTypeSelection ), NULL, this );
252 m_choiceRegulatorSelector->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( PANEL_REGULATOR_BASE::OnRegulatorSelection ), NULL, this );
253 m_buttonDataFile->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_REGULATOR_BASE::OnDataFileSelection ), NULL, this );
254 m_buttonEditItem->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_REGULATOR_BASE::OnEditRegulator ), NULL, this );
255 m_buttonAddItem->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_REGULATOR_BASE::OnAddRegulator ), NULL, this );
256 m_buttonRemoveItem->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_REGULATOR_BASE::OnRemoveRegulator ), NULL, this );
257 m_buttonCalculate->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_REGULATOR_BASE::OnRegulatorCalcButtonClick ), NULL, this );
258 m_buttonRegulReset->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_REGULATOR_BASE::OnRegulatorResetButtonClick ), NULL, this );
259}
260
262{
263 // Disconnect Events
264 m_choiceRegType->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( PANEL_REGULATOR_BASE::OnRegulTypeSelection ), NULL, this );
265 m_choiceRegulatorSelector->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( PANEL_REGULATOR_BASE::OnRegulatorSelection ), NULL, this );
266 m_buttonDataFile->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_REGULATOR_BASE::OnDataFileSelection ), NULL, this );
267 m_buttonEditItem->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_REGULATOR_BASE::OnEditRegulator ), NULL, this );
268 m_buttonAddItem->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_REGULATOR_BASE::OnAddRegulator ), NULL, this );
269 m_buttonRemoveItem->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_REGULATOR_BASE::OnRemoveRegulator ), NULL, this );
270 m_buttonCalculate->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_REGULATOR_BASE::OnRegulatorCalcButtonClick ), NULL, this );
271 m_buttonRegulReset->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_REGULATOR_BASE::OnRegulatorResetButtonClick ), NULL, this );
272
273}
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(-1,-1), long style=wxTAB_TRAVERSAL, const wxString &name=wxEmptyString)
#define _(s)