Skip to content

Commit

Permalink
@mbridak Added CAT poll interval.
Browse files Browse the repository at this point in the history
  • Loading branch information
mbridak committed Nov 27, 2024
1 parent 89410b0 commit 14d9533
Show file tree
Hide file tree
Showing 8 changed files with 94 additions and 73 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Changelog

- [24-11-27] Added CAT poll interval.
- [24-11-26-1] Changed ESC to stop CW, CTRL-W to wipe input fields.
- [24-11-26] Trying something different with rigctld parsing.
- [24-11-15] Fix CQWW points, fix mode showing as RPRT.
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ generated, 'cause I'm lazy, list of those who've submitted PR's.

## Recent Changes (Polishing the Turd)

- [24-11-27] Added CAT poll interval.
- [24-11-26-1] Changed ESC to stop CW, CTRL-W to wipe input fields.
- [24-11-26] Trying something different with rigctld parsing.
- [24-11-15] Fix CQWW points, fix mode showing as RPRT.
Expand Down
3 changes: 3 additions & 0 deletions not1mm/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2920,6 +2920,7 @@ def readpreferences(self) -> None:
self.pref.get("CAT_ip", "127.0.0.1"),
int(self.pref.get("CAT_port", 12345)),
)
self.rig_control.delta = int(self.pref.get("CAT_polldelta", 555))
self.rig_control.moveToThread(self.radio_thread)
self.radio_thread.started.connect(self.rig_control.run)
self.radio_thread.finished.connect(self.rig_control.deleteLater)
Expand All @@ -2936,6 +2937,7 @@ def readpreferences(self) -> None:
self.pref.get("CAT_ip", "127.0.0.1"),
int(self.pref.get("CAT_port", 4532)),
)
self.rig_control.delta = int(self.pref.get("CAT_polldelta", 555))
self.rig_control.moveToThread(self.radio_thread)
self.radio_thread.started.connect(self.rig_control.run)
self.radio_thread.finished.connect(self.rig_control.deleteLater)
Expand All @@ -2947,6 +2949,7 @@ def readpreferences(self) -> None:
self.pref.get("CAT_ip", "127.0.0.1"),
int(self.pref.get("CAT_port", 0000)),
)
self.rig_control.delta = int(self.pref.get("CAT_polldelta", 555))
self.rig_control.moveToThread(self.radio_thread)
self.radio_thread.started.connect(self.rig_control.run)
self.radio_thread.finished.connect(self.rig_control.deleteLater)
Expand Down
144 changes: 77 additions & 67 deletions not1mm/data/configuration.ui
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,43 @@
<string>CAT</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_4">
<item row="1" column="3">
<widget class="QLineEdit" name="rigcontrolport_field">
<property name="font">
<font>
<family>JetBrains Mono ExtraLight</family>
<pointsize>12</pointsize>
<bold>false</bold>
<strikeout>false</strikeout>
</font>
</property>
<property name="accessibleName">
<string>port number</string>
</property>
<property name="accessibleDescription">
<string>port number of rig control d or f l rig.</string>
</property>
<property name="inputMethodHints">
<set>Qt::InputMethodHint::ImhDigitsOnly</set>
</property>
<property name="text">
<string>4532</string>
</property>
</widget>
</item>
<item row="5" column="0" colspan="4">
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="rigcontrolip_field">
<property name="font">
Expand All @@ -398,7 +435,38 @@
</property>
</widget>
</item>
<item row="3" column="0" colspan="4">
<item row="3" column="1" colspan="3">
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_6">
<property name="font">
<font>
<family>JetBrains Mono ExtraLight</family>
<pointsize>12</pointsize>
<bold>false</bold>
<strikeout>false</strikeout>
</font>
</property>
<property name="text">
<string>Rig Control IP:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="4" column="0" colspan="4">
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="sizeConstraint">
<enum>QLayout::SizeConstraint::SetDefaultConstraint</enum>
Expand Down Expand Up @@ -513,50 +581,6 @@
</item>
</layout>
</item>
<item row="2" column="1" colspan="3">
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_6">
<property name="font">
<font>
<family>JetBrains Mono ExtraLight</family>
<pointsize>12</pointsize>
<bold>false</bold>
<strikeout>false</strikeout>
</font>
</property>
<property name="text">
<string>Rig Control IP:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="2">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="2">
<widget class="QLabel" name="label_7">
<property name="font">
Expand All @@ -575,8 +599,8 @@
</property>
</widget>
</item>
<item row="4" column="0" colspan="4">
<spacer name="verticalSpacer_3">
<item row="0" column="2">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
Expand All @@ -588,30 +612,16 @@
</property>
</spacer>
</item>
<item row="1" column="3">
<widget class="QLineEdit" name="rigcontrolport_field">
<property name="font">
<font>
<family>JetBrains Mono ExtraLight</family>
<pointsize>12</pointsize>
<bold>false</bold>
<strikeout>false</strikeout>
</font>
</property>
<property name="accessibleName">
<string>port number</string>
</property>
<property name="accessibleDescription">
<string>port number of rig control d or f l rig.</string>
</property>
<property name="inputMethodHints">
<set>Qt::InputMethodHint::ImhDigitsOnly</set>
</property>
<item row="2" column="0">
<widget class="QLabel" name="label_27">
<property name="text">
<string>4532</string>
<string>CAT Poll Interval (ms):</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="catpoll_field"/>
</item>
</layout>
</widget>
<widget class="QWidget" name="cw_tab">
Expand Down
5 changes: 5 additions & 0 deletions not1mm/lib/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ def setup(self):
)
self.rigcontrolip_field.setText(str(self.preference.get("CAT_ip", "")))
self.rigcontrolport_field.setText(str(self.preference.get("CAT_port", "")))
self.catpoll_field.setText(str(self.preference.get("CAT_polldelta", 500)))
self.userigctld_radioButton.setChecked(bool(self.preference.get("userigctld")))
self.useflrig_radioButton.setChecked(bool(self.preference.get("useflrig")))

Expand Down Expand Up @@ -215,6 +216,10 @@ def save_changes(self):
self.preference["CAT_port"] = int(self.rigcontrolport_field.text())
except ValueError:
...
try:
self.preference["CAT_polldelta"] = int(self.catpoll_field.text())
except ValueError:
...
self.preference["userigctld"] = self.userigctld_radioButton.isChecked()
self.preference["useflrig"] = self.useflrig_radioButton.isChecked()
self.preference["cwip"] = self.cwip_field.text()
Expand Down
2 changes: 1 addition & 1 deletion not1mm/lib/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""It's the version"""

__version__ = "24.11.26.1"
__version__ = "24.11.27"
9 changes: 5 additions & 4 deletions not1mm/radio.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ class Radio(QObject):
vfoa = "14030000"
mode = "CW"
bw = "500"
delta = 1
poll_time = datetime.datetime.now() + datetime.timedelta(seconds=delta)
delta = 500
poll_time = datetime.datetime.now() + datetime.timedelta(milliseconds=delta)
time_to_quit = False
online = False
interface = None
Expand Down Expand Up @@ -72,7 +72,7 @@ def run(self):
while not self.time_to_quit:
if datetime.datetime.now() > self.poll_time:
self.poll_time = datetime.datetime.now() + datetime.timedelta(
seconds=self.delta
milliseconds=self.delta
)
vfoa = self.cat.get_vfo()
self.online = False
Expand Down Expand Up @@ -102,7 +102,8 @@ def run(self):
)
except QEventLoop:
...
QThread.msleep(100)
# QThread.msleep(int(self.delta / 2))
QThread.msleep(1)

def store_last_data_mode(self, the_mode: str = ""):
"""if the last mode is a data mode, save it."""
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "not1mm"
version = "24.11.26.1"
version = "24.11.27"
description = "NOT1MM Logger"
readme = "README.md"
requires-python = ">=3.9"
Expand Down

0 comments on commit 14d9533

Please sign in to comment.