Skip to content

Commit

Permalink
@mbridak Add ESM to ARRL VHF
Browse files Browse the repository at this point in the history
  • Loading branch information
mbridak committed Nov 24, 2024
1 parent 801ab1b commit c026bea
Show file tree
Hide file tree
Showing 4 changed files with 281 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@ generated, 'cause I'm lazy, list of those who've submitted PR's.
- **ARRL DX CW, SSB**
- **ARRL Field Day**
- **ARRL Sweepstakes CW, SSB**
- ARRL VHF January, June, September
- CQ 160 CW, SSB
- **ARRL VHF January, June, September**
- **CQ 160 CW, SSB**
- **CQ WPX CW, RTTY, SSB**
- **CQ World Wide CW, RTTY, SSB**
- **CWOps CWT**
Expand Down
93 changes: 92 additions & 1 deletion not1mm/plugins/arrl_vhf_jan.py
Original file line number Diff line number Diff line change
Expand Up @@ -522,11 +522,102 @@ def ft8_handler(the_packet: dict):
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_2"]:
if 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_2"]:
if 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)


def populate_history_info_line(self):
result = self.database.fetch_call_history(self.callsign.text())
if result:
self.history_info.setText(
f"{result.get('Call', '')}, {result.get('Loc1', '')}, {result.get('UserText','...')}"
f"{result.get('Call', '')}, {result.get('Name', '')}, {result.get('Loc1', '')}, {result.get('UserText','...')}"
)
else:
self.history_info.setText("")
Expand Down
93 changes: 92 additions & 1 deletion not1mm/plugins/arrl_vhf_jun.py
Original file line number Diff line number Diff line change
Expand Up @@ -490,11 +490,102 @@ def ft8_handler(the_packet: dict):
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_2"]:
if 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_2"]:
if 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)


def populate_history_info_line(self):
result = self.database.fetch_call_history(self.callsign.text())
if result:
self.history_info.setText(
f"{result.get('Call', '')}, {result.get('Loc1', '')}, {result.get('UserText','...')}"
f"{result.get('Call', '')}, {result.get('Name', '')}, {result.get('Loc1', '')}, {result.get('UserText','...')}"
)
else:
self.history_info.setText("")
Expand Down
96 changes: 95 additions & 1 deletion not1mm/plugins/arrl_vhf_sep.py
Original file line number Diff line number Diff line change
Expand Up @@ -490,11 +490,102 @@ def ft8_handler(the_packet: dict):
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_2"]:
if 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_2"]:
if 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)


def populate_history_info_line(self):
result = self.database.fetch_call_history(self.callsign.text())
if result:
self.history_info.setText(
f"{result.get('Call', '')}, {result.get('Loc1', '')}, {result.get('UserText','...')}"
f"{result.get('Call', '')}, {result.get('Name', '')}, {result.get('Loc1', '')}, {result.get('UserText','...')}"
)
else:
self.history_info.setText("")
Expand All @@ -507,3 +598,6 @@ def check_call_history(self):
self.history_info.setText(f"{result.get('UserText','')}")
if self.other_2.text() == "":
self.other_2.setText(f"{result.get('Loc1', '')}")


# !!Order!!,Call,Name,Loc1,UserText,

0 comments on commit c026bea

Please sign in to comment.