本文整理汇总了C++中FOOTPRINT_WIZARD::SetParameterValues方法的典型用法代码示例。如果您正苦于以下问题:C++ FOOTPRINT_WIZARD::SetParameterValues方法的具体用法?C++ FOOTPRINT_WIZARD::SetParameterValues怎么用?C++ FOOTPRINT_WIZARD::SetParameterValues使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FOOTPRINT_WIZARD
的用法示例。
在下文中一共展示了FOOTPRINT_WIZARD::SetParameterValues方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ParametersUpdated
/**
* Function SelectCurrentFootprint
* Selects the current footprint name and display it
*/
void FOOTPRINT_WIZARD_FRAME::ParametersUpdated( wxGridEvent& event )
{
int page = m_pageList->GetSelection();
FOOTPRINT_WIZARD* footprintWizard = GetMyWizard();
if( !footprintWizard )
return;
if( page<0 )
return;
int n = m_parameterGrid->GetNumberRows();
wxArrayString arr;
wxArrayString ptList = footprintWizard->GetParameterTypes( page );
for( int i = 0; i<n; i++ )
{
wxString value = m_parameterGrid->GetCellValue( i, 1 );
// if this parameter is expected to be an internal
// unit convert it back from the user format
if( ptList[i]==wxT( "IU" ) )
{
LOCALE_IO toggle;
double dValue;
value.ToDouble( &dValue );
// convert from mils to inches where it's needed
if( g_UserUnit==INCHES )
dValue = dValue / 1000.0;
dValue = From_User_Unit( g_UserUnit, dValue );
value.Printf( wxT( "%f" ), dValue );
}
// If our locale is set to use , for decimal point, just change it
// to be scripting compatible
arr.Add( value );
}
wxString res = footprintWizard->SetParameterValues( page, arr );
ReloadFootprint();
DisplayWizardInfos();
}
示例2: ParametersUpdated
void FOOTPRINT_WIZARD_FRAME::ParametersUpdated( wxGridEvent& event )
{
int page = m_pageList->GetSelection();
FOOTPRINT_WIZARD* footprintWizard = GetMyWizard();
if( !footprintWizard )
return;
if( page < 0 )
return;
wxArrayString prmValues = footprintWizard->GetParameterValues( page );
wxArrayString ptList = footprintWizard->GetParameterTypes( page );
bool has_changed = false;
int count = m_parameterGrid->GetNumberRows();
// Skip extra event, useless
if( event.GetString() == m_parameterGrid->GetCellValue( event.GetRow(), m_columnPrmValue ) )
return;
for( int prm_id = 0; prm_id < count; ++prm_id )
{
wxString value = m_parameterGrid->GetCellValue( prm_id, m_columnPrmValue );
// if this parameter is expected to be an internal
// unit convert it back from the user format
if( ptList[prm_id]==wxT( "IU" ) )
{
// If our locale is set to use, for decimal point, just change it
// to be scripting compatible
LOCALE_IO toggle;
double dValue;
value.ToDouble( &dValue );
// convert from mils to inches where it's needed
if( g_UserUnit==INCHES )
dValue = dValue / 1000.0;
dValue = From_User_Unit( g_UserUnit, dValue );
// Internal units are int. Print them as int.
value.Printf( "%d", KiROUND( dValue ) );
if( prmValues[prm_id].EndsWith(".0") )
{
prmValues[prm_id].RemoveLast();
prmValues[prm_id].RemoveLast();
}
}
if( prmValues[prm_id] != value )
{
has_changed = true;
prmValues[prm_id] = value;
}
}
if( has_changed )
{
wxString res = footprintWizard->SetParameterValues( page, prmValues );
if( !res.IsEmpty() )
wxMessageBox( res );
ReloadFootprint();
DisplayWizardInfos();
}
}