本文整理汇总了C++中Parm::set_from_link方法的典型用法代码示例。如果您正苦于以下问题:C++ Parm::set_from_link方法的具体用法?C++ Parm::set_from_link怎么用?C++ Parm::set_from_link使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Parm
的用法示例。
在下文中一共展示了Parm::set_from_link方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ReadPHolderListDES
void PHolderListMgr::ReadPHolderListDES( char *newfile )
{
FILE *fp;
fp = fopen( newfile, "r" );
char temp[255];
fgets( temp, 255, fp );
Stringc line = temp;
int nparm = line.convert_to_integer();
if( nparm > 0 )
{
pHolderListMgrPtr->DelAllPHolders();
vector< Geom* > gVec = aircraftPtr->getGeomVec();
gVec.push_back( aircraftPtr->getUserGeom() );
for ( int i = 0 ; i < nparm ; i++ )
{
fgets( temp, 255, fp );
line = temp;
int istart = 0;
int iend = line.search_for_substring(':');
int id = line.get_range( istart, iend-1 ).convert_to_integer();
istart = iend + 1;
iend = line.search_for_substring( istart, ':' );
istart = iend + 1;
iend = line.search_for_substring( istart, ':' );
Stringc group = line.get_range( istart, iend-1 );
istart = iend + 1;
iend = line.search_for_substring( istart, ':' );
Stringc parm = line.get_range( istart, iend-1 );
istart = iend + 1;
iend = line.get_length();
double val = line.get_range( istart, iend-1 ).convert_to_double();
Parm* p = parmMgrPtr->FindParm( gVec, id, group, parm );
if ( p )
{
p->set_from_link( val );
p->get_geom()->parm_changed( p );
ParmHolder* ph = new ParmHolder();
ph->setParm( p );
m_PHolderVec.push_back( ph );
m_CurrPHolderIndex = (int)m_PHolderVec.size() - 1;
}
}
}
fclose( fp );
}
示例2: ReadPHolderListXDDM
void PHolderListMgr::ReadPHolderListXDDM( char *newfile )
{
pHolderListMgrPtr->DelAllPHolders();
//==== Read Xml File ====//
xmlDocPtr doc;
xmlNodePtr node;
LIBXML_TEST_VERSION
xmlKeepBlanksDefault(0);
//==== Build an XML tree from a the file ====//
doc = xmlParseFile(newfile);
// if (doc == NULL) return 0;
xmlNodePtr root = xmlDocGetRootElement(doc);
if (root == NULL)
{
fprintf(stderr,"empty document\n");
xmlFreeDoc(doc);
// return 0;
}
vector< Geom* > gVec = aircraftPtr->getGeomVec();
gVec.push_back( aircraftPtr->getUserGeom() );
vector< xmlNodePtr > vlist;
int num_v = xmlGetNumNames( root, "Variable" );
for ( int i = 0 ; i < num_v ; i++ )
{
xmlNodePtr var_node = xmlGetNode( root, "Variable", i );
vlist.push_back( var_node );
}
int num_c = xmlGetNumNames( root, "Constant" );
for ( int i = 0 ; i < num_c ; i++ )
{
xmlNodePtr cst_node = xmlGetNode( root, "Constant", i );
vlist.push_back( cst_node );
}
int num_tot = num_v + num_c;
for ( int i = 0 ; i < num_tot ; i++ )
{
xmlNodePtr var_node = vlist[i];
if ( var_node )
{
Stringc varname = Stringc( xmlFindPropString( var_node, "VSPVarName", " " ) );
int istart = 0;
int iend = varname.search_for_substring(':');
int id = varname.get_range( istart, iend-1 ).convert_to_integer();
istart = iend + 1;
iend = varname.search_for_substring( istart, ':' );
istart = iend + 1;
iend = varname.search_for_substring( istart, ':' );
Stringc group = varname.get_range( istart, iend-1 );
istart = iend + 1;
iend = varname.get_length();
Stringc parm = varname.get_range( istart, iend-1 );
Parm* p = parmMgrPtr->FindParm( gVec, id, group, parm );
if ( p )
{
double val = xmlFindPropDouble( var_node, "Value", p->get() );
p->set_from_link( val );
p->get_geom()->parm_changed( p );
ParmHolder* ph = new ParmHolder();
ph->setParm( p );
const xmlChar* varstr = (xmlChar*) "Variable";
if( !xmlStrcmp(var_node->name, varstr ) )
ph->setDesType( XDDM_VAR );
else
ph->setDesType( XDDM_CONST );
m_PHolderVec.push_back( ph );
m_CurrPHolderIndex = (int)m_PHolderVec.size() - 1;
}
}
}
//===== Free Doc =====//
xmlFreeDoc( doc );
// return 1;
}