2015-08-09 07:15:42 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KICAD, a free EDA CAD application.
|
|
|
|
*
|
2021-02-12 00:47:08 +00:00
|
|
|
* Copyright (C) 1992-2021 Kicad Developers, see AUTHORS.txt for contributors.
|
2015-08-09 07:15:42 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
2019-05-01 18:57:59 +00:00
|
|
|
* as published by the Free Software Foundation; either version 3
|
2015-08-09 07:15:42 +00:00
|
|
|
* 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.
|
|
|
|
*
|
2019-05-01 18:57:59 +00:00
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
2015-08-09 07:15:42 +00:00
|
|
|
*/
|
|
|
|
|
2020-08-07 00:09:33 +00:00
|
|
|
#ifndef PCB_CALCULATOR_H
|
|
|
|
#define PCB_CALCULATOR_H
|
2011-08-12 05:21:36 +00:00
|
|
|
|
2020-10-13 01:55:32 +00:00
|
|
|
#include "transline/transline.h" // Included for SUBST_PRMS_ID definition.
|
2020-10-13 01:01:25 +00:00
|
|
|
#include "transline_ident.h"
|
|
|
|
#include "pcb_calculator_frame_base.h"
|
2011-08-12 05:21:36 +00:00
|
|
|
|
2020-10-13 01:01:25 +00:00
|
|
|
#include "attenuators/attenuator_classes.h"
|
|
|
|
#include "class_regulator_data.h"
|
2012-04-02 18:11:00 +00:00
|
|
|
|
|
|
|
extern const wxString PcbCalcDataFileExt;
|
2011-08-12 05:21:36 +00:00
|
|
|
|
2020-10-13 01:01:25 +00:00
|
|
|
class APP_SETTINGS_BASE;
|
|
|
|
class KIWAY;
|
2020-08-24 10:40:38 +00:00
|
|
|
class PCB_CALCULATOR_SETTINGS;
|
|
|
|
|
2020-10-13 01:01:25 +00:00
|
|
|
|
2021-02-12 00:47:08 +00:00
|
|
|
/*
|
|
|
|
* Class PCB_CALCULATOR_FRAME_BASE
|
|
|
|
* This is the main frame for this application
|
|
|
|
*/
|
2011-08-12 05:21:36 +00:00
|
|
|
class PCB_CALCULATOR_FRAME : public PCB_CALCULATOR_FRAME_BASE
|
|
|
|
{
|
2012-04-02 18:11:00 +00:00
|
|
|
public:
|
|
|
|
REGULATOR_LIST m_RegulatorList; // the list of known regulator
|
|
|
|
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
PCB_CALCULATOR_FRAME( KIWAY* aKiway, wxWindow* aParent );
|
2011-08-12 05:21:36 +00:00
|
|
|
~PCB_CALCULATOR_FRAME();
|
|
|
|
|
|
|
|
private:
|
|
|
|
// Event handlers
|
2016-09-24 18:53:15 +00:00
|
|
|
void OnClosePcbCalc( wxCloseEvent& event ) override;
|
2012-04-03 18:26:05 +00:00
|
|
|
|
2021-02-11 23:43:08 +00:00
|
|
|
void OnUpdateUI( wxUpdateUIEvent& event ) override;
|
2011-08-12 05:21:36 +00:00
|
|
|
|
2015-08-09 09:03:25 +00:00
|
|
|
// Config read-write, virtual from EDA_BASE_FRAME
|
2020-01-13 01:44:19 +00:00
|
|
|
void LoadSettings( APP_SETTINGS_BASE* aCfg ) override;
|
|
|
|
void SaveSettings( APP_SETTINGS_BASE* aCfg ) override;
|
2011-08-12 05:21:36 +00:00
|
|
|
|
2012-04-02 18:11:00 +00:00
|
|
|
// R/W data files:
|
|
|
|
bool ReadDataFile();
|
|
|
|
bool WriteDataFile();
|
|
|
|
|
2012-04-05 18:56:06 +00:00
|
|
|
/**
|
|
|
|
* @return the full filename of the selected pcb_calculator data file
|
|
|
|
*/
|
|
|
|
const wxString GetDataFilename();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Initialize the full filename of the selected pcb_calculator data file
|
|
|
|
* force the standard extension of the file (.pcbcalc)
|
|
|
|
* @param aFilename = the full filename, with or without extension
|
|
|
|
*/
|
2020-08-07 00:09:33 +00:00
|
|
|
void SetDataFilename( const wxString& aFilename );
|
2012-04-03 18:26:05 +00:00
|
|
|
|
2011-08-12 05:21:36 +00:00
|
|
|
/**
|
2021-02-12 00:47:08 +00:00
|
|
|
* Panel-specific initializers
|
2011-08-12 05:21:36 +00:00
|
|
|
*/
|
2021-02-12 00:47:08 +00:00
|
|
|
void initTrackWidthPanel();
|
|
|
|
void initESeriesPanel();
|
|
|
|
void initColorCodePanel();
|
|
|
|
void initViaSizePanel();
|
2020-09-15 14:03:07 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Called on calculate button and executes all E-series calculations
|
|
|
|
*/
|
|
|
|
void OnCalculateESeries( wxCommandEvent& event ) override;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Radio Buttons to select the E-serie for the resistor calculator
|
|
|
|
* @param event contains the radio button state
|
|
|
|
*/
|
2021-02-11 23:43:08 +00:00
|
|
|
void OnESeriesSelection( wxCommandEvent& event ) override;
|
2020-09-15 14:03:07 +00:00
|
|
|
|
2011-08-12 05:21:36 +00:00
|
|
|
/**
|
2021-02-12 00:47:08 +00:00
|
|
|
* Function writeTrackWidthConfig
|
2020-08-24 10:40:38 +00:00
|
|
|
* Write Track width parameters in config
|
2011-08-12 05:21:36 +00:00
|
|
|
*/
|
2021-02-12 00:47:08 +00:00
|
|
|
void writeTrackWidthConfig();
|
2011-08-12 05:21:36 +00:00
|
|
|
|
|
|
|
/**
|
2015-08-09 07:15:42 +00:00
|
|
|
* Function OnTWParametersChanged
|
|
|
|
* Called when the user changes the general parameters (i.e., anything that
|
|
|
|
* is not one of the controlling values). This update the calculations.
|
|
|
|
*/
|
2016-09-24 18:53:15 +00:00
|
|
|
void OnTWParametersChanged( wxCommandEvent& event ) override;
|
2015-08-09 07:15:42 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function OnTWCalculateFromCurrent
|
|
|
|
* Called when the user changes the desired maximum current. This sets the
|
|
|
|
* current as the controlling value and performs the calculations.
|
|
|
|
*/
|
2016-09-24 18:53:15 +00:00
|
|
|
void OnTWCalculateFromCurrent( wxCommandEvent& event ) override;
|
2015-08-09 07:15:42 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function OnTWCalculateFromExtWidth
|
|
|
|
* Called when the user changes the desired external trace width. This sets
|
|
|
|
* the external width as the controlling value and performs the calculations.
|
|
|
|
*/
|
2016-09-24 18:53:15 +00:00
|
|
|
void OnTWCalculateFromExtWidth( wxCommandEvent& event ) override;
|
2015-08-09 07:15:42 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function OnTWCalculateFromIntWidth
|
|
|
|
* Called when the user changes the desired internal trace width. This sets
|
|
|
|
* the internal width as the controlling value and performs the calculations.
|
|
|
|
*/
|
2016-09-24 18:53:15 +00:00
|
|
|
void OnTWCalculateFromIntWidth( wxCommandEvent& event ) override;
|
2015-08-09 07:15:42 +00:00
|
|
|
|
2019-11-10 09:36:26 +00:00
|
|
|
/**
|
|
|
|
* Function OnTWResetButtonClick
|
|
|
|
* Called when the user clicks the reset button. This sets
|
|
|
|
* the parameters to their default values.
|
|
|
|
*/
|
|
|
|
void OnTWResetButtonClick( wxCommandEvent& event ) override;
|
|
|
|
|
2015-08-09 07:15:42 +00:00
|
|
|
/**
|
|
|
|
* Function TWCalculateWidth
|
|
|
|
* Calculate track width required based on given current and temperature rise.
|
2011-08-12 05:21:36 +00:00
|
|
|
*/
|
2021-02-11 23:43:08 +00:00
|
|
|
double TWCalculateWidth( double aCurrent, double aThickness, double aDeltaT_C,
|
|
|
|
bool aUseInternalLayer );
|
2011-08-12 05:21:36 +00:00
|
|
|
|
2015-08-09 07:15:42 +00:00
|
|
|
/**
|
|
|
|
* Function TWCalculateCurrent
|
|
|
|
* Calculate maximum current based on given width and temperature rise.
|
|
|
|
*/
|
2021-02-11 23:43:08 +00:00
|
|
|
double TWCalculateCurrent( double aWidth, double aThickness, double aDeltaT_C,
|
|
|
|
bool aUseInternalLayer );
|
2015-08-09 07:15:42 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function TWDisplayValues
|
|
|
|
* Displays the results of a calculation (including resulting values such
|
|
|
|
* as the resistance and power loss).
|
|
|
|
*/
|
2021-02-11 23:43:08 +00:00
|
|
|
void TWDisplayValues( double aCurrent, double aExtWidth, double aIntWidth,
|
|
|
|
double aExtThickness, double aIntThickness );
|
2015-08-09 07:15:42 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function TWUpdateModeDisplay
|
|
|
|
* Updates the fields to show whether the maximum current, external trace
|
|
|
|
* width, or internal trace width is currently the controlling parameter.
|
|
|
|
*/
|
|
|
|
void TWUpdateModeDisplay();
|
|
|
|
|
2019-04-10 10:24:52 +00:00
|
|
|
/**
|
2021-02-12 00:47:08 +00:00
|
|
|
* Function writeViaSizeConfig
|
2020-08-24 10:40:38 +00:00
|
|
|
* Write Via Size parameters in config
|
2019-04-10 10:24:52 +00:00
|
|
|
*/
|
2021-02-12 00:47:08 +00:00
|
|
|
void writeViaSizeConfig();
|
2019-04-10 10:24:52 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function OnViaCalculate
|
|
|
|
* Called when the user changes any value in the via calcultor.
|
|
|
|
*/
|
|
|
|
void OnViaCalculate( wxCommandEvent& event ) override;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function OnViaEpsilonR_Button
|
|
|
|
*/
|
|
|
|
void OnViaEpsilonR_Button( wxCommandEvent& event ) override;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function OnViaRho_Button
|
|
|
|
*/
|
|
|
|
void OnViaRho_Button( wxCommandEvent& event ) override;
|
|
|
|
|
2019-09-20 16:14:52 +00:00
|
|
|
/**
|
|
|
|
* Update the Error message in Via calculation panel
|
|
|
|
*/
|
2019-11-10 09:36:26 +00:00
|
|
|
void onUpdateViaCalcErrorText( wxUpdateUIEvent& event ) override;
|
|
|
|
|
|
|
|
/**
|
2021-02-12 00:47:08 +00:00
|
|
|
* Function OnViaResetButtonClick
|
|
|
|
* Called when the user clicks the reset button; sets the parameters to their default values.
|
|
|
|
*/
|
2019-11-10 09:36:26 +00:00
|
|
|
void OnViaResetButtonClick( wxCommandEvent& event ) override;
|
2019-09-20 16:14:52 +00:00
|
|
|
|
2019-04-10 10:24:52 +00:00
|
|
|
/**
|
|
|
|
* Function VSDisplayValues
|
|
|
|
* Displays the results of the calculation.
|
|
|
|
*/
|
|
|
|
void VSDisplayValues( double aViaResistance, double aVoltageDrop, double aPowerLoss,
|
2021-02-11 23:43:08 +00:00
|
|
|
double aEstimatedAmpacity, double aThermalResistance,
|
|
|
|
double aCapacitance, double aTimeDegradation, double aInductance,
|
|
|
|
double aReactance );
|
2019-04-10 10:24:52 +00:00
|
|
|
|
2011-08-12 05:21:36 +00:00
|
|
|
// Electrical spacing panel:
|
2016-09-24 18:53:15 +00:00
|
|
|
void OnElectricalSpacingUnitsSelection( wxCommandEvent& event ) override;
|
|
|
|
void OnElectricalSpacingRefresh( wxCommandEvent& event ) override;
|
2011-08-12 05:21:36 +00:00
|
|
|
void ElectricalSpacingUpdateData( double aUnitScale );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function OnTranslineSelection
|
|
|
|
* Called on new transmission line selection
|
2021-02-12 00:47:08 +00:00
|
|
|
*/
|
2016-09-24 18:53:15 +00:00
|
|
|
void OnTranslineSelection( wxCommandEvent& event ) override;
|
2011-08-12 05:21:36 +00:00
|
|
|
|
2019-11-10 09:36:26 +00:00
|
|
|
/**
|
|
|
|
* Function OnTransLineResetButtonClick
|
2021-02-12 00:47:08 +00:00
|
|
|
* Called when the user clicks the reset button; sets the parameters to their default values.
|
|
|
|
*/
|
2019-11-10 09:36:26 +00:00
|
|
|
void OnTransLineResetButtonClick( wxCommandEvent& event ) override;
|
|
|
|
|
2011-08-12 05:21:36 +00:00
|
|
|
/**
|
|
|
|
* Function OnTranslineAnalyse
|
2021-02-12 00:47:08 +00:00
|
|
|
* Run a new analyse for the current transline with current parameters and displays the
|
|
|
|
* electrical parameters
|
2011-08-12 05:21:36 +00:00
|
|
|
*/
|
2016-09-24 18:53:15 +00:00
|
|
|
void OnTranslineAnalyse( wxCommandEvent& event ) override;
|
2011-08-12 05:21:36 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function OnTranslineSynthetize
|
2021-02-12 00:47:08 +00:00
|
|
|
* Run a new synthezis for the current transline with current parameters and displays the
|
|
|
|
* geometrical parameters
|
2011-08-12 05:21:36 +00:00
|
|
|
*/
|
2016-09-24 18:53:15 +00:00
|
|
|
void OnTranslineSynthetize( wxCommandEvent& event ) override;
|
2011-08-12 05:21:36 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function OnTranslineEpsilonR_Button
|
2021-02-12 00:47:08 +00:00
|
|
|
* Shows a list of current relative dielectric constant(Er) and set the selected value in
|
|
|
|
* main dialog frame
|
2011-08-12 05:21:36 +00:00
|
|
|
*/
|
2016-09-24 18:53:15 +00:00
|
|
|
void OnTranslineEpsilonR_Button( wxCommandEvent& event ) override;
|
2011-08-12 05:21:36 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function OnTranslineTanD_Button
|
2021-02-12 00:47:08 +00:00
|
|
|
* Shows a list of current dielectric loss factor (tangent delta) and set the selected value
|
|
|
|
* in main dialog frame
|
2011-08-12 05:21:36 +00:00
|
|
|
*/
|
2016-09-24 18:53:15 +00:00
|
|
|
void OnTranslineTanD_Button( wxCommandEvent& event ) override;
|
2011-08-12 05:21:36 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function OnTranslineRho_Button
|
2021-02-12 00:47:08 +00:00
|
|
|
* Shows a list of current Specific resistance list (rho) and set the selected value in main
|
|
|
|
* dialog frame
|
2011-08-12 05:21:36 +00:00
|
|
|
*/
|
2016-09-24 18:53:15 +00:00
|
|
|
void OnTranslineRho_Button( wxCommandEvent& event ) override;
|
2011-08-12 05:21:36 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function TranslineTypeSelection
|
2021-02-12 00:47:08 +00:00
|
|
|
* Must be called after selection of a new transline. Update all values, labels and tool
|
|
|
|
* tips of parameters needed by the new transline; irrelevant parameters are blanked.
|
2014-03-22 08:28:39 +00:00
|
|
|
* @param aType = the TRANSLINE_TYPE_ID of the new selected transline
|
2011-08-12 05:21:36 +00:00
|
|
|
*/
|
2014-03-22 08:28:39 +00:00
|
|
|
void TranslineTypeSelection( enum TRANSLINE_TYPE_ID aType );
|
2011-08-12 05:21:36 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function TransfDlgDataToTranslineParams
|
2021-02-12 00:47:08 +00:00
|
|
|
* Read values entered in dialog frame, and transfert these values in current transline
|
|
|
|
* parameters, converted in normalized units
|
2011-08-12 05:21:36 +00:00
|
|
|
*/
|
|
|
|
void TransfDlgDataToTranslineParams();
|
|
|
|
|
|
|
|
// Color Code panel
|
2016-09-24 18:53:15 +00:00
|
|
|
void OnToleranceSelection( wxCommandEvent& event ) override;
|
2011-08-12 05:21:36 +00:00
|
|
|
void ToleranceSelection( int aSelection );
|
|
|
|
|
|
|
|
// Attenuators Panel
|
2016-09-24 18:53:15 +00:00
|
|
|
void OnAttenuatorSelection( wxCommandEvent& event ) override;
|
2011-08-12 05:21:36 +00:00
|
|
|
void SetAttenuator( unsigned aIdx );
|
2016-09-24 18:53:15 +00:00
|
|
|
void OnCalculateAttenuator( wxCommandEvent& event ) override;
|
2011-08-12 05:21:36 +00:00
|
|
|
void TransfPanelDataToAttenuator();
|
|
|
|
void TransfAttenuatorDataToPanel();
|
|
|
|
void TransfAttenuatorResultsToPanel();
|
|
|
|
|
|
|
|
// Regulators Panel
|
2016-09-24 18:53:15 +00:00
|
|
|
void OnRegulatorCalcButtonClick( wxCommandEvent& event ) override;
|
2019-11-10 09:36:26 +00:00
|
|
|
void OnRegulatorResetButtonClick( wxCommandEvent& event ) override;
|
2016-09-24 18:53:15 +00:00
|
|
|
void OnRegulTypeSelection( wxCommandEvent& event ) override;
|
|
|
|
void OnRegulatorSelection( wxCommandEvent& event ) override;
|
|
|
|
void OnDataFileSelection( wxCommandEvent& event ) override;
|
|
|
|
void OnAddRegulator( wxCommandEvent& event ) override;
|
|
|
|
void OnEditRegulator( wxCommandEvent& event ) override;
|
|
|
|
void OnRemoveRegulator( wxCommandEvent& event ) override;
|
2012-04-02 18:11:00 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function RegulatorPageUpdate:
|
|
|
|
* Update the regulator page dialog display:
|
|
|
|
* enable the current regulator drawings and the formula used for calculations
|
|
|
|
*/
|
|
|
|
void RegulatorPageUpdate();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function SelectLastSelectedRegulator
|
2021-02-12 00:47:08 +00:00
|
|
|
* If m_lastSelectedRegulatorName is empty, just calls RegulatorPageUpdate()
|
2012-04-02 18:11:00 +00:00
|
|
|
*/
|
|
|
|
void SelectLastSelectedRegulator();
|
|
|
|
|
2011-08-12 05:21:36 +00:00
|
|
|
void RegulatorsSolve();
|
|
|
|
|
2020-08-24 10:40:38 +00:00
|
|
|
/**
|
|
|
|
* Write regulators parameters in config
|
|
|
|
* @param aCfg is the config settings
|
|
|
|
*/
|
|
|
|
void Regulators_WriteConfig( PCB_CALCULATOR_SETTINGS* aCfg );
|
|
|
|
|
2011-08-12 05:21:36 +00:00
|
|
|
public:
|
|
|
|
// Read/write params values and results
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function SetPrmValue
|
|
|
|
* Read/write params values and results
|
|
|
|
* @param aPrmId = param id to write
|
|
|
|
* @param aValue = valmue to write
|
|
|
|
*/
|
|
|
|
void SetPrmValue( enum PRMS_ID aPrmId, double aValue );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function SetResult
|
|
|
|
* Puts the text into the given result line.
|
|
|
|
* @param aLineNumber = the line (0 to 5) wher to display the text
|
|
|
|
* @param aText = the text to display
|
|
|
|
*/
|
2020-08-07 00:09:33 +00:00
|
|
|
void SetResult( int aLineNumber, const wxString& aText );
|
2011-08-12 05:21:36 +00:00
|
|
|
|
2020-08-07 00:09:33 +00:00
|
|
|
/** Function SetPrgmBgColor
|
|
|
|
* Set the background color of a parameter
|
|
|
|
* @param aPrmId = param id to set
|
|
|
|
* @param aCol = new color
|
|
|
|
*/
|
|
|
|
void SetPrmBgColor( enum PRMS_ID aPrmId, const KIGFX::COLOR4D* aCol );
|
2011-08-12 05:21:36 +00:00
|
|
|
/**
|
|
|
|
* Function GetPrmValue
|
|
|
|
* Returns a param value.
|
|
|
|
* @param aPrmId = param id to write
|
|
|
|
* @return the value always in normalized unit (meter, Hz, Ohm, radian)
|
|
|
|
*/
|
2021-03-06 09:27:41 +00:00
|
|
|
double GetPrmValue( enum PRMS_ID aPrmId ) const;
|
2011-08-12 05:21:36 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function IsPrmSelected
|
|
|
|
* @return true if the param aPrmId is selected
|
|
|
|
* Has meaning only for params that have a radio button
|
|
|
|
*/
|
2021-03-06 09:27:41 +00:00
|
|
|
bool IsPrmSelected( enum PRMS_ID aPrmId ) const;
|
2011-08-12 05:21:36 +00:00
|
|
|
|
|
|
|
// Board classes panel:
|
2016-09-24 18:53:15 +00:00
|
|
|
void OnBoardClassesUnitsSelection( wxCommandEvent& event ) override;
|
2011-08-12 05:21:36 +00:00
|
|
|
void BoardClassesUpdateData( double aUnitScale );
|
|
|
|
|
2020-03-24 01:01:23 +00:00
|
|
|
// Calculator doesn't host a tool framework
|
2020-08-07 00:09:33 +00:00
|
|
|
wxWindow* GetToolCanvas() const override
|
|
|
|
{
|
|
|
|
return nullptr;
|
|
|
|
}
|
2021-02-12 00:47:08 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
bool m_RegulatorListChanged; // Set when m_RegulatorList is modified and the corresponging file
|
|
|
|
// must be rewritten
|
|
|
|
|
|
|
|
enum // Which dimension is controlling the track width / current
|
|
|
|
{ // calculations:
|
|
|
|
TW_MASTER_CURRENT, // the maximum current,
|
|
|
|
TW_MASTER_EXT_WIDTH, // the external trace width,
|
|
|
|
TW_MASTER_INT_WIDTH // or the internal trace width?
|
|
|
|
} m_TWMode;
|
|
|
|
|
|
|
|
bool m_TWNested; // Used to stop events caused by setting the answers.
|
|
|
|
|
|
|
|
enum TRANSLINE_TYPE_ID m_currTransLineType;
|
|
|
|
TRANSLINE* m_currTransLine;
|
|
|
|
std::vector<TRANSLINE_IDENT*> m_transline_list;
|
|
|
|
|
|
|
|
ATTENUATOR* m_currAttenuator;
|
|
|
|
std::vector<ATTENUATOR*> m_attenuator_list;
|
|
|
|
|
|
|
|
wxString m_lastSelectedRegulatorName;
|
|
|
|
|
|
|
|
wxBitmap* m_ccValueNamesBitmap;
|
|
|
|
wxBitmap* m_ccValuesBitmap;
|
|
|
|
wxBitmap* m_ccMultipliersBitmap;
|
|
|
|
wxBitmap* m_ccTolerancesBitmap;
|
|
|
|
|
|
|
|
int m_lastNotebookPage;
|
2021-02-14 11:17:12 +00:00
|
|
|
bool m_macHack;
|
2011-08-12 05:21:36 +00:00
|
|
|
};
|
|
|
|
|
2012-04-05 18:56:06 +00:00
|
|
|
|
|
|
|
extern const wxString DataFileNameExt;
|
|
|
|
|
2020-08-07 00:09:33 +00:00
|
|
|
#endif // PCB_CALCULATOR_H
|