Beispiel #1
0
	void Executer::executeCurrentAction()
	{
		//Skip disabled actions
		if(mCurrentActionIndex >= 0)
		{
			while(mCurrentActionIndex < mScript->actionCount() && canExecuteAction(mCurrentActionIndex) != CanExecute)
				++mCurrentActionIndex;
		}

		if(mCurrentActionIndex < 0 || mCurrentActionIndex >= mScript->actionCount())
		{
			stopExecution();
			return;
		}

        int nextLine = mCurrentActionIndex + 2;
		if(nextLine > mScript->actionCount())
			nextLine = -1;

		QScriptValue script = mScriptEngine->globalObject().property("Script");
		script.setProperty("nextLine", mScriptEngine->newVariant(QVariant(nextLine)));
        script.setProperty("line", mCurrentActionIndex + 1, QScriptValue::ReadOnly);

		ActionTools::ActionInstance *actionInstance = currentActionInstance();

        const ActionTools::ExceptionActionInstancesHash &exceptionActionInstancesHash = actionInstance->exceptionActionInstances();
        const ActionTools::ActionException::ExceptionActionInstance &exceptionAction = exceptionActionInstancesHash.value(ActionTools::ActionException::CodeErrorException);
        mShowDebuggerOnCodeError = (exceptionAction.action() == ActionTools::ActionException::StopExecutionExceptionAction);

		mExecutionWindow->setCurrentActionName(actionInstance->definition()->name());
		mExecutionWindow->setCurrentActionColor(actionInstance->color());

		connect(actionInstance, SIGNAL(executionEnded()), this, SLOT(actionExecutionEnded()));
		connect(actionInstance, SIGNAL(executionException(int,QString)), this, SLOT(executionException(int,QString)));
		connect(actionInstance, SIGNAL(disableAction(bool)), this, SLOT(disableAction(bool)));
		connect(actionInstance, SIGNAL(showProgressDialog(QString,int)), this, SLOT(showProgressDialog(QString,int)));
		connect(actionInstance, SIGNAL(updateProgressDialog(int)), this, SLOT(updateProgressDialog(int)));
		connect(actionInstance, SIGNAL(updateProgressDialog(QString)), this, SLOT(updateProgressDialog(QString)));
		connect(actionInstance, SIGNAL(hideProgressDialog()), this, SLOT(hideProgressDialog()));
		connect(actionInstance, SIGNAL(consolePrint(QString)), this, SLOT(consolePrint(QString)));
		connect(actionInstance, SIGNAL(consolePrintWarning(QString)), this, SLOT(consolePrintWarning(QString)));
		connect(actionInstance, SIGNAL(consolePrintError(QString)), this, SLOT(consolePrintError(QString)));
		
		mExecutionStatus = PrePause;

		mExecutionTimer.start();
		mExecutionTime.start();
		if(currentActionInstance()->pauseBefore() + mPauseBefore > 0)
		{
			mExecutionWindow->setProgressEnabled(true);
			mExecutionWindow->setProgressMinimum(0);
			mExecutionWindow->setProgressMaximum(currentActionInstance()->pauseBefore() + mPauseBefore);
			mExecutionWindow->setProgressValue(0);
		}
		else
			mExecutionWindow->setProgressEnabled(false);

		mExecutionEnded = true;
	}
bool KviPackageWriter::pack(const QString & szFileName, kvi_u32_t uPackFlags)
{
	m_p->iCurrentProgress = 0;
	if(!(uPackFlags & NoProgressDialog))
	{
		showProgressDialog(__tr2qs("Creating package..."), 100);
		updateProgress(m_p->iCurrentProgress, __tr2qs("Writing package header"));
	}

	bool bRet = packInternal(szFileName, uPackFlags);

	hideProgressDialog();
	return bRet;
}
Beispiel #3
0
MainWindow::MainWindow(QThread *atermThread):
  m_fileDialog("", this)
{
  m_ui.setupUi(this);

  m_ltsManager = new LtsManager(this, &m_settings, atermThread);
  m_markManager = new MarkManager(this, m_ltsManager);

  m_infoDock = new InfoDock(this, m_ltsManager, m_markManager);
  m_markDock = new MarkDock(this, m_markManager);
  m_simDock = new SimDock(this, m_ltsManager);
  m_settingsDock = new SettingsDock(this, &m_settings);
  m_settingsDialog = new SettingsDialog(this, &m_settings);
  m_ltsCanvas = new LtsCanvas(this, &m_settings, m_ltsManager, m_markManager);
  setCentralWidget(m_ltsCanvas);
  m_progressDialog = new QProgressDialog("", QString(), 0, 6, this);
  m_progressDialog->setMinimumDuration(0);

  m_ui.informationDock->setWidget(m_infoDock);
  m_ui.simulationDock->setWidget(m_simDock);
  m_ui.markDock->setWidget(m_markDock);
  m_ui.settingsDock->setWidget(m_settingsDock);

  m_ui.viewMenu->insertAction(m_ui.preferences, m_ui.informationDock->toggleViewAction());
  m_ui.viewMenu->insertAction(m_ui.preferences, m_ui.simulationDock->toggleViewAction());
  m_ui.viewMenu->insertAction(m_ui.preferences, m_ui.markDock->toggleViewAction());
  m_ui.viewMenu->insertAction(m_ui.preferences, m_ui.settingsDock->toggleViewAction());
  m_ui.viewMenu->insertSeparator(m_ui.preferences);

  mcrl2::log::logger::register_output_policy(m_logRelay);
  connect(&m_logRelay, SIGNAL(logMessage(QString, QString, QDateTime, QString)), this, SLOT(logMessage(QString, QString, QDateTime, QString)));

  connect(m_ui.open, SIGNAL(triggered()), this, SLOT(open()));
  connect(m_ui.openTrace, SIGNAL(triggered()), this, SLOT(openTrace()));
  connect(m_ui.exportBitmap, SIGNAL(triggered()), this, SLOT(exportBitmap()));
  connect(m_ui.exportText, SIGNAL(triggered()), this, SLOT(exportText()));
  connect(m_ui.exportVector, SIGNAL(triggered()), this, SLOT(exportVector()));
  connect(m_ui.exit, SIGNAL(triggered()), QApplication::instance(), SLOT(quit()));

  connect(m_ui.resetViewpoint, SIGNAL(triggered()), m_ltsCanvas, SLOT(resetView()));
  connect(m_ui.zoomIntoAbove, SIGNAL(triggered()), m_ltsManager, SLOT(zoomInAbove()));
  connect(m_ui.zoomIntoBelow, SIGNAL(triggered()), m_ltsManager, SLOT(zoomInBelow()));
  connect(m_ui.zoomOut, SIGNAL(triggered()), m_ltsManager, SLOT(zoomOut()));

  connect(m_ui.displayStates, SIGNAL(triggered(bool)), &m_settings.displayStates, SLOT(setValue(bool)));
  connect(&m_settings.displayStates, SIGNAL(changed(bool)), m_ui.displayStates, SLOT(setChecked(bool)));
  connect(m_ui.displayTransitions, SIGNAL(triggered(bool)), &m_settings.displayTransitions, SLOT(setValue(bool)));
  connect(&m_settings.displayTransitions, SIGNAL(changed(bool)), m_ui.displayTransitions, SLOT(setChecked(bool)));
  connect(m_ui.displayBackpointers, SIGNAL(triggered(bool)), &m_settings.displayBackpointers, SLOT(setValue(bool)));
  connect(&m_settings.displayBackpointers, SIGNAL(changed(bool)), m_ui.displayBackpointers, SLOT(setChecked(bool)));
  connect(m_ui.displayWireframe, SIGNAL(triggered(bool)), &m_settings.displayWireframe, SLOT(setValue(bool)));
  connect(&m_settings.displayWireframe, SIGNAL(changed(bool)), m_ui.displayWireframe, SLOT(setChecked(bool)));

  connect(m_ui.preferences, SIGNAL(triggered()), m_settingsDialog, SLOT(show()));

  connect(m_ltsManager, SIGNAL(loadingLts()), this, SLOT(loadingLts()));
  connect(m_ltsManager, SIGNAL(rankingStates()), this, SLOT(rankingStates()));
  connect(m_ltsManager, SIGNAL(clusteringStates()), this, SLOT(clusteringStates()));
  connect(m_ltsManager, SIGNAL(computingClusterInfo()), this, SLOT(computingClusterInfo()));
  connect(m_ltsManager, SIGNAL(positioningClusters()), this, SLOT(positioningClusters()));
  connect(m_ltsManager, SIGNAL(positioningStates()), this, SLOT(positioningStates()));
  connect(m_ltsManager, SIGNAL(ltsStructured()), this, SLOT(hideProgressDialog()));
  connect(m_ltsManager, SIGNAL(errorLoadingLts()), this, SLOT(hideProgressDialog()));
  connect(m_ltsManager, SIGNAL(startStructuring()), this, SLOT(startStructuring()));
  connect(m_ltsManager, SIGNAL(stopStructuring()), this, SLOT(stopStructuring()));

  connect(m_ltsManager, SIGNAL(selectionChanged()), this, SLOT(selectionChanged()));
  connect(m_ltsManager, SIGNAL(ltsZoomed(LTS *)), this, SLOT(zoomChanged()));
  m_ui.zoomIntoAbove->setEnabled(false);
  m_ui.zoomIntoBelow->setEnabled(false);
  m_ui.zoomOut->setEnabled(false);

  connect(m_ltsCanvas, SIGNAL(renderingStarted()), this, SLOT(startRendering()));
  connect(m_ltsCanvas, SIGNAL(renderingFinished()), this, SLOT(clearStatusBar()));

  QSettings settings("mCRL2", "LTSView");
  restoreGeometry(settings.value("geometry").toByteArray());
  restoreState(settings.value("windowState").toByteArray());
}
bool KviPackageReader::unpack(const QString & szLocalFileName, const QString & szUnpackPath, kvi_u32_t uUnpackFlags)
{
	bool bRet = unpackInternal(szLocalFileName, szUnpackPath, uUnpackFlags);
	hideProgressDialog();
	return bRet;
}