Skip to content
Snippets Groups Projects
Commit 3fbec27e authored by Carl Philipp Klemm's avatar Carl Philipp Klemm
Browse files

model: add method to get parameter uniquie names

parent 86ce9a62
No related branches found
No related tags found
No related merge requests found
......@@ -167,15 +167,10 @@ bool Componant::isValidComponantChar(char componantCh)
switch(componantCh)
{
case Cap::staticGetComponantChar():
return true;
case Resistor::staticGetComponantChar():
return true;
case Inductor::staticGetComponantChar():
return true;
case Cpe::staticGetComponantChar():
return true;
case Warburg::staticGetComponantChar():
return true;
case FiniteTransmitionline::staticGetComponantChar():
return true;
default:
......
......@@ -214,6 +214,13 @@ public:
*/
std::vector<Range> getDefaultParameters();
/**
* @brief Gets the names of all the parameters in this model
*
* @return The names of all the parameters in this model.
*/
std::vector<std::string> getParameterNames();
/**
* @brief Gets the total number of parameters used by all the circuit elements in this model.
*
......
......@@ -239,6 +239,21 @@ std::vector<Range> Model::getDefaultParameters()
return out;
}
std::vector<std::string> Model::getParameterNames()
{
std::vector<Componant*> flatComponants = getFlatComponants();
std::vector<std::string> out;
out.reserve(getParameterCount());
for(Componant* componant : flatComponants)
{
for(size_t i = 0; i < componant->paramCount(); ++i)
out.push_back(componant->getUniqueName() + "_" + std::to_string(i));
}
return out;
}
DataPoint Model::execute(fvalue omega, size_t index)
{
if(_model)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment