KiCad PCB EDA Suite
net_settings.cpp File Reference
#include <nlohmann/json.hpp>
#include <project/net_settings.h>
#include <settings/parameters.h>
#include <settings/json_settings_internals.h>
#include <settings/settings_manager.h>
#include <string_utils.h>
#include <convert_to_biu.h>

Go to the source code of this file.

Functions

static OPT< int > getInPcbUnits (const nlohmann::json &aObj, const std::string &aKey, OPT< int > aDefault=OPT< int >())
 
static int getInSchUnits (const nlohmann::json &aObj, const std::string &aKey, int aDefault)
 
static bool isSuperSubOverbar (wxChar c)
 

Variables

const int netSettingsSchemaVersion = 2
 

Function Documentation

◆ getInPcbUnits()

static OPT<int> getInPcbUnits ( const nlohmann::json aObj,
const std::string &  aKey,
OPT< int >  aDefault = OPT<int>() 
)
static

Definition at line 38 of file net_settings.cpp.

40 {
41  if( aObj.contains( aKey ) && aObj[aKey].is_number() )
42  return PcbMm2iu( aObj[aKey].get<double>() );
43  else
44  return aDefault;
45 };
constexpr int PcbMm2iu(double mm)

References PcbMm2iu().

Referenced by NET_SETTINGS::NET_SETTINGS().

◆ getInSchUnits()

static int getInSchUnits ( const nlohmann::json aObj,
const std::string &  aKey,
int  aDefault 
)
static

Definition at line 48 of file net_settings.cpp.

49 {
50  if( aObj.contains( aKey ) && aObj[aKey].is_number() )
51  return SchMils2iu( aObj[aKey].get<double>() );
52  else
53  return aDefault;
54 };
constexpr int SchMils2iu(double mils)

References SchMils2iu().

Referenced by NET_SETTINGS::NET_SETTINGS().

◆ isSuperSubOverbar()

static bool isSuperSubOverbar ( wxChar  c)
static

Definition at line 315 of file net_settings.cpp.

316 {
317  return c == '_' || c == '^' || c == '~';
318 }

Referenced by NET_SETTINGS::ParseBusGroup(), and NET_SETTINGS::ParseBusVector().

Variable Documentation

◆ netSettingsSchemaVersion

const int netSettingsSchemaVersion = 2

Definition at line 35 of file net_settings.cpp.