DeviceConfig¶
Bases: object
DeviceConfig class provides information for device configuration.
This class holds the configuration parameters for a specific device, including its ID, driver type, sub-devices, and driver-specific settings.
__init__(driverType)
¶
Constructor.
Initializes a new instance of DeviceConfig with the specified driver type.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
driverType
|
int
|
The driver type of the device |
required |
fromXML(deviceNode)
¶
Load from XML.
Populates the device configuration from the provided XML node.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
deviceNode
|
XMLNode
|
The XML node containing device information |
required |
Raises:
| Type | Description |
|---|---|
InscoperException
|
If an error occurs |
toXML(xmlParent)
¶
Save to XML.
Serializes the device configuration 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 occurs |
getId()
¶
Get the ID of the device.
Retrieves the unique identifier of the device.
Returns:
| Type | Description |
|---|---|
str
|
The ID of the device |
setId(id)
¶
Set the ID of the device.
Assigns a unique identifier to the device.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
string
|
The ID of the device |
required |
getDriverType()
¶
Get the driver type of the device.
Retrieves the type of driver associated with this device.
Returns:
| Type | Description |
|---|---|
int
|
The driver type of the device |
setDriverType(driverType)
¶
Set the driver type of the device.
Sets the type of driver for this device.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
driverType
|
int
|
The driver type of the device |
required |
getSubDeviceConfigList()
¶
Get the sub-device configuration list.
Retrieves the list of sub-device configurations associated with this device.
Returns:
| Type | Description |
|---|---|
list[SubDeviceConfig]
|
The list of sub-device configurations |
setSubDeviceConfigList(subDevices)
¶
Set the sub-device configuration list.
Replaces the current list of sub-device configurations.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
subDevices
|
list[SubDeviceConfig]
|
The list of sub-device configurations |
required |
addSubDeviceConfig(subDevice)
¶
Add a sub-device configuration to the list.
Appends a new sub-device configuration to the device.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
subDevice
|
SubDeviceConfig
|
The sub-device configuration to add |
required |
getDriverConfig()
¶
Get the driver configuration.
Retrieves the specific configuration for the underlying driver.
Returns:
| Type | Description |
|---|---|
DriverConfig
|
The driver configuration |
setDriverConfig(driverConfig)
¶
Set the driver configuration.
Assigns the specific configuration for the underlying driver.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
driverConfig
|
DriverConfig
|
The driver configuration |
required |