openDAQ
Open data acquisition platform
IDeviceUpdateOptions Struct Referenceabstract

Allows for specifying how a device and its subdevices are to be updated when loading a configuration. More...

+ Inheritance diagram for IDeviceUpdateOptions:
+ Collaboration diagram for IDeviceUpdateOptions:

Detailed Description

Allows for specifying how a device and its subdevices are to be updated when loading a configuration.

The device options object can be created using a serialized openDAQ JSON setup. The options are structured hierarchically, so that options for subdevices are stored in the parent device options. The following metadata is read from the setup: local ID, manufacturer, serial number, and connection string.

For each individual device in the setup, the update mode can be specified. The update mode defines how the device is updated when loading:

  • Load: Updates the device. Adds the device if missing.
  • UpdateOnly: The device is updated, but not added if missing.
  • Skip: The device is not updated. Does neither add nor remove the device.
  • Remove: Removes the device from the tree, if present.
  • Remap: Same as load, but removes old device (if present) and uses the new manufacturer, serial number, and connection string to add a new one and update.

Remapping

When the update mode is set to Remap, the device is removed and added again with the new manufacturer, serial number, and connection string. This can be used when swapping out a device with a different one of the same make/model. This option will try and load the same settings used to configure the original device to the new one.

When loading, the new manufacturer + serial number combination will have priority over the new connection string. In case a device with the new manufacturer + serial number combination is not found, the new connection string will be used as fallback.

If the remapping fails (e.g. due to missing device with the new manufacturer + serial number combination and invalid connection string), the original device will be removed (if present) and no new device will be added.

Signal->Input port connections will be preserved when remapping, assuming the new device has the same signal and input port structure and IDs.

Public Member Functions

virtual ErrCode INTERFACE_FUNC getLocalId (IString **localId)=0
 Gets the local ID of the device. The local ID is obtained from the JSON key for the device entry. More...
 
virtual ErrCode INTERFACE_FUNC getManufacturer (IString **manufacturer)=0
 Gets the manufacturer of the device, as written in the setup string. More...
 
virtual ErrCode INTERFACE_FUNC getSerialNumber (IString **serialNumber)=0
 Gets the serial number of the device, as written in the setup string. More...
 
virtual ErrCode INTERFACE_FUNC getConnectionString (IString **connectionString)=0
 Gets the connection string of the device, as written in the setup string. More...
 
virtual ErrCode INTERFACE_FUNC setNewManufacturer (IString *manufacturer)=0
 Sets the new manufacturer of the device to be used for remapping. More...
 
virtual ErrCode INTERFACE_FUNC getNewManufacturer (IString **manufacturer)=0
 Gets the new manufacturer of the device to be used for remapping. More...
 
virtual ErrCode INTERFACE_FUNC setNewSerialNumber (IString *serialNumber)=0
 Sets the new serial number of the device to be used for remapping. More...
 
virtual ErrCode INTERFACE_FUNC getNewSerialNumber (IString **serialNumber)=0
 Gets the new serial number of the device to be used for remapping. More...
 
virtual ErrCode INTERFACE_FUNC setNewConnectionString (IString *connectionString)=0
 Sets the new connection string of the device to be used for remapping. More...
 
virtual ErrCode INTERFACE_FUNC getNewConnectionString (IString **connectionString)=0
 Gets the new connection string of the device to be used for remapping. More...
 
virtual ErrCode INTERFACE_FUNC getUpdateMode (DeviceUpdateMode *mode)=0
 Gets the update mode for the device. More...
 
virtual ErrCode INTERFACE_FUNC setUpdateMode (DeviceUpdateMode mode)=0
 Sets the update mode for the device. More...
 
virtual ErrCode INTERFACE_FUNC getChildDeviceOptions (IList **childDeviceOptions)=0
 Gets the list of child device options for the device. These are used to configure subdevices of the current device. More...
 
- Public Member Functions inherited from IBaseObject
virtual ErrCode INTERFACE_FUNC borrowInterface (const IntfID &intfID, void **obj) const =0
 Returns another interface which is supported by the object without incrementing the reference count. More...
 
virtual ErrCode INTERFACE_FUNC dispose ()=0
 Disposes all references held by the object. More...
 
virtual ErrCode INTERFACE_FUNC getHashCode (SizeT *hashCode)=0
 Returns hash code of the object. More...
 
virtual ErrCode INTERFACE_FUNC equals (IBaseObject *other, Bool *equal) const =0
 Compares object to another object for equality. More...
 
virtual ErrCode INTERFACE_FUNC toString (CharPtr *str)=0
 Returns a string representation of the object. More...
 
- Public Member Functions inherited from IUnknown
virtual ErrCode INTERFACE_FUNC queryInterface (const IntfID &intfID, void **obj)=0
 Returns another interface which is supported by the object and increments the reference count. More...
 
virtual int INTERFACE_FUNC addRef ()=0
 Increments the reference count for an interface on an object. More...
 
virtual int INTERFACE_FUNC releaseRef ()=0
 Decrements the reference count for an interface on an object. More...
 

Member Function Documentation

◆ getChildDeviceOptions()

virtual ErrCode INTERFACE_FUNC getChildDeviceOptions ( IList **  childDeviceOptions)
pure virtual

Gets the list of child device options for the device. These are used to configure subdevices of the current device.

Parameters
childDeviceOptionsThe list of child device options for the device.

◆ getConnectionString()

virtual ErrCode INTERFACE_FUNC getConnectionString ( IString **  connectionString)
pure virtual

Gets the connection string of the device, as written in the setup string.

Parameters
connectionStringThe connection string of the device.

◆ getLocalId()

virtual ErrCode INTERFACE_FUNC getLocalId ( IString **  localId)
pure virtual

Gets the local ID of the device. The local ID is obtained from the JSON key for the device entry.

Parameters
localIdThe local ID of the device.

The root device might not have the local ID configured. In this case the local ID will be set to "Root".

◆ getManufacturer()

virtual ErrCode INTERFACE_FUNC getManufacturer ( IString **  manufacturer)
pure virtual

Gets the manufacturer of the device, as written in the setup string.

Parameters
manufacturerThe manufacturer of the device.

◆ getNewConnectionString()

virtual ErrCode INTERFACE_FUNC getNewConnectionString ( IString **  connectionString)
pure virtual

Gets the new connection string of the device to be used for remapping.

Parameters
connectionStringThe new connection string of the device to be used for remapping.

The manufacturer and serial number combination has priority over the connection string when remapping.

◆ getNewManufacturer()

virtual ErrCode INTERFACE_FUNC getNewManufacturer ( IString **  manufacturer)
pure virtual

Gets the new manufacturer of the device to be used for remapping.

Parameters
manufacturerThe new manufacturer of the device to be used for remapping.

◆ getNewSerialNumber()

virtual ErrCode INTERFACE_FUNC getNewSerialNumber ( IString **  serialNumber)
pure virtual

Gets the new serial number of the device to be used for remapping.

Parameters
serialNumberThe new serial number of the device to be used for remapping.

◆ getSerialNumber()

virtual ErrCode INTERFACE_FUNC getSerialNumber ( IString **  serialNumber)
pure virtual

Gets the serial number of the device, as written in the setup string.

Parameters
serialNumberThe serial number of the device.

◆ getUpdateMode()

virtual ErrCode INTERFACE_FUNC getUpdateMode ( DeviceUpdateMode mode)
pure virtual

Gets the update mode for the device.

Parameters
modeThe update mode for the device.

◆ setNewConnectionString()

virtual ErrCode INTERFACE_FUNC setNewConnectionString ( IString connectionString)
pure virtual

Sets the new connection string of the device to be used for remapping.

Parameters
connectionStringThe new connection string of the device to be used for remapping.

The manufacturer and serial number combination has priority over the connection string when remapping.

◆ setNewManufacturer()

virtual ErrCode INTERFACE_FUNC setNewManufacturer ( IString manufacturer)
pure virtual

Sets the new manufacturer of the device to be used for remapping.

Parameters
manufacturerThe new manufacturer of the device to be used for remapping.

◆ setNewSerialNumber()

virtual ErrCode INTERFACE_FUNC setNewSerialNumber ( IString serialNumber)
pure virtual

Sets the new serial number of the device to be used for remapping.

Parameters
serialNumberThe new serial number of the device to be used for remapping.

◆ setUpdateMode()

virtual ErrCode INTERFACE_FUNC setUpdateMode ( DeviceUpdateMode  mode)
pure virtual

Sets the update mode for the device.

Parameters
modeThe update mode for the device.