diff --git a/source/RobotAPI/libraries/skills_gui/skill_details/SkillDetailsTreeWidget.cpp b/source/RobotAPI/libraries/skills_gui/skill_details/SkillDetailsTreeWidget.cpp index 57b150a1866b55037145e9b5cd7bb18d39ebc3e6..4cf1ffffa87376456f17ac2d022bfd03484ac116 100644 --- a/source/RobotAPI/libraries/skills_gui/skill_details/SkillDetailsTreeWidget.cpp +++ b/source/RobotAPI/libraries/skills_gui/skill_details/SkillDetailsTreeWidget.cpp @@ -34,6 +34,21 @@ namespace armarx::skills::gui // dont touch the widget if the skill id didn't change if (shownSkill.has_value() && skillId == shownSkill.value().skillId) return; + + // check the parameters: did they change? + if (shownSkill.has_value()) + { + auto remDesc = shownSkill.value().skillDescr; + if (descr.rootProfileDefaults != remDesc.rootProfileDefaults) + { + // TODO: ask the user if they want to reset to defaults + // for now, we just overwrite without asking... (and do nothing) + } + // other cases: if the parameter types change, we *have* to reset; else the skill + // (probably) can't be started with the parameters. + // same goes for the result type. + } + this->resetWidget(); auto aron_args = descr.parametersType; diff --git a/source/RobotAPI/libraries/skills_gui/skill_details/SkillDetailsTreeWidget.h b/source/RobotAPI/libraries/skills_gui/skill_details/SkillDetailsTreeWidget.h index 277be11e97b2085e63f089e27cf6eb4922d2ed63..d10855dbc49f64be0533382043fbdf57d5f9b6d1 100644 --- a/source/RobotAPI/libraries/skills_gui/skill_details/SkillDetailsTreeWidget.h +++ b/source/RobotAPI/libraries/skills_gui/skill_details/SkillDetailsTreeWidget.h @@ -39,8 +39,6 @@ namespace armarx::skills::gui std::optional<ShownSkill> shownSkill; - // check for update - skills::SkillDescription shownDescription; AronTreeWidgetControllerPtr aronTreeWidgetController = nullptr; void setupUi(); };