|
33 | 33 | print(exception) |
34 | 34 | print("portaudio is not installed") |
35 | 35 | sd = None |
36 | | -from PyQt6 import QtCore, QtGui, QtWidgets, uic |
| 36 | +from PyQt6 import QtCore, QtGui, QtWidgets, uic, QtNetwork |
37 | 37 | from PyQt6.QtCore import QDir, Qt, QThread, QSettings, QCoreApplication |
38 | 38 | from PyQt6.QtGui import QFontDatabase, QColorConstants, QPalette, QColor, QPixmap |
39 | 39 | from PyQt6.QtWidgets import QFileDialog, QSplashScreen, QApplication |
|
66 | 66 | from not1mm.lib.version import __version__ |
67 | 67 | from not1mm.lib.versiontest import VersionTest |
68 | 68 | from not1mm.lib.ft8_watcher import FT8Watcher |
69 | | -from not1mm.lib.fldigi_watcher import FlDigiWatcher |
70 | 69 | from not1mm.lib.fldigi_sendstring import FlDigi_Comm |
71 | 70 |
|
72 | 71 | import not1mm.fsutils as fsutils |
@@ -174,10 +173,8 @@ class MainWindow(QtWidgets.QMainWindow): |
174 | 173 |
|
175 | 174 | radio_thread = QThread() |
176 | 175 | voice_thread = QThread() |
177 | | - fldigi_thread = QThread() |
178 | 176 | rtc_thread = QThread() |
179 | 177 |
|
180 | | - fldigi_watcher = None |
181 | 178 | rig_control = None |
182 | 179 | log_window = None |
183 | 180 | check_window = None |
@@ -668,14 +665,6 @@ def __init__(self, splash): |
668 | 665 | self.show_splash_msg("Reading macros.") |
669 | 666 | self.read_macros() |
670 | 667 |
|
671 | | - self.show_splash_msg("Starting FlDigi watcher.") |
672 | | - self.fldigi_watcher = FlDigiWatcher() |
673 | | - self.fldigi_watcher.moveToThread(self.fldigi_thread) |
674 | | - self.fldigi_thread.started.connect(self.fldigi_watcher.run) |
675 | | - self.fldigi_thread.finished.connect(self.fldigi_watcher.deleteLater) |
676 | | - self.fldigi_watcher.poll_callback.connect(self.fldigi_qso) |
677 | | - self.fldigi_thread.start() |
678 | | - |
679 | 668 | self.show_splash_msg("Restoring window states.") |
680 | 669 | self.settings = QSettings("K6GTE", "not1mm") |
681 | 670 | if self.settings.value("windowState") is not None: |
@@ -718,6 +707,20 @@ def __init__(self, splash): |
718 | 707 | "You can udate to the current version by using:\npip install -U not1mm" |
719 | 708 | ) |
720 | 709 |
|
| 710 | + self.udp_socket = QtNetwork.QUdpSocket() |
| 711 | + b_result = self.udp_socket.bind( |
| 712 | + QtNetwork.QHostAddress.SpecialAddress.AnyIPv4, 9876 |
| 713 | + ) |
| 714 | + logger.info(f"bind {b_result}") |
| 715 | + self.udp_socket.readyRead.connect(self.fldigi_on_udp_socket_ready_read) |
| 716 | + |
| 717 | + def fldigi_on_udp_socket_ready_read(self): |
| 718 | + """""" |
| 719 | + datagram, sender_host, sender_port_number = self.udp_socket.readDatagram( |
| 720 | + self.udp_socket.pendingDatagramSize() |
| 721 | + ) |
| 722 | + self.fldigi_qso(datagram.decode()) |
| 723 | + |
721 | 724 | def load_call_history(self) -> None: |
722 | 725 | """Display filepicker and load chosen call history file.""" |
723 | 726 | filename = self.filepicker("other") |
|
0 commit comments