blob: de3e946b6e3e78189999229b5438fb6908d2e065 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
from __future__ import annotations
"""PySide6 port of the examples/serialbus/modbus/client example from Qt v6.x"""
from argparse import ArgumentParser, RawDescriptionHelpFormatter
import sys
from PySide6.QtCore import QCoreApplication, QLoggingCategory
from PySide6.QtWidgets import QApplication
from mainwindow import MainWindow
if __name__ == "__main__":
parser = ArgumentParser(prog="Modbus Client Example",
formatter_class=RawDescriptionHelpFormatter)
parser.add_argument("-v", "--verbose", action="store_true",
help="Generate more output")
options = parser.parse_args()
if options.verbose:
QLoggingCategory.setFilterRules("qt.modbus* = true")
a = QApplication(sys.argv)
w = MainWindow()
w.show()
sys.exit(QCoreApplication.exec())
|