Skip to content

Commit

Permalink
Merge pull request #185 from mbridak/recheck-esm-state-on-run-sandp-t…
Browse files Browse the repository at this point in the history
…oggle

Recheck esm state on run sandp toggle
  • Loading branch information
mbridak authored Oct 19, 2024
2 parents c1b5e01 + 2589cfd commit 3f22f41
Show file tree
Hide file tree
Showing 7 changed files with 200 additions and 15 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-10-19] Change ESM button states when the run state is toggled. Add ESM to ARRL Field Day and Winter Field Day.
- [24-10-18] Fixed marked spots showing the correct time.
- [24-10-17-2] Add ESM to ARRL Sweepstakes.
- [24-10-17-1] Fix dupe check. Reordered change mode and interface update sequence. Resend mode if rigctld does not report back `RPRT 0`
Expand Down
27 changes: 14 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
- [Data and RTTY](#data-and-rtty)
- [Other not so supported contests](#other-not-so-supported-contests)
- [Our Code Contributors ✨](#our-code-contributors-)
- [List of should be working contests](#list-of-should-be-working-contests)
- [List of should be working contests, those in bold have ESM](#list-of-should-be-working-contests-those-in-bold-have-esm)
- [Recent Changes](#recent-changes)
- [Flatpak](#flatpak)
- [Installation](#installation)
Expand Down Expand Up @@ -169,7 +169,7 @@ generated, 'cause I'm lazy, list of those who've submitted PR's.
<img src="https://contrib.rocks/image?repo=mbridak/not1mm" alt="Avatar icons for code contributors." />
</a>

## List of should be working contests
## List of should be working contests, those in bold have ESM

- General Logging (There are better general loggers like QLog, KLog, CQRLog)
- 10 10 Fall CW
Expand All @@ -178,28 +178,29 @@ generated, 'cause I'm lazy, list of those who've submitted PR's.
- 10 10 Winter Phone
- ARRL 10M
- ARRL DX CW, SSB
- ARRL Field Day
- ARRL Sweepstakes CW, SSB
- **ARRL Field Day**
- **ARRL Sweepstakes CW, SSB**
- ARRL VHF January, June, September
- CQ 160 CW, SSB
- .CQ WPX CW, RTTY, SSB
- .CQ World Wide CW, RTTY, SSB
- .CWOps CWT
- **CQ WPX CW, RTTY, SSB**
- **CQ World Wide CW, RTTY, SSB**
- **CWOps CWT**
- Helvetia
- IARU Fieldday R1 CW, SSB
- IARU HF
- ICWC MST
- Japan International DX CW, SSB
- .K1USN Slow Speed Test
- .NAQP CW, RTTY, SSB
- **K1USN Slow Speed Test**
- **NAQP CW, RTTY, SSB**
- Phone Weekly Test
- RAC Canada Day
- Stew Perry Topband
- .Weekly RTTY
- Winter Field Day
- **Weekly RTTY**
- **Winter Field Day**

## Recent Changes

- [24-10-19] Change ESM button states when the run state is toggled. Add ESM to ARRL Field Day and Winter Field Day.
- [24-10-18] Fixed marked spots showing the correct time.
- [24-10-17-2] Add ESM to ARRL Sweepstakes.
- [24-10-17-1] Fix dupe check. Reordered change mode and interface update sequence. Resend mode if rigctld does not report back `RPRT 0`
Expand Down Expand Up @@ -821,8 +822,8 @@ change.

## Testing Out ESM Currently only in CQ WW

I caved and started working on ESM or Enter Sends Message. Currently it is only
working in the CQ WW. To test it out you can go to `FILE -> Configuration Settings`
I caved and started working on ESM or Enter Sends Message. To test it out you can
go to `FILE -> Configuration Settings`

![Config Screen](https://github.com/mbridak/not1mm/raw/master/pic/esm_config.png)

Expand Down
1 change: 1 addition & 0 deletions not1mm/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2534,6 +2534,7 @@ def run_sp_buttons_clicked(self) -> None:
self.pref["run_state"] = self.radioButton_run.isChecked()
self.write_preference()
self.read_cw_macros()
self.check_esm()

def write_preference(self) -> None:
"""
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.10.18"
__version__ = "24.10.19"
91 changes: 91 additions & 0 deletions not1mm/plugins/arrl_field_day.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,3 +401,94 @@ def ft8_handler(the_packet: dict):
ALTEREGO.other_1.setText(the_packet.get("CLASS", "ERR"))
ALTEREGO.other_2.setText(the_packet.get("ARRL_SECT", "ERR"))
ALTEREGO.save_contact()


def process_esm(self, new_focused_widget=None, with_enter=False):
"""ESM State Machine"""

# self.pref["run_state"]

# -----===== Assigned F-Keys =====-----
# self.esm_dict["CQ"]
# self.esm_dict["EXCH"]
# self.esm_dict["QRZ"]
# self.esm_dict["AGN"]
# self.esm_dict["HISCALL"]
# self.esm_dict["MYCALL"]
# self.esm_dict["QSOB4"]

# ----==== text fields ====----
# self.callsign
# self.sent
# self.receive
# self.other_1
# self.other_2

if new_focused_widget is not None:
self.current_widget = self.inputs_dict.get(new_focused_widget)

# print(f"checking esm {self.current_widget=} {with_enter=} {self.pref.get("run_state")=}")

for a_button in [
self.esm_dict["CQ"],
self.esm_dict["EXCH"],
self.esm_dict["QRZ"],
self.esm_dict["AGN"],
self.esm_dict["HISCALL"],
self.esm_dict["MYCALL"],
self.esm_dict["QSOB4"],
]:
if a_button is not None:
self.restore_button_color(a_button)

buttons_to_send = []

if self.pref.get("run_state"):
if self.current_widget == "callsign":
if len(self.callsign.text()) < 3:
self.make_button_green(self.esm_dict["CQ"])
buttons_to_send.append(self.esm_dict["CQ"])
elif len(self.callsign.text()) > 2:
self.make_button_green(self.esm_dict["HISCALL"])
self.make_button_green(self.esm_dict["EXCH"])
buttons_to_send.append(self.esm_dict["HISCALL"])
buttons_to_send.append(self.esm_dict["EXCH"])

elif self.current_widget in ["other_1", "other_2"]:
if self.other_1.text() == "" or self.other_2.text() == "":
self.make_button_green(self.esm_dict["AGN"])
buttons_to_send.append(self.esm_dict["AGN"])
else:
self.make_button_green(self.esm_dict["QRZ"])
buttons_to_send.append(self.esm_dict["QRZ"])
buttons_to_send.append("LOGIT")

if with_enter is True and bool(len(buttons_to_send)):
for button in buttons_to_send:
if button:
if button == "LOGIT":
self.save_contact()
continue
self.process_function_key(button)
else:
if self.current_widget == "callsign":
if len(self.callsign.text()) > 2:
self.make_button_green(self.esm_dict["MYCALL"])
buttons_to_send.append(self.esm_dict["MYCALL"])

elif self.current_widget in ["other_1", "other_2"]:
if self.other_1.text() == "" or self.other_2.text() == "":
self.make_button_green(self.esm_dict["AGN"])
buttons_to_send.append(self.esm_dict["AGN"])
else:
self.make_button_green(self.esm_dict["EXCH"])
buttons_to_send.append(self.esm_dict["EXCH"])
buttons_to_send.append("LOGIT")

if with_enter is True and bool(len(buttons_to_send)):
for button in buttons_to_send:
if button:
if button == "LOGIT":
self.save_contact()
continue
self.process_function_key(button)
91 changes: 91 additions & 0 deletions not1mm/plugins/winter_field_day.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,3 +321,94 @@ def cabrillo(self):

def recalculate_mults(self):
"""Recalculates multipliers after change in logged qso."""


def process_esm(self, new_focused_widget=None, with_enter=False):
"""ESM State Machine"""

# self.pref["run_state"]

# -----===== Assigned F-Keys =====-----
# self.esm_dict["CQ"]
# self.esm_dict["EXCH"]
# self.esm_dict["QRZ"]
# self.esm_dict["AGN"]
# self.esm_dict["HISCALL"]
# self.esm_dict["MYCALL"]
# self.esm_dict["QSOB4"]

# ----==== text fields ====----
# self.callsign
# self.sent
# self.receive
# self.other_1
# self.other_2

if new_focused_widget is not None:
self.current_widget = self.inputs_dict.get(new_focused_widget)

# print(f"checking esm {self.current_widget=} {with_enter=} {self.pref.get("run_state")=}")

for a_button in [
self.esm_dict["CQ"],
self.esm_dict["EXCH"],
self.esm_dict["QRZ"],
self.esm_dict["AGN"],
self.esm_dict["HISCALL"],
self.esm_dict["MYCALL"],
self.esm_dict["QSOB4"],
]:
if a_button is not None:
self.restore_button_color(a_button)

buttons_to_send = []

if self.pref.get("run_state"):
if self.current_widget == "callsign":
if len(self.callsign.text()) < 3:
self.make_button_green(self.esm_dict["CQ"])
buttons_to_send.append(self.esm_dict["CQ"])
elif len(self.callsign.text()) > 2:
self.make_button_green(self.esm_dict["HISCALL"])
self.make_button_green(self.esm_dict["EXCH"])
buttons_to_send.append(self.esm_dict["HISCALL"])
buttons_to_send.append(self.esm_dict["EXCH"])

elif self.current_widget in ["other_1", "other_2"]:
if self.other_1.text() == "" or self.other_2.text() == "":
self.make_button_green(self.esm_dict["AGN"])
buttons_to_send.append(self.esm_dict["AGN"])
else:
self.make_button_green(self.esm_dict["QRZ"])
buttons_to_send.append(self.esm_dict["QRZ"])
buttons_to_send.append("LOGIT")

if with_enter is True and bool(len(buttons_to_send)):
for button in buttons_to_send:
if button:
if button == "LOGIT":
self.save_contact()
continue
self.process_function_key(button)
else:
if self.current_widget == "callsign":
if len(self.callsign.text()) > 2:
self.make_button_green(self.esm_dict["MYCALL"])
buttons_to_send.append(self.esm_dict["MYCALL"])

elif self.current_widget in ["other_1", "other_2"]:
if self.other_1.text() == "" or self.other_2.text() == "":
self.make_button_green(self.esm_dict["AGN"])
buttons_to_send.append(self.esm_dict["AGN"])
else:
self.make_button_green(self.esm_dict["EXCH"])
buttons_to_send.append(self.esm_dict["EXCH"])
buttons_to_send.append("LOGIT")

if with_enter is True and bool(len(buttons_to_send)):
for button in buttons_to_send:
if button:
if button == "LOGIT":
self.save_contact()
continue
self.process_function_key(button)
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.10.18"
version = "24.10.19"
description = "NOT1MM Logger"
readme = "README.md"
requires-python = ">=3.9"
Expand Down

0 comments on commit 3f22f41

Please sign in to comment.