Skip to content

Commit

Permalink
fix(core): Fix grouping parameters
Browse files Browse the repository at this point in the history
(cherry picked from commit 91dcb2f686de5d3113975c212e52bcadb607893a)
  • Loading branch information
vasylskorych committed Dec 3, 2024
1 parent 168e44d commit a73ebfa
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ModelsAPI/BaseUnit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,11 @@ void CBaseUnit::AddParametersToGroup(const std::string& _unitParamNameSelector,
m_unitParameters.AddParametersToGroup(_unitParamNameSelector, _unitParamSelectedValueName, _groupedParamNames);
}

void CBaseUnit::AddParametersToGroup(const std::string& _unitParamNameSelector, const char* _unitParamSelectedValueName, const std::vector<std::string>& _groupedParamNames)
{
AddParametersToGroup(_unitParamNameSelector, std::string(_unitParamSelectedValueName), _groupedParamNames);
}

void CBaseUnit::AddParametersToGroup(const std::string& _unitParamNameSelector, bool _unitParamSelectedValue, const std::vector<std::string>& _groupedParamNames)
{
const auto* groupParameter = m_unitParameters.GetCheckboxParameter(_unitParamNameSelector);
Expand Down
9 changes: 9 additions & 0 deletions ModelsAPI/BaseUnit.h
Original file line number Diff line number Diff line change
Expand Up @@ -693,6 +693,15 @@ class CBaseUnit
* \param _groupedParamNames Names of other unit parameters that will be shown if \p _unitParamSelectedValueName is selected.
*/
void AddParametersToGroup(const std::string& _unitParamNameSelector, const std::string& _unitParamSelectedValueName, const std::vector<std::string>& _groupedParamNames);
/**
* \brief Groups the specified unit parameters.
* \details Allows to hide some parameters depending on the selected value of a combobox unit parameter.
* The parameter, its value and all the adding parameters must already exist. If something does not exist, logic_error exception is thrown.
* \param _unitParamNameSelector Name of the target combobox unit parameter.
* \param _unitParamSelectedValueName Selected value of the target combobox unit parameter.
* \param _groupedParamNames Names of other unit parameters that will be shown if \p _unitParamSelectedValueName is selected.
*/
void AddParametersToGroup(const std::string& _unitParamNameSelector, const char* _unitParamSelectedValueName, const std::vector<std::string>& _groupedParamNames);
/**
* \brief Groups the specified unit parameters.
* \details Allows to hide some parameters depending on the selected value of a checkbox unit parameter.
Expand Down

0 comments on commit a73ebfa

Please sign in to comment.