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(
"" );
85 wxASSERT( transline );
107 wxString msg = wxString::FromUTF8( aText );
115 wxString msg = wxString::FromUTF8( aText );
117 fullmsg.Printf( wxT(
"%g " ), aValue );
146 for(
unsigned ii = 0; ii < tr_ident->
GetPrmsCount(); ii++ )
150 if( aPrmId == prm->
m_Id )
167 for(
unsigned ii = 0; ii < tr_ident->
GetPrmsCount(); ii++ )
171 if( aPrmId == prm->
m_Id )
176 msg.Printf( wxT(
"%g" ), prm->
m_Value );
177 ( (wxTextCtrl*) prm->
m_ValueCtrl )->SetValue( msg );
181 wxLogMessage( wxT(
"GetPrmValue: prm %d not found" ), (
int) aPrmId );
192 wxColour wxcol = wxColour(
static_cast<unsigned char>( aCol->
r * 255 ),
193 static_cast<unsigned char>( aCol->
g * 255 ),
194 static_cast<unsigned char>( aCol->
b * 255 ) );
201 for(
unsigned ii = 0; ii < tr_ident->
GetPrmsCount(); ii++ )
204 wxTextCtrl* ctl =
static_cast<wxTextCtrl*
>( prm->
m_ValueCtrl );
206 if( aPrmId == prm->
m_Id )
208 ctl->SetBackgroundColour( wxcol );
209 ctl->SetStyle( 0, -1, ctl->GetDefaultStyle() );
224 #define MSG_CNT_MAX 8
231 wxASSERT( ( aLineNumber >= 0 ) && ( aLineNumber <
MSG_CNT_MAX ) );
233 if( aLineNumber < 0 )
239 messages[aLineNumber]->SetLabel( aText );
252 wxMessageBox( wxT(
"IsPrmSelected() error" ) );
A color representation with 4 components: red, green, blue, alpha.
wxStaticText * m_Message2
wxStaticText * m_Message3
wxStaticText * m_Message6
wxRadioButton * m_radioBtnPrm2
wxStaticText * m_Message7
wxRadioButton * m_radioBtnPrm1
wxStaticText * m_Message4
wxStaticText * m_Message1
wxStaticText * m_Message5
wxStaticText * m_Message8
void SetResult(int aLineNumber, const wxString &aText)
Put the text into the given result line.
void SetPrmBgColor(enum PRMS_ID aPrmId, const KIGFX::COLOR4D *aCol)
Set the background color of a parameter.
std::vector< TRANSLINE_IDENT * > m_transline_list
void SetPrmValue(enum PRMS_ID aPrmId, double aValue)
Read/write params values and results.
enum TRANSLINE_TYPE_ID m_currTransLineType
bool IsPrmSelected(enum PRMS_ID aPrmId) const
Function IsPrmSelected.
double GetPrmValue(enum PRMS_ID aPrmId) const
Return a param value.
PCB calculator the main frame.
A class to handle a list of parameters of a given transline.
unsigned GetPrmsCount() const
TRANSLINE_PRM * GetPrm(unsigned aIdx) const
A class to handle one parameter of transline.
void SetPropertyInDialog(enum PRMS_ID aPrmId, double value)
void SetPropertyBgColorInDialog(enum PRMS_ID aPrmId, const KIGFX::COLOR4D *aCol)
Function SetPropertyBgColorInDialog Set the background color of a parameter.
double GetPropertyInDialog(enum PRMS_ID aPrmId)
void SetResultInDialog(int line, const char *aText)
bool IsSelectedInDialog(enum PRMS_ID aPrmId)
double DoubleFromString(const wxString &TextValue)
PANEL_TRANSLINE * getTranslinePanel()