2020-01-13 01:44:19 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
2022-09-07 23:16:57 +00:00
|
|
|
* Copyright (C) 2020-2022 KiCad Developers, see AUTHORS.txt for contributors.
|
2020-01-13 01:44:19 +00:00
|
|
|
*
|
|
|
|
* 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>
|
2021-06-04 03:52:50 +00:00
|
|
|
#include <unordered_map>
|
2020-01-13 01:44:19 +00:00
|
|
|
#include <settings/app_settings.h>
|
|
|
|
|
|
|
|
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;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct REGULATORS
|
|
|
|
{
|
|
|
|
wxString r1;
|
|
|
|
wxString r2;
|
|
|
|
wxString vref;
|
|
|
|
wxString vout;
|
|
|
|
wxString data_file;
|
|
|
|
wxString selected_regulator;
|
|
|
|
int type;
|
|
|
|
int last_param;
|
|
|
|
};
|
|
|
|
|
2022-06-16 22:04:45 +00:00
|
|
|
struct CABLE_SIZE
|
|
|
|
{
|
|
|
|
int diameterUnit;
|
|
|
|
int linResUnit;
|
|
|
|
int frequencyUnit;
|
|
|
|
int lengthUnit;
|
2022-07-23 17:29:22 +00:00
|
|
|
wxString conductorMaterialResitivity;
|
2022-09-07 23:16:57 +00:00
|
|
|
wxString conductorTemperature;
|
|
|
|
wxString conductorThermalCoef;
|
2022-06-16 22:04:45 +00:00
|
|
|
};
|
|
|
|
|
2022-07-06 18:28:59 +00:00
|
|
|
struct WAVELENGTH
|
|
|
|
{
|
|
|
|
double permittivity;
|
|
|
|
double permeability;
|
|
|
|
double frequency;
|
|
|
|
int frequencyUnit;
|
|
|
|
int periodUnit;
|
|
|
|
int wavelengthVacuumUnit;
|
|
|
|
int wavelengthMediumUnit;
|
|
|
|
int speedUnit;
|
|
|
|
};
|
|
|
|
|
2020-01-13 01:44:19 +00:00
|
|
|
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;
|
|
|
|
};
|
|
|
|
|
2022-10-03 18:03:03 +00:00
|
|
|
struct CORROSION_TABLE
|
|
|
|
{
|
|
|
|
wxString threshold_voltage;
|
|
|
|
};
|
|
|
|
|
2020-01-13 01:44:19 +00:00
|
|
|
PCB_CALCULATOR_SETTINGS();
|
|
|
|
|
|
|
|
virtual ~PCB_CALCULATOR_SETTINGS() {}
|
|
|
|
|
|
|
|
virtual bool MigrateFromLegacy( wxConfigBase* aLegacyConfig ) override;
|
|
|
|
|
2021-06-08 19:39:47 +00:00
|
|
|
protected:
|
|
|
|
virtual std::string getLegacyFrameName() const override { return "pcb_calculator"; }
|
|
|
|
|
|
|
|
public:
|
2020-01-13 01:44:19 +00:00
|
|
|
ATTENUATORS m_Attenuators;
|
|
|
|
|
|
|
|
int m_BoardClassUnits;
|
|
|
|
|
|
|
|
int m_ColorCodeTolerance;
|
|
|
|
|
|
|
|
ELECTRICAL m_Electrical;
|
|
|
|
|
|
|
|
int m_LastPage;
|
|
|
|
|
|
|
|
REGULATORS m_Regulators;
|
|
|
|
|
2022-06-16 22:04:45 +00:00
|
|
|
CABLE_SIZE m_cableSize;
|
|
|
|
|
2022-07-06 18:28:59 +00:00
|
|
|
WAVELENGTH m_wavelength;
|
|
|
|
|
2020-01-13 01:44:19 +00:00
|
|
|
TRACK_WIDTH m_TrackWidth;
|
|
|
|
|
|
|
|
TRANSMISSION_LINE m_TransLine;
|
|
|
|
|
|
|
|
VIA_SIZE m_ViaSize;
|
2022-10-03 18:03:03 +00:00
|
|
|
|
|
|
|
CORROSION_TABLE m_CorrosionTable;
|
2020-01-13 01:44:19 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|