/
wsjt.py
2927 lines (2713 loc) · 102 KB
/
wsjt.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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/usr/bin/env python
#--------------------------------------------------------------------- WSJT
# $Date$ $Revision$
#
from Tkinter import *
from tkFileDialog import *
from WsjtMod import Pmw
import tkMessageBox
from WsjtMod import g
import os,time
from WsjtMod import Audio
from math import log10
try:
from numpy.oldnumeric import zeros
# print "importing from numpy"
except:
from Numeric import zeros
# print "importing from Numeric"
import dircache
import Image,ImageTk #, ImageDraw
from WsjtMod.palettes import colormapblue, colormapgray0, colormapHot, \
colormapAFMHot, colormapgray1, colormapLinrad, Colormap2Palette
from types import *
import array
import thread
import webbrowser
root = Tk()
Version="9.1 r" + "$Rev$"[6:-1]
print "******************************************************************"
print "WSJT Version " + Version + ", by K1JT"
print "Revision date: " + \
"$Date$"[7:-1]
print "Run date: " + time.asctime(time.gmtime()) + " UTC"
#See if we are running in Windows
g.Win32=0
if sys.platform=="win32":
g.Win32=1
try:
root.option_readfile('wsjtrc.win')
except:
pass
else:
try:
root.option_readfile('wsjtrc')
except:
pass
root_geom=""
#------------------------------------------------------ Global variables
appdir=os.getcwd()
Audio.gcom2.appdir=(appdir+(' '*80))[:80]
Audio.ftn_init()
addpfx0=""
first=1
g.appdir=appdir
isync=0
isync441=1
isync_iscat=1
isync65=1
isync_save=0
itol=5 #Default tol=400 Hz
ntol=(10,25,50,100,200,400,600) #List of available tolerances
idsec=0
#irdsec=0
lauto=0
ltxdf=0
altmsg=0
cmap0="Linrad"
fileopened=""
font1='Helvetica'
hiscall=""
hisgrid=""
isec0=-99
jtol=IntVar()
k2txb=IntVar()
kb8rq=IntVar()
loopall=0
mode=StringVar()
mode.set("")
mrudir=os.getcwd()
MyCall0=""
nafc=IntVar()
naz=0
ndepth=IntVar()
nel=0
ncall=0
ncwtrperiod=120
ndmiles=0
ndkm=0
ndebug=IntVar()
neme=IntVar()
nfreeze=IntVar()
nhotaz=0
nhotabetter=0
nmeas=0
nlowbeacon=IntVar()
nlowbeacon.set(0)
nmonitor=IntVar()
nopen=0
nshrx=IntVar()
noshjt65=IntVar()
noshjt65all=IntVar()
nsync=IntVar()
nzap=IntVar()
qdecode=IntVar()
setseq=IntVar()
ShOK=IntVar()
slabel="Sync "
textheight=7
ToRadio0=""
tx6alt=""
txsnrdb=99.
TxFirst=IntVar()
xypm=[]
green=zeros(500,'f')
im=Image.new('P',(500,120))
im.putpalette(Colormap2Palette(colormapLinrad),"RGB")
pim=ImageTk.PhotoImage(im)
balloon=Pmw.Balloon(root)
g.freeze_decode=0
g.mode=""
g.ndevin=IntVar()
g.ndevout=IntVar()
g.DevinName=StringVar()
g.DevoutName=StringVar()
#------------------------------------------------------ showspecjt
def showspecjt(event=NONE):
if g.showspecjt==0: g.showspecjt=1
#------------------------------------------------------ restart
def restart():
Audio.gcom2.nrestart=1
Audio.gcom2.mantx=1
#------------------------------------------------------ restart2
def restart2():
Audio.gcom2.shok=ShOK.get()
Audio.gcom2.nrestart=1
#------------------------------------------------------ toggle_freeze
def toggle_freeze(event=NONE):
nfreeze.set(1-nfreeze.get())
#------------------------------------------------------ toggle_zap
def toggle_zap(event=NONE):
nzap.set(1-nzap.get())
#------------------------------------------------------ btx (1-6)
def btx1(event=NONE):
ntx.set(1)
Audio.gcom2.txmsg=(tx1.get()+(' '*28))[:28]
Audio.gcom2.ntxreq=1
restart()
def btx2(event=NONE):
ntx.set(2)
Audio.gcom2.txmsg=(tx2.get()+(' '*28))[:28]
Audio.gcom2.ntxreq=2
restart()
def btx3(event=NONE):
ntx.set(3)
Audio.gcom2.txmsg=(tx3.get()+(' '*28))[:28]
Audio.gcom2.ntxreq=3
restart()
def btx4(event=NONE):
ntx.set(4)
Audio.gcom2.txmsg=(tx4.get()+(' '*28))[:28]
Audio.gcom2.ntxreq=4
restart()
def btx5(event=NONE):
ntx.set(5)
Audio.gcom2.txmsg=(tx5.get()+(' '*28))[:28]
Audio.gcom2.ntxreq=5
restart()
def btx6(event=NONE):
ntx.set(6)
Audio.gcom2.txmsg=(tx6.get()+(' '*28))[:28]
Audio.gcom2.ntxreq=6
restart()
#------------------------------------------------------ quit
def quit(event=NONE):
root.destroy()
#------------------------------------------------------ testmsgs
def testmsgs():
for m in (tx1, tx2, tx3, tx4, tx5, tx6):
m.delete(0,99)
tx1.insert(0,"@A")
tx2.insert(0,"@B")
tx3.insert(0,"@C")
tx4.insert(0,"@D")
tx5.insert(0,"@1000")
tx6.insert(0,"@2000")
#------------------------------------------------------ textsize
def textsize():
global textheight
if textheight <= 9:
textheight=21
else:
if mode.get()[:4]=='JT65' or mode.get()[:3]=='JT4':
textheight=7
else:
textheight=9
text.configure(height=textheight)
#------------------------------------------------------ logqso
def logqso(event=NONE):
t=time.strftime("%Y-%b-%d,%H:%M",time.gmtime())
tf=str(g.nfreq)
if g.nfreq==2: tf="1.8"
if g.nfreq==4: tf="3.5"
t=t+","+ToRadio.get()+","+HisGrid.get()+","+tf+","+g.mode+"\n"
t2="Please confirm making the following entry in WSJT.LOG:\n\n" + t
result=tkMessageBox.askyesno(message=t2)
if result:
f=open(appdir+'/WSJT.LOG','a')
f.write(t)
f.close()
#------------------------------------------------------ monitor
def monitor(event=NONE):
bmonitor.configure(bg='green')
Audio.gcom2.monitoring=1
#------------------------------------------------------ stopmon
def stopmon(event=NONE):
global loopall
loopall=0
bmonitor.configure(bg='gray85')
Audio.gcom2.monitoring=0
#------------------------------------------------------ dbl_click_text
def dbl_click_text(event):
t=text.get('1.0',END) #Entire contents of text box
t1=text.get('1.0',CURRENT) #Contents from start to mouse pointer
if mode.get()=='Diana':
report.delete(0,END)
report.insert(0,'OOO')
dbl_click_call(t,t1,'OOO',event)
#------------------------------------------------------ dbl_click3_text
def dbl_click3_text(event):
if mode.get()[:4]=='JT65' or mode.get()[:3]=='JT4':
t=text.get('1.0',END) #Entire contents of text box
t1=text.get('1.0',CURRENT) #Contents from start to mouse pointer
n=t1.rfind("\n")
rpt=t1[n+12:n+15]
if rpt[0:1] == " ": rpt=rpt[1:]
if rpt[:1]=='-' and len(rpt)==2: rpt=rpt[0:1]+'0'+rpt[1:2]
dbl_click_call(t,t1,rpt,event)
elif mode.get()[:5]=='ISCAT' or mode.get()=='Diana':
t=text.get('1.0',END) #Entire contents of text box
t1=text.get('1.0',CURRENT) #Contents from start to mouse pointer
n=t1.rfind("\n")
rpt=t1[n+12:n+15]
if mode.get()=='Diana':
rpt=t1[n+12:n+16]
if rpt[0:1] == " ": rpt=rpt[1:]
report.delete(0,END)
report.insert(0,rpt)
dbl_click_call(t,t1,rpt,event)
elif mode.get()=='FSK441' or mode.get()=='JTMS':
t=text.get('1.0',END) #Entire contents of text box
t1=text.get('1.0',CURRENT) #Contents from start to mouse pointer
n=t1.rfind("\n")
rpt=t1[n+21:n+23]
report.delete(0,END)
report.insert(0,rpt)
dbl_click_call(t,t1,rpt,event)
#------------------------------------------------------ dbl_click_ave
def dbl_click_ave(event):
t=avetext.get('1.0',END) #Entire contents of text box
t1=avetext.get('1.0',CURRENT) #Contents from start to mouse pointer
dbl_click_call(t,t1,'OOO',event)
#------------------------------------------------------ dbl_click_call
def dbl_click_call(t,t1,rpt,event):
global hiscall
i=len(t1) #Length to mouse pointer
i1=t1.rfind(' ')+1 #index of preceding space
i2=i1+t[i1:].find(' ') #index of next space
hiscall=t[i1:i2] #selected word, assumed as callsign
if hiscall[0:1]=='<' and hiscall [i2-i1-1:]=='>':
hiscall=hiscall[1:i2-i1-1]
ToRadio.delete(0,END)
ToRadio.insert(0,hiscall)
i3=t1.rfind('\n')+1 #start of selected line
if i>6 and i2>i1:
try:
nsec=60*int(t1[i3+2:i3+4]) + int(t1[i3+4:i3+6])
except:
nsec=0
if setseq.get(): TxFirst.set((nsec/Audio.gcom1.trperiod)%2)
lookup()
GenStdMsgs()
if (mode.get()[:4]=='JT65' or \
mode.get()[:3]=='JT4') and rpt <> "OOO":
n=tx1.get().rfind(" ")
t2=tx1.get()[0:n+1]
tx2.delete(0,END)
tx2.insert(0,t2+rpt)
tx3.delete(0,END)
tx3.insert(0,t2+"R"+rpt)
tx4.delete(0,END)
tx4.insert(0,t2+"RRR")
tx5.delete(0,END)
tx5.insert(0,t2+"73")
if t[i3:i1].find(' CQ ')>=0:
ntx.set(1)
else:
ntx.set(2)
if event.num==3 and not lauto: toggleauto()
def textkey(event=NONE):
text.configure(state=DISABLED)
def avetextkey(event=NONE):
avetext.configure(state=DISABLED)
#------------------------------------------------------ force_decode
def force_decode(event=NONE):
Audio.gcom2.nforce=1
if event.keysym == 'd': Audio.gcom2.ntx2=0
if event.keysym == 'D': Audio.gcom2.ntx2=1
decode()
#------------------------------------------------------ decode
def decode(event=NONE):
if Audio.gcom2.ndecoding==0: #If already busy, ignore request
Audio.gcom2.nagain=1
Audio.gcom2.npingtime=0 #Decode whole record
n=1
Audio.gcom2.mousebutton=0
if Audio.gcom2.ndecoding0==4: n=4
Audio.gcom2.ndecoding=n #Standard decode, full file (d2a)
#------------------------------------------------------ decode_include
def decode_include(event=NONE):
global isync,isync_save
isync_save=isync
isync=-99
Audio.gcom2.minsigdb=-99
decode()
#------------------------------------------------------ decode_exclude
def decode_exclude(event=NONE):
global isync,isync_save
isync_save=isync
isync=99
Audio.gcom2.minsigdb=99
decode()
#------------------------------------------------------ openfile
def openfile(event=NONE):
global mrudir,fileopened,nopen
nopen=1 #Work-around for "click feedthrough" bug
try:
os.chdir(mrudir)
except:
pass
fname=askopenfilename(filetypes=[("Wave files","*.wav *.WAV")])
if fname:
Audio.getfile(fname,len(fname))
if Audio.gcom2.ierr: print 'Error ',Audio.gcom2.ierr, \
'when trying to read file',fname
mrudir=os.path.dirname(fname)
fileopened=os.path.basename(fname)
os.chdir(appdir)
#------------------------------------------------------ opennext
def opennext(event=NONE):
global ncall,fileopened,loopall,mrudir
if fileopened=="" and ncall==0:
openfile()
ncall=1
else:
# Make a list of *.wav files in mrudir
la=os.listdir(mrudir)
la.sort()
lb=[]
for i in range(len(la)):
j=la[i].find(".wav") + la[i].find(".WAV")
if j>0: lb.append(la[i])
for i in range(len(lb)):
if lb[i]==fileopened:
break
if i<len(lb)-1:
fname=mrudir+"/"+lb[i+1]
# if not lauto: stopmon()
Audio.getfile(fname,len(fname))
if Audio.gcom2.ierr: print 'Error ',Audio.gcom2.ierr, \
'when trying to read file',fname
mrudir=os.path.dirname(fname)
fileopened=os.path.basename(fname)
else:
t="No more *.wav files in this directory."
tkMessageBox.showwarning(message=t)
ncall=0
loopall=0
#------------------------------------------------------ decodeall
def decodeall(event=NONE):
global loopall
loopall=1
opennext()
#------------------------------------------------------ astro1
def astro1(event=NONE):
astro.astro2(g.astro_geom0)
#------------------------------------------------------ options1
def options1(event=NONE):
options.options2(root_geom[root_geom.index("+"):])
#------------------------------------------------------ txmute
def txmute(event=NONE):
Audio.gcom1.mute=1-Audio.gcom1.mute
if Audio.gcom1.mute:
lab7.configure(bg='red',fg='black')
else:
lab7.configure(bg='gray85',fg='gray85')
#------------------------------------------------------ savelast
def savelast(event=NONE):
Audio.gcom2.nsavelast=1
#------------------------------------------------------ stub
def stub(event=NONE):
MsgBox("Sorry, this function is not yet implemented.")
#------------------------------------------------------ MsgBox
def MsgBox(t):
tkMessageBox._show(message=t)
#------------------------------------------------------ txstop
def txstop(event=NONE):
if lauto: toggleauto()
Audio.gcom1.txok=0
Audio.gcom2.mantx=0
#------------------------------------------------------ lookup
def lookup(event=NONE):
global hiscall,hisgrid
hiscall=ToRadio.get().upper().strip()
ToRadio.delete(0,END)
ToRadio.insert(0,hiscall)
s=whois(hiscall)
balloon.bind(ToRadio,s[:-1])
hisgrid=""
if s:
i1=s.find(',')
i2=s.find(',',i1+1)
hisgrid=s[i1+1:i2]
hisgrid=hisgrid[:2].upper()+hisgrid[2:4]+hisgrid[4:6].lower()
if len(hisgrid)==4: hisgrid=hisgrid+"mm"
if len(hisgrid)==5: hisgrid=hisgrid+"m"
HisGrid.delete(0,99)
HisGrid.insert(0,hisgrid)
def lookup_gen(event):
lookup()
GenStdMsgs()
#-------------------------------------------------------- addtodb
def addtodb():
global hiscall
if HisGrid.get()=="":
MsgBox("Please enter a valid grid locator.")
else:
modified=0
hiscall=ToRadio.get().upper().strip()
hisgrid=HisGrid.get().strip()
hc=hiscall
NewEntry=hc + "," + hisgrid
result=tkMessageBox.askyesno(message="Is this station known to be active on EME?")
if result:
NewEntry=NewEntry + ",EME,,"
else:
NewEntry=NewEntry + ",,,"
try:
f=open(appdir+'/CALL3.TXT','r')
s=f.readlines()
except:
print 'Error opening CALL3.TXT'
s=""
f.close()
hc2=""
stmp=[]
for i in range(len(s)):
hc1=hc2
if s[i][:2]=="//":
stmp.append(s[i])
else:
i1=s[i].find(",")
hc2=s[i][:i1]
if hc>hc1 and hc<hc2:
stmp.append(NewEntry+"\n")
modified=1
elif hc==hc2:
t=s[i] + "\n\n is already in CALL3.TXT\nDo you wish to replace this entry?"
result=tkMessageBox.askyesno(message=t)
if result:
i1=s[i].find(",")
i2=s[i].find(",",i1+1)
i3=s[i].find(",",i2+1)
i4=len(NewEntry)
s[i]=NewEntry[:i4-1] + s[i][i3+1:]
modified=1
stmp.append(s[i])
if hc>hc1 and modified==0:
stmp.append(NewEntry+"\n")
try:
f=open(appdir+'/CALL3.TMP','w')
f.writelines(stmp)
f.close()
except:
print 'Error in opening or writing to CALL3.TMP'
if modified:
if os.path.exists("CALL3.OLD"): os.remove("CALL3.OLD")
os.rename("CALL3.TXT","CALL3.OLD")
os.rename("CALL3.TMP","CALL3.TXT")
#------------------------------------------------------ setrpt
def setrpt(event):
# report.delete(0,END)
report.focus_set()
#-------------------------------------------------------- clrToRadio
def clrToRadio(event):
ToRadio.delete(0,END)
HisGrid.delete(0,99)
ToRadio.focus_set()
if kb8rq.get():
ntx.set(6)
nfreeze.set(0)
#------------------------------------------------------ whois
def whois(hiscall):
whodat=""
try:
f=open(appdir+'/CALL3.TXT','r')
s=f.readlines()
f.close()
except:
print 'Error when searching CALL3.TXT, or no such file present'
s=""
for i in range(len(s)):
if s[i][:2] != '//':
i1=s[i].find(',')
if s[i][:i1] == hiscall:
return s[i]
return ""
#------------------------------------------------------ cleartext
def cleartext():
f=open(appdir+'/decoded.txt',mode='w')
f.truncate(0) #Delete contents of decoded.txt
f.close()
f=open(appdir+'/decoded.ave',mode='w')
f.truncate(0) #Delete contents of decoded.ave
f.close()
#------------------------------------------------------ ModeFSK441
def ModeFSK441(event=NONE):
global slabel,isync,isync441,textheight,itol
if g.mode != "FSK441":
if lauto: toggleauto()
mode.set("FSK441")
cleartext()
Audio.gcom1.trperiod=30
lab2.configure(text='FileID T Width dB Rpt DF')
lab1.configure(text='Time (s)',bg="green")
lab4.configure(fg='black')
lab5.configure(fg='black')
lab6.configure(bg="green")
isync=isync441
slabel="S "
f5b1.grid(column=0,row=0,padx=2,sticky='EW')
lsync.configure(text=slabel+str(isync))
iframe4b.pack_forget()
textheight=9
text.configure(height=textheight)
bclravg.pack_forget()
binclude.pack_forget()
bexclude.pack_forget()
cbfreeze.grid_forget()
cbafc.grid_forget()
lsync.grid(column=0,row=0,padx=8,sticky='EW')
ltol.grid(column=0,row=1,padx=8,sticky='EW')
cbzap.grid(column=1,row=0,padx=2,sticky='W')
nfreeze.set(0)
shrx.grid(column=1,row=1,sticky='W',padx=2)
shmsg.grid(column=1,row=0,sticky='W',padx=2)
report.grid(column=1,row=1,sticky='W',padx=7)
labreport.grid(column=0,row=1,sticky='E',padx=0)
if ltxdf: toggletxdf()
graph2.configure(bg='black')
btxdf.grid_forget()
report.delete(0,END)
report.insert(0,'26')
itol=4
inctol()
ntx.set(1)
GenStdMsgs()
erase()
#------------------------------------------------------ ModeJT65
def ModeJT65():
global slabel,isync,isync65,textheight,itol
cleartext()
lab2.configure(text='FileID Sync dB DT DF W')
lab4.configure(fg='gray85')
lab5.configure(fg='gray85')
Audio.gcom1.trperiod=60
iframe4b.pack(after=iframe4,expand=1, fill=X, padx=4)
textheight=7
text.configure(height=textheight)
isync=isync65
slabel="Sync "
f5b1.grid(column=0,row=0,padx=2,sticky='EW')
lsync.configure(text=slabel+str(isync))
lsync.grid(column=0,row=0,padx=2,sticky='EW')
ltol.grid(column=0,row=1,padx=2,sticky='EW')
cbzap.grid(column=1,row=0,padx=2,sticky='W')
btxstop.pack_forget()
bclravg.pack(side=LEFT,expand=1,fill=X)
binclude.pack(side=LEFT,expand=1,fill=X)
bexclude.pack(side=LEFT,expand=1,fill=X)
btxstop.pack(side=LEFT,expand=1,fill=X)
cbfreeze.grid(column=1,row=2,padx=2,sticky='W')
cbafc.grid(column=1,row=1,padx=2,sticky='W')
if ltxdf: toggletxdf()
btxdf.grid_forget()
shmsg.grid_forget()
shrx.grid_forget()
report.grid_forget()
labreport.grid_forget()
graph2.configure(bg='#66FFFF')
itol=4
inctol()
nfreeze.set(0)
ntx.set(1)
GenStdMsgs()
erase()
# graph2.pack_forget()
#------------------------------------------------------ ModeJT65A
def ModeJT65A(event=NONE):
if g.mode != "JT65A":
if lauto: toggleauto()
ModeJT65()
mode.set("JT65A")
btxdf.grid(column=1,row=0,sticky='EW',padx=4)
#------------------------------------------------------ ModeJT65B
def ModeJT65B(event=NONE):
if g.mode != "JT65B":
if lauto: toggleauto()
mode.set("JT65B")
ModeJT65()
#------------------------------------------------------ ModeJT65B2
def ModeJT65B2(event=NONE):
if g.mode != "JT65B2":
if lauto: toggleauto()
mode.set("JT65B2")
ModeJT65()
Audio.gcom1.trperiod=30
#------------------------------------------------------ ModeJT65C
def ModeJT65C(event=NONE):
if g.mode != "JT65C":
if lauto: toggleauto()
mode.set("JT65C")
ModeJT65()
#------------------------------------------------------ ModeJT65C2
def ModeJT65C2(event=NONE):
if g.mode != "JT65C2":
if lauto: toggleauto()
mode.set("JT65C2")
ModeJT65()
Audio.gcom1.trperiod=30
#------------------------------------------------------ ModeJTMS
def ModeJTMS(event=NONE):
if g.mode != "JTMS":
if lauto: toggleauto()
ModeFSK441()
cbfreeze.grid(column=0,row=2,padx=4,sticky='W')
mode.set("JTMS")
#------------------------------------------------------ ModeISCAT_A
def ModeISCAT_A(event=NONE):
ModeISCAT_B()
mode.set("ISCAT-A")
Audio.gcom2.mode4=1
#------------------------------------------------------ ModeISCAT_B
def ModeISCAT_B(event=NONE):
global isync,isync_iscat,slabel
if g.mode != "ISCAT-B":
if lauto: toggleauto()
cleartext()
ModeFSK441()
slabel="Sync "
mode.set("ISCAT-B")
lab2.configure(text='FileID Sync dB DT DF F1')
isync=isync_iscat
lsync.configure(text=slabel+str(isync))
cbafc.grid(column=1,row=1,padx=2,sticky='W')
cbfreeze.grid(column=1,row=2,padx=2,sticky='W')
itol=3
ltol.configure(text='Tol '+str(ntol[itol]))
inctol()
nfreeze.set(0)
report.delete(0,END)
report.insert(0,'-15')
shrx.grid_forget()
shmsg.grid_forget()
ntx.set(1)
Audio.gcom2.mousedf=0
Audio.gcom2.mode4=2
GenStdMsgs()
erase()
#------------------------------------------------------ ModeDiana
def ModeDiana(event=NONE):
global isync,isync_iscat
if g.mode != "Diana":
if lauto: toggleauto()
ModeJT65()
Audio.gcom1.trperiod=30
mode.set("Diana")
lab2.configure(text='FileID Sync dB DT DF F1')
isync=1
lsync.configure(text=slabel+str(isync))
report.delete(0,END)
report.insert(0,'-20')
#------------------------------------------------------ ModeCW
def ModeCW(event=NONE):
if g.mode != "CW":
if lauto: toggleauto()
cleartext()
ModeJT65B()
mode.set("CW")
Audio.gcom1.trperiod=ncwtrperiod
iframe4b.pack_forget()
text.configure(height=9)
cbfreeze.grid_forget()
cbafc.grid_forget()
lsync.grid_forget()
ltol.grid_forget()
cbzap.grid_forget()
f5b1.grid_forget()
if ltxdf: toggletxdf()
ntx.set(1)
GenStdMsgs()
erase()
#------------------------------------------------------ ModeJT4
def ModeJT4():
global slabel,isync,isync65,textheight,itol
ModeJT65()
bclravg.pack_forget()
binclude.pack_forget()
bexclude.pack_forget()
#------------------------------------------------------ ModeJT4A
def ModeJT4A():
global slabel,isync,isync65,textheight,itol
ModeJT4()
mode.set("JT4A")
Audio.gcom2.mode4=1
btxdf.grid(column=1,row=0,sticky='EW',padx=4)
#------------------------------------------------------ ModeJT4B
def ModeJT4B():
global slabel,isync,isync65,textheight,itol
ModeJT4()
mode.set("JT4B")
Audio.gcom2.mode4=2
#------------------------------------------------------ ModeJT4C
def ModeJT4C():
global slabel,isync,isync65,textheight,itol
ModeJT4()
mode.set("JT4C")
Audio.gcom2.mode4=4
#------------------------------------------------------ ModeJT4D
def ModeJT4D():
global slabel,isync,isync65,textheight,itol
ModeJT4()
mode.set("JT4D")
Audio.gcom2.mode4=9
#------------------------------------------------------ ModeJT4E
def ModeJT4E():
global slabel,isync,isync65,textheight,itol
ModeJT4()
mode.set("JT4E")
Audio.gcom2.mode4=18
#------------------------------------------------------ ModeJT4F
def ModeJT4F():
global slabel,isync,isync65,textheight,itol
ModeJT4()
mode.set("JT4F")
Audio.gcom2.mode4=36
#------------------------------------------------------ ModeJT4G
def ModeJT4G():
global slabel,isync,isync65,textheight,itol
ModeJT4()
mode.set("JT4G")
Audio.gcom2.mode4=72
#------------------------------------------------------ ModeEcho
def ModeEcho(event=NONE):
ModeCW()
mode.set("Echo")
if lauto: toggleauto()
lab2.configure(text=' N Level Sig DF Width Az El Q')
Audio.gcom1.trperiod=6
tx1.delete(0,99)
tx2.delete(0,99)
tx3.delete(0,99)
tx4.delete(0,99)
tx5.delete(0,99)
tx6.delete(0,99)
#------------------------------------------------------ ModeMeasure
def ModeMeasure(event=NONE):
ModeEcho()
mode.set("Measure")
#------------------------------------------------------ msgpos
def msgpos():
g=root_geom[root_geom.index("+"):]
t=g[1:]
x=int(t[:t.index("+")]) # + 70
y=int(t[t.index("+")+1:]) # + 70
return "+%d+%d" % (x,y)
#------------------------------------------------------ about
def about(event=NONE):
global Version
about=Toplevel(root)
about.geometry(msgpos())
if g.Win32: about.iconbitmap("wsjt.ico")
t="WSJT Version " + Version + ", by K1JT"
Label(about,text=t,font=(font1,16)).pack(padx=20,pady=5)
t="""
WSJT is a weak signal communications program. It supports
these operating modes:
1. FSK441 - meteor scatter
2. ISCAT - for tropo- and iono-scatter, weak Es/F2 on 50 MHz
(replaces JT6M)
3. JT65 - for HF, EME, and troposcatter
4. JT4 - HF, microwave beacons, 10 GHz EME and rainscatter
5. CW - 15 WPM Morse code, messages structured for EME
6. Echo - EME Echo testing
Copy (c) 2001-2011 by Joseph H. Taylor, Jr., K1JT, with
contributions from additional authors. WSJT is Open Source
software, licensed under the GNU General Public License (GPL).
Source code and programming information may be found at
http://developer.berlios.de/projects/wsjt/.
"""
Label(about,text=t,justify=LEFT).pack(padx=20)
t="Revision date: " + \
"$Date$"[7:-1]
Label(about,text=t,justify=LEFT).pack(padx=20)
about.focus_set()
#------------------------------------------------------ shortcuts
def shortcuts(event=NONE):
scwid=Toplevel(root)
scwid.geometry(msgpos())
if g.Win32: scwid.iconbitmap("wsjt.ico")
t="""
F1 List keyboard shortcuts
Shift+F1 List special mouse commands
Ctrl+F1 About WSJT
F2 Options
F3 Tx Mute
F4 Clear "To Radio"
Alt+F4 Exit program
F5 What message to send?
Shift+F5 Examples of minimal JT65 QSOs
F6 Open next file in directory
Shift+F6 Decode all wave files in directory
F9 Online Supplement to User's Guide
F10 Show SpecJT
Shift+F10 Show astronomical data
F11 Decrement Freeze DF
F12 Increment Freeze DF
Alt+1 to Alt+6 Tx1 to Tx6
Alt+A Toggle Auto On/Off
Alt+C Clear average
Alt+D Decode
Ctrl+D Force Decode
Shift+Ctrl+D Force Decode, no JT65 shorthands
Alt+E Erase
Alt+F Toggle Freeze
Alt+G Generate standard messages
Ctrl+G Generate alternate JT65/JT4 Messages
Alt+I Include
Alt+L Lookup
Ctrl+L Lookup, then Generate Standard Messages
Alt+M Monitor
Alt+O Tx Stop
Alt+Q Log QSO
Alt+R Enter report
Alt+S Stop Monitoring or Decoding
Alt+V Save Last
Alt+X Exclude
Alt+Z Toggle Zap
"""
Label(scwid,text=t,justify=LEFT).pack(padx=20)
scwid.focus_set()
#------------------------------------------------------ mouse_commands
def mouse_commands(event=NONE):
scwid=Toplevel(root)
scwid.geometry(msgpos())
if g.Win32: scwid.iconbitmap("wsjt.ico")
t="""
Click on Action
--------------------------------------------------------
Waterfall FSK441, JTMS: click to decode region
JT65: Click to set DF for Freeze
Double-click to Freeze and Decode
Main screen, FSK441, JTMS, ISCAT: click to decode ping
graphics area JT65: Click to set DF for Freeze
Double-click to Freeze and Decode
Main screen, Double-click puts callsign in Tx messages
text area Right-double-click also sets Auto ON
Sync, S, Left/Right click to increase/decrease
Tol, ...
"""
Label(scwid,text=t,justify=LEFT).pack(padx=20)
scwid.focus_set()
#------------------------------------------------------ what2send
def what2send(event=NONE):
screenf5=Toplevel(root)
screenf5.geometry(root_geom[root_geom.index("+"):])
if g.Win32: screenf5.iconbitmap("wsjt.ico")
t="""
To optimize your chances of completing a valid QSO using WSJT,
use the following standard procedures and *do not* exchange pertinent
information by other means (e.g., internet, telephone, ...) while the
QSO is in progress!
FSK441, JTMS, or ISCAT: If you have received
... less than both calls from the other station, send both calls.
... both calls, send both calls and your signal report.
... both calls and signal report, send R and your report.
... R plus signal report, send RRR.
... RRR, the QSO is complete. However, the other station may not
know this, so it is conventional to send 73 to signify that you are done.
(Outside of North America, the customary procedures may be slightly
different.)
JT65, JT4: If you have received
... less than both calls, send both calls and your grid locator.
... both calls, send both calls, your grid locator, and OOO.
... both calls and OOO, send RO.
... RO, send RRR.
... RRR, the QSO is complete. However, the other station may not
know this, so it is conventional to send 73 to signify that you are done.
(Sending grid locators is conventional in JT65, but numerical signal
reports may be substituted.)
"""
Label(screenf5,text=t,justify=LEFT).pack(padx=20)
screenf5.focus_set()
#------------------------------------------------------ minimal_qso
def minimal_qso(event=NONE):
screenf5s=Toplevel(root)