All Parms in OpenVSP are stored in Parm Containers. The functions in this group can be used to work with Parm Containers through the API. Click here to return to the main page.
More...
◆ AddUserParm()
| std::string vsp::AddUserParm |
( |
int | type, |
|
|
const std::string & | name, |
|
|
const std::string & | group ) |
|
extern |
Function to add a new user Parm of input type, name, and group
if ( length.length() == 0 || length == "NONE" )
{
Print( "ERROR: AddUserParm returned no id" );
__failure++;
}
std::string AddUserParm(int type, const std::string &name, const std::string &group)
void SetParmDescript(const std::string &parm_id, const std::string &desc)
double SetParmValLimits(const std::string &parm_id, double val, double lower_limit, double upper_limit)
- See also
- PARM_TYPE
- Parameters
-
| [in] | type | int Parm type enum (i.e. PARM_DOUBLE_TYPE) |
| [in] | name | string Parm name |
| [in] | group | string Parm group |
- Returns
- string Parm ID
◆ DeleteAllUserParm()
| void vsp::DeleteAllUserParm |
( |
| ) |
|
|
extern |
Delete all user created Parms. The predefined User_0 through User_15 Parms belong to the vehicle and are not removed.
{
Print( "ERROR: AddUserParm" );
__failure++;
}
{
Print( "ERROR: DeleteAllUserParm" );
__failure++;
}
◆ DeleteUserParm()
| void vsp::DeleteUserParm |
( |
const std::string & | id | ) |
|
|
extern |
Get the user parm container ID
if ( int( id_arr.size() ) > n )
{
{
Print( "ERROR: DeleteUserParm removed nothing" );
__failure++;
}
}
std::vector< std::string > GetAllUserParms()
void DeleteUserParm(const std::string &id)
int GetNumPredefinedUserParms()
◆ FindContainer()
| std::string vsp::FindContainer |
( |
const std::string & | name, |
|
|
int | index ) |
|
extern |
Get the ID of a Parm Container with specified name at input index
if ( veh_id.length() == 0 )
{
Print( "ERROR: FindContainer found nothing" );
__failure++;
}
std::string FindContainer(const std::string &name, int index)
- See also
- FindContainersWithName
- Parameters
-
| [in] | name | string Parm Container name |
| [in] | index | int Parm Container index |
- Returns
- string Parm Container ID
◆ FindContainerGroupNames()
| std::vector< std::string > vsp::FindContainerGroupNames |
( |
const std::string & | parm_container_id | ) |
|
|
extern |
Get an array of Parm group names included in the specified Container
if ( grp_arr.length() == 0 )
{
Print( "ERROR: FindContainerGroupNames found nothing" );
__failure++;
}
Print( "---> UserParms Container Group IDs: " );
for ( int i = 0; i < int( grp_arr.size() ); i++ )
{
string message = "\t" + grp_arr[i] + "\n";
Print( message );
}
std::vector< std::string > FindContainerGroupNames(const std::string &parm_container_id)
- Parameters
-
| [in] | parm_container_id | string Parm Container ID |
- Returns
- vector<string> Array of Parm group names
◆ FindContainerParmIDs()
| std::vector< std::string > vsp::FindContainerParmIDs |
( |
const std::string & | parm_container_id | ) |
|
|
extern |
Get an array of Parm IDs included in the specified Container
string parm_container_id =
FindContainer( parm_container_name, struct_ind );
if ( parm_ids.length() == 0 )
{
Print( "ERROR: FindContainerParmIDs found nothing" );
__failure++;
}
for ( uint i = 0; i < uint(parm_ids.length()); i++ )
{
string name_id =
GetParmName( parm_ids[i] ) + string(
": ") + parm_ids[i] + string(
"\n");
Print( name_id );
}
std::string GetFeaStructName(const std::string &geom_id, int fea_struct_ind)
int AddFeaStruct(const std::string &geom_id, bool init_skin=true, int surfindex=0)
std::string AddGeom(const std::string &type, const std::string &parent=std::string())
std::vector< std::string > FindContainerParmIDs(const std::string &parm_container_id)
std::string GetParmName(const std::string &parm_id)
- Parameters
-
| [in] | parm_container_id | string Parm Container ID |
- Returns
- vector<string> Array of Parm IDs
◆ FindContainers()
| std::vector< std::string > vsp::FindContainers |
( |
| ) |
|
|
extern |
Get an array of all Parm Container IDs
if ( ctr_arr.length() == 0 )
{
Print( "ERROR: FindContainers found nothing" );
__failure++;
}
Print( "---> API Parm Container IDs: " );
for ( int i = 0; i < int( ctr_arr.size() ); i++ )
{
string message = "\t" + ctr_arr[i] + "\n";
Print( message );
}
std::vector< std::string > FindContainers()
- Returns
- vector<string> Array of Parm Container IDs
◆ FindContainersWithName()
| std::vector< std::string > vsp::FindContainersWithName |
( |
const std::string & | name | ) |
|
|
extern |
Get an array of Parm Container IDs for Containers with the specified name
if ( ctr_arr.length() == 0 )
{
Print( "ERROR: FindContainersWithName found nothing" );
__failure++;
}
if ( ctr_arr.size() > 0 ) { Print( ( "UserParms Parm Container ID: " + ctr_arr[0] ) ); }
std::vector< std::string > FindContainersWithName(const std::string &name)
- Parameters
-
| [in] | name | string Parm Container name |
- Returns
- vector<string> Array of Parm Container IDs
◆ GetAllUserParms()
| std::vector< std::string > vsp::GetAllUserParms |
( |
| ) |
|
|
extern |
Get the vector of id's for all user parameters
if ( id_arr.length() == 0 )
{
Print( "ERROR: GetAllUserParms returned nothing" );
__failure++;
}
Print( "---> User Parm IDs: " );
for ( int i = 0; i < int( id_arr.size() ); i++ )
{
string message = "\t" + id_arr[i] + "\n";
Print( message );
}
- Returns
- vector <string> Array of user parameter ids
◆ GetNumPredefinedUserParms()
| int vsp::GetNumPredefinedUserParms |
( |
| ) |
|
|
extern |
Get the number of pre-defined user parameters
if ( n <= 0 )
{
Print( "ERROR: GetNumPredefinedUserParms" );
__failure++;
}
- Returns
- int Number of pre-defined user Parms
◆ GetNumUserParms()
| int vsp::GetNumUserParms |
( |
| ) |
|
|
extern |
Get the number of user parameters
{
Print( "ERROR: GetNumUserParms disagrees with the user Parm list" );
__failure++;
}
{
Print( "ERROR: GetNumUserParms did not follow AddUserParm" );
__failure++;
}
- Returns
- int Number of user Parms
◆ GetUserParmContainer()
| std::string vsp::GetUserParmContainer |
( |
| ) |
|
|
extern |
Get the user parm container ID
if ( up_id.length() == 0 )
{
Print( "ERROR: GetUserParmContainer returned nothing" );
__failure++;
}
std::string GetUserParmContainer()
- Returns
- string User parm container ID
◆ GetVehicleID()
| std::string vsp::GetVehicleID |
( |
| ) |
|
|
extern |
Get the ID of the Vehicle Parm Container
if ( veh_id.length() == 0 )
{
Print( "ERROR: GetVehicleID returned nothing" );
__failure++;
}
std::string GetVehicleID()
- Returns
- string Vehicle ID
◆ SetContainerName()
| void vsp::SetContainerName |
( |
const std::string & | parm_container_id, |
|
|
const std::string & | name ) |
|
extern |
Get the name of the specified Parm Container
if ( GetContainerName( veh_id ) != "Vehicle" ) { Print( "---> Error: API GetContainerName" ); __failure++; }
- Parameters
-
| [in] | parm_container_id | string Parm Container ID |
- Returns
- string Parm Container name
Set the name of the specified Parm Container. This is the general counterpart to GetContainerName and works on any container reached by ID. Containers that derive their name from what they hold, such as an unsteady group, will overwrite it on their next update.
if ( GetContainerName( pid ) != "ExampleContainerName" )
{
Print( "ERROR: SetContainerName did not take" );
__failure++;
}
{
Print( "ERROR: SetContainerName disagrees with GetGeomName" );
__failure++;
}
if ( GetNumTotalErrors() == 0 )
{
Print( "ERROR: SetContainerName accepted a bad container ID" );
__failure++;
}
while ( GetNumTotalErrors() > 0 )
{
}
std::string GetGeomName(const std::string &geom_id)
void SetContainerName(const std::string &parm_container_id, const std::string &name)
- See also
- GetContainerName, FindContainer
- Parameters
-
| [in] | parm_container_id | string Parm Container ID |
| [in] | name | string Parm Container name |