Workspace 6.21.5
Static Public Member Functions | List of all members
WorkflowToolUtil Class Reference

General class for utility functions across the Workflow Tool set.

#include <Tools/WorkflowComparison/workflowtoolutil.h>

Static Public Member Functions

static void addToolLogCategories ()
 
static QMap< QString, bool > disableLogs (const QList< Application::LogManager::MessageCategory > &logTypes)
 
static QString generateIdFromConnection (const DataExecution::Connection &conn)
 
static QString generateIdFromConnectionData (const ConnectionData &connectionData)
 
static QString generateIdFromConnectionDifference (const OperationDifference &opDiff, const ConnectionDifference &connDiff)
 
static QString generateIdFromInputDifference (const OperationDifference &opDiff, const InputDifference &inputDiff, const InputDifference *parentDiff=nullptr)
 
static QString generateIdFromIOBase (const DataExecution::IOBase &iobase)
 
static QString generateIdFromIOBase (const QString &opId, const QString &ioName, int index=-1)
 
static QString generateIdFromOutputDifference (const OperationDifference &opDiff, const OutputDifference &outputDiff)
 
static bool isKnownWorkspaceType (const QString &type)
 Returns true if this operation type is known to be a nested workspace.
 
static bool isWorkspaceType (const DataExecution::Operation &op)
 Returns the result of Operation::isWorkspaceType()
 
static QStringList loadApplicationColourNames (Application::Settings &settings)
 Loads a list of the names of the application colours which can be set by the user.
 
static QMap< QString, QColor > loadApplicationColours (Application::Settings &settings)
 Loads all the application's colours from the application settings.
 
static QColor loadColour (const QString &name, const QString &defaultValue, Application::Settings &settings)
 loads a colour stored as hex in settings, if not currently in settings will use the defaultSetting and save that to settings
 
static QMap< QString, QColor > loadColours (const QString &tag, Application::Settings &settings)
 Loads a set of application colours, where the colourSectionTag defines whcih colours should be loaded.
 
static QMap< QString, QColor > loadDefaultColours (Application::Settings &settings)
 Loads all the default application colours from the application settings.
 
static void restoreLogState (const QMap< QString, bool > &origValues)
 
static bool saveColour (const QString &name, const QString &value, Application::Settings &settings)
 Saves a colour to the current colour setting group, overwrites the value if it already exists.
 
static QString toString (DifferenceType)
 
static DifferenceType typeFromString (const QString &str)
 

Member Function Documentation

◆ addToolLogCategories()

void addToolLogCategories ( )
static

◆ disableLogs()

QMap< QString, bool > disableLogs ( const QList< Application::LogManager::MessageCategory > &  logTypes)
static
Parameters
logTypesThe category of message to write to the log
Returns
The original state, so that they can be restored

Disables categories of logs so that the log output is not cluttered with irrelevant error messages

See also
restoreLogState

◆ generateIdFromConnection()

QString generateIdFromConnection ( const DataExecution::Connection connection)
static
Returns
A unique identifier for a connection.
See also
generateIdFromConnectionDifference

◆ generateIdFromConnectionData()

QString generateIdFromConnectionData ( const ConnectionData connectionData)
static
Returns
A unique identifier for this set of identifying data.

◆ generateIdFromConnectionDifference()

QString generateIdFromConnectionDifference ( const OperationDifference opDiff,
const ConnectionDifference connDiff 
)
static
Returns
A unique identifier for this connection difference.

◆ generateIdFromInputDifference()

QString generateIdFromInputDifference ( const OperationDifference opDiff,
const InputDifference inputDiff,
const InputDifference parentDiff = nullptr 
)
static
Returns
A unique identifier for this input difference.

◆ generateIdFromIOBase() [1/2]

QString generateIdFromIOBase ( const DataExecution::IOBase iobase)
static
Returns
A unique identifier for an iobase using its operation's UUID and its name.

◆ generateIdFromIOBase() [2/2]

QString generateIdFromIOBase ( const QString &  opId,
const QString &  ioName,
int  index = -1 
)
static
Returns
A unique identifier for an iobase using its operation's UUID and its name.

◆ generateIdFromOutputDifference()

QString generateIdFromOutputDifference ( const OperationDifference opDiff,
const OutputDifference outputDiff 
)
static
Returns
A unique identifier for this output difference.

◆ isKnownWorkspaceType()

bool isKnownWorkspaceType ( const QString &  type)
static

◆ isWorkspaceType()

bool isWorkspaceType ( const DataExecution::Operation op)
static

This operation also builds up an internal map of Workspace types that can be accessed later by WorkflowTools that cannot call isWorkspaceType directly

See also
WorkflowToolUtil::isKnownWorkspaceType(const QString& type)

◆ loadApplicationColourNames()

QStringList loadApplicationColourNames ( Application::Settings settings)
static
Parameters
settingsApplication settings
Returns
A list of the names of the colours (as used by the application)

◆ loadApplicationColours()

QMap< QString, QColor > loadApplicationColours ( Application::Settings settings)
static
Parameters
settingsApplication settings
Returns
A map where the key is the (local) colour name

◆ loadColour()

QColor loadColour ( const QString &  name,
const QString &  defaultValue,
Application::Settings settings 
)
static
Parameters
nameidentifier to be used for this colour's use eg "FileA_border"
defaultValueColour to use if colour "name" not defined, in hex format eg "#FFFFD0"
settingsthe applications Settings member

◆ loadColours()

QMap< QString, QColor > loadColours ( const QString &  colourSectionTag,
Application::Settings settings 
)
static
Parameters
colourSectionTagtag distinguishin one set of colors from the other (can be defaultsolours or appcolours)
settingsApplication settings
Returns
A map where the key is the (local) colour name

◆ loadDefaultColours()

QMap< QString, QColor > loadDefaultColours ( Application::Settings settings)
static
Parameters
settingsApplication settings
Returns
A map where the key is the (local) colour name

◆ restoreLogState()

void restoreLogState ( const QMap< QString, bool > &  origValues)
static
Parameters
origValuesThe original states of the log categories before they were disabled

Restores the enabled states categories of logs overridden by the disableLogs call

See also
disableLogs

◆ saveColour()

bool saveColour ( const QString &  name,
const QString &  value,
Application::Settings settings 
)
static
Parameters
nameName by which the colour is known by the app
valueThe value of the colour in hex format
settingsApplication settings

◆ toString()

QString toString ( DifferenceType  type)
static

◆ typeFromString()

DifferenceType typeFromString ( const QString &  str)
static