|
46 | 46 | from PyQt6 import QtWidgets |
47 | 47 |
|
48 | 48 | from not1mm.lib.ham_utility import get_logged_band |
49 | | -from not1mm.lib.plugin_common import gen_adif, get_points |
| 49 | +from not1mm.lib.plugin_common import gen_adif, get_points, online_score_xml |
50 | 50 | from not1mm.lib.version import __version__ |
51 | 51 |
|
52 | 52 | logger = logging.getLogger(__name__) |
@@ -169,24 +169,30 @@ def points(self): |
169 | 169 | return 0 |
170 | 170 |
|
171 | 171 |
|
172 | | -def show_mults(self): |
| 172 | +def show_mults(self, rtc=None): |
173 | 173 | """Return display string for mults""" |
174 | 174 |
|
175 | 175 | # Multipliers: W/VE Stations: Each US state/VE area once per band |
176 | 176 | # Each DXCC/WAE country once per band |
177 | 177 | # Each CQ zone once per band |
178 | 178 |
|
| 179 | + _zone, _country, _spc_count = 0, 0, 0 |
179 | 180 | result1 = self.database.fetch_zn_band_count() |
180 | 181 | result2 = self.database.fetch_country_band_count() |
181 | 182 | res3_query = f"select count(DISTINCT(Exchange1 || ':' || Band)) as spc_count from dxlog where ContestNR = {self.database.current_contest};" |
182 | 183 | result3 = self.database.exec_sql(res3_query) |
183 | | - if result1 and result2 and result3: |
184 | | - return ( |
185 | | - int(result1.get("zb_count", 0)) |
186 | | - + int(result2.get("cb_count", 0)) |
187 | | - + int(result3.get("spc_count", 0)) |
188 | | - ) |
189 | | - return 0 |
| 184 | + |
| 185 | + if result1: |
| 186 | + _zone = int(result1.get("zb_count", 0)) |
| 187 | + if result2: |
| 188 | + _country = int(result2.get("cb_count", 0)) |
| 189 | + if result3: |
| 190 | + _spc_count = int(result3.get("spc_count", 0)) |
| 191 | + |
| 192 | + if rtc is not None: |
| 193 | + return (_country + _spc_count, _zone) |
| 194 | + |
| 195 | + return _country + _spc_count + _zone |
190 | 196 |
|
191 | 197 |
|
192 | 198 | def show_qso(self): |
@@ -647,3 +653,15 @@ def check_call_history(self): |
647 | 653 | self.other_1.setText(f"{result.get('CQZone', '')}") |
648 | 654 | if self.other_2.text() == "": |
649 | 655 | self.other_2.setText(f"{result.get('State', '')}") |
| 656 | + |
| 657 | + |
| 658 | +def get_mults(self): |
| 659 | + """Get mults for RTC XML""" |
| 660 | + mults = {} |
| 661 | + mults["country"], mults["zone"] = show_mults(self, rtc=True) |
| 662 | + return mults |
| 663 | + |
| 664 | + |
| 665 | +def just_points(self): |
| 666 | + """Get points for RTC XML""" |
| 667 | + return get_points(self) |
0 commit comments