Workspace 6.21.5
|
Singleton class holding the settings for the Workspace. More...
#include <Workspace/Application/settings.h>
Static Public Member Functions | |
static Settings & | getInstance () |
Plugins can create their own settings class. The Settings class is only meant for the core workspace itself and should be considered read-only to all other code (ie all plugins).
using LogMessageCategoryMap = QMap<QString, bool> |
enum PluginAutoLoadPolicy |
Specifies how PluginManager will look for and load plugins automatically when it is created (typically during application startup). These options only take effect if set before the first use of PluginManager. Note that none of these options affect the behaviour of PluginManager::loadPlugin() or PluginManager::addPlugin() but rather only the plugins that PluginManager will automatically load by itself.
Enumerator | |
---|---|
AutoLoadNoPlugins | PluginManager should not auto-load any plugins. Only the built-in plugin will be loaded automatically (it cannot be disabled). |
AutoLoadAllPlugins | Any plugin that PluginManager finds can be loaded automatically. |
AutoLoadAllPluginsExceptExcluded | Any plugin that PluginManager finds can be loaded automatically unless it has been specifically excluded by calling setPluginNames/PathsToExclude(). The built-in plugin cannot be excluded. |
AutoLoadOnlySpecifiedPlugins | PluginManager can only auto-load a plugin if it appears in the list provided to setPluginsToAutoLoad(). The built-in plugin will always be loaded. |
AutoLoadOnlySchedulers | PluginManager should not auto-load any plugins. Only the built-in plugin and any plugins with schedulers/authenticators will be loaded automatically. |
enum SettingsVariable |
Settings variables. The user can not remove or rename these variables as they are used as defaults in workspace-gui and core operations.
Enumerator | |
---|---|
R | |
Matlab | |
FFmpeg | |
CMakeGui | |
Python | |
VisualStudioCmdPrompt | |
VisualStudioIDE | |
SampleWorkflows | |
VisualStudioCmdPromptParameters |
enum TimestampFormat |
|
strong |
|
default |
void addPluginPath | ( | const QString & | path | ) |
path | The plugin path to add to the list. It can be either a plugin library or a directory to search (non-recursively) for plugin libraries. |
This function only affects the plugin auto-load behaviour of PluginManager when the PluginManager singleton is constructed. It will have no effect if called after the first use of PluginManager.
void addToWorkspaceCollection | ( | const QString & | path, |
bool | saveable = true |
||
) |
path | The path to add to the workspace collection. It can be an absolute path to a local file, a URL or a Qt resource path. In all cases, it should point to a typical workspace XML file which can be loaded just like any other workspace file. Alternatively, the path can also be a directory on the local file system, in which case all XML files in that directory will be scanned and those that appear to be workspace XML files will be added to the collection. The directory is not scanned recursively. |
saveable | If true, then the specified path is added to the permanent set of paths stored in the workspace settings. If false, then the path will be used only for this running instance and will be discarded when the application terminates. |
void clearWorkflowTreePresets | ( | ) | const |
bool getAnnouncementCheckEnabled | ( | ) | const |
const QString & getApplicationName | ( | ) | const |
DataExecution::SerializedItem getApplicationSettings | ( | ) |
If the application name has been set, then an application-specific settings tree is available for loading and saving settings specific to that application. A separate settings file will be created for the application so that it does not interfere with the generic workspace settings or with other applications' settings. Applications are allowed to store whatever data they want, using whatever hierarchy they deem appropriate. When the settings are loaded by the application, the application-specific settings are also loaded. If the applciation name is set after the settings have already been loaded, then the application-specific settings are loaded immediately as part of setting the application name. Similarly, when the settings are saved, the application-specific settings are also saved.
int getArrowLocation | ( | ) | const |
bool getAutoSave | ( | ) |
int getAutoSaveInterval | ( | ) |
const QString & getBackupDirectory | ( | ) |
bool getBypass | ( | ) | const |
bool getCaptureMiniDump | ( | ) | const |
Settings::ConnectionRackVisibilityTrigger getConnectionRackVisibilityTrigger | ( | ) | const |
Settings::DependencyVisibilityPolicyFlags getDependencyVisibilityPolicy | ( | ) | const |
QString getDependencyVisibilityShortcutKeySequence | ( | ) | const |
bool getDeprecatedOperationsInCatalogueVisibility | ( | ) | const |
QMap< QString, QString > getDistributedLog | ( | const QString & | sinkName | ) | const |
sinkName | Name of the log sink. |
int getDockArea | ( | ) |
QString getDumpOutputFolder | ( | ) | const |
bool getExecProfileAllOpsIsEnabled | ( | ) | const |
bool getForwardProfilingEventsToDistributedLogManager | ( | ) | const |
bool getForwardTextLogToDistributedLogManager | ( | ) | const |
bool getGlobalNameDialogWidgetListVisibility | ( | ) | const |
QString getInstallBasePath | ( | ) | const |
The install base path is supposed to represent the directory below which all the workspace application's files are installed. Typical subdirectories below it will be bin, lib, images, styles, and so on. If the install base path is incorrectly set, many aspects of the workspace will not function properly, particularly the loading of workspace plugins.
|
static |
Plugin code should not change any of the settings. This should only be done by the workspace code. Plugin code is, however, allowed to read all settings.
int getLastAnnouncementId | ( | ) | const |
QString getLastStartupErrorCause | ( | ) | const |
|
inline |
bool getLogExecutionTimes | ( | ) | const |
Settings::LogMessageCategoryMap getLogMessageCategoryMap | ( | ) | const |
bool getLogOperationLinksAlways | ( | ) | const |
bool getLogOperationLinksVerbosely | ( | ) | const |
bool getLogPluginLoadErrors | ( | ) | const |
bool getLogTimestamp | ( | ) | const |
Settings::TimestampFormat getLogTimestampFormat | ( | ) | const |
Settings::MiniOperationVisibilityPolicy getMiniOperationVisibilityPolicy | ( | ) | const |
bool getMouseWheelZoomInForwards | ( | ) | const |
bool getNotifyProgress | ( | ) | const |
bool getOperationTimelineWidgetIsEnabled | ( | ) | const |
bool getPerformanceTimingEnabled | ( | ) | const |
Settings::PluginAutoLoadPolicy getPluginAutoLoadPolicy | ( | ) | const |
bool getPluginErrorTracking | ( | ) | const |
const QStringList & getPluginNamesToExclude | ( | ) | const |
const QStringList & getPluginPaths | ( | ) | const |
const QStringList & getPluginPathsToExclude | ( | ) | const |
DataExecution::SerializedItem getPluginSettings | ( | const QString & | pluginName | ) |
pluginName | The name of the plugin whose settings are to be retrieved. This name must match exactly with the value returned from the plugin's WorkspacePlugin::getName() function and the plugin must already be loaded (ie already added to the PluginManager). |
All plugins get their own branch of the tree which is not shared with any other plugin, nor with the workspace code itself. Plugins are allowed to store whatever data they want, using whatever hierarchy they deem appropriate. When the settings are loaded by the workspace during startup, the plugin data is also loaded automatically. Similarly, when the settings are saved, all the plugin data is also saved. It is allowable for plugins to call save() if they make changes to the settings and want to ensure that the data is written to the settings file, but this would normally be left to the workspace application to handle.
const QStringList & getPluginsToAutoLoad | ( | ) | const |
const QUuid & getProcessUuid | ( | ) | const |
|
inline |
bool getProfilerInfoLocalBroadcast | ( | ) | const |
Settings::PropertiesOnCreatePolicy getPropertiesOnCreatePolicy | ( | ) | const |
bool getQuiet | ( | ) | const |
bool getSchedulerLoggingIsEnabled | ( | ) | const |
const QString & getServiceName | ( | ) | const |
const QString & getSettingsDirectory | ( | ) | const |
const QString & getSettingsFileName | ( | ) | const |
bool getSettingsVariable | ( | const QString & | name, |
QString & | value | ||
) | const |
name | Name of settings variable. |
value | Output parameter for storing value of settings variable. |
QString getSettingsVariable | ( | SettingsVariable | type | ) | const |
type | Type of system settings variable. |
QStringList getSettingsVariableNameList | ( | ) | const |
bool getShowConnectionPortLabels | ( | ) | const |
bool getShowDeprecatedMessages | ( | ) | const |
bool getSkipLoadingDesigners | ( | ) | const |
QString getSoundEffectPath | ( | SoundEffect | effect | ) | const |
int getSoundEffectVolume | ( | ) | const |
bool getSplitLongLogLines | ( | ) | const |
const QStringList & getSymbolPathFolders | ( | ) | const |
bool getToggleDockableWidget | ( | ) | const |
bool getToggleOpProgressBars | ( | ) | const |
bool getTooltipEnabled | ( | ) | const |
|
inline |
QString getVersionSampleFilesCopyDialogDisplayed | ( | ) | const |
bool getWidgetsTriggerWorkflowUpdates | ( | ) | const |
QStringList getWorkflowTreePresetNames | ( | ) | const |
QVariant getWorkflowTreeSetting | ( | const QString & | presetName, |
WorkflowTree | setting | ||
) | const |
presetName | preset identifier |
setting | Workflow tree setting type. |
QVariant getWorkflowTreeSetting | ( | WorkflowTree | setting | ) | const |
QStringList getWorkspaceCollectionPaths | ( | bool | includeNonSaveable = true | ) | const |
includeNonSaveable | If true, then both saveable and non-saveable paths will be returned. When false, only the saveable paths are returned. This would mostly be used for code that needs to configure the collection paths and which will eventually cause the settings to be saved at some point. |
bool getWorkspaceServerLoggingIsEnabled | ( | ) | const |
bool getWorkspaceStatusTableIsEnabled | ( | ) | const |
bool isLoaded | ( | ) |
bool isServer | ( | ) | const |
bool load | ( | ) |
Loads the settings from the file identified by the currently set directory and file name. Any settings present in the file will overwrite the defaults. If a particular setting is not present in the file, the previous value (which is the default unless programatically changed before calling load()) will be retained.
true
), it would be unwise to call load() again. Such extra calls to load() may affect the stability of the application, since certain application-level objects load things from the settings during startup.void removeFromWorkspaceCollection | ( | const QString & | path | ) |
path | The path to remove from the workspace collection, if present. |
void removePluginPath | ( | const QString & | path | ) |
path | The plugin path to remove from the list, if present. |
bool save | ( | ) |
Saves the settings to the file identified by the currently set directory and file name. All settings are written, whether they are set to the default or something else.
The settings would normally have been previously loaded by a call to load(). While it is not an error to save before loading, doing so will discard all previous contents stored in the settings. This is mostly dangerous for plugins which store their own settings data, since the workspace knows nothing about those and will throw away all such data.
void setAnnouncementCheckEnabled | ( | bool | enable | ) |
void setApplicationName | ( | const QString & | appName | ) |
appName | Specifies a name for this application. This name should be relatively unique because it will be used as part of the name of the settings file for application-specific settings. It will often be the same as the name of the executable (without any .exe extension, etc). |
void setArrowLocation | ( | int | arrowLocation | ) |
void setAutoSave | ( | bool | b | ) |
b | state sets the auto-save feature |
void setAutoSaveInterval | ( | int | interval | ) |
interval | sets the auto-save interval |
void setBypass | ( | bool | b | ) |
b | If true, then calls to load() and save() will do nothing, but still return a success status (ie true ). |
Some uses of the workspace require that a known, controllable startup environment be used. An example of this would be a test case which needed to ensure that only specific plugins were loaded on startup. In order to allow this, clients can call setBypass() with b set to true
. This will prevent any settings file from being loaded or saved, which not only gives the default settings, it also ensures the user's existing settings are not modified.
void setCaptureMiniDump | ( | bool | val | ) |
val | Whether to allow capturing unhandled exception and create mini dump |
void setConnectionRackVisibilityTrigger | ( | ConnectionRackVisibilityTrigger | trigger | ) |
trigger | The trigger type, controlling when connection racks are shown. |
void setDependencyVisibilityPolicy | ( | DependencyVisibilityPolicyFlags | policy | ) |
policy | The desired visibility of dependency ports on operations. |
void setDeprecatedOperationsInCatalogueVisibility | ( | bool | visible | ) |
visible | True if deprecated operations are visible in the operation catalogue. |
void setDistributedLog | ( | const QString & | sinkName, |
const QMap< QString, QString > & | valueMap | ||
) |
sinkName | Name of the log sink. |
valueMap | Map of settings entries. |
void setDockArea | ( | int | area | ) |
area | Sets default creation area |
void setDumpOutputFolder | ( | const QString & | dumpOutputFolder | ) |
dumpOutputFolder | sets a path to where dump files should write to |
void setExecProfileAllOpsIsEnabled | ( | bool | enabled | ) |
enabled | True if the user wants to keep track of the execution time for all operations; otherwise false. |
void setForwardProfilingEventsToDistributedLogManager | ( | bool | forward | ) |
forward | true if the process is going to forward Profiling events from LogManager are all forwarded to DistributedLogManager. Some tools and unitest cases would prefer not to forward Profiling events to DistributedLogManager. Needs to set before DistributedLogManager gets instanced. |
void setForwardTextLogToDistributedLogManager | ( | bool | forward | ) |
forward | true if the process is going to forward text log from LogManager to DistributedLogManager. Some tools and unitest cases would prefer not to forward test log to DistributedLogManager. Needs to set before DistributedLogManager gets instanced. |
void setGlobalNameDialogWidgetListVisibility | ( | bool | visible | ) |
void setInstallBasePath | ( | const QString & | p | ) |
p | The new install base path. No trailing path separator should be included. |
void setIsServer | ( | bool | isServer | ) |
isServer | true if the process is going to be a workspace-server (or similar) which is not going to execute any workflow in local scheduler. It may still schedule workflows via OOP scheduler. No ExecutionTimekeeper or profiling collection service available in this case, though a workspace-server may still help passing profiling info between schedulers. e.g. pass data from OOP scheduler and store in MongoDB scheduler. |
void setLastAnnouncementId | ( | int | id | ) |
void setLastStartupErrorCause | ( | const QString & | pluginPath | ) |
pluginPath | sets a path that will be cleared unless application crashes on startup |
|
inline |
void setLogExecutionTimes | ( | bool | b | ) |
b | If true, then every time the workspace manages to bring all required things up to date, it will log a message to the main application log stating how long it took to perform the last update. If set to false, no such message will be logged. |
void setLogMessageCategoryMap | ( | const LogMessageCategoryMap & | categories | ) |
categories | A map of category name -> enabled flag. |
void setLogOperationLinksAlways | ( | bool | b | ) |
Whether or not operation links are automatically appended whenever an operation logs information.
void setLogOperationLinksVerbosely | ( | bool | b | ) |
b | If true, when Operation links are written to the log, their ID and Path information will be included. |
void setLogPluginLoadErrors | ( | bool | b | ) |
b | If false , then no plugin load error messages will be logged if a library fails to be loaded as a workspace plugin during the startup sequence. Setting this to true can be useful when a workspace plugin fails to load due to unresolved symbols during development. It would normally be set to false for most users. |
true
.void setLogTimestamp | ( | bool | b | ) |
b | If true, all log text would display a timestamp in log viewer. If set to false, no such prefix shown in the log viewer. |
void setLogTimestampFormat | ( | TimestampFormat | format | ) |
format | Format of timestamp appended to log. Supported formats are: UTC display in UTC timestamp, this is default. Local display in local timestamp LocalTime display in local time and with only time Elapse display elapse since the beginning time of execution. Setting invalid formats would fallback to default. |
void setMiniOperationVisibilityPolicy | ( | MiniOperationVisibilityPolicy | p | ) |
p | The desired visibility policy for WorkspaceInput, WorkspaceOutput and Variable operation types. |
void setMouseWheelZoomInForwards | ( | bool | b | ) |
b | If true, then moving the mouse wheel away from the user should result in zooming in and moving it towards the user should result in zooming out. If false, then the reverse is true. |
The workspace GUI obeys this setting for zooming on the workspace itself. Workspace plugins should also obey this setting where they make use of the mouse wheel in a way which notionally corresponds to some kind of zooming (eg interacting with a 3D scene).
void setNotifyProgress | ( | bool | b | ) |
b | If true, then operations are allowed to issue progress notifications. In some cases, this can cause a noticable degradation in performance, especially when observers responding to the notifications do so in a different thread (which is what widgets would typically do). If you want to maximize performance, turn off progress notifications by setting this parameter to false. |
void setOperationTimelineWidgetIsEnabled | ( | bool | enabled | ) |
enabled | True if the operation timeline widget should be enabled; otherwise false. |
void setPerformanceTimingEnabled | ( | bool | timingEnabled | ) |
void setPluginAutoLoadPolicy | ( | Settings::PluginAutoLoadPolicy | policy | ) |
policy | Specifies the plugin auto-load policy that PluginManager should use when it is first created. |
Some applications need to limit or prescribe the plugins that can be loaded on startup, which is where setPluginAutoLoadPolicy() is useful. If setPluginAutoLoadPolicy() is not called, the default behaviour is AutoLoadAllPluginsExceptExcluded.
The plugin auto-load behaviour specified by calling this function applies only to the currently running process. No change is made to the settings file, so the function needs to be called each time the application is run to obtain the nominated behaviour.
The workspace GUI is one example where a command-line option allows the user to disable plugin loading. This in turn allows the user to start up the application and configure the settings to permanently exclude unwanted plugins. This can be particularly useful if those plugins require licenses and their failure to load might result in the application being asked to terminate.
void setPluginErrorTracking | ( | bool | tracking | ) |
tracking | Specifies if pluginmanager should track error plugins to help prevent them from loading in the next run. |
By default, tracking error plugin is turned on. Changing this settings should before PluginManager instantiated to take effect.
void setPluginNamesToExclude | ( | const QStringList & | pluginNames | ) |
pluginNames | The names of the plugin libraries to exclude from PluginManager's plugin auto-loading process. |
void setPluginPaths | ( | const QStringList & | paths | ) |
paths | The paths to load as plugins or to search for plugins when the PluginManager is created. |
Some paths are automatically included by default and do not need to be included in paths.
This function only affects the plugin auto-load behaviour of PluginManager when the PluginManager singleton is constructed. It will have no effect if called after the first use of PluginManager.
void setPluginPathsToExclude | ( | const QStringList & | paths | ) |
paths | The file names of the plugin libraries to exclude from PluginManager's plugin auto-loading process. These should always be absolute paths. |
The paths passed to this function are saved to the settings file. This will result in all subsequently started Workspace applications being affected by the exclusions. This behaviour may be changed in the future.
void setPluginsToAutoLoad | ( | const QStringList & | pluginNames | ) |
pluginNames | The list of plugin names that PluginManager should auto-load. |
Calling this function also results in the plugin auto-load policy being set to AutoLoadOnlySpecifiedPlugins.
void setProfilerInfoLocalBroadcast | ( | bool | allowBroadcast | ) |
allowBroadcast | Let Execution Profiler broadcast the profiler process info to the localhost processes. This option is OFF by default and should be turned ON when using the Profiler tool (as an example of a subscriber) to know which processes are actively monitoring their execution profiling. Note that only the profiler process info is broadcast, not the execution profiling data which is sent (unicast only) to the process (or processes) that subscribe(s) to that profiler. |
void setPropertiesOnCreatePolicy | ( | PropertiesOnCreatePolicy | policy | ) |
policy | The policy for when / if to create properties dialogs when operations are created. |
void setQuiet | ( | bool | b | ) |
b | If false, then whenever a workspace plugin is added to the PluginManager, an informational message will be output. If b is true, then no message is output. This is most useful when the workspace library is being used as part of another application and the loading of plugin libraries should be hidden from the user. |
void setSchedulerLoggingIsEnabled | ( | bool | b | ) |
b | If true, then the scheduler outputs log trace. |
void setServiceName | ( | const QString & | serviceName | ) |
serviceName | Specifies a service name for this application. This name should be the same as its parent application. For example an application started by workspace-server should use a same service name as the workspace-server. The service name would be used to keep track of instance of server. A free standing application not started by any server should have service name left empty. |
void setSettingsDirectory | ( | const QString & | dir | ) |
dir | The directory that holds all the settings files. |
The main workspace settings file will be assumed to reside in dir. Plugins should also use this directory for their own settings files.
void setSettingsFileName | ( | const QString & | fileName | ) |
fileName | The file name of the settings file, without path. |
The main workspace settings file will be assumed to reside in the directory returned by getSettingsDirectory(). The actual name of the settings file will be set to fileName. Plugins must not use this file name for their own settings, as this will overwrite the workspace settings and lead to potentially unexpected behaviour.
bool setSettingsVariable | ( | const QString & | name, |
const QString & | value | ||
) |
name | Name of settings variable. |
value | Value of settings variable. |
void setSettingsVariable | ( | SettingsVariable | type, |
const QString & | value | ||
) |
type | Type of system settings variable. |
value | Value of system settings variable. |
void setShowConnectionPortLabels | ( | bool | b | ) |
b | If true, labels will be displayed next to each connection port that is displayed in the UI. This means that when operations are being inspected, the names of their inputs / outputs will be visible on the workspace canvas. |
void setShowDeprecatedMessages | ( | bool | b | ) |
void setSkipLoadingDesigners | ( | bool | skipLoadingDesigners | ) |
skipLoadingDesigners | Whether designers should be loaded or not. |
By default desingers will be loaded when needed. Some applications may not have the need of loading them, setting this could help make those application free of locking the plugins in developing plugins.
void setSoundEffectPath | ( | SoundEffect | effect, |
const QString & | path | ||
) |
effect | Effect type |
path | Path to the sound effect file. |
void setSoundEffectVolume | ( | int | volume | ) |
volume | Sound effect volume (0 - 100) |
void setSplitLongLogLines | ( | bool | split | ) |
Set to split long log lines to avoid UI performance issue.
void setSymbolPathFolders | ( | const QStringList & | folders | ) |
folders | sets paths to where symbol files locate |
bool settingsFileExists | ( | ) | const |
void setToggleDockableWidget | ( | bool | b | ) |
b | If true, state of DisplayWidgets being created is set to Dockable |
void setToggleOpProgressBars | ( | bool | checked | ) |
void setTooltipEnabled | ( | bool | enabled | ) |
enabled | True if canvas tooltips are enabled |
|
inline |
void setVersionSampleFilesCopyDialogDisplayed | ( | const QString & | version | ) |
version | Version format: major.minor |
void setWidgetsTriggerWorkflowUpdates | ( | bool | widgetsTriggerUpdates | ) |
widgetsTriggerUpdates | True if widgets should trigger updates on the workflow. |
void setWorkflowTreeSetting | ( | const QString & | presetName, |
WorkflowTree | setting, | ||
const QVariant & | value | ||
) | const |
presetName | presetName identifier |
setting | Workflow tree setting type. |
value | The value of the setting. |
void setWorkflowTreeSetting | ( | WorkflowTree | setting, |
const QVariant & | value | ||
) | const |
setting | Workflow tree setting type. |
value | The value of the setting. |
void setWorkspaceCollectionPaths | ( | const QStringList & | paths | ) |
paths | The paths to use for the workspace collection. These will be saveable paths and all non-saveable paths will be cleared. It is not possible to set the non-saveable paths directly, only by calling addToWorkspaceCollection(). |
void setWorkspaceServerLoggingIsEnabled | ( | bool | b | ) |
b | If true, then the remote scheduler outputs log trace. |
void setWorkspaceStatusTableIsEnabled | ( | bool | enabled | ) |
enabled | True if the workspace status table should be enabled; otherwise false. |