本文整理汇总了C++中qreal::PluginConfigurator::projectManager方法的典型用法代码示例。如果您正苦于以下问题:C++ PluginConfigurator::projectManager方法的具体用法?C++ PluginConfigurator::projectManager怎么用?C++ PluginConfigurator::projectManager使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类qreal::PluginConfigurator
的用法示例。
在下文中一共展示了PluginConfigurator::projectManager方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: init
void RobotsPluginFacade::init(qReal::PluginConfigurator const &configurer)
{
mRobotSettingsPage = new ui::RobotsSettingsPage(mKitPluginManager, mRobotModelManager);
mDevicesConfigurationManager.reset(new DevicesConfigurationManager(
configurer.graphicalModelApi()
, configurer.logicalModelApi()
, configurer.mainWindowInterpretersInterface()
, configurer.systemEvents()
));
if (!selectKit(configurer)) {
/// @todo Correctly handle unselected kit.
return;
}
mParser.reset(new textLanguage::RobotsBlockParser(mRobotModelManager
, [this]() { return mInterpreter ? mInterpreter->timeElapsed() : 0; }));
interpreterBase::blocksBase::BlocksFactoryInterface * const coreFactory = new coreBlocks::CoreBlocksFactory();
coreFactory->configure(configurer.graphicalModelApi()
, configurer.logicalModelApi()
, mRobotModelManager
, *configurer.mainWindowInterpretersInterface().errorReporter()
, *mParser
);
mBlocksFactoryManager.addFactory(coreFactory);
interpreter::Interpreter *interpreter = new interpreter::Interpreter(
configurer.graphicalModelApi()
, configurer.logicalModelApi()
, configurer.mainWindowInterpretersInterface()
, configurer.projectManager()
, mBlocksFactoryManager
, mRobotModelManager
, *mParser
, mActionsManager.connectToRobotAction()
);
mInterpreter = interpreter;
connect(&configurer.systemEvents(), &qReal::SystemEvents::closedMainWindow
, mInterpreter, &interpreter::InterpreterInterface::stopRobot);
connect(&mRobotModelManager, &RobotModelManager::robotModelChanged
, mInterpreter, &interpreter::InterpreterInterface::stopRobot);
initKitPlugins(configurer);
initSensorWidgets();
auto paletteUpdateManager = new PaletteUpdateManager(configurer.mainWindowInterpretersInterface()
, mBlocksFactoryManager, this);
connect(&mRobotModelManager, &RobotModelManager::robotModelChanged
, paletteUpdateManager, &PaletteUpdateManager::updatePalette);
mDevicesConfigurationManager->connectDevicesConfigurationProvider(interpreter);
// It will subscribe to all signals itself and free memory too.
new KitAutoSwitcher(configurer.projectManager(), configurer.logicalModelApi()
, mBlocksFactoryManager, mKitPluginManager, mRobotModelManager, this);
connectInterpreterToActions();
connectEventsForKitPlugin();
connect(&mActionsManager.robotSettingsAction(), &QAction::triggered
, [=] () { configurer.mainWindowInterpretersInterface().openSettingsDialog(tr("Robots")); });
connect(&configurer.systemEvents(), &qReal::SystemEvents::activeTabChanged
, &mActionsManager, &ActionsManager::onActiveTabChanged);
sync();
}
示例2: init
void RobotsPluginFacade::init(const qReal::PluginConfigurator &configurer)
{
mActionsManager.init(&configurer.mainWindowInterpretersInterface());
mRobotSettingsPage = new ui::RobotsSettingsPage(mKitPluginManager, mRobotModelManager
, configurer.logicalModelApi());
connect(&configurer.systemEvents(), &qReal::SystemEvents::activeTabChanged
, mRobotSettingsPage, &ui::RobotsSettingsPage::onProjectOpened);
mDevicesConfigurationManager.reset(new DevicesConfigurationManager(
configurer.graphicalModelApi()
, configurer.logicalModelApi()
, configurer.mainWindowInterpretersInterface()
, configurer.projectManager()
));
if (!selectKit(configurer)) {
/// @todo Correctly handle unselected kit.
return;
}
mParser.reset(new textLanguage::RobotsBlockParser(mRobotModelManager
, [this]() { return mInterpreter ? mInterpreter->timeElapsed() : 0; }));
kitBase::blocksBase::BlocksFactoryInterface * const coreFactory = new coreBlocks::CoreBlocksFactory();
coreFactory->configure(configurer.graphicalModelApi()
, configurer.logicalModelApi()
, mRobotModelManager
, *configurer.mainWindowInterpretersInterface().errorReporter()
, *mParser
);
mBlocksFactoryManager.addFactory(coreFactory);
mUiManager.reset(new UiManager(mActionsManager.debugModeAction()
, mActionsManager.editModeAction()
, configurer.mainWindowDockInterface()
, configurer.systemEvents()
, mEventsForKitPlugin
, mRobotModelManager));
interpreter::Interpreter *interpreter = new interpreter::Interpreter(
configurer.graphicalModelApi()
, configurer.logicalModelApi()
, configurer.mainWindowInterpretersInterface()
, configurer.projectManager()
, mBlocksFactoryManager
, mRobotModelManager
, *mParser
, mActionsManager.connectToRobotAction()
);
mInterpreter = interpreter;
connect(&configurer.systemEvents(), &qReal::SystemEvents::closedMainWindow
, mInterpreter, &interpreter::InterpreterInterface::userStopRobot);
connect(&mRobotModelManager, &RobotModelManager::robotModelChanged
, mInterpreter, &interpreter::InterpreterInterface::userStopRobot);
initKitPlugins(configurer);
initSensorWidgets();
auto paletteUpdateManager = new PaletteUpdateManager(configurer.mainWindowInterpretersInterface()
, mBlocksFactoryManager, this);
connect(&mRobotModelManager, &RobotModelManager::robotModelChanged
, paletteUpdateManager, &PaletteUpdateManager::updatePalette);
mDevicesConfigurationManager->connectDevicesConfigurationProvider(interpreter);
// It will subscribe to all signals itself and free memory too.
new KitAutoSwitcher(configurer.projectManager(), configurer.logicalModelApi()
, mBlocksFactoryManager, mKitPluginManager, mRobotModelManager, this);
mSaveAsTaskManager.reset(new ExerciseExportManager(configurer.logicalModelApi()
, configurer.repoControlInterface(), configurer.projectManager()));
connectInterpreterToActions();
connectEventsForKitPlugin();
connect(&mActionsManager.robotSettingsAction(), &QAction::triggered
, [=] () { configurer.mainWindowInterpretersInterface().openSettingsDialog(tr("Robots")); });
connect(&configurer.systemEvents(), &qReal::SystemEvents::activeTabChanged
, &mActionsManager, &ActionsManager::onActiveTabChanged);
// Just to capture them, not configurer.
qReal::ProjectManagementInterface &projectManager = configurer.projectManager();
qReal::gui::MainWindowInterpretersInterface &mainWindow = configurer.mainWindowInterpretersInterface();
qReal::GraphicalModelAssistInterface &graphicalModel = configurer.graphicalModelApi();
connect(&mActionsManager.homeAction(), &QAction::triggered, [&projectManager, &mainWindow, &graphicalModel]() {
if (projectManager.somethingOpened()) {
for (const qReal::Id &diagram : graphicalModel.children(qReal::Id::rootId())) {
if (diagram.type() == qReal::Id("RobotsMetamodel", "RobotsDiagram", "RobotsDiagramNode")) {
mainWindow.activateItemOrDiagram(diagram);
return;
}
}
} else {
//.........这里部分代码省略.........