QSet<qReal::Id> BlocksFactoryManager::visibleBlocks(const RobotModelInterface &robotModel) const { QSet<qReal::Id> result; const QString kitId = robotModel.kitId(); for (const RobotModelInterface *robotModel : mFactories.keys()) { if (robotModel && robotModel->kitId() == kitId) { for (const BlocksFactoryInterface * factory : factoriesFor(*robotModel)) { result += factory->providedBlocks().toSet(); } } } return result; }
TwoDRobotModel::TwoDRobotModel(const RobotModelInterface &realModel) : CommonRobotModel(realModel.kitId(), realModel.robotId()) , mRealModel(&realModel) , mEngine(nullptr) { for (const PortInfo &port : realModel.availablePorts()) { if (!port.name().toLower().contains("gamepad")) { addAllowedConnection(port, realModel.allowedDevices(port)); } } addAllowedConnection(PortInfo("MarkerPort", output), { markerInfo() }); }