1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212
|
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright The KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef _PCB_CALCULATOR_SETTINGS_H
#define _PCB_CALCULATOR_SETTINGS_H
#include <array>
#include <unordered_map>
#include <settings/app_settings.h>
// Deafult value for TI LM317
#define DEFAULT_REGULATOR_RESTOL "1"
#define DEFAULT_REGULATOR_R1 "0.240"
#define DEFAULT_REGULATOR_R2 "0.720"
#define DEFAULT_REGULATOR_VREF_MIN "1.20"
#define DEFAULT_REGULATOR_VREF_TYP "1.25"
#define DEFAULT_REGULATOR_VREF_MAX "1.30"
#define DEFAULT_REGULATOR_VOUT_TYP "5"
#define DEFAULT_REGULATOR_IADJ_TYP "50"
#define DEFAULT_REGULATOR_IADJ_MAX "100"
class PCB_CALCULATOR_SETTINGS : public APP_SETTINGS_BASE
{
public:
struct ATTENUATOR
{
double attenuation;
double zin;
double zout;
};
struct ATTENUATORS
{
int type;
std::unordered_map<std::string, ATTENUATOR> attenuators;
};
struct ELECTRICAL
{
int spacing_units;
wxString spacing_voltage;
double iec60664_ratedVoltage;
int iec60664_OVC;
double iec60664_RMSvoltage;
double iec60664_transientOV;
double iec60664_peakOV;
int iec60664_insulationType;
int iec60664_pollutionDegree;
int iec60664_materialGroup;
int iec60664_pcbMaterial;
double iec60664_altitude;
};
struct REGULATORS
{
wxString resTol;
wxString r1;
wxString r2;
wxString vrefMin;
wxString vrefTyp;
wxString vrefMax;
wxString voutTyp;
wxString iadjTyp;
wxString iadjMax;
wxString data_file;
wxString selected_regulator;
int type;
int last_param;
};
struct CABLE_SIZE
{
int diameterUnit;
int linResUnit;
int frequencyUnit;
int lengthUnit;
int currentDensityChoice;
wxString conductorMaterialResitivity;
wxString conductorTemperature;
wxString conductorThermalCoef;
};
struct WAVELENGTH
{
double permittivity;
double permeability;
double frequency;
int frequencyUnit;
int periodUnit;
int wavelengthVacuumUnit;
int wavelengthMediumUnit;
int speedUnit;
};
struct TRACK_WIDTH
{
wxString current;
wxString delta_tc;
wxString track_len;
int track_len_units;
wxString resistivity;
wxString ext_track_width;
int ext_track_width_units;
wxString ext_track_thickness;
int ext_track_thickness_units;
wxString int_track_width;
int int_track_width_units;
wxString int_track_thickness;
int int_track_thickness_units;
};
/// Map of TRANSLINE_PRM id to value
typedef std::map<std::string, double> TL_PARAM_MAP;
/// Map of TRANSLINE_PRM id to units selection
typedef std::map<std::string, int> TL_PARAM_UNITS_MAP;
struct TRANSMISSION_LINE
{
int type;
/// Transline parameters, per transline type
std::map<std::string, TL_PARAM_MAP> param_values;
/// Transline parameter units selections, per transline type
std::map<std::string, TL_PARAM_UNITS_MAP> param_units;
};
struct VIA_SIZE
{
wxString hole_diameter;
int hole_diameter_units;
wxString thickness;
int thickness_units;
wxString length;
int length_units;
wxString pad_diameter;
int pad_diameter_units;
wxString clearance_diameter;
int clearance_diameter_units;
wxString characteristic_impedance;
int characteristic_impedance_units;
wxString applied_current;
wxString plating_resistivity;
wxString permittivity;
wxString temp_rise;
wxString pulse_rise_time;
};
struct CORROSION_TABLE
{
wxString threshold_voltage;
bool show_symbols;
};
PCB_CALCULATOR_SETTINGS();
virtual ~PCB_CALCULATOR_SETTINGS() {}
virtual bool MigrateFromLegacy( wxConfigBase* aLegacyConfig ) override;
protected:
virtual std::string getLegacyFrameName() const override { return "pcb_calculator"; }
public:
ATTENUATORS m_Attenuators;
int m_BoardClassUnits;
int m_ColorCodeTolerance;
ELECTRICAL m_Electrical;
int m_LastPage;
REGULATORS m_Regulators;
CABLE_SIZE m_cableSize;
WAVELENGTH m_wavelength;
TRACK_WIDTH m_TrackWidth;
TRANSMISSION_LINE m_TransLine;
VIA_SIZE m_ViaSize;
CORROSION_TABLE m_CorrosionTable;
};
#endif
|