-
Notifications
You must be signed in to change notification settings - Fork 0
/
calls.py
executable file
·147 lines (104 loc) · 4.3 KB
/
calls.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
############################################################################################
#
# calls.py - Rev 1.0
# Copyright (C) 2021-4 by Joseph B. Attili, aa2il AT arrl DOT net
#
# Keying routines for random callsigns practice.
#
############################################################################################
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
############################################################################################
from tkinter import END,E,W
from collections import OrderedDict
from random import random
from rig_io import SST_SECS
from default import DEFAULT_KEYING
############################################################################################
VERBOSITY=0
############################################################################################
# Keying class for SST mini tests - inherits base class
class RANDOM_CALLS_KEYING(DEFAULT_KEYING):
def __init__(self,P):
DEFAULT_KEYING.__init__(self,P,'SST','K1USNSST*.txt')
# Routient to set macros for this contest
def macros(self):
MACROS = OrderedDict()
MACROS[0] = {'Label' : 'CQ' , 'Text' : 'CQ '}
MACROS[1] = {'Label' : 'Reply' , 'Text' : '[CALL]'}
MACROS[2] = {'Label' : 'TU/QRZ?' , 'Text' : '[CALL_CHANGED] ee [LOG]'}
MACROS[3] = {'Label' : 'Call?' , 'Text' : '[CALL]? '}
MACROS[3+12] = {'Label' : 'Call?' , 'Text' : 'CALL? '}
MACROS[4] = {'Label' : '[MYCALL]' , 'Text' : '[MYCALL] '}
MACROS[4+12] = {'Label' : 'His Call' , 'Text' : '[CALL] '}
MACROS[5] = {'Label' : 'S&P Reply' , 'Text' : 'TU '}
MACROS[6] = {'Label' : 'AGN?' , 'Text' : 'AGN? '}
MACROS[6+12] = {'Label' : '? ' , 'Text' : '? '}
MACROS[7] = {'Label' : 'Log QSO' , 'Text' : '[LOG] '}
MACROS[8] = {'Label' : ' ' , 'Text' : ' '}
MACROS[9] = {'Label' : ' ' , 'Text' : ' '}
MACROS[10] = {'Label' : ' ' , 'Text' : ' '}
MACROS[11] = {'Label' : ' ' , 'Text' : ' '}
return MACROS
# Routine to generate a hint for a given call
def hint(self,call):
P=self.P
return ' '
# Routine to get practice qso info
def qso_info(self,HIST,call,iopt):
if iopt==1:
done = True
return done
else:
self.call = call
txt2 = ' '
return txt2
# Error checking
def error_check(self):
P=self.P
call2 = P.gui.get_call().upper()
match = self.call==call2
if not match:
txt='********************** ERROR **********************'
print(txt)
P.gui.txt.insert(END, txt+'\n')
txt2='Call sent:'+self.call+'\t- received:'+call2
print(txt2)
P.gui.txt.insert(END, txt2+'\n')
print(txt+'\n')
P.gui.txt.insert(END, txt+'\n')
P.gui.txt.see(END)
return match
# Specific contest exchange for SST
def enable_boxes(self,gui):
gui.contest=True
gui.hide_all()
# Indicate which macro to fire if return key is pressed while in each entry bos
self.macros=[1,None,2]
gui.boxes=[gui.call]
gui.boxes.append(gui.name)
gui.boxes.append(gui.qth)
# Gather together logging info for this contest
def logging(self):
gui=self.P.gui
call=gui.get_call().upper()
valid = len(call)>=3
exch = ''
exch_out = ''
qso2={}
return exch,valid,exch_out,qso2
# Dupe processing for this contest
def dupe(self,a):
gui=self.P.gui
# Hint insertion
def insert_hint(self,h=None):
gui=self.P.gui