Class: QgsAbstractSensor¶
An abstract base class for sensor classes
Added in version 3.32.
Class Hierarchy¶
Base classes¶
Subclasses¶
An abstract class QIODevice-based sensor classes |
- class qgis.core.QgsAbstractSensor[source]¶
Bases:
QObject- __init__(parent: QObject | None = None)
Constructor for an abstract sensor, bound to the specified
parent.- Parameters:
parent (Optional[QObject] = None)
- data(self) QgsAbstractSensor.SensorData[source]¶
Returns the latest captured data from the sensor.
- Return type:
- signal dataChanged[source]¶
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- signal errorOccurred[source]¶
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- handleConnect(self)[source]¶
Handles the connection to the sensor.
Note
Triggered by calling
connectSensor()
- handleDisconnect(self)[source]¶
Handles the disconnection from the sensor.
Note
Triggered by calling
disconnectSensor()
- id(self) str[source]¶
Returns the sensor ID.
Note
This is a autogenerated unique string identifying an individual sensor.
- Return type:
str
- signal nameChanged[source]¶
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- readPropertiesFromElement(self, element: QDomElement, document: QDomDocument) bool[source]¶
Restores specific sensor type properties from a DOM element.
- Parameters:
element (QDomElement) – DOM node corresponding to item (e.g. ‘Sensor’ element)
document (QDomDocument) – DOM document
- Return type:
bool
- readXml(self, element: QDomElement, document: QDomDocument) bool[source]¶
Restores generic sensor details from a DOM element.
- Parameters:
element (QDomElement) – DOM node corresponding to item (e.g. ‘Sensor’ element)
document (QDomDocument) – DOM document
- Return type:
bool
- setData(self, data: QgsAbstractSensor.SensorData)[source]¶
Sets the latest captured data from the sensor.
- Parameters:
data (QgsAbstractSensor.SensorData)
- setName(self, name: str | None)[source]¶
Sets the user-friendly name identfying the sensor.
- Parameters:
name (Optional[str])
- setStatus(self, status: Qgis.DeviceConnectionStatus)[source]¶
Sets the current sensor
status.- Parameters:
status (Qgis.DeviceConnectionStatus)
- status(self) Qgis.DeviceConnectionStatus[source]¶
Returns the current sensor status.
- Return type:
- signal statusChanged[source]¶
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- type(self) str[source]¶
Returns the sensor type. This will match the type string of the sensor class, as used by
QgsSensorRegistry.- Return type:
str