Class: QgsSerialPortSensor¶
- class qgis.core.QgsSerialPortSensor¶
Bases:
QgsIODeviceSensor
A serial port sensor class
New in version 3.32.
QgsSerialPortSensor(parent: QObject = None) Constructor for a serial port sensor, bound to the specified
parent
.Methods
Returns a new serial port sensor.
Initiates the I/O
device
.Parses the data read from the device when available.
Returns the serial port the sensor connects to.
- param element:
Sets the serial port the sensor connects to.
- rtype:
str
- param element:
- childEvent(self, QChildEvent)¶
- connectNotify(self, QMetaMethod)¶
- create(parent: QObject) QgsSerialPortSensor ¶
Returns a new serial port sensor.
The caller takes responsibility for deleting the returned object.
- Parameters:
parent (QObject) –
- Return type:
- customEvent(self, QEvent)¶
- disconnectNotify(self, QMetaMethod)¶
- handleConnect(self)¶
- handleDisconnect(self)¶
- initIODevice(self, device: QIODevice)¶
Initiates the I/O
device
.Note
Takes ownership of the device.
- isSignalConnected(self, QMetaMethod) bool ¶
- parseData(self)¶
Parses the data read from the device when available.
- portName(self) str ¶
Returns the serial port the sensor connects to.
- Return type:
str
- readPropertiesFromElement(self, element: QDomElement, document: QDomDocument) bool ¶
- Parameters:
element (QDomElement) –
document (QDomDocument) –
- Return type:
bool
- receivers(self, PYQT_SIGNAL) int ¶
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- setPortName(self, portName: str)¶
Sets the serial port the sensor connects to.
- Parameters:
portName (str) – the port name (e.g. COM4)
- timerEvent(self, QTimerEvent)¶
- type(self) str ¶
- Return type:
str
- writePropertiesToElement(self, element: QDomElement, document: QDomDocument) bool ¶
- Parameters:
element (QDomElement) –
document (QDomDocument) –
- Return type:
bool