KiCad PCB EDA Suite
Loading...
Searching...
No Matches
sim_types.h File Reference
#include <cmath>
#include <limits>

Go to the source code of this file.

Enumerations

enum  SIM_TYPE {
  ST_UNKNOWN , ST_AC , ST_DC , ST_DISTO ,
  ST_NOISE , ST_OP , ST_PZ , ST_SENS ,
  ST_TF , ST_TRAN , ST_SP , ST_FFT ,
  ST_LAST
}
 < Possible simulation types More...
 
enum  SIM_TRACE_TYPE {
  SPT_VOLTAGE = 0x0001 , SPT_CURRENT = 0x0002 , SPT_AC_PHASE = 0x0004 , SPT_AC_GAIN = 0x0008 ,
  SPT_POWER = 0x0010 , SPT_SP_AMP = 0x0020 , SPT_SP_SMITH = 0x0040 , SPT_SP_MASK = SPT_SP_AMP | SPT_AC_PHASE | SPT_SP_SMITH ,
  SPT_Y_AXIS_MASK = 0x00FF , SPT_TIME = 0x0100 , SPT_LIN_FREQUENCY = 0x0200 , SPT_LOG_FREQUENCY = 0x0400 ,
  SPT_SWEEP = 0x0800 , SPT_X_AXIS_MASK = 0xFF00 , SPT_UNKNOWN = 0x0000
}
 

Functions

double MagnitudeToDb (double aMagnitude)
 Convert a linear magnitude to decibels.
 

Enumeration Type Documentation

◆ SIM_TRACE_TYPE

Enumerator
SPT_VOLTAGE 
SPT_CURRENT 
SPT_AC_PHASE 
SPT_AC_GAIN 
SPT_POWER 
SPT_SP_AMP 
SPT_SP_SMITH 
SPT_SP_MASK 
SPT_Y_AXIS_MASK 
SPT_TIME 
SPT_LIN_FREQUENCY 
SPT_LOG_FREQUENCY 
SPT_SWEEP 
SPT_X_AXIS_MASK 
SPT_UNKNOWN 

Definition at line 48 of file sim_types.h.

◆ SIM_TYPE

enum SIM_TYPE

< Possible simulation types

Enumerator
ST_UNKNOWN 
ST_AC 
ST_DC 
ST_DISTO 
ST_NOISE 
ST_OP 
ST_PZ 
ST_SENS 
ST_TF 
ST_TRAN 
ST_SP 
ST_FFT 
ST_LAST 

Definition at line 30 of file sim_types.h.

Function Documentation

◆ MagnitudeToDb()

double MagnitudeToDb ( double aMagnitude)
inline

Convert a linear magnitude to decibels.

A node carrying no signal is a routine AC result, not an error, and its zero magnitude has no logarithm. Reporting NaN lets consumers leave a gap rather than draw the node at some finite level it never had.

Parameters
aMagnitudeis a linear magnitude, normally non-negative.
Returns
the magnitude in dB, or NaN if it has none.

Definition at line 82 of file sim_types.h.

Referenced by SIM_PLOT_TAB::SetTraceData().