Skip to content

Commit

Permalink
Fix problem with current configuration (#1581)
Browse files Browse the repository at this point in the history
  • Loading branch information
IKhonakhbeeva committed Sep 12, 2022
1 parent 6224f82 commit f02e280
Showing 1 changed file with 9 additions and 2 deletions.
Expand Up @@ -425,8 +425,15 @@ QString GeneratorFactoryBase::isrHooksCode()
QMap<PortInfo, DeviceInfo> GeneratorFactoryBase::currentConfiguration() const
{
auto worldModel = mRepo.metaInformation("worldModel").toString();
const auto id = mRobotModelManager.model().robotId();
auto robotConfig = RobotModelUtils::deserializeFromWorldModel(worldModel)[id];
const auto curId = mRobotModelManager.model().robotId();
auto robotsConfig = RobotModelUtils::deserializeFromWorldModel(worldModel);
QMap<PortInfo, DeviceInfo> robotConfig;
for (const auto &id : robotsConfig.keys()) {
if (id.startsWith(curId.left(3))) {
robotConfig = robotsConfig[id];
break;
}
}
// At the moment we have sensors configuration from widget-configurer. We must also add here non-configurable
// by user devices (like encoders, displays and so on).
for (const PortInfo &port : mRobotModelManager.model().availablePorts()) {
Expand Down

0 comments on commit f02e280

Please sign in to comment.