not1mm 24.10.8__py3-none-any.whl → 24.10.11__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- not1mm/__main__.py +94 -11
- not1mm/data/configuration.ui +585 -0
- not1mm/lib/settings.py +53 -0
- not1mm/lib/version.py +1 -1
- not1mm/plugins/cq_ww_cw.py +108 -0
- not1mm/plugins/cq_ww_rtty.py +134 -16
- not1mm/plugins/cq_ww_ssb.py +108 -0
- {not1mm-24.10.8.dist-info → not1mm-24.10.11.dist-info}/METADATA +61 -2
- {not1mm-24.10.8.dist-info → not1mm-24.10.11.dist-info}/RECORD +13 -13
- {not1mm-24.10.8.dist-info → not1mm-24.10.11.dist-info}/LICENSE +0 -0
- {not1mm-24.10.8.dist-info → not1mm-24.10.11.dist-info}/WHEEL +0 -0
- {not1mm-24.10.8.dist-info → not1mm-24.10.11.dist-info}/entry_points.txt +0 -0
- {not1mm-24.10.8.dist-info → not1mm-24.10.11.dist-info}/top_level.txt +0 -0
not1mm/__main__.py
CHANGED
@@ -37,7 +37,7 @@ except OSError as exception:
|
|
37
37
|
from PyQt6 import QtCore, QtGui, QtWidgets, uic
|
38
38
|
from PyQt6.QtCore import QDir, Qt, QThread, QSettings, QCoreApplication
|
39
39
|
from PyQt6.QtGui import QFontDatabase, QColorConstants, QPalette, QColor, QPixmap
|
40
|
-
from PyQt6.QtWidgets import QFileDialog, QSplashScreen
|
40
|
+
from PyQt6.QtWidgets import QFileDialog, QSplashScreen, QApplication
|
41
41
|
|
42
42
|
from not1mm.lib.about import About
|
43
43
|
from not1mm.lib.cwinterface import CW
|
@@ -162,6 +162,8 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
162
162
|
oldtext = ""
|
163
163
|
text_color = QColorConstants.Black
|
164
164
|
current_palette = None
|
165
|
+
use_esm = False
|
166
|
+
esm_dict = {}
|
165
167
|
|
166
168
|
radio_thread = QThread()
|
167
169
|
voice_thread = QThread()
|
@@ -176,6 +178,8 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
176
178
|
lookup_service = None
|
177
179
|
fldigi_util = None
|
178
180
|
|
181
|
+
current_widget = None
|
182
|
+
|
179
183
|
def __init__(self, splash):
|
180
184
|
super().__init__()
|
181
185
|
logger.info("MainWindow: __init__")
|
@@ -194,6 +198,7 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
194
198
|
self.setCorner(Qt.Corner.TopLeftCorner, Qt.DockWidgetArea.LeftDockWidgetArea)
|
195
199
|
self.setCorner(Qt.Corner.BottomLeftCorner, Qt.DockWidgetArea.LeftDockWidgetArea)
|
196
200
|
uic.loadUi(fsutils.APP_DATA_PATH / "main.ui", self)
|
201
|
+
QApplication.instance().focusObjectChanged.connect(self.on_focus_changed)
|
197
202
|
self.cw_entry.hide()
|
198
203
|
self.leftdot.hide()
|
199
204
|
self.rightdot.hide()
|
@@ -246,13 +251,18 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
246
251
|
self.radioButton_sp.clicked.connect(self.run_sp_buttons_clicked)
|
247
252
|
self.score.setText("0")
|
248
253
|
self.callsign.textEdited.connect(self.callsign_changed)
|
249
|
-
self.callsign.returnPressed.connect(self.
|
250
|
-
self.
|
251
|
-
self.
|
252
|
-
self.
|
254
|
+
self.callsign.returnPressed.connect(self.check_esm_with_enter)
|
255
|
+
self.callsign.cursorPositionChanged.connect(self.check_esm)
|
256
|
+
self.sent.returnPressed.connect(self.check_esm_with_enter)
|
257
|
+
self.sent.cursorPositionChanged.connect(self.check_esm)
|
258
|
+
self.receive.returnPressed.connect(self.check_esm_with_enter)
|
259
|
+
self.receive.cursorPositionChanged.connect(self.check_esm)
|
260
|
+
self.other_1.returnPressed.connect(self.check_esm_with_enter)
|
253
261
|
self.other_1.textEdited.connect(self.other_1_changed)
|
254
|
-
self.
|
262
|
+
self.other_1.cursorPositionChanged.connect(self.check_esm)
|
263
|
+
self.other_2.returnPressed.connect(self.check_esm_with_enter)
|
255
264
|
self.other_2.textEdited.connect(self.other_2_changed)
|
265
|
+
self.other_2.cursorPositionChanged.connect(self.check_esm)
|
256
266
|
|
257
267
|
self.sent.setText("59")
|
258
268
|
self.receive.setText("59")
|
@@ -651,6 +661,47 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
651
661
|
"You can udate to the current version by using:\npip install -U not1mm"
|
652
662
|
)
|
653
663
|
|
664
|
+
def on_focus_changed(self, new):
|
665
|
+
""""""
|
666
|
+
if self.use_esm:
|
667
|
+
if hasattr(self.contest, "process_esm"):
|
668
|
+
self.contest.process_esm(self, new_focused_widget=new)
|
669
|
+
|
670
|
+
def make_button_green(self, the_button: QtWidgets.QPushButton) -> None:
|
671
|
+
"""Turn the_button green."""
|
672
|
+
if the_button is not None:
|
673
|
+
pal = QPalette()
|
674
|
+
pal.isCopyOf(self.current_palette)
|
675
|
+
greenColor = QColor(0, 128, 0)
|
676
|
+
pal.setBrush(QPalette.ColorRole.Button, greenColor)
|
677
|
+
the_button.setPalette(pal)
|
678
|
+
|
679
|
+
def restore_button_color(self, the_button: QtWidgets.QPushButton) -> None:
|
680
|
+
"""Restores the color of the button"""
|
681
|
+
the_button.setPalette(self.current_palette)
|
682
|
+
|
683
|
+
def check_esm_with_enter(self):
|
684
|
+
"""Check for ESM, otherwise save contact."""
|
685
|
+
if self.use_esm:
|
686
|
+
if hasattr(self.contest, "process_esm"):
|
687
|
+
self.contest.process_esm(self, with_enter=True)
|
688
|
+
else:
|
689
|
+
self.save_contact()
|
690
|
+
else:
|
691
|
+
self.save_contact()
|
692
|
+
|
693
|
+
def check_esm(self):
|
694
|
+
"""Check for ESM, otherwise save contact."""
|
695
|
+
if self.use_esm:
|
696
|
+
if hasattr(self.contest, "process_esm"):
|
697
|
+
self.contest.process_esm(self)
|
698
|
+
else:
|
699
|
+
...
|
700
|
+
# self.save_contact()
|
701
|
+
else:
|
702
|
+
...
|
703
|
+
# self.save_contact()
|
704
|
+
|
654
705
|
def show_splash_msg(self, msg: str) -> None:
|
655
706
|
"""Show text message in the splash window."""
|
656
707
|
self.splash.showMessage(
|
@@ -1719,7 +1770,6 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
1719
1770
|
-------
|
1720
1771
|
None
|
1721
1772
|
"""
|
1722
|
-
|
1723
1773
|
modifier = event.modifiers()
|
1724
1774
|
if event.key() == Qt.Key.Key_K:
|
1725
1775
|
self.toggle_cw_entry()
|
@@ -2027,7 +2077,7 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
2027
2077
|
|
2028
2078
|
logger.debug("saving contact")
|
2029
2079
|
if self.contest is None:
|
2030
|
-
self.show_message_box("You have no contest defined
|
2080
|
+
self.show_message_box("You have no contest defined...")
|
2031
2081
|
return
|
2032
2082
|
if len(self.callsign.text()) < 3:
|
2033
2083
|
return
|
@@ -2057,6 +2107,10 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
2057
2107
|
float(self.radio_state.get("vfoa", 0.0)) / 1000, 2
|
2058
2108
|
)
|
2059
2109
|
self.contact["Mode"] = self.radio_state.get("mode", "")
|
2110
|
+
self.contact["Freq"] = round(float(self.radio_state.get("vfoa", 0.0)) / 1000, 2)
|
2111
|
+
self.contact["QSXFreq"] = round(
|
2112
|
+
float(self.radio_state.get("vfoa", 0.0)) / 1000, 2
|
2113
|
+
)
|
2060
2114
|
self.contact["ContestName"] = self.contest.cabrillo_name
|
2061
2115
|
self.contact["ContestNR"] = self.pref.get("contest", "0")
|
2062
2116
|
self.contact["StationPrefix"] = self.station.get("Call", "")
|
@@ -2415,7 +2469,7 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
2415
2469
|
app.processEvents()
|
2416
2470
|
self.rig_control.ptt_off()
|
2417
2471
|
|
2418
|
-
def process_function_key(self, function_key) -> None:
|
2472
|
+
def process_function_key(self, function_key, rttysendrx=True) -> None:
|
2419
2473
|
"""
|
2420
2474
|
Called when a function key is clicked.
|
2421
2475
|
|
@@ -2445,7 +2499,10 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
2445
2499
|
"DIGI-U",
|
2446
2500
|
"DIGI-L",
|
2447
2501
|
]:
|
2448
|
-
self.fldigi_util.send_string(
|
2502
|
+
self.fldigi_util.send_string(
|
2503
|
+
self.process_macro(function_key.toolTip()), rxafter=rttysendrx
|
2504
|
+
)
|
2505
|
+
return
|
2449
2506
|
if self.cw:
|
2450
2507
|
if self.pref.get("cwtype") == 3 and self.rig_control is not None:
|
2451
2508
|
self.rig_control.sendcw(self.process_macro(function_key.toolTip()))
|
@@ -2666,7 +2723,33 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
2666
2723
|
for band_to_show in self.pref.get("bands", []):
|
2667
2724
|
if band_to_show in _indicator:
|
2668
2725
|
_indicator[band_to_show].show()
|
2669
|
-
|
2726
|
+
|
2727
|
+
fkey_dict = {
|
2728
|
+
"F1": self.F1,
|
2729
|
+
"F2": self.F2,
|
2730
|
+
"F3": self.F3,
|
2731
|
+
"F4": self.F4,
|
2732
|
+
"F5": self.F5,
|
2733
|
+
"F6": self.F6,
|
2734
|
+
"F7": self.F7,
|
2735
|
+
"F8": self.F8,
|
2736
|
+
"F9": self.F9,
|
2737
|
+
"F10": self.F10,
|
2738
|
+
"F11": self.F11,
|
2739
|
+
"F12": self.F12,
|
2740
|
+
"DISABLED": None,
|
2741
|
+
}
|
2742
|
+
|
2743
|
+
self.use_esm = self.pref.get("use_esm", False)
|
2744
|
+
self.esm_dict["CQ"] = fkey_dict.get(self.pref.get("esm_cq", "DISABLED"))
|
2745
|
+
self.esm_dict["EXCH"] = fkey_dict.get(self.pref.get("esm_exch", "DISABLED"))
|
2746
|
+
self.esm_dict["QRZ"] = fkey_dict.get(self.pref.get("esm_qrz", "DISABLED"))
|
2747
|
+
self.esm_dict["AGN"] = fkey_dict.get(self.pref.get("esm_agn", "DISABLED"))
|
2748
|
+
self.esm_dict["HISCALL"] = fkey_dict.get(
|
2749
|
+
self.pref.get("esm_hiscall", "DISABLED")
|
2750
|
+
)
|
2751
|
+
self.esm_dict["MYCALL"] = fkey_dict.get(self.pref.get("esm_mycall", "DISABLED"))
|
2752
|
+
self.esm_dict["QSOB4"] = fkey_dict.get(self.pref.get("esm_qsob4", "DISABLED"))
|
2670
2753
|
|
2671
2754
|
def watch_udp(self) -> None:
|
2672
2755
|
"""
|