#include <wx/choicdlg.h>
#include <wx/filename.h>
#include <wx/settings.h>
#include <bitmaps.h>
#include <calculator_panels/panel_transline.h>
#include <common_data.h>
#include <widgets/unit_selector.h>
Go to the source code of this file.
|
double | DoubleFromString (const wxString &TextValue) |
|
static bool | findMatch (wxArrayString &aList, const wxString &aValue, int &aIdx) |
|
◆ elecprms_cnt
#define elecprms_cnt (sizeof(elecprms)/sizeof(elecprms[0])) |
◆ frequencyprms_cnt
#define frequencyprms_cnt (sizeof(frequencyprms)/sizeof(frequencyprms[0])) |
◆ physprms_cnt
#define physprms_cnt (sizeof(physprms)/sizeof(physprms[0])) |
◆ substrateprms_cnt
#define substrateprms_cnt (sizeof(substrateprms)/sizeof(substrateprms[0])) |
◆ DoubleFromString()
double DoubleFromString |
( |
const wxString & |
TextValue | ) |
|
Definition at line 37 of file params_read_write.cpp.
42 const struct lconv* lc = localeconv();
43 wxChar decimal_point = lc->decimal_point[0];
44 wxString buf( TextValue.Strip( wxString::both ) );
47 buf.Replace( wxT(
"." ), wxString( decimal_point, 1 ) );
50 buf.Replace( wxT(
"," ), wxString( decimal_point, 1 ) );
55 unsigned brk_point = 0;
56 while( brk_point < buf.Len() )
58 wxChar ch = buf[brk_point];
59 if( !( ( ch >=
'0' && ch <=
'9' ) || ( ch == decimal_point ) || ( ch ==
'-' )
60 || ( ch ==
'+' ) || ( ch ==
'e' ) || ( ch ==
'E' ) ) )
69 return std::nan(
"" );
72 if( !buf.Left( brk_point ).ToDouble( &value ) )
73 return std::nan(
"" );
Referenced by PANEL_TRANSLINE::TransfDlgDataToTranslineParams().
◆ findMatch()
static bool findMatch |
( |
wxArrayString & |
aList, |
|
|
const wxString & |
aValue, |
|
|
int & |
aIdx |
|
) |
| |
|
static |
Definition at line 39 of file transline_dlg_funct.cpp.
48 wxString cvalue = aValue;
49 cvalue.Replace(
',',
'.' );
52 for( wxString&
text: aList )
57 wxString val_str =
text.BeforeFirst(
' ' );
58 val_str.Replace(
',',
'.' );
61 if( val_str == cvalue )
74 struct lconv* lc = localeconv();
75 char localeDecimalSeparator = *lc->decimal_point;
77 if( localeDecimalSeparator ==
',' )
78 cvalue.Replace(
'.',
',' );
81 cvalue.ToDouble( &curr_value );
85 for( wxString&
text: aList )
91 wxString val_str =
text.BeforeFirst(
' ' );
93 if( localeDecimalSeparator ==
',' )
94 val_str.Replace(
'.',
',' );
96 val_str.ToDouble( &val );;
98 if( curr_value == val )
References text.
Referenced by PANEL_TRANSLINE::OnTranslineEpsilonR_Button(), PANEL_TRANSLINE::OnTranslineRho_Button(), and PANEL_TRANSLINE::OnTranslineTanD_Button().