KiCad PCB EDA Suite
sim_plot_panel.cpp
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 KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * @author Tomasz Wlostowski <[email protected]>
8 * @author Maciej Suminski <[email protected]>
9 *
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version 3
13 * of the License, or (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, you may find one here:
22 * https://www.gnu.org/licenses/gpl-3.0.html
23 * or you may search the http://www.gnu.org website for the version 3 license,
24 * or you may write to the Free Software Foundation, Inc.,
25 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
26 */
27
28#include "sim_plot_colors.h"
29#include "sim_plot_panel.h"
30#include "sim_plot_frame.h"
31
32#include <algorithm>
33#include <limits>
34
35
36static wxString formatFloat( double x, int nDigits )
37{
38 wxString rv, fmt;
39
40 if( nDigits )
41 fmt.Printf( "%%.0%df", nDigits );
42 else
43 fmt = wxT( "%.0f" );
44
45 rv.Printf( fmt, x );
46
47 return rv;
48}
49
50
51static void getSISuffix( double x, const wxString& unit, int& power, wxString& suffix )
52{
53 const int n_powers = 11;
54
55 const struct
56 {
57 int exponent;
58 char suffix;
59 } powers[] =
60 {
61 { -18, 'a' },
62 { -15, 'f' },
63 { -12, 'p' },
64 { -9, 'n' },
65 { -6, 'u' },
66 { -3, 'm' },
67 { 0, 0 },
68 { 3, 'k' },
69 { 6, 'M' },
70 { 9, 'G' },
71 { 12, 'T' },
72 { 14, 'P' }
73 };
74
75 power = 0;
76 suffix = unit;
77
78 if( x == 0.0 )
79 return;
80
81 for( int i = 0; i < n_powers - 1; i++ )
82 {
83 double r_cur = pow( 10, powers[i].exponent );
84
85 if( fabs( x ) >= r_cur && fabs( x ) < r_cur * 1000.0 )
86 {
87 power = powers[i].exponent;
88
89 if( powers[i].suffix )
90 suffix = wxString( powers[i].suffix ) + unit;
91 else
92 suffix = unit;
93
94 return;
95 }
96 }
97}
98
99
100static int countDecimalDigits( double x, int maxDigits )
101{
102 if( std::isnan( x ) )
103 {
104 // avoid trying to count the decimals of NaN
105 return 0;
106 }
107
108 int64_t k = (int)( ( x - floor( x ) ) * pow( 10.0, (double) maxDigits ) );
109 int n = 0;
110
111 while( k && ( ( k % 10LL ) == 0LL || ( k % 10LL ) == 9LL ) )
112 {
113 k /= 10LL;
114 }
115
116 n = 0;
117
118 while( k != 0LL )
119 {
120 n++;
121 k /= 10LL;
122 }
123
124 return n;
125}
126
127
128template <typename parent>
129class LIN_SCALE : public parent
130{
131public:
132 LIN_SCALE( const wxString& name, const wxString& unit, int flags ) :
133 parent( name, flags ),
134 m_unit( unit )
135 {};
136
137 void formatLabels() override
138 {
139 double maxVis = parent::AbsVisibleMaxValue();
140
141 wxString suffix;
142 int power = 0;
143 int digits = 0;
144 int constexpr DIGITS = 3;
145
146 getSISuffix( maxVis, m_unit, power, suffix );
147
148 double sf = pow( 10.0, power );
149
150 for( mpScaleBase::TickLabel& l : parent::TickLabels() )
151 {
152 int k = countDecimalDigits( l.pos / sf, DIGITS );
153
154 digits = std::max( digits, k );
155 }
156
157 for( mpScaleBase::TickLabel& l : parent::TickLabels() )
158 {
159 l.label = formatFloat( l.pos / sf, digits ) + suffix;
160 l.visible = true;
161 }
162 }
163
164private:
165 const wxString m_unit;
166};
167
168
169template <typename parent>
170class LOG_SCALE : public parent
171{
172public:
173 LOG_SCALE( const wxString& name, const wxString& unit, int flags ) :
174 parent( name, flags ),
175 m_unit( unit )
176 {};
177
178 void formatLabels() override
179 {
180 wxString suffix;
181 int power;
182
183 for( mpScaleBase::TickLabel& l : parent::TickLabels() )
184 {
185 getSISuffix( l.pos, m_unit, power, suffix );
186 double sf = pow( 10.0, power );
187 int k = countDecimalDigits( l.pos / sf, 3 );
188
189 l.label = formatFloat( l.pos / sf, k ) + suffix;
190 l.visible = true;
191 }
192 }
193
194private:
195 const wxString m_unit;
196};
197
198
199void CURSOR::Plot( wxDC& aDC, mpWindow& aWindow )
200{
201 if( !m_window )
202 m_window = &aWindow;
203
204 if( !m_visible )
205 return;
206
207 const auto& dataX = m_trace->GetDataX();
208 const auto& dataY = m_trace->GetDataY();
209
210 if( dataX.size() <= 1 )
211 return;
212
213 if( m_updateRequired )
214 {
215 m_coords.x = m_trace->s2x( aWindow.p2x( m_dim.x ) );
216
217 // Find the closest point coordinates
218 auto maxXIt = std::upper_bound( dataX.begin(), dataX.end(), m_coords.x );
219 int maxIdx = maxXIt - dataX.begin();
220 int minIdx = maxIdx - 1;
221
222 // Out of bounds checks
223 if( minIdx < 0 )
224 {
225 minIdx = 0;
226 maxIdx = 1;
227 m_coords.x = dataX[0];
228 }
229 else if( maxIdx >= (int) dataX.size() )
230 {
231 maxIdx = dataX.size() - 1;
232 minIdx = maxIdx - 1;
233 m_coords.x = dataX[maxIdx];
234 }
235
236 const double leftX = dataX[minIdx];
237 const double rightX = dataX[maxIdx];
238 const double leftY = dataY[minIdx];
239 const double rightY = dataY[maxIdx];
240
241 // Linear interpolation
242 m_coords.y = leftY + ( rightY - leftY ) / ( rightX - leftX ) * ( m_coords.x - leftX );
243 m_updateRequired = false;
244
245 // Notify the parent window about the changes
246 wxQueueEvent( aWindow.GetParent(), new wxCommandEvent( EVT_SIM_CURSOR_UPDATE ) );
247 }
248 else
249 {
250 m_updateRef = true;
251 }
252
253 if( m_updateRef )
254 {
256 m_updateRef = false;
257 }
258
259 // Line length in horizontal and vertical dimensions
260 const wxPoint cursorPos( aWindow.x2p( m_trace->x2s( m_coords.x ) ),
261 aWindow.y2p( m_trace->y2s( m_coords.y ) ) );
262
263 wxCoord leftPx = m_drawOutsideMargins ? 0 : aWindow.GetMarginLeft();
264 wxCoord rightPx = m_drawOutsideMargins ? aWindow.GetScrX() :
265 aWindow.GetScrX() - aWindow.GetMarginRight();
266 wxCoord topPx = m_drawOutsideMargins ? 0 : aWindow.GetMarginTop();
267 wxCoord bottomPx = m_drawOutsideMargins ? aWindow.GetScrY() :
268 aWindow.GetScrY() - aWindow.GetMarginBottom();
269
270 wxPen pen = GetPen();
271 pen.SetStyle( m_continuous ? wxPENSTYLE_SOLID : wxPENSTYLE_LONG_DASH );
272 aDC.SetPen( pen );
273
274 if( topPx < cursorPos.y && cursorPos.y < bottomPx )
275 aDC.DrawLine( leftPx, cursorPos.y, rightPx, cursorPos.y );
276
277 if( leftPx < cursorPos.x && cursorPos.x < rightPx )
278 aDC.DrawLine( cursorPos.x, topPx, cursorPos.x, bottomPx );
279}
280
281
282bool CURSOR::Inside( wxPoint& aPoint )
283{
284 if( !m_window )
285 return false;
286
287 return ( std::abs( (double) aPoint.x -
288 m_window->x2p( m_trace->x2s( m_coords.x ) ) ) <= DRAG_MARGIN )
289 || ( std::abs( (double) aPoint.y -
290 m_window->y2p( m_trace->y2s( m_coords.y ) ) ) <= DRAG_MARGIN );
291}
292
293
295{
296 if( !m_window )
297 return;
298
301}
302
303
304SIM_PLOT_PANEL::SIM_PLOT_PANEL( const wxString& aCommand, int aOptions, wxWindow* parent,
305 SIM_PLOT_FRAME* aMainFrame, wxWindowID id, const wxPoint& pos,
306 const wxSize& size, long style, const wxString& name )
307 : SIM_PANEL_BASE( aCommand, aOptions, parent, id, pos, size, style, name ),
308 m_axis_x( nullptr ),
309 m_axis_y1( nullptr ),
310 m_axis_y2( nullptr ),
311 m_dotted_cp( false ),
312 m_masterFrame( aMainFrame )
313{
314 m_sizer = new wxBoxSizer( wxVERTICAL );
315 m_plotWin = new mpWindow( this, wxID_ANY, pos, size, style );
316
317 m_plotWin->LimitView( true );
318 m_plotWin->SetMargins( 50, 80, 50, 80 );
319
321
322 updateAxes();
323
324 // a mpInfoLegend displays le name of traces on the left top panel corner:
325 m_legend = new mpInfoLegend( wxRect( 0, 40, 200, 40 ), wxTRANSPARENT_BRUSH );
326 m_legend->SetVisible( false );
328
331
332 m_sizer->Add( m_plotWin, 1, wxALL | wxEXPAND, 1 );
333 SetSizer( m_sizer );
334}
335
336
338{
339 // ~mpWindow destroys all the added layers, so there is no need to destroy m_traces contents
340}
341
342
344{
345 if( m_axis_x )
346 return;
347
348 switch( GetType() )
349 {
350 case ST_AC:
351 m_axis_x = new LOG_SCALE<mpScaleXLog>( _( "Frequency" ), wxT( "Hz" ), mpALIGN_BOTTOM );
352 m_axis_y1 = new LIN_SCALE<mpScaleY>( _( "Gain" ), wxT( "dBV" ), mpALIGN_LEFT );
353 m_axis_y2 = new LIN_SCALE<mpScaleY>( _( "Phase" ), wxT( "°" ), mpALIGN_RIGHT );
355 break;
356
357 case ST_DC:
359 break;
360
361 case ST_NOISE:
362 m_axis_x = new LOG_SCALE<mpScaleXLog>( _( "Frequency" ), wxT( "Hz" ), mpALIGN_BOTTOM );
363 m_axis_y1 = new mpScaleY( _( "noise [(V or A)^2/Hz]" ), mpALIGN_LEFT );
364 break;
365
366 case ST_TRANSIENT:
367 m_axis_x = new LIN_SCALE<mpScaleX>( _( "Time" ), wxT( "s" ), mpALIGN_BOTTOM );
368 m_axis_y1 = new LIN_SCALE<mpScaleY>( _( "Voltage" ), wxT( "V" ), mpALIGN_LEFT );
369 m_axis_y2 = new LIN_SCALE<mpScaleY>( _( "Current" ), wxT( "A" ), mpALIGN_RIGHT );
371 break;
372
373 default:
374 // suppress warnings
375 break;
376 }
377
378 if( m_axis_x )
379 {
380 m_axis_x->SetTicks( false );
382
384 }
385
386 if( m_axis_y1 )
387 {
388 m_axis_y1->SetTicks( false );
391 }
392
393 if( m_axis_y2 )
394 {
395 m_axis_y2->SetTicks( false );
398 }
399}
400
402{
403 wxString sim_cmd = getSimCommand().Lower();
404 wxString rem;
405
406 if( sim_cmd.StartsWith( ".dc", &rem ) )
407 {
408 wxChar ch;
409
410 rem.Trim( false );
411
412 try
413 {
414 ch = rem.GetChar( 0 );
415 }
416 catch( ... )
417 {;}
418
419 switch( ch )
420 {
421 // Make sure that we have a reliable default (even if incorrectly labeled)
422 default:
423 case 'v':
424 m_axis_x = new LIN_SCALE<mpScaleX>( _( "Voltage (swept)" ), wxT( "V" ),
426 break;
427 case 'i':
428 m_axis_x = new LIN_SCALE<mpScaleX>( _( "Current (swept)" ), wxT( "A" ),
430 break;
431 case 'r':
432 m_axis_x = new LIN_SCALE<mpScaleX>( _( "Resistance (swept)" ), wxT( "Ω" ),
434 break;
435 case 't':
436 m_axis_x = new LIN_SCALE<mpScaleX>( _( "Temperature (swept)" ), wxT( "°C" ),
438 break;
439 }
440
441 m_axis_y1 = new LIN_SCALE<mpScaleY>( _( "Voltage (measured)" ), wxT( "V" ), mpALIGN_LEFT );
442 m_axis_y2 = new LIN_SCALE<mpScaleY>( _( "Current" ), wxT( "A" ), mpALIGN_RIGHT );
443 }
444}
445
446
448{
449 // Update bg and fg colors:
453
454 // Update color of all traces
455 for( auto& [ name, trace ] : m_traces )
456 {
457 if( CURSOR* cursor = trace->GetCursor() )
459 }
460
462}
463
464
466{
467 int type = trace->GetType();
468 wxPenStyle penStyle = ( ( ( type & SPT_AC_PHASE ) || ( type & SPT_CURRENT ) ) && m_dotted_cp )
469 ? wxPENSTYLE_DOT
470 : wxPENSTYLE_SOLID;
471 trace->SetPen( wxPen( trace->GetTraceColour(), 2, penStyle ) );
472}
473
474
475bool SIM_PLOT_PANEL::addTrace( const wxString& aTitle, const wxString& aName, int aPoints,
476 const double* aX, const double* aY, SIM_PLOT_TYPE aType )
477{
478 TRACE* trace = nullptr;
479
480 updateAxes();
481
482 // Find previous entry, if there is one
483 auto prev = m_traces.find( aTitle );
484 bool addedNewEntry = ( prev == m_traces.end() );
485
486 if( addedNewEntry )
487 {
488 if( GetType() == ST_TRANSIENT )
489 {
490 bool hasVoltageTraces = false;
491
492 for( const auto& tr : m_traces )
493 {
494 if( !( tr.second->GetType() & SPT_CURRENT ) )
495 {
496 hasVoltageTraces = true;
497 break;
498 }
499 }
500
501 if( !hasVoltageTraces )
502 m_axis_y2->SetMasterScale( nullptr );
503 else
505 }
506
507 // New entry
508 trace = new TRACE( aName, aType );
510 UpdateTraceStyle( trace );
511 m_traces[ aTitle ] = trace;
512
513 // It is a trick to keep legend & coords always on the top
514 for( mpLayer* l : m_topLevel )
515 m_plotWin->DelLayer( l );
516
517 m_plotWin->AddLayer( (mpLayer*) trace );
518
519 for( mpLayer* l : m_topLevel )
520 m_plotWin->AddLayer( l );
521 }
522 else
523 {
524 trace = prev->second;
525 }
526
527 std::vector<double> tmp( aY, aY + aPoints );
528
529 if( GetType() == ST_AC )
530 {
531 if( aType & SPT_AC_PHASE )
532 {
533 for( int i = 0; i < aPoints; i++ )
534 tmp[i] = tmp[i] * 180.0 / M_PI; // convert to degrees
535 }
536 else
537 {
538 for( int i = 0; i < aPoints; i++ )
539 {
540 // log( 0 ) is not valid.
541 if( tmp[i] != 0 )
542 tmp[i] = 20 * log( tmp[i] ) / log( 10.0 ); // convert to dB
543 }
544 }
545 }
546
547 trace->SetData( std::vector<double>( aX, aX + aPoints ), tmp );
548
549 if( ( aType & SPT_AC_PHASE ) || ( aType & SPT_CURRENT ) )
550 trace->SetScale( m_axis_x, m_axis_y2 );
551 else
552 trace->SetScale( m_axis_x, m_axis_y1 );
553
555
556 return addedNewEntry;
557}
558
559
560bool SIM_PLOT_PANEL::deleteTrace( const wxString& aName )
561{
562 auto it = m_traces.find( aName );
563
564 if( it != m_traces.end() )
565 {
566 TRACE* trace = it->second;
567 m_traces.erase( it );
568
569 if( CURSOR* cursor = trace->GetCursor() )
570 m_plotWin->DelLayer( cursor, true );
571
572 m_plotWin->DelLayer( trace, true, true );
573 ResetScales();
574
575 return true;
576 }
577
578 return false;
579}
580
581
582void SIM_PLOT_PANEL::EnableCursor( const wxString& aName, bool aEnable )
583{
584 TRACE* t = GetTrace( aName );
585
586 if( t == nullptr || t->HasCursor() == aEnable )
587 return;
588
589 if( aEnable )
590 {
591 CURSOR* c = new CURSOR( t, this );
592 int plotCenter = GetPlotWin()->GetMarginLeft()
595 / 2;
596 c->SetX( plotCenter );
598 t->SetCursor( c );
599 m_plotWin->AddLayer( c );
600 }
601 else
602 {
603 CURSOR* c = t->GetCursor();
604 t->SetCursor( nullptr );
605 m_plotWin->DelLayer( c, true );
606 }
607
608 // Notify the parent window about the changes
609 wxQueueEvent( GetParent(), new wxCommandEvent( EVT_SIM_CURSOR_UPDATE ) );
610}
611
612
614{
615 if( m_axis_x )
617
618 if( m_axis_y1 )
620
621 if( m_axis_y2 )
623
624 for( auto& [ name, trace ] : m_traces )
625 trace->UpdateScales();
626}
627
628
629wxDEFINE_EVENT( EVT_SIM_CURSOR_UPDATE, wxCommandEvent );
const char * name
Definition: DXF_plotter.cpp:56
Cursor attached to a trace to follow its values:
mpWindow * m_window
void SetX(int aX)
wxRealPoint m_coords
bool m_updateRef
static constexpr int DRAG_MARGIN
void UpdateReference() override
Updates the rectangle reference point.
bool m_updateRequired
bool Inside(wxPoint &aPoint) override
Checks whether a point is inside the info box rectangle.
void Plot(wxDC &aDC, mpWindow &aWindow) override
Plot method.
const TRACE * m_trace
LIN_SCALE(const wxString &name, const wxString &unit, int flags)
const wxString m_unit
void formatLabels() override
LOG_SCALE(const wxString &name, const wxString &unit, int flags)
void formatLabels() override
const wxString m_unit
const wxString & getSimCommand() const
SIM_TYPE GetType() const
wxColour GenerateColor(std::map< wxString, TRACE * > aTraces)
wxColour GetPlotColor(enum COLOR_SET aColorId)
Implementing SIM_PLOT_FRAME_BASE.
mpScaleY * m_axis_y1
bool addTrace(const wxString &aTitle, const wxString &aName, int aPoints, const double *aX, const double *aY, SIM_PLOT_TYPE aType)
void UpdatePlotColors()
‍Update plot colors
SIM_PLOT_PANEL(const wxString &aCommand, int aOptions, wxWindow *parent, SIM_PLOT_FRAME *aMainFrame, wxWindowID id, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=0, const wxString &name=wxPanelNameStr)
wxBoxSizer * m_sizer
SIM_PLOT_COLORS m_colors
TRACE * GetTrace(const wxString &aName) const
void EnableCursor(const wxString &aName, bool aEnable)
Reset scale ranges to fit the current traces.
mpInfoLegend * m_legend
void updateAxes()
‍Create/Ensure axes are available for plotting
void UpdateTraceStyle(TRACE *trace)
void ResetScales()
Update trace line style.
virtual ~SIM_PLOT_PANEL()
set the pointer to the sim plot frame
std::map< wxString, TRACE * > m_traces
mpScaleXBase * m_axis_x
bool deleteTrace(const wxString &aName)
mpWindow * m_plotWin
mpWindow * GetPlotWin() const
mpScaleY * m_axis_y2
std::vector< mpLayer * > m_topLevel
void SetCursor(CURSOR *aCursor)
wxColour GetTraceColour()
void SetTraceColour(wxColour aColour)
bool HasCursor() const
void SetData(const std::vector< double > &aX, const std::vector< double > &aY) override
Assigns new data set for the trace.
SIM_PLOT_TYPE GetType() const
const std::vector< double > & GetDataY() const
const std::vector< double > & GetDataX() const
CURSOR * GetCursor() const
virtual void SetScale(mpScaleBase *scaleX, mpScaleBase *scaleY)
Definition: mathplot.cpp:3557
double y2s(double y) const
Definition: mathplot.cpp:3594
double x2s(double x) const
Definition: mathplot.cpp:3588
double s2x(double plotCoordX) const
Definition: mathplot.cpp:3576
wxPoint m_reference
Definition: mathplot.h:396
wxRect m_dim
Definition: mathplot.h:395
Implements the legend to be added to the plot This layer allows you to add a legend to describe the p...
Definition: mathplot.h:438
bool m_drawOutsideMargins
Definition: mathplot.h:320
bool m_continuous
Definition: mathplot.h:318
void SetPen(wxPen pen)
Set layer pen.
Definition: mathplot.h:277
bool m_visible
Definition: mathplot.h:322
const wxPen & GetPen() const
Get pen set for this layer.
Definition: mathplot.h:248
void SetVisible(bool show)
Sets layer visibility.
Definition: mathplot.h:302
void SetNameAlign(int align)
Definition: mathplot.h:709
void SetTicks(bool enable)
Set X axis ticks or grid.
Definition: mathplot.h:714
void ResetDataRange()
Definition: mathplot.h:759
void SetTicks(bool ticks)
Set Y axis ticks or grid.
Definition: mathplot.h:969
void SetMasterScale(mpScaleY *masterScale)
Definition: mathplot.h:979
Canvas for plotting mpLayer implementations.
Definition: mathplot.h:1047
void SetColourTheme(const wxColour &bgColour, const wxColour &drawColour, const wxColour &axesColour)
Set Color theme.
Definition: mathplot.cpp:2782
int GetMarginLeft() const
Definition: mathplot.h:1377
int GetScrX(void) const
Get current view's X dimension in device context units.
Definition: mathplot.h:1138
void SetMargins(int top, int right, int bottom, int left)
Set window margins, creating a blank area where some kinds of layers cannot draw.
Definition: mathplot.cpp:2716
double p2x(wxCoord pixelCoordX)
Converts mpWindow (screen) pixel coordinates into graph (floating point) coordinates,...
Definition: mathplot.h:1192
int GetXScreen(void) const
Definition: mathplot.h:1139
void LimitView(bool aEnable)
Limit zooming & panning to the area used by the plots.
Definition: mathplot.h:1429
wxCoord x2p(double x)
Converts graph (floating point) coordinates into mpWindow (screen) pixel coordinates,...
Definition: mathplot.h:1202
int GetMarginTop() const
Definition: mathplot.h:1371
bool DelLayer(mpLayer *layer, bool alsoDeleteObject=false, bool refreshDisplay=true)
Remove a plot layer from the canvas.
Definition: mathplot.cpp:2295
void UpdateAll()
Refresh display.
Definition: mathplot.cpp:2437
wxCoord y2p(double y)
Converts graph (floating point) coordinates into mpWindow (screen) pixel coordinates,...
Definition: mathplot.h:1207
int GetMarginRight() const
Definition: mathplot.h:1373
int GetMarginBottom() const
Definition: mathplot.h:1375
void EnableDoubleBuffer(bool enabled)
Enable/disable the double-buffering of the window, eliminating the flicker (default=disabled).
Definition: mathplot.h:1212
int GetScrY(void) const
Get current view's Y dimension in device context units.
Definition: mathplot.h:1147
bool AddLayer(mpLayer *layer, bool refreshDisplay=true)
Add a plot layer to the canvas.
Definition: mathplot.cpp:2278
#define _(s)
class WXDLLIMPEXP_MATHPLOT mpWindow
Definition: mathplot.h:108
#define mpALIGN_RIGHT
Aligns label to the right.
Definition: mathplot.h:477
#define mpALIGN_LEFT
Aligns label to the left.
Definition: mathplot.h:481
class WXDLLIMPEXP_MATHPLOT mpScaleY
Definition: mathplot.h:107
#define mpALIGN_BOTTOM
Aligns label to the bottom.
Definition: mathplot.h:485
EDA_ANGLE abs(const EDA_ANGLE &aAngle)
Definition: eda_angle.h:412
Class is responsible for providing colors for traces on simulation plot.
wxDEFINE_EVENT(EVT_SIM_CURSOR_UPDATE, wxCommandEvent)
static void getSISuffix(double x, const wxString &unit, int &power, wxString &suffix)
static int countDecimalDigits(double x, int maxDigits)
static wxString formatFloat(double x, int nDigits)
SIM_PLOT_TYPE
Definition: sim_types.h:47
@ SPT_AC_PHASE
Definition: sim_types.h:51
@ SPT_CURRENT
Definition: sim_types.h:50
@ ST_TRANSIENT
Definition: sim_types.h:42
@ ST_NOISE
Definition: sim_types.h:37
@ ST_AC
Definition: sim_types.h:34
@ ST_DC
Definition: sim_types.h:35