18.1 Skip to content

18. General Settings

18.1 TUFLOW Viewer Settings

This page provides details on the various options and settings that are available in TUFLOW Viewer Settings. The settings can be found under the QGIS menu: Plugins ► TUFLOW ► TUFLOW Viewer V2 ► TUFLOW Viewer Settings

18.2 Copy hdf5 Files Before Loading

Since QGIS 3.30, it is no longer possible to have the same XMDF open in QGIS that TUFLOW is actively writing results to. This is due to updates to the hdf5 library that now uses stricter permissions for files while they are open for writing.

To get around this limitation, the TUFLOW Viewer has the option to automatically copy files that use the hdf5 libraries (i.e. XMDF and NetCDF results) before loading. Copying the file means that QGIS and TUFLOW are not accessing the same file, eliminating the file access conflict. The results can be reloaded at any stage by using the "Reload Layer" tool in the TUFLOW plugin (located in the plugin toolbar). Note: Reloading XMDF format requires QGIS 3.42 or later.

This option can be toggled in the General tab.

The copy process is very fast if the source is on a local drive, however this option may not be suitable for users who are working with large results files on a network drive (depending on your network setup). There is also the possibility that if TUFLOW tries to write to a file while it is in the process of being copied, TUFLOW could fail to write the output. It should not cause a critical error, and TUFLOW will enter a retry loop to try to write to the file again, but it is something to be aware of.

18.3 Formats

The Formats tab shows all the different formats TUFLOW Viewer supports and also allows users to toggle the format off.

The load method describes how the result format is loaded into QGIS. This is for information only and cannot be changed by the user. It can be useful to understand for some formats as it can override the default behaviour in QGIS. For example, NetCDF grids are loaded when the file is dragged by the user and dropped into QGIS. This overrides the default drag and drop behaviour that QGIS already implements for NetCDF. Whereas TUFLOW Cross Sections (e.g. 1d_xs.shp files) are loaded "On Opened", which occurs after QGIS has finished loading the file. This means that TUFLOW Viewer is not overriding the default behaviour in QGIS in respect to opening this particular format.

Toggling the format off will prevent TUFLOW Viewer from loading that particular format. As stated in the above paragraph, this can be useful for some formats to prevent TUFLOW Viewer from overriding default behaviours in QGIS. For example, if it is desired to load NetCDF grids using the default drag and drop behaviour in QGIS, the NetCDF Grids format should be unchecked.

18.4 Debug

The Debug tab contains options that are used for debugging purposes.

Currently, the only option in this tab is to set the level of logging. The logging level will filter the amount of information that is logged to the Log Messages Panel. Typically, keeping the logging level at "Info" is sufficient for general use. However, setting the level to "Debug" can be useful when trying to troubleshoot an issue and may also be useful when working with TUFLOW Support to resolve an issue.

18.5 Cache

TUFLOW Viewer caches some settings and results to disk. For example, default styling for the XMDF format, and copied results if the "Copy hdf5 files before loading" option is enabled.

The cache directory is located in the home directory: home/.tuflow_plugin/tuflow_viewer. For Windows, this will be C:\users\<username>\.tuflow_plugin\tuflow_viewer. It is completely safe to delete the contents of this folder or any of the subfolders within it.

Copied results are not cleaned up by TUFLOW Viewer as results may be loaded again later, and it is faster not to have to copy the file again. However, this can cause the cache to grow quite large if many large results are copied. It may be a good idea to clean this folder periodically. A future version of the viewer may have an option to automatically clean up old copied files after a certain amount of time, and/or have an option to clear it via the settings menu. If the "Copy hdf5 files before loading" option is disabled, then the cache should not grow significantly in size.