Skip to content

Commit f3087af

Browse files
authored
Merge pull request #454 from aknrdureegaesr/logged_not_wiped_qso_to_cluster
Logged not wiped qso to cluster
2 parents ff35a7c + c3f309d commit f3087af

File tree

1 file changed

+24
-9
lines changed

1 file changed

+24
-9
lines changed

not1mm/__main__.py

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -695,6 +695,7 @@ def __init__(self, splash):
695695
if self.rotator_window is not None:
696696
self.rotator_window.set_mygrid(self.station.get("GridSquare", ""))
697697
self.contact = self.database.empty_contact.copy()
698+
self.previous_contact = self.contact # Keep previous contact, if any, so we can spot it.
698699
self.current_op = self.station.get("Call", "")
699700
self.voice_process.current_op = self.current_op
700701
self.make_op_dir()
@@ -1756,6 +1757,7 @@ def new_database(self) -> None:
17561757
)
17571758
self.database = DataBase(self.dbname, fsutils.APP_DATA_PATH)
17581759
self.contact = self.database.empty_contact.copy()
1760+
self.previous_contact = self.contact
17591761
self.station = self.database.fetch_station()
17601762
if self.station is None:
17611763
self.station = {}
@@ -1804,6 +1806,7 @@ def open_database(self) -> None:
18041806
)
18051807
self.database = DataBase(self.dbname, fsutils.MODULE_PATH)
18061808
self.contact = self.database.empty_contact.copy()
1809+
self.previous_contact = self.contact
18071810
self.station = self.database.fetch_station()
18081811
if self.station is None:
18091812
self.station = {}
@@ -2618,15 +2621,25 @@ def mark_spot(self):
26182621
self.bandmap_window.msg_from_main(cmd)
26192622

26202623
def spot_dx(self):
2621-
""""""
2622-
freq = self.radio_state.get("vfoa")
2623-
dx = self.callsign.text()
2624-
if freq and dx:
2625-
cmd = {}
2626-
cmd["cmd"] = "SPOTDX"
2627-
cmd["dx"] = dx
2628-
cmd["freq"] = float(int(freq) / 1000)
2629-
if self.bandmap_window:
2624+
"""If a bandmap_window exists, send it a SPOTDX command to forward info to the cluster."""
2625+
if self.bandmap_window:
2626+
freq = self.radio_state.get("vfoa")
2627+
dx = self.callsign.text()
2628+
if freq and dx:
2629+
cmd = {
2630+
"cmd": "SPOTDX",
2631+
"dx": dx,
2632+
"freq": float(int(freq) / 1000)
2633+
}
2634+
elif self.previous_contact["Call"] and self.previous_contact["Freq"]:
2635+
cmd = {
2636+
"cmd": "SPOTDX",
2637+
"dx": self.previous_contact["Call"],
2638+
"freq": self.previous_contact["Freq"]
2639+
}
2640+
else:
2641+
cmd = None
2642+
if cmd:
26302643
self.bandmap_window.msg_from_main(cmd)
26312644

26322645
def get_sn(self):
@@ -3122,6 +3135,8 @@ def save_contact(self) -> None:
31223135
self.n1mm.send_contact_info()
31233136

31243137
self.database.log_contact(self.contact)
3138+
# Copy the last contact so it can be sent to the cluster:
3139+
self.previous_contact = dict(self.contact)
31253140
self.current_sn = None
31263141
# server
31273142
if self.pref.get("useserver", False) is True:

0 commit comments

Comments
 (0)