Class: QgsSensorRegistry¶
Registry of available sensor types.
QgsSensorRegistry
is not usually directly created, but
rather accessed through QgsApplication.sensorRegistry()
.
A companion class, QgsSensorGuiRegistry
, handles the GUI
behavior of sensors.
Added in version 3.32.
Class Hierarchy¶
Base classes¶
Methods
Registers a new sensor type. |
|
Creates a new instance of a sensor given the type. |
|
Populates the registry with standard sensor types. |
|
Removes a new a sensor type from the registry. |
|
Returns the metadata for the specified sensor type. |
|
Returns a map of available sensor types to translated name. |
Signals
Emitted whenever a new sensor type is added to the registry, with the specified type and visible name. |
- class qgis.core.QgsSensorRegistry[source]¶
Bases:
QObject
- __init__(parent: QObject | None = None)
Creates a new empty item registry.
QgsSensorRegistry is not usually directly created, but rather accessed through
QgsApplication.sensorRegistry()
.See also
- Parameters:
parent (Optional[QObject] = None)
- addSensorType(self, metadata: QgsSensorAbstractMetadata | None) bool [source]¶
Registers a new sensor type.
Note
Takes ownership of the metadata instance.
- Parameters:
metadata (Optional[QgsSensorAbstractMetadata])
- Return type:
bool
- createSensor(self, type: str | None, parent: QObject | None = None) QgsAbstractSensor | None [source]¶
Creates a new instance of a sensor given the
type
.- Parameters:
type (Optional[str])
parent (Optional[QObject] = None)
- Return type:
Optional[QgsAbstractSensor]
- populate(self) bool [source]¶
Populates the registry with standard sensor types. If called on a non-empty registry then this will have no effect and will return
False
.- Return type:
bool
- removeSensorType(self, type: str | None) bool [source]¶
Removes a new a sensor type from the registry.
- Parameters:
type (Optional[str])
- Return type:
bool
- signal sensorAdded(type: str, name: str)[source]¶
Emitted whenever a new sensor type is added to the registry, with the specified
type
and visiblename
.- Parameters:
type (str)
name (str)
- sensorMetadata(self, type: str | None) QgsSensorAbstractMetadata | None [source]¶
Returns the metadata for the specified sensor
type
. ReturnsNone
if a corresponding type was not found in the registry.- Parameters:
type (Optional[str])
- Return type:
Optional[QgsSensorAbstractMetadata]
- sensorTypes(self) Dict[str, str] ¶
Returns a map of available sensor types to translated name.
- Return type:
Dict[str, str]