Pcb Calculator: Convert tracks width versus current formula to markdown.

This commit is contained in:
Jakub Kozdon 2019-10-04 17:05:50 +02:00 committed by jean-pierre charras
parent 0a829c328e
commit 4646bc0eef
4 changed files with 30 additions and 24 deletions

1
.gitignore vendored
View File

@ -26,6 +26,7 @@ pcb_calculator/attenuators/bridget_tee_formula.h
pcb_calculator/attenuators/pi_formula.h pcb_calculator/attenuators/pi_formula.h
pcb_calculator/attenuators/splitter_formula.h pcb_calculator/attenuators/splitter_formula.h
pcb_calculator/attenuators/tee_formula.h pcb_calculator/attenuators/tee_formula.h
pcb_calculator/tracks_width_versus_current_formula.h
Makefile Makefile
CMakeCache.txt CMakeCache.txt
auto_renamed_to_cpp auto_renamed_to_cpp

View File

@ -191,12 +191,14 @@ endfunction()
md_doc2h( ${CMAKE_CURRENT_SOURCE_DIR}/attenuators/splitter_formula ) md_doc2h( ${CMAKE_CURRENT_SOURCE_DIR}/attenuators/splitter_formula )
md_doc2h( ${CMAKE_CURRENT_SOURCE_DIR}/attenuators/pi_formula ) md_doc2h( ${CMAKE_CURRENT_SOURCE_DIR}/attenuators/pi_formula )
md_doc2h( ${CMAKE_CURRENT_SOURCE_DIR}/attenuators/tee_formula ) md_doc2h( ${CMAKE_CURRENT_SOURCE_DIR}/attenuators/tee_formula )
md_doc2h( ${CMAKE_CURRENT_SOURCE_DIR}/tracks_width_versus_current_formula )
set( DOCS_LIST set( DOCS_LIST
${CMAKE_CURRENT_SOURCE_DIR}/attenuators/pi_formula.h ${CMAKE_CURRENT_SOURCE_DIR}/attenuators/pi_formula.h
${CMAKE_CURRENT_SOURCE_DIR}/attenuators/tee_formula.h ${CMAKE_CURRENT_SOURCE_DIR}/attenuators/tee_formula.h
${CMAKE_CURRENT_SOURCE_DIR}/attenuators/bridget_tee_formula.h ${CMAKE_CURRENT_SOURCE_DIR}/attenuators/bridget_tee_formula.h
${CMAKE_CURRENT_SOURCE_DIR}/attenuators/splitter_formula.h ${CMAKE_CURRENT_SOURCE_DIR}/attenuators/splitter_formula.h
${CMAKE_CURRENT_SOURCE_DIR}/tracks_width_versus_current_formula.h
) )
set_source_files_properties( attenuators/attenuator_classes.cpp set_source_files_properties( attenuators/attenuator_classes.cpp

View File

@ -28,6 +28,7 @@
#include <cmath> #include <cmath>
#include <wx/wx.h> #include <wx/wx.h>
#include <wx/config.h> #include <wx/config.h>
#include <dialog_helpers.h>
#include <pcb_calculator_frame_base.h> #include <pcb_calculator_frame_base.h>
@ -35,6 +36,9 @@
#include <UnitSelector.h> #include <UnitSelector.h>
#include <units_scales.h> #include <units_scales.h>
wxString tracks_width_versus_current_formula =
#include <tracks_width_versus_current_formula.h>
extern double DoubleFromString( const wxString& TextValue ); extern double DoubleFromString( const wxString& TextValue );
// Key words to read/write some parameters in config: // Key words to read/write some parameters in config:
@ -440,30 +444,14 @@ void PCB_CALCULATOR_FRAME::TW_Init( wxConfigBase* aCfg )
aCfg->Read( KEYWORD_TW_INTTRACK_THICKNESS_UNIT, &tmp, 0 ); aCfg->Read( KEYWORD_TW_INTTRACK_THICKNESS_UNIT, &tmp, 0 );
m_IntTrackThicknessUnit->SetSelection( tmp ); m_IntTrackThicknessUnit->SetSelection( tmp );
// Init formulas text if( tracks_width_versus_current_formula.StartsWith( "<!" ) )
msg = "<br>"; m_htmlWinFormulas->SetPage( tracks_width_versus_current_formula );
msg << _( "If you specify the maximum current, then the trace " else
"widths will be calculated to suit." ) {
<< "<br>" << _( "If you specify one of the trace widths, the maximum " wxString html_txt;
"current it can handle will be calculated. The width " ConvertMarkdown2Html( wxGetTranslation( tracks_width_versus_current_formula ), html_txt );
"for the other trace to also handle this current will " m_htmlWinFormulas->SetPage( html_txt );
"then be calculated." ) }
<< "<br>" << _( "The controlling value is shown in bold." ) << "<br><br>"
<< _( "The calculations are valid for currents up to 35A "
"(external) or 17.5A (internal), temperature rises "
"up to 100 deg C, and widths of up to 400mil (10mm)." )<< "<br>"
<< _( "The formula, from IPC 2221, is" )
<< "<center><b>I = K * dT<sup>0.44</sup> * (W*H)<sup>0.725</sup></b></center>"
<< _( "where:" ) << "<br><b>I</b> = "
<< _( "maximum current in amps" )
<< "<br><b>dT</b> = "
<< _( "temperature rise above ambient in deg C" )
<< "<br><b>W,H</b> = "
<< _( "width and thickness in mils" ) << "<br>"
<< "<b>K</b> = "
<< _( "0.024 for internal traces or 0.048 for external traces" );
m_htmlWinFormulas->AppendToPage( msg );
// Make sure the correct master mode is displayed. // Make sure the correct master mode is displayed.
TWUpdateModeDisplay(); TWUpdateModeDisplay();

View File

@ -0,0 +1,15 @@
If you specify the maximum current, then the trace widths will be calculated to suit.
If you specify one of the trace widths, the maximum current it can handle will be calculated. The width for the other trace to also handle this current will then be calculated.
The controlling value is shown in bold.
The calculations are valid for currents up to 35A (external) or 17.5A (internal), temperature rises up to 100 deg C, and widths of up to 400mil (10mm).
The formula, from IPC 2221, is
<center>__I = K * dT<sup>0.44</sup> * (W*H)<sup>0.725</sup>__</center>
where:
__I__ = maximum current in amps
__dt__ = temperature rise above ambient in deg C
__W,H__ = width and thickness in mils
__K__ = 0.024 for internal traces or 0.048 for external traces