当前位置: 首页>>代码示例>>C++>>正文


C++ qreal::PluginConfigurator类代码示例

本文整理汇总了C++中qreal::PluginConfigurator的典型用法代码示例。如果您正苦于以下问题:C++ PluginConfigurator类的具体用法?C++ PluginConfigurator怎么用?C++ PluginConfigurator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了PluginConfigurator类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: init

void UpdatesCheckerPlugin::init(qReal::PluginConfigurator const &configurator)
{
	mErrorReporter = configurator.mainWindowInterpretersInterface().errorReporter();
	mMainWindowWidget = configurator.mainWindowInterpretersInterface().windowWidget();
	initSettingsUi(*configurator.mainWindowInterpretersInterface().preferencesPages()["preferencesBehaviourPage"]);
	checkForUpdates(false);
}
开发者ID:AirVan21,项目名称:qreal,代码行数:7,代码来源:updatesCheckerPlugin.cpp

示例2: init

void GenerationRulesPlugin::init(const qReal::PluginConfigurator &configurator
		, qrRepo::LogicalRepoApi &metamodelRepoApi
		, qReal::EditorManagerInterface *editorManagerInterface)
{
	mRepo = &configurator.repoControlInterface();
	mMainWindowInterpretersInterface = &configurator.mainWindowInterpretersInterface();
	mLogicalModelAssistInterface = &configurator.logicalModelApi();

	mMetamodelRepoApi = &metamodelRepoApi;

	mEditorManagerInterface = editorManagerInterface;
}
开发者ID:Axroy,项目名称:qreal,代码行数:12,代码来源:generationRulesPlugin.cpp

示例3: init

void TrikRuCGeneratorPlugin::init(qReal::PluginConfigurator const &configurator
		, interpreterBase::robotModel::RobotModelManagerInterface const &robotModelManager
		, qrtext::LanguageToolboxInterface &textLanguage)
{
	RobotsGeneratorPluginBase::init(configurator, robotModelManager, textLanguage);
	mCommunicator = new utils::TcpRobotCommunicator("TrikTcpServer");
	mCommunicator->setErrorReporter(configurator.mainWindowInterpretersInterface().errorReporter());
}
开发者ID:AirVan21,项目名称:qreal,代码行数:8,代码来源:trikRuCGeneratorPlugin.cpp

示例4: init

void UXInfoPlugin::init(qReal::PluginConfigurator const &configurator)
{
	initSettingsUi(*configurator.mainWindowInterpretersInterface().preferencesPages()["preferencesBehaviourPage"]);

	connect(&configurator.systemEvents(), &qReal::SystemEvents::lowLevelEvent, this, &UXInfoPlugin::processEvent);

	connect(&configurator.systemEvents(), &qReal::SystemEvents::closedMainWindow, [=]() {
		UXInfo::instance()->closeUXInfo();
		int const finishTimestamp = QDateTime::currentMSecsSinceEpoch();
		QString const totalTime = QString::number((finishTimestamp - mStartTimestamp) / 1000);
		UXInfo::reportTotalTime(totalTime);
	});

	connect(&configurator.systemEvents(), &qReal::SystemEvents::graphicalElementAdded
			, [](qReal::Id const &id) { UXInfo::reportCreation(id.editor(), id.element()); });

	connect(&configurator.systemEvents(), &qReal::SystemEvents::informationAdded
			, [](QString const &message, qReal::Id const &position) {
		UXInfo::reportErrors("information", position.editor(), position.element(), message);
	});
	connect(&configurator.systemEvents(), &qReal::SystemEvents::warningAdded
			, [](QString const &message, qReal::Id const &position) {
		UXInfo::reportErrors("warning", position.editor(), position.element(), message);
	});
	connect(&configurator.systemEvents(), &qReal::SystemEvents::errorAdded
			, [](QString const &message, qReal::Id const &position) {
		UXInfo::reportErrors("error", position.editor(), position.element(), message);
	});
	connect(&configurator.systemEvents(), &qReal::SystemEvents::criticalAdded
			, [](QString const &message, qReal::Id const &position) {
		UXInfo::reportErrors("critical", position.editor(), position.element(), message);
	});

	QWidget * const windowWidget = configurator.mainWindowInterpretersInterface().windowWidget();
	static_cast<QMainWindow *>(windowWidget)->addToolBar(Qt::TopToolBarArea, mUsabilityTestingToolbar);
	mUsabilityTestingToolbar->setVisible(qReal::SettingsManager::value("usabilityTestingMode").toBool());

	for (QAction const *action : windowWidget->actions()) {
		if (action->isCheckable()) {
			connect(action, &QAction::triggered, &mFilterObject, &FilterObject::toggledActionActivated);
		} else {
			connect(action, &QAction::triggered, &mFilterObject, &FilterObject::triggeredActionActivated);
		}
	}
}
开发者ID:Antropovi,项目名称:qreal,代码行数:45,代码来源:uxInfoPlugin.cpp

示例5: initFactoriesFor

void RobotsPluginFacade::initFactoriesFor(QString const &kitId
		, interpreterBase::robotModel::RobotModelInterface const *model
		, qReal::PluginConfigurator const &configurer)
{
	// Pulling each robot model to each kit plugin with same ids. We need it for supporting
	// plugin-based blocks set extension for concrete roobt model.
	for (interpreterBase::KitPluginInterface * const kit : mKitPluginManager.kitsById(kitId)) {
		interpreterBase::blocksBase::BlocksFactoryInterface * const factory = kit->blocksFactoryFor(model);
		if (factory) {
			/// @todo Non-obvious dependency on mParser, which may or may not be constructed here.
			///       More functional style will be helpful here.
			factory->configure(configurer.graphicalModelApi()
					, configurer.logicalModelApi()
					, mRobotModelManager
					, *configurer.mainWindowInterpretersInterface().errorReporter()
					, *mParser
					);

			mBlocksFactoryManager.addFactory(factory, model);
		}
	}
}
开发者ID:AirVan21,项目名称:qreal,代码行数:22,代码来源:robotsPluginFacade.cpp

示例6: initKitPlugins

void RobotsPluginFacade::initKitPlugins(qReal::PluginConfigurator const &configurer)
{
	/// @todo: Check that this code works when different kit is selected
	for (QString const &kitId : mKitPluginManager.kitIds()) {
		for (interpreterBase::KitPluginInterface * const kit : mKitPluginManager.kitsById(kitId)) {
			kit->init(mEventsForKitPlugin, configurer.systemEvents(), configurer.graphicalModelApi()
					, configurer.logicalModelApi(), configurer.mainWindowInterpretersInterface(), *mInterpreter);

			for (interpreterBase::robotModel::RobotModelInterface const *model : kit->robotModels()) {
				initFactoriesFor(kitId, model, configurer);
				connect(&mEventsForKitPlugin, &interpreterBase::EventsForKitPluginInterface::interpretationStarted
						, model, &interpreterBase::robotModel::RobotModelInterface::onInterpretationStarted);
			}

			mDevicesConfigurationManager->connectDevicesConfigurationProvider(kit->devicesConfigurationProvider());
		}

		for (generatorBase::GeneratorKitPluginInterface * const generator : mKitPluginManager.generatorsById(kitId)) {
			generator->init(configurer, mRobotModelManager, *mParser);
		}
	}
}
开发者ID:AirVan21,项目名称:qreal,代码行数:22,代码来源:robotsPluginFacade.cpp

示例7: selectKit

bool RobotsPluginFacade::selectKit(qReal::PluginConfigurator const &configurer)
{
	/// @todo reinit it each time when robot model changes
	/// @todo: do we need this method?
	QString const selectedKit = qReal::SettingsManager::value("SelectedRobotKit").toString();
	if (selectedKit.isEmpty() && !mKitPluginManager.kitIds().isEmpty()) {
		qReal::SettingsManager::setValue("SelectedRobotKit", mKitPluginManager.kitIds()[0]);
	} else if (mKitPluginManager.kitIds().isEmpty()) {
		configurer.mainWindowInterpretersInterface().setEnabledForAllElementsInPalette(false);

		/// @todo Correctly handle unselected kit.
		return false;
	}

	return true;
}
开发者ID:AirVan21,项目名称:qreal,代码行数:16,代码来源:robotsPluginFacade.cpp

示例8: 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();
}
开发者ID:AirVan21,项目名称:qreal,代码行数:72,代码来源:robotsPluginFacade.cpp

示例9: 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 {
//.........这里部分代码省略.........
开发者ID:Ashatta,项目名称:qreal,代码行数:101,代码来源:robotsPluginFacade.cpp

示例10: init

void TestInvocationPlugin::init(const qReal::PluginConfigurator &configurator)
{
	mMainWindow = &(configurator.mainWindowInterpretersInterface());
}
开发者ID:ASabina,项目名称:qreal,代码行数:4,代码来源:testInvocationPlugin.cpp

示例11:

void TrikV6RuntimeUploaderPlugin::init(const qReal::PluginConfigurator &configurator)
{
	mUploaderTool.init(configurator.mainWindowInterpretersInterface());
}
开发者ID:ecolog,项目名称:qreal,代码行数:4,代码来源:trikV6RuntimeUploaderPlugin.cpp

示例12: init

void GenerationRulesPlugin::init(qReal::PluginConfigurator const &configurator, qrRepo::LogicalRepoApi &metamodelRepoApi)
{
	mRepo = &configurator.repoControlInterface();
	mMainWindowInterpretersInterface = &configurator.mainWindowInterpretersInterface();
	mMetamodelRepoApi = &metamodelRepoApi;
}
开发者ID:AirVan21,项目名称:qreal,代码行数:6,代码来源:generationRulesPlugin.cpp

示例13: init

void TrikRuntimeUploaderPlugin::init(const qReal::PluginConfigurator &configurator)
{
	mMainWindowInterface = &configurator.mainWindowInterpretersInterface();
}
开发者ID:dvvrd,项目名称:qreal,代码行数:4,代码来源:trikRuntimeUploaderPlugin.cpp

示例14: init

void ExterminatusPlugin::init(qReal::PluginConfigurator const &configurator)
{
	mRepo = &configurator.repoControlInterface();
	mMainWindowInterpretersInterface = &configurator.mainWindowInterpretersInterface();
}
开发者ID:Antropovi,项目名称:qreal,代码行数:5,代码来源:exterminatusPlugin.cpp


注:本文中的qreal::PluginConfigurator类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。