Script

Qualified name: mv::util::Script

class Script : public QObject

Script class.

Contains information for running a script

Author

Thomas Kroes

Public Types

enum class Type

Script types.

Values:

enumerator None
enumerator Loader

Not a valid script type.

enumerator Writer

Data loading scripts.

enumerator Analysis

Data writer scripts.

enumerator Transformation

Data analysis scripts.

enumerator View

Data transformation scripts.

Data view scripts

enum class Language

Script language.

Values:

enumerator None
enumerator Python

Not a valid script language.

enumerator R

Python scripting.

R scripting

Public Functions

explicit Script(const QString &title, const Type &type, const Language &language, const Version &languageVersion, const QString &location, QObject *parent = nullptr)

Construct script with type and language.

Parameters:
  • titleScript title

  • typeScript type

  • languageScript language

  • languageVersionVersion of the scripting language

  • locationScript location

  • datasets – List of datasets that the script can work with

  • parent – Pointer to parent object (optional, default is nullptr)

explicit Script(const QString &title, const Type &type, const Language &language, const Version &languageVersion, const QString &location, const Datasets &datasets, QObject *parent = nullptr)

Construct script with type and language.

Parameters:
  • titleScript title

  • typeScript type

  • languageScript language

  • languageVersionVersion of the scripting language

  • locationScript location

  • datasets – List of datasets that the script can work with

  • parent – Pointer to parent object (optional, default is nullptr)

explicit Script(const QString &title, const Type &type, const Language &language, const Version &languageVersion, const QString &location, const DataTypes &dataTypes, QObject *parent = nullptr)

Construct script with type and language.

Parameters:
  • titleScript title

  • typeScript type

  • languageScript language

  • languageVersionVersion of the scripting language

  • locationScript location

  • datasets – List of datasets that the script can work with

  • parent – Pointer to parent object (optional, default is nullptr)

virtual void run()

Runs the script.

inline Type getType() const

Get script title.

inline QString getTypeName() const

Get script type.

inline Language getLanguage() const

Get script type name.

inline Version getLanguageVersion() const

Get script language.

inline QString getLocation() const

Get script language version.

inline Datasets getDatasets() const

Get script location.

inline DataTypes getDataTypes() const

Get script datasets.

QIcon getLanguageIcon() const

Get script compatible data types.

inline void setTitle(const QString &title)

Get icon representing the scripting language.

inline void setType(const Type &type)

Set script title.

inline void setLanguage(const Language &language)

Set script type.

inline void setLanguageVersion(const Version &languageVersion)

Set script language.

inline void setLocation(const QString &location)

Set script language version.

inline void setDatasets(const Datasets &datasets)

Set script location.

inline void setDataTypes(const DataTypes &dataTypes)

Set script datasets.

Public Static Functions

static QString getTypeName(const Type &type)

Get the type name from type.

Parameters:

type – Type enum

Returns:

Script type name

static Type getTypeEnum(const QString &typeName)

Get type enum from typeName.

Parameters:

typeName – Type name

Returns:

Script type enum

static QString getLanguageName(const Language &language)

Get the language name from language.

Parameters:

language – Language enum

Returns:

Language name

static Language getLanguageEnum(const QString &languageName)

Get language enum from language name.

Parameters:

languageName – Language name

Returns:

Language enum

Public Static Attributes

static QMap<Type, QString> typeMap

Maps type to type name.

static QMap<Language, QString> languageMap

Maps language enum to language name.