IMPROVED ERROR FOR USB CONNECTIONS TECNA

This commit is contained in:
edo-neo 2024-11-06 12:55:05 +01:00
parent b0510d205a
commit c791ba76e9

View File

@ -51,11 +51,11 @@ class ModbusComponent(Component):
strict=False,
)
if not self.client.connect():
QMessageBox.critical(None, "ERRORE", "CONNESSIONE ASSENTE ALLA TECNA - VERIFICARE CONNESSIONE USB",)
raise ConnectionError("device not reachable (could not connect): {} ({})".format(self.name, self.port))
QMessageBox.critical(None, "ERRORE", f"ERRORE TECNA - VERIFICARE CONNESSIONE USB")
exit(-1)
#raise ConnectionError("device not reachable (could not connect): {} ({})".format(self.name, self.port))
if not self.client.is_socket_open():
QMessageBox.critical(None, "ERRORE", "CONNESSIONE ASSENTE ALLA TECNA - VERIFICARE CONNESSIONE USB",)
raise ConnectionError("device not reachable (socket not open): {} ({})".format(self.name, self.port))
self.lock.unlock()