Skip to content

Config

Bases: object

Config class provides information for global configuration.

This class handles the loading, saving, and management of the global configuration for the Inscoper API, including driver lists, device configurations, and log levels.

__init__()

Default constructor.

Initializes a new instance of the Config class with default values.

fromXML(xml)

Provide configuration information from an XML node.

Loads the configuration settings from the specified XML node.

Parameters:

Name Type Description Default
xml XMLNode

an XML node containing configuration information

required

Raises:

Type Description
InscoperException

if an error occurred

toXML(xmlParent)

Export configuration information in an XML node attached to the parent XML node.

Saves the current configuration settings to the specified parent XML node.

Parameters:

Name Type Description Default
xmlParent XMLNode

The parent XML node

required

Raises:

Type Description
InscoperException

if an error occurred

getAPILogLevel()

Get the log level of the API.

Retrieves the current logging verbosity level used by the API.

Returns:

Type Description
int

The log level of the API

setAPILogLevel(apiLogLevel)

Set the log level of the API.

Updates the logging verbosity level for the API.

Parameters:

Name Type Description Default
apiLogLevel int

The log level of the API

required

getLibraryPaths()

Get the library paths.

Retrieves the list of folders where external libraries (e.g., Micro-Manager, Custom drivers) are located.

Returns:

Type Description
list[string]

The library paths

setLibraryPaths(libraryPaths)

Set the library paths.

Sets the list of folders where external libraries (e.g., Micro-Manager, Custom drivers) are located.

Parameters:

Name Type Description Default
libraryPaths list[string]

The list of library paths

required

getDriverList()

Get the driver list.

Retrieves the list of available drivers in the configuration.

Returns:

Type Description
list[string]

The list of drivers

getDeviceList()

Get the device configuration list.

Retrieves the list of configured devices.

Returns:

Type Description
list[DeviceConfig]

The list of device configurations

setDeviceList(deviceList)

Set the device configuration list.

Updates the list of configured devices.

Parameters:

Name Type Description Default
deviceList list[DeviceConfig]

The list of device configurations

required

addDeviceConfig(device)

Add a device configuration to the list.

Appends a new device configuration to the current list of devices.

Parameters:

Name Type Description Default
device DeviceConfig

The device configuration to add

required

getConfigPath()

Get the configuration path.

Retrieves the folder path to the current configuration.

Returns:

Type Description
str

The path to the current configuration

setConfigPath(configPath)

Set the configuration path.

Sets the folder path to the current configuration.

Parameters:

Name Type Description Default
configPath string

The path to the current configuration

required