43 const struct lconv* lc = localeconv();
44 wxChar decimal_point = lc->decimal_point[0];
45 wxString buf( TextValue.Strip( wxString::both ) );
48 buf.Replace( wxT(
"." ), wxString( decimal_point, 1 ) );
51 buf.Replace( wxT(
"," ), wxString( decimal_point, 1 ) );
56 unsigned brk_point = 0;
57 while( brk_point < buf.Len() )
59 wxChar ch = buf[brk_point];
60 if( !( ( ch >=
'0' && ch <=
'9' ) || ( ch == decimal_point ) || ( ch ==
'-' )
61 || ( ch ==
'+' ) || ( ch ==
'e' ) || ( ch ==
'E' ) ) )
70 return std::nan(
"" );
73 if( !buf.Left( brk_point ).ToDouble( &value ) )
74 return std::nan(
"" );
86 wxASSERT( transline );
108 wxString msg = wxString::FromUTF8( aText );
116 wxString msg = wxString::FromUTF8( aText );
118 fullmsg.Printf( wxT(
"%g " ), aValue );
147 for(
unsigned ii = 0; ii < tr_ident->
GetPrmsCount(); ii++ )
151 if( aPrmId == prm->
m_Id )
168 for(
unsigned ii = 0; ii < tr_ident->
GetPrmsCount(); ii++ )
172 if( aPrmId == prm->
m_Id )
177 msg.Printf( wxT(
"%g" ), prm->
m_Value );
178 ( (wxTextCtrl*) prm->
m_ValueCtrl )->SetValue( msg );
182 wxLogMessage( wxT(
"GetPrmValue: prm %d not found" ), (
int) aPrmId );
193 wxColour wxcol = wxColour(
static_cast<unsigned char>( aCol->
r * 255 ),
194 static_cast<unsigned char>( aCol->
g * 255 ),
195 static_cast<unsigned char>( aCol->
b * 255 ) );
202 for(
unsigned ii = 0; ii < tr_ident->
GetPrmsCount(); ii++ )
205 wxTextCtrl* ctl =
static_cast<wxTextCtrl*
>( prm->
m_ValueCtrl );
207 if( aPrmId == prm->
m_Id )
209 ctl->SetBackgroundColour( wxcol );
210 ctl->SetStyle( 0, -1, ctl->GetDefaultStyle() );
225#define MSG_CNT_MAX 10
229 wxASSERT( ( aLineNumber >= 0 ) && ( aLineNumber <
MSG_CNT_MAX ) );
231 if( aLineNumber < 0 )
237 messages[aLineNumber]->SetLabel( aText );
250 wxMessageBox( wxT(
"IsPrmSelected() error" ) );
A color representation with 4 components: red, green, blue, alpha.
wxStaticText * m_Message2
wxStaticText * m_Message9
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
wxStaticText * m_Message10
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()