コード例 #1
0
ファイル: robotsPlugin.cpp プロジェクト: MariaLitvinova/qreal
void RobotsPlugin::init(PluginConfigurator const &configurator)
{
	details::Tracer::debug(details::tracer::initialization, "RobotsPlugin::init", "Initializing plugin");
	mInterpreter.init(configurator.graphicalModelApi()
			, configurator.logicalModelApi()
			, configurator.mainWindowInterpretersInterface());
	mMainWindowInterpretersInterface = &configurator.mainWindowInterpretersInterface();
	details::Tracer::debug(details::tracer::initialization, "RobotsPlugin::init", "Initializing done");
}
コード例 #2
0
void VisualInterpreterPlugin::init(PluginConfigurator const &configurator)
{
	mErrorReporter = configurator.mainWindowInterpretersInterface().errorReporter();

	mMetamodelGeneratorSupport = new MetamodelGeneratorSupport(
			configurator.mainWindowInterpretersInterface().errorReporter()
			, &configurator.mainWindowInterpretersInterface());

	mVisualInterpreterUnit = new VisualInterpreterUnit(configurator.logicalModelApi()
			, configurator.graphicalModelApi()
			, configurator.mainWindowInterpretersInterface());
}
コード例 #3
0
ファイル: visualDebuggerPlugin.cpp プロジェクト: Esenin/qreal
void VisualDebuggerPlugin::init(PluginConfigurator const &configurator)
{
	mErrorReporter = configurator.mainWindowInterpretersInterface().errorReporter();
	mParser = new BlockParser(mErrorReporter);

	mVisualDebugger = new VisualDebugger(configurator.logicalModelApi()
			, configurator.graphicalModelApi()
			, configurator.mainWindowInterpretersInterface()
			, mParser
	);

	mDebuggerConnector = new DebuggerConnector(this);
}
コード例 #4
0
ファイル: robotsPlugin.cpp プロジェクト: IrinaShkviro/qreal
void RobotsPlugin::init(PluginConfigurator const &configurator)
{
	details::Tracer::debug(details::tracer::initialization, "RobotsPlugin::init", "Initializing plugin");
	mInterpreter.init(configurator.graphicalModelApi()
			, configurator.logicalModelApi()
			, configurator.mainWindowInterpretersInterface()
			, configurator.projectManager());
	mMainWindowInterpretersInterface = &configurator.mainWindowInterpretersInterface();
	mSceneCustomizer = &configurator.sceneCustomizer();
	SettingsManager::setValue("IndexGrid", gridWidth);
	mCustomizer.placePluginWindows(mInterpreter.watchWindow(), produceSensorsConfigurer());
	rereadSettings();
	connect(mRobotSettingsPage, SIGNAL(saved()), this, SLOT(rereadSettings()));
	details::Tracer::debug(details::tracer::initialization, "RobotsPlugin::init", "Initializing done");
}
コード例 #5
0
void VisualDebuggerPlugin::init(PluginConfigurator const &configurator)
{
	mErrorReporter = configurator.mainWindowInterpretersInterface().errorReporter();
	mParser = new BlockParser(mErrorReporter);

	mVisualDebugger = new VisualDebugger(configurator.logicalModelApi()
			, configurator.graphicalModelApi()
			, configurator.mainWindowInterpretersInterface()
			, mParser
	);

	mDebuggerConnector = new DebuggerConnector(this);

	connect(&configurator.systemEvents(), SIGNAL(activeTabChanged(Id)), this, SLOT(activeTabChanged(qReal::Id)));
}
コード例 #6
0
ファイル: refactoringPlugin.cpp プロジェクト: Anna-/qreal
void RefactoringPlugin::init(PluginConfigurator const &configurator)
{
	mErrorReporter = configurator.mainWindowInterpretersInterface().errorReporter();
	mLogicalModelApi = &configurator.logicalModelApi();
	mGraphicalModelApi = &configurator.graphicalModelApi();

	mMetamodelGeneratorSupport = new MetamodelGeneratorSupport(
			configurator.mainWindowInterpretersInterface().errorReporter()
			, &configurator.mainWindowInterpretersInterface());
	mRepoControlIFace = &configurator.repoControlInterface();
	mMainWindowIFace = &configurator.mainWindowInterpretersInterface();
	mQRealSourceFilesPath = SettingsManager::value("qrealSourcesLocation", "").toString();
	mQRealSourceFilesPath = SettingsManager::value("qrealSourcesLocation").toString();
	mPathToRefactoringExamples = mQRealSourceFilesPath + "/plugins/refactoring/refactoringExamples/";

	mRefactoringWindow = new RefactoringWindow(mMainWindowIFace->windowWidget());
	connect(mRefactoringWindow, SIGNAL(rejected()), this, SLOT(discardRefactoring()));

	mRefactoringRepoApi = new qrRepo::RepoApi(mQRealSourceFilesPath + "/plugins/refactoring/refactoringExamples", true);
	mRefactoringFinder = new RefactoringFinder(configurator.logicalModelApi()
			, configurator.graphicalModelApi()
			, configurator.mainWindowInterpretersInterface()
			, mRefactoringRepoApi);

	connect(mRefactoringWindow, SIGNAL(findButtonClicked(QString)), this, SLOT(findRefactoring(QString)));
	connect(mRefactoringWindow, SIGNAL(findNextButtonClicked()), this, SLOT(findNextRefactoring()));
	connect(mRefactoringWindow, SIGNAL(discardButtonClicked()), this, SLOT(discardRefactoring()));
	connect(mRefactoringWindow, SIGNAL(applyButtonClicked()), this, SLOT(applyRefactoring()));

	mRefactoringApplier = new RefactoringApplier(configurator.logicalModelApi()
			, configurator.graphicalModelApi()
			, configurator.mainWindowInterpretersInterface()
			, mRefactoringRepoApi
			, &mCurrentMatch);
}
コード例 #7
0
ファイル: robotsPluginFacade.cpp プロジェクト: Anna-/qreal
bool RobotsPluginFacade::selectKit(PluginConfigurator const &configurer)
{
	/// @todo reinit it each time when robot model changes
	/// @todo: do we need this method?
	QString const selectedKit = SettingsManager::value("SelectedRobotKit").toString();
	if (selectedKit.isEmpty() && !mKitPluginManager.kitIds().isEmpty()) {
		SettingsManager::setValue("SelectedRobotKit", mKitPluginManager.kitIds()[0]);
	} else if (mKitPluginManager.kitIds().isEmpty()) {
		configurer.mainWindowInterpretersInterface().setEnabledForAllElementsInPalette(false);

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

	return true;
}
コード例 #8
0
ファイル: robotsPluginFacade.cpp プロジェクト: Anna-/qreal
void RobotsPluginFacade::initFactoriesFor(QString const &kitId
		, interpreterBase::robotModel::RobotModelInterface const *model
		, 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);
		}
	}
}
コード例 #9
0
void MetaEditorSupportPlugin::init(PluginConfigurator const &configurator)
{
    mMainWindowInterface = &configurator.mainWindowInterpretersInterface();
    mLogicalRepoApi = &configurator.logicalModelApi().mutableLogicalRepoApi();
    mRepoControlApi = &configurator.repoControlInterface();
}
コード例 #10
0
void HascolSupportPlugin::init(PluginConfigurator const &configurator)
{
	mMainWindowInterface = &configurator.mainWindowInterpretersInterface();
	mLogicalRepoApi = &configurator.logicalModelApi().mutableLogicalRepoApi();
}