diff --git a/componant/componant.cpp b/componant/componant.cpp index f7317a43d46b4dea8a43e21d3219842eb50cc6b9..e51760803f81c777a1019f3213c919045a21b0a5 100644 --- a/componant/componant.cpp +++ b/componant/componant.cpp @@ -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: diff --git a/eisgenerator/model.h b/eisgenerator/model.h index ef2cef020e5f69bf1f54f460379dc9cb21cccfa6..230a8a7b744adf7b1dcb1406188d798a89bc3e44 100644 --- a/eisgenerator/model.h +++ b/eisgenerator/model.h @@ -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. * diff --git a/model.cpp b/model.cpp index 6dedc7de4144b3b39d53bd5700a9235d46f21f39..6bb8de1e2ab207663eec8a819065cee38b2e0c46 100644 --- a/model.cpp +++ b/model.cpp @@ -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)