2009-08-06 08:56:47 -04:00
|
|
|
#----------------------------------------------------------------------- MAP65
|
2006-08-05 13:42:04 -04:00
|
|
|
# $Date$ $Revision$
|
|
|
|
#
|
2006-08-05 13:35:21 -04:00
|
|
|
from Tkinter import *
|
|
|
|
from tkFileDialog import *
|
|
|
|
import Pmw
|
|
|
|
from tkMessageBox import showwarning
|
|
|
|
import g,os,time
|
|
|
|
import Audio
|
|
|
|
from math import log10
|
2007-12-31 10:15:55 -05:00
|
|
|
try:
|
|
|
|
from numpy.oldnumeric import zeros
|
|
|
|
except:
|
|
|
|
from Numeric import zeros
|
2006-08-05 13:35:21 -04:00
|
|
|
import dircache
|
|
|
|
import Image,ImageTk #, ImageDraw
|
|
|
|
from palettes import colormapblue, colormapgray0, colormapHot, \
|
|
|
|
colormapAFMHot, colormapgray1, colormapLinrad, Colormap2Palette
|
|
|
|
from types import *
|
|
|
|
import array
|
|
|
|
|
|
|
|
root = Tk()
|
2007-12-21 13:51:43 -05:00
|
|
|
Version="0.9 r" + "$Rev$"[6:-1]
|
2007-07-12 10:47:41 -04:00
|
|
|
Version=Version.strip()
|
2006-08-05 13:35:21 -04:00
|
|
|
print "******************************************************************"
|
2007-01-08 15:54:34 -05:00
|
|
|
print "MAP65 Version " + Version + ", by K1JT"
|
2006-08-05 13:35:21 -04:00
|
|
|
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:
|
2007-01-08 15:54:34 -05:00
|
|
|
root.option_readfile('map65rc.win')
|
2006-08-05 13:35:21 -04:00
|
|
|
except:
|
|
|
|
pass
|
|
|
|
else:
|
|
|
|
try:
|
2007-01-08 15:54:34 -05:00
|
|
|
root.option_readfile('map65rc')
|
2006-08-05 13:35:21 -04:00
|
|
|
except:
|
|
|
|
pass
|
|
|
|
root_geom=""
|
|
|
|
|
|
|
|
|
|
|
|
#------------------------------------------------------ Global variables
|
|
|
|
appdir=os.getcwd()
|
2007-07-09 12:14:00 -04:00
|
|
|
g.appdir=appdir
|
2007-01-09 09:40:24 -05:00
|
|
|
isync=1
|
2006-08-05 13:35:21 -04:00
|
|
|
isync_save=0
|
|
|
|
iclip=0
|
2007-01-09 09:40:24 -05:00
|
|
|
itol=5 #Default tol=500 Hz
|
|
|
|
ntol=(10,20,50,100,200,500,1000) #List of available tolerances
|
2006-08-05 13:35:21 -04:00
|
|
|
idsec=0
|
|
|
|
lauto=0
|
2006-09-08 10:21:08 -04:00
|
|
|
altmsg=0
|
2007-01-08 15:54:34 -05:00
|
|
|
bm_geom=""
|
2007-01-17 09:36:54 -05:00
|
|
|
bm2_geom=""
|
2006-08-05 13:35:21 -04:00
|
|
|
cmap0="Linrad"
|
|
|
|
fileopened=""
|
|
|
|
font1='Helvetica'
|
2007-10-25 15:44:42 -04:00
|
|
|
fqso0=125
|
2006-08-05 13:35:21 -04:00
|
|
|
hiscall=""
|
|
|
|
hisgrid=""
|
2007-07-11 15:47:36 -04:00
|
|
|
hisgrid0=""
|
2006-08-05 13:35:21 -04:00
|
|
|
isec0=-99
|
2007-11-01 15:03:01 -04:00
|
|
|
isec00=-99
|
2006-08-05 13:35:21 -04:00
|
|
|
k2txb=IntVar()
|
|
|
|
kb8rq=IntVar()
|
2007-07-09 20:15:11 -04:00
|
|
|
kxp0=0
|
2006-08-05 13:35:21 -04:00
|
|
|
loopall=0
|
|
|
|
mode=StringVar()
|
|
|
|
mode.set("")
|
|
|
|
mrudir=os.getcwd()
|
2007-11-05 14:19:46 -05:00
|
|
|
multicast=IntVar()
|
2006-08-05 13:35:21 -04:00
|
|
|
nafc=IntVar()
|
|
|
|
naz=0
|
|
|
|
ndepth=IntVar()
|
|
|
|
nel=0
|
|
|
|
nblank=IntVar()
|
|
|
|
ncall=0
|
|
|
|
ndmiles=0
|
|
|
|
ndkm=0
|
|
|
|
ndebug=IntVar()
|
2007-07-02 12:02:06 -04:00
|
|
|
ndebug2=IntVar()
|
2007-06-25 16:18:43 -04:00
|
|
|
ndebug.set(0)
|
2007-07-02 12:02:06 -04:00
|
|
|
ndebug2.set(0)
|
2006-08-05 13:35:21 -04:00
|
|
|
neme=IntVar()
|
|
|
|
nfreeze=IntVar()
|
|
|
|
nopen=0
|
|
|
|
nosh441=IntVar()
|
|
|
|
noshjt65=IntVar()
|
|
|
|
setseq=IntVar()
|
2006-09-08 10:21:08 -04:00
|
|
|
tx6alt=""
|
2006-08-05 13:35:21 -04:00
|
|
|
txsnrdb=99.
|
|
|
|
TxFirst=IntVar()
|
2008-09-19 13:25:58 -04:00
|
|
|
worked={}
|
2006-08-05 13:35:21 -04:00
|
|
|
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=""
|
2007-01-13 19:44:34 -05:00
|
|
|
g.ndecphase=0
|
2006-08-05 13:35:21 -04:00
|
|
|
g.ndevin=IntVar()
|
|
|
|
g.ndevout=IntVar()
|
|
|
|
g.DevinName=StringVar()
|
|
|
|
g.DevoutName=StringVar()
|
2007-07-03 21:58:22 -04:00
|
|
|
|
|
|
|
g.fc=["" for i in range(200)]
|
|
|
|
|
2006-08-05 13:35:21 -04:00
|
|
|
#------------------------------------------------------ showspecjt
|
|
|
|
def showspecjt(event=NONE):
|
2006-09-08 10:34:55 -04:00
|
|
|
if g.showspecjt==0: g.showspecjt=1
|
2006-08-05 13:35:21 -04:00
|
|
|
|
|
|
|
#------------------------------------------------------ restart
|
|
|
|
def restart():
|
|
|
|
Audio.gcom2.nrestart=1
|
|
|
|
Audio.gcom2.mantx=1
|
|
|
|
|
|
|
|
#------------------------------------------------------ restart2
|
|
|
|
def restart2():
|
|
|
|
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]
|
|
|
|
Audio.gcom2.ntxreq=1
|
|
|
|
restart()
|
|
|
|
def btx2(event=NONE):
|
|
|
|
ntx.set(2)
|
|
|
|
Audio.gcom2.txmsg=(tx2.get()+' ')[:28]
|
|
|
|
Audio.gcom2.ntxreq=2
|
|
|
|
restart()
|
|
|
|
def btx3(event=NONE):
|
|
|
|
ntx.set(3)
|
|
|
|
Audio.gcom2.txmsg=(tx3.get()+' ')[:28]
|
|
|
|
Audio.gcom2.ntxreq=3
|
|
|
|
restart()
|
|
|
|
def btx4(event=NONE):
|
|
|
|
ntx.set(4)
|
|
|
|
Audio.gcom2.txmsg=(tx4.get()+' ')[:28]
|
|
|
|
Audio.gcom2.ntxreq=4
|
|
|
|
restart()
|
|
|
|
def btx5(event=NONE):
|
|
|
|
ntx.set(5)
|
|
|
|
Audio.gcom2.txmsg=(tx5.get()+' ')[:28]
|
|
|
|
Audio.gcom2.ntxreq=5
|
|
|
|
restart()
|
|
|
|
def btx6(event=NONE):
|
|
|
|
ntx.set(6)
|
|
|
|
Audio.gcom2.txmsg=(tx6.get()+' ')[:28]
|
|
|
|
Audio.gcom2.ntxreq=6
|
|
|
|
restart()
|
|
|
|
|
|
|
|
#------------------------------------------------------ quit
|
|
|
|
def quit():
|
|
|
|
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")
|
|
|
|
|
2007-07-03 15:47:14 -04:00
|
|
|
#------------------------------------------------------ delta_phi
|
|
|
|
def delta_phi():
|
|
|
|
global lauto
|
|
|
|
Audio.gcom2.monitoring=0
|
|
|
|
lauto=0
|
|
|
|
Audio.gcom2.lauto=0
|
|
|
|
Audio.gcom2.ndphi=1
|
|
|
|
decode()
|
|
|
|
|
2007-07-02 15:17:07 -04:00
|
|
|
#------------------------------------------------------
|
|
|
|
def messages(event=NONE):
|
2007-07-03 13:34:35 -04:00
|
|
|
global Version,bm,bm_geom,msgtext
|
2007-01-11 16:25:52 -05:00
|
|
|
bm=Toplevel(root)
|
2007-06-26 10:20:11 -04:00
|
|
|
bm.title("Messages")
|
2007-01-11 16:25:52 -05:00
|
|
|
bm.geometry(bm_geom)
|
|
|
|
if g.Win32: bm.iconbitmap("wsjt.ico")
|
|
|
|
iframe_bm1 = Frame(bm, bd=1, relief=SUNKEN)
|
2007-07-10 11:23:54 -04:00
|
|
|
Label(iframe_bm1,text='Freq DF Pol UTC dB').pack(anchor=W, \
|
2007-07-09 20:15:11 -04:00
|
|
|
pady=0,side='top')
|
2007-07-10 11:02:56 -04:00
|
|
|
msgtext=Text(iframe_bm1, height=35, width=45, bg="Navy", fg="yellow")
|
2007-07-03 13:34:35 -04:00
|
|
|
msgtext.bind('<Double-Button-1>',dbl_click_msgtext)
|
|
|
|
msgtext.pack(side=LEFT, fill=X, padx=1, pady=3)
|
|
|
|
bmsb = Scrollbar(iframe_bm1, orient=VERTICAL, command=msgtext.yview)
|
2007-01-11 16:25:52 -05:00
|
|
|
bmsb.pack(side=RIGHT, fill=Y)
|
2007-07-03 13:34:35 -04:00
|
|
|
msgtext.configure(yscrollcommand=bmsb.set)
|
|
|
|
msgtext.tag_configure('age0',foreground='red')
|
|
|
|
msgtext.tag_configure('age1',foreground='yellow')
|
|
|
|
msgtext.tag_configure('age2',foreground='gray75')
|
|
|
|
msgtext.tag_configure('age3',foreground='gray50')
|
2007-01-11 16:25:52 -05:00
|
|
|
iframe_bm1.pack(expand=1, fill=X, padx=4)
|
|
|
|
|
2007-07-02 15:17:07 -04:00
|
|
|
#------------------------------------------------------ bandmap
|
|
|
|
def bandmap(event=NONE):
|
2007-07-03 15:47:14 -04:00
|
|
|
global Version,bm2,bm2_geom,bmtext
|
2007-01-17 09:36:54 -05:00
|
|
|
bm2=Toplevel(root)
|
2007-06-26 10:20:11 -04:00
|
|
|
bm2.title("Band Map")
|
2007-01-17 09:36:54 -05:00
|
|
|
bm2.geometry(bm2_geom)
|
|
|
|
if g.Win32: bm2.iconbitmap("wsjt.ico")
|
|
|
|
iframe_bm2 = Frame(bm2, bd=1, relief=SUNKEN)
|
2008-09-19 13:25:58 -04:00
|
|
|
bmtext=Text(iframe_bm2, height=24, width=39, bg="Navy", fg="yellow")
|
2007-07-03 15:47:14 -04:00
|
|
|
bmtext.bind('<Double-Button-1>',dbl_click_bmtext)
|
|
|
|
bmtext.pack(side=LEFT, fill=X, padx=1, pady=3)
|
|
|
|
bmtext.tag_configure('age0',foreground='red')
|
|
|
|
bmtext.tag_configure('age1',foreground='yellow')
|
|
|
|
bmtext.tag_configure('age2',foreground='gray75')
|
|
|
|
bmtext.tag_configure('age3',foreground='gray50')
|
2007-07-03 13:34:35 -04:00
|
|
|
iframe_bm2.pack(expand=1, fill=X, padx=4,pady=5)
|
2007-01-17 09:36:54 -05:00
|
|
|
|
2006-08-05 13:35:21 -04:00
|
|
|
#------------------------------------------------------ logqso
|
|
|
|
def logqso(event=NONE):
|
|
|
|
t=time.strftime("%Y-%b-%d,%H:%M",time.gmtime())
|
2007-07-18 10:13:16 -04:00
|
|
|
# t=t+","+hiscall+","+hisgrid+","+str(g.nfreq)+","+g.mode+"\n"
|
|
|
|
t=t+","+ToRadio.get()+","+HisGrid.get()+","+str(g.nfreq)+","+g.mode+"\n"
|
2007-01-08 15:54:34 -05:00
|
|
|
t2="Please confirm making the following entry in MAP65.LOG:\n\n" + t
|
2008-09-19 13:25:58 -04:00
|
|
|
if worked.has_key(hiscall.strip()):
|
|
|
|
t2=t2 + "\n\n*** Dupe: " + hiscall + "is already in LOG ***"
|
2006-08-05 13:35:21 -04:00
|
|
|
msg=Pmw.MessageDialog(root,buttons=('Yes','No'),message_text=t2)
|
|
|
|
msg.geometry(msgpos())
|
|
|
|
if g.Win32: msg.iconbitmap("wsjt.ico")
|
|
|
|
msg.focus_set()
|
|
|
|
result=msg.activate()
|
|
|
|
if result == 'Yes':
|
|
|
|
f=open(appdir+'/WSJT.LOG','a')
|
|
|
|
f.write(t)
|
|
|
|
f.close()
|
2008-09-19 13:25:58 -04:00
|
|
|
worked[hiscall.strip()]=1
|
2006-08-05 13:35:21 -04:00
|
|
|
|
|
|
|
#------------------------------------------------------ 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
|
2007-01-09 09:40:24 -05:00
|
|
|
t1=text.get('1.0',CURRENT) #Contents from start to cursor
|
2007-10-25 19:27:15 -04:00
|
|
|
dbl_click_call(t,t1,'OOO',1,event)
|
2007-10-25 12:31:19 -04:00
|
|
|
#------------------------------------------------------ dbl_click3_text
|
|
|
|
def dbl_click3_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
|
|
|
|
n=t1.rfind("\n")
|
|
|
|
rpt=t1[n+24:n+27]
|
|
|
|
if rpt[0:1] == " ": rpt=rpt[1:]
|
2007-10-25 19:27:15 -04:00
|
|
|
dbl_click_call(t,t1,rpt,1,event)
|
2007-07-03 13:34:35 -04:00
|
|
|
#------------------------------------------------------ dbl_click_msgtext
|
|
|
|
def dbl_click_msgtext(event):
|
|
|
|
t=msgtext.get('1.0',END) #Entire contents of text box
|
|
|
|
t1=msgtext.get('1.0',CURRENT) #Contents from start to cursor
|
2007-10-25 19:27:15 -04:00
|
|
|
dbl_click_call(t,t1,'OOO',2,event)
|
2007-07-03 15:47:14 -04:00
|
|
|
#------------------------------------------------------ dbl_click_bmtext
|
|
|
|
def dbl_click_bmtext(event):
|
|
|
|
t=bmtext.get('1.0',END) #Entire contents of text box
|
|
|
|
t1=bmtext.get('1.0',CURRENT) #Contents from start to cursor
|
2007-10-25 19:27:15 -04:00
|
|
|
dbl_click_call(t,t1,'OOO',3,event)
|
2006-08-05 13:35:21 -04:00
|
|
|
#------------------------------------------------------ dbl_click_ave
|
|
|
|
def dbl_click_ave(event):
|
2007-01-09 09:40:24 -05:00
|
|
|
t=avetext.get('1.0',END) #Entire contents of text box
|
|
|
|
t1=avetext.get('1.0',CURRENT) #Contents from start to cursor
|
2007-10-25 19:27:15 -04:00
|
|
|
dbl_click_call(t,t1,'OOO',1,event)
|
2006-08-05 13:35:21 -04:00
|
|
|
#------------------------------------------------------ dbl_click_call
|
2007-10-25 19:27:15 -04:00
|
|
|
def dbl_click_call(t,t1,rpt,nbox,event):
|
2006-08-05 13:35:21 -04:00
|
|
|
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
|
2008-09-19 13:25:58 -04:00
|
|
|
if hiscall[:1]=='*': hiscall=hiscall[1:]
|
|
|
|
if worked.has_key(hiscall.strip()):
|
|
|
|
# MsgBox("Possible dupe: " + hiscall)
|
|
|
|
t="Possible dupe: " + hiscall
|
|
|
|
msg=Pmw.MessageDialog(root,buttons=('OK','Cancel'),message_text=t)
|
|
|
|
msg.geometry(msgpos())
|
|
|
|
if g.Win32: msg.iconbitmap("wsjt.ico")
|
|
|
|
msg.focus_set()
|
|
|
|
result=msg.activate()
|
2008-09-19 15:53:02 -04:00
|
|
|
else:
|
|
|
|
result='OK'
|
|
|
|
if result == 'OK':
|
|
|
|
ToRadio.delete(0,END)
|
|
|
|
ToRadio.insert(0,hiscall)
|
|
|
|
i3=t1.rfind('\n')+1 #start of selected line
|
|
|
|
if i>=4 and i2>i1:
|
|
|
|
nsec=0
|
|
|
|
try:
|
|
|
|
nsec=3600*int(t1[i3+13:i3+15]) + 60*int(t1[i3+15:i3+17])
|
|
|
|
except:
|
|
|
|
pass
|
|
|
|
if setseq.get() and nbox!=3:
|
|
|
|
TxFirst.set((nsec/int(Audio.gcom1.trperiod))%2)
|
|
|
|
lookup()
|
|
|
|
GenStdMsgs()
|
|
|
|
if 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")
|
|
|
|
i3=t[:i1].strip().rfind(' ')+1
|
|
|
|
if t[i3:i1].strip() == 'CQ' or nbox >= 2:
|
|
|
|
ntx.set(1)
|
|
|
|
else:
|
|
|
|
ntx.set(2)
|
|
|
|
if event.num==3 and not lauto: toggleauto()
|
2006-09-07 16:29:47 -04:00
|
|
|
|
2008-09-19 15:53:02 -04:00
|
|
|
#----------------------------------------------------------- textkey
|
2006-09-07 16:29:47 -04:00
|
|
|
def textkey(event=NONE):
|
|
|
|
text.configure(state=DISABLED)
|
|
|
|
def avetextkey(event=NONE):
|
|
|
|
avetext.configure(state=DISABLED)
|
|
|
|
|
2006-08-05 13:35:21 -04:00
|
|
|
#------------------------------------------------------ decode
|
|
|
|
def decode(event=NONE):
|
|
|
|
if Audio.gcom2.ndecoding==0: #If already busy, ignore request
|
|
|
|
Audio.gcom2.nagain=1
|
|
|
|
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
|
2007-01-13 19:44:34 -05:00
|
|
|
fname=askopenfilename(filetypes=[("Linrad timf2 files","*.tf2 *.TF2")])
|
2006-08-05 13:35:21 -04:00
|
|
|
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:
|
2007-01-13 19:44:34 -05:00
|
|
|
# Make a list of *.tf2 files in mrudir
|
2006-08-05 13:35:21 -04:00
|
|
|
la=os.listdir(mrudir)
|
|
|
|
la.sort()
|
|
|
|
lb=[]
|
|
|
|
for i in range(len(la)):
|
2007-01-13 19:44:34 -05:00
|
|
|
j=la[i].find(".tf2") + la[i].find(".TF2")
|
2006-08-05 13:35:21 -04:00
|
|
|
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:
|
2007-01-13 19:44:34 -05:00
|
|
|
t="No more files to process."
|
2006-08-05 13:35:21 -04:00
|
|
|
msg=Pmw.MessageDialog(root,buttons=('OK',),message_text=t)
|
|
|
|
msg.geometry(msgpos())
|
|
|
|
if g.Win32: msg.iconbitmap("wsjt.ico")
|
|
|
|
msg.focus_set()
|
|
|
|
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')
|
|
|
|
|
|
|
|
#------------------------------------------------------ MsgBox
|
|
|
|
def MsgBox(t):
|
|
|
|
msg=Pmw.MessageDialog(root,buttons=('OK',),message_text=t)
|
|
|
|
result=msg.activate()
|
|
|
|
msg.focus_set()
|
|
|
|
|
|
|
|
#------------------------------------------------------ txstop
|
|
|
|
def txstop(event=NONE):
|
|
|
|
if lauto: toggleauto()
|
|
|
|
Audio.gcom1.txok=0
|
|
|
|
Audio.gcom2.mantx=0
|
2007-06-22 16:32:58 -04:00
|
|
|
# specjt.pal_gray0() ????
|
2006-08-05 13:35:21 -04:00
|
|
|
|
|
|
|
#------------------------------------------------------ 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
|
|
|
|
msg=Pmw.MessageDialog(root,buttons=('Yes','No'),
|
|
|
|
message_text="Is this station known to be active on EME?")
|
|
|
|
result=msg.activate()
|
|
|
|
msg.focus_set()
|
|
|
|
if result=="Yes":
|
|
|
|
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?"
|
|
|
|
msg=Pmw.MessageDialog(root,buttons=('Yes','No'),
|
|
|
|
message_text=t)
|
|
|
|
result=msg.activate()
|
|
|
|
msg.focus_set()
|
|
|
|
if result=="Yes":
|
|
|
|
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")
|
|
|
|
|
|
|
|
#-------------------------------------------------------- clrToRadio
|
|
|
|
def clrToRadio(event):
|
|
|
|
ToRadio.delete(0,END)
|
|
|
|
HisGrid.delete(0,99)
|
|
|
|
ToRadio.focus_set()
|
2006-08-29 15:25:49 -04:00
|
|
|
if kb8rq.get():
|
|
|
|
ntx.set(6)
|
|
|
|
nfreeze.set(0)
|
2006-08-05 13:35:21 -04:00
|
|
|
|
|
|
|
#------------------------------------------------------ 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()
|
|
|
|
|
|
|
|
#------------------------------------------------------ ModeJT65
|
|
|
|
def ModeJT65():
|
2007-07-02 15:17:07 -04:00
|
|
|
global isync,itol
|
2006-08-05 13:35:21 -04:00
|
|
|
cleartext()
|
|
|
|
Audio.gcom1.trperiod=60
|
|
|
|
iframe4b.pack(after=iframe4,expand=1, fill=X, padx=4)
|
|
|
|
bclravg.configure(state=NORMAL)
|
|
|
|
binclude.configure(state=NORMAL)
|
|
|
|
bexclude.configure(state=NORMAL)
|
2006-09-19 14:55:21 -04:00
|
|
|
itol=4
|
2006-08-05 13:35:21 -04:00
|
|
|
inctol()
|
2006-09-06 16:28:14 -04:00
|
|
|
nfreeze.set(0)
|
2006-08-05 13:35:21 -04:00
|
|
|
ntx.set(1)
|
|
|
|
GenStdMsgs()
|
|
|
|
erase()
|
|
|
|
|
|
|
|
#------------------------------------------------------ ModeJT65A
|
|
|
|
def ModeJT65A(event=NONE):
|
|
|
|
if g.mode != "JT65A":
|
|
|
|
if lauto: toggleauto()
|
|
|
|
mode.set("JT65A")
|
|
|
|
ModeJT65()
|
|
|
|
|
|
|
|
#------------------------------------------------------ ModeJT65B
|
|
|
|
def ModeJT65B(event=NONE):
|
|
|
|
if g.mode != "JT65B":
|
|
|
|
if lauto: toggleauto()
|
|
|
|
mode.set("JT65B")
|
|
|
|
ModeJT65()
|
|
|
|
|
|
|
|
#------------------------------------------------------ ModeJT65C
|
|
|
|
def ModeJT65C(event=NONE):
|
|
|
|
if g.mode != "JT65C":
|
|
|
|
if lauto: toggleauto()
|
|
|
|
mode.set("JT65C")
|
|
|
|
ModeJT65()
|
|
|
|
|
|
|
|
#------------------------------------------------------ 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")
|
2007-01-08 15:54:34 -05:00
|
|
|
t="MAP65 Version " + Version + ", by K1JT"
|
2006-08-05 13:35:21 -04:00
|
|
|
Label(about,text=t,font=(font1,16)).pack(padx=20,pady=5)
|
|
|
|
t="""
|
2007-01-08 15:54:34 -05:00
|
|
|
MAP65 is a weak signal communications program designed primarily
|
|
|
|
for the Earth-Moon-Earth (EME) propagation path.
|
2006-08-05 13:35:21 -04:00
|
|
|
|
2007-01-09 09:40:24 -05:00
|
|
|
Copyright (c) 2001-2007 by Joseph H. Taylor, Jr., K1JT, with
|
2007-01-08 15:54:34 -05:00
|
|
|
contributions from additional authors. MAP65 is Open Source
|
2006-08-05 13:35:21 -04:00
|
|
|
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="""
|
2006-09-06 16:28:14 -04:00
|
|
|
F1 List keyboard shortcuts
|
2006-09-07 10:33:37 -04:00
|
|
|
Shift+F1 List special mouse commands
|
2007-01-08 15:54:34 -05:00
|
|
|
Ctrl+F1 About MAP65
|
2006-09-06 16:28:14 -04:00
|
|
|
F2 Options
|
|
|
|
F3 Tx Mute
|
|
|
|
F4 Clear "To Radio"
|
|
|
|
F5 What message to send?
|
|
|
|
F6 Open next file in directory
|
2006-09-07 10:33:37 -04:00
|
|
|
Shift+F6 Decode all wave files in directory
|
2007-07-12 10:47:41 -04:00
|
|
|
Shift+F8 JT65B
|
2007-07-02 15:17:07 -04:00
|
|
|
F10 Show Waterfall
|
2006-09-07 10:33:37 -04:00
|
|
|
Shift+F10 Show astronomical data
|
2007-07-05 13:48:38 -04:00
|
|
|
F11 Decrease DF
|
|
|
|
F12 Increase DF
|
|
|
|
Shift+F11 Decrease QSO Frequency
|
|
|
|
Shift+F12 Increase QSO Frequency
|
2006-09-07 10:33:37 -04:00
|
|
|
Alt+1 to Alt+6 Tx1 to Tx6
|
|
|
|
Alt+A Toggle Auto On/Off
|
|
|
|
Alt+D Decode
|
|
|
|
Alt+E Erase
|
|
|
|
Alt+G Generate Standard Messages
|
2006-09-08 10:21:08 -04:00
|
|
|
Ctrl+G Generate Alternate JT65 Messages
|
2006-09-07 10:33:37 -04:00
|
|
|
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+S Stop Monitoring or Decoding
|
|
|
|
Alt+X Exclude
|
2006-08-05 13:35:21 -04:00
|
|
|
"""
|
|
|
|
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
|
|
|
|
--------------------------------------------------------
|
2007-07-02 15:17:07 -04:00
|
|
|
Waterfall (upper) Click to set QSO frequency; double-click to set
|
|
|
|
QSO frequency and Decode
|
2006-08-05 13:35:21 -04:00
|
|
|
|
2007-07-02 15:17:07 -04:00
|
|
|
Waterfall (lower) Click to set target DF; double-click to set
|
|
|
|
target DF and Decode
|
2006-08-05 13:35:21 -04:00
|
|
|
|
2007-07-02 15:17:07 -04:00
|
|
|
Main screen, Double-click puts callsign in Tx messages
|
|
|
|
text area
|
2006-08-05 13:35:21 -04:00
|
|
|
"""
|
|
|
|
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="""
|
2007-01-09 09:40:24 -05:00
|
|
|
To optimize your chances of completing a valid JT65 QSO, use
|
|
|
|
the following standard procedures and *do not* exchange pertinent
|
|
|
|
information by other means (e.g., internet, telephone, ...) while
|
|
|
|
the QSO is in progress!
|
2006-08-05 13:35:21 -04:00
|
|
|
|
2007-01-09 09:40:24 -05:00
|
|
|
If you have received
|
2006-08-05 13:35:21 -04:00
|
|
|
... 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.
|
|
|
|
|
2007-07-10 13:03:48 -04:00
|
|
|
Sending grid locators is conventional in JT65, but numerical signal
|
|
|
|
reports such as "-22" or "R-24" may be substituted.
|
2006-08-05 13:35:21 -04:00
|
|
|
"""
|
|
|
|
Label(screenf5,text=t,justify=LEFT).pack(padx=20)
|
|
|
|
screenf5.focus_set()
|
|
|
|
|
|
|
|
#------------------------------------------------------ prefixes
|
|
|
|
def prefixes(event=NONE):
|
|
|
|
pfx=Toplevel(root)
|
|
|
|
pfx.geometry(msgpos())
|
|
|
|
if g.Win32: pfx.iconbitmap("wsjt.ico")
|
|
|
|
f=open(appdir+'/prefixes.txt','r')
|
|
|
|
s=f.readlines()
|
|
|
|
t2=""
|
|
|
|
for i in range(4):
|
|
|
|
t2=t2+s[i]
|
|
|
|
t=""
|
|
|
|
for i in range(len(s)-4):
|
|
|
|
t=t+s[i+4]
|
|
|
|
t=t.split()
|
|
|
|
t.sort()
|
|
|
|
t1=""
|
|
|
|
n=0
|
|
|
|
for i in range(len(t)):
|
|
|
|
t1=t1+t[i]+" "
|
|
|
|
n=n+len(t[i])+2
|
|
|
|
if n>60:
|
|
|
|
t1=t1+"\n"
|
|
|
|
n=0
|
|
|
|
t1=t1+"\n"
|
|
|
|
if options.addpfx.get().lstrip():
|
|
|
|
t1=t1+"\nOptional prefix: "+(options.addpfx.get().lstrip()+' ')[:8]
|
|
|
|
t2=t2+"\n"+t1
|
|
|
|
Label(pfx,text=t2,justify=LEFT).pack(padx=20)
|
|
|
|
pfx.focus_set()
|
|
|
|
|
|
|
|
#------------------------------------------------------ azdist
|
|
|
|
def azdist():
|
|
|
|
if len(HisGrid.get().strip())<4:
|
|
|
|
labAz.configure(text="")
|
|
|
|
labDist.configure(text="")
|
|
|
|
else:
|
2007-01-09 09:40:24 -05:00
|
|
|
labAz.configure(text="Az: %d" % (naz,))
|
|
|
|
if options.mileskm.get()==0:
|
|
|
|
labDist.configure(text=str(ndmiles)+" mi")
|
|
|
|
else:
|
|
|
|
labDist.configure(text=str(int(1.609344*ndmiles))+" km")
|
2006-08-05 13:35:21 -04:00
|
|
|
|
|
|
|
#------------------------------------------------------ inctol
|
|
|
|
def inctol(event=NONE):
|
|
|
|
global itol
|
2007-01-09 09:40:24 -05:00
|
|
|
maxitol=6
|
2006-12-22 09:43:54 -05:00
|
|
|
if itol<maxitol: itol=itol+1
|
2006-08-05 13:35:21 -04:00
|
|
|
ltol.configure(text='Tol '+str(ntol[itol]))
|
|
|
|
|
|
|
|
#------------------------------------------------------ dectol
|
|
|
|
def dectol(event):
|
|
|
|
global itol
|
|
|
|
if itol>0 : itol=itol-1
|
|
|
|
ltol.configure(text='Tol '+str(ntol[itol]))
|
|
|
|
|
|
|
|
#------------------------------------------------------ incdsec
|
|
|
|
def incdsec(event):
|
|
|
|
global idsec
|
|
|
|
idsec=idsec+5
|
|
|
|
bg='red'
|
|
|
|
if idsec==0: bg='white'
|
|
|
|
ldsec.configure(text='Dsec '+str(0.1*idsec),bg=bg)
|
|
|
|
Audio.gcom1.ndsec=idsec
|
|
|
|
|
|
|
|
#------------------------------------------------------ decdsec
|
|
|
|
def decdsec(event):
|
|
|
|
global idsec
|
|
|
|
idsec=idsec-5
|
|
|
|
bg='red'
|
|
|
|
if idsec==0: bg='white'
|
|
|
|
ldsec.configure(text='Dsec '+str(0.1*idsec),bg=bg)
|
|
|
|
Audio.gcom1.ndsec=idsec
|
|
|
|
|
|
|
|
#------------------------------------------------------ erase
|
|
|
|
def erase(event=NONE):
|
|
|
|
text.configure(state=NORMAL)
|
|
|
|
text.delete('1.0',END)
|
|
|
|
text.configure(state=DISABLED)
|
|
|
|
avetext.configure(state=NORMAL)
|
|
|
|
avetext.delete('1.0',END)
|
|
|
|
avetext.configure(state=DISABLED)
|
|
|
|
Audio.gcom2.decodedfile=" "
|
|
|
|
#------------------------------------------------------ clear_avg
|
|
|
|
def clear_avg(event=NONE):
|
|
|
|
avetext.configure(state=NORMAL)
|
|
|
|
avetext.delete('1.0',END)
|
|
|
|
avetext.configure(state=DISABLED)
|
|
|
|
f=open(appdir+'/decoded.ave',mode='w')
|
|
|
|
f.truncate(0) #Delete contents of decoded.ave
|
|
|
|
f.close()
|
|
|
|
Audio.gcom2.nclearave=1
|
|
|
|
|
|
|
|
#------------------------------------------------------ delwav
|
|
|
|
def delwav():
|
2007-07-11 12:20:35 -04:00
|
|
|
t="Are you sure you want to delete\nall *.tf2 files in " + \
|
|
|
|
options.savedir.get() + " ?"
|
2006-08-05 13:35:21 -04:00
|
|
|
msg=Pmw.MessageDialog(root,buttons=('Yes','No'),message_text=t)
|
|
|
|
msg.geometry(msgpos())
|
|
|
|
if g.Win32: msg.iconbitmap("wsjt.ico")
|
|
|
|
msg.focus_set()
|
|
|
|
result=msg.activate()
|
|
|
|
if result == 'Yes':
|
2007-07-11 12:20:35 -04:00
|
|
|
# Make a list of *.tf2 in SaveDir
|
|
|
|
la=dircache.listdir(options.savedir.get())
|
2006-08-05 13:35:21 -04:00
|
|
|
lb=[]
|
|
|
|
for i in range(len(la)):
|
2007-07-11 12:20:35 -04:00
|
|
|
j=la[i].find(".tf2") + la[i].find(".TF2")
|
2006-08-05 13:35:21 -04:00
|
|
|
if j>0: lb.append(la[i])
|
|
|
|
# Now delete them all.
|
2007-07-11 12:20:35 -04:00
|
|
|
savedir=options.savedir.get()
|
|
|
|
if savedir[-1:] != '/' and savedir[-1:] != '\\':
|
|
|
|
savedir=savedir + '/'
|
2006-08-05 13:35:21 -04:00
|
|
|
for i in range(len(lb)):
|
2007-07-11 12:20:35 -04:00
|
|
|
fname=savedir+lb[i]
|
2006-08-05 13:35:21 -04:00
|
|
|
os.remove(fname)
|
|
|
|
|
|
|
|
#------------------------------------------------------ del_all
|
|
|
|
def del_all():
|
|
|
|
Audio.gcom1.ns0=-999999
|
|
|
|
|
2007-07-03 13:34:35 -04:00
|
|
|
#------------------------------------------------------ clr_all
|
|
|
|
def clr_all():
|
|
|
|
Audio.gcom2.nrw26=1 #Request rewind of tmp26.txt
|
|
|
|
msgtext.delete('1.0',END)
|
2007-07-03 15:47:14 -04:00
|
|
|
bmtext.delete('1.0',END)
|
2007-07-03 13:34:35 -04:00
|
|
|
|
2006-08-05 13:35:21 -04:00
|
|
|
#------------------------------------------------------ toggleauto
|
|
|
|
def toggleauto(event=NONE):
|
|
|
|
global lauto
|
|
|
|
lauto=1-lauto
|
|
|
|
Audio.gcom2.lauto=lauto
|
|
|
|
if lauto:
|
|
|
|
monitor()
|
|
|
|
else:
|
|
|
|
Audio.gcom1.txok=0
|
|
|
|
Audio.gcom2.mantx=0
|
|
|
|
if lauto==0: auto.configure(text='Auto is OFF',bg='gray85',relief=RAISED)
|
|
|
|
if lauto==1: auto.configure(text='Auto is ON',bg='red',relief=SOLID)
|
|
|
|
|
|
|
|
#----------------------------------------------------- dtdf_change
|
|
|
|
# Readout of graphical cursor location
|
|
|
|
def dtdf_change(event):
|
2007-01-09 09:40:24 -05:00
|
|
|
if event.y<40 and Audio.gcom2.nspecial==0:
|
|
|
|
lab1.configure(text='Time (s)',bg="#33FFFF") #light blue
|
|
|
|
t="%.1f" % (12.0*event.x/500.0-2.0,)
|
|
|
|
lab6.configure(text=t,bg="#33FFFF")
|
|
|
|
elif (event.y>=40 and event.y<95) or \
|
|
|
|
(event.y<95 and Audio.gcom2.nspecial>0):
|
|
|
|
lab1.configure(text='DF (Hz)',bg='red')
|
|
|
|
idf=Audio.gcom2.idf
|
|
|
|
t="%d" % int(idf+1200.0*event.x/500.0-600.0,)
|
|
|
|
lab6.configure(text=t,bg="red")
|
2006-08-05 13:35:21 -04:00
|
|
|
else:
|
2007-01-09 09:40:24 -05:00
|
|
|
lab1.configure(text='Time (s)',bg='green')
|
|
|
|
t="%.1f" % (53.0*event.x/500.0,)
|
|
|
|
lab6.configure(text=t,bg="green")
|
2006-08-05 13:35:21 -04:00
|
|
|
|
|
|
|
#---------------------------------------------------- mouse_click_g1
|
|
|
|
def mouse_click_g1(event):
|
|
|
|
global nopen
|
|
|
|
if not nopen:
|
2007-01-09 09:40:24 -05:00
|
|
|
Audio.gcom2.mousedf=int(Audio.gcom2.idf+(event.x-250)*2.4)
|
2006-08-05 13:35:21 -04:00
|
|
|
nopen=0
|
|
|
|
|
|
|
|
#------------------------------------------------------ double-click_g1
|
|
|
|
def double_click_g1(event):
|
2007-01-09 09:40:24 -05:00
|
|
|
if Audio.gcom2.ndecoding==0:
|
2006-08-05 13:35:21 -04:00
|
|
|
g.freeze_decode=1
|
|
|
|
|
|
|
|
#------------------------------------------------------ mouse_up_g1
|
|
|
|
def mouse_up_g1(event):
|
2007-06-25 16:18:43 -04:00
|
|
|
# This is a fix for certain mouse-clicks
|
2006-08-05 13:35:21 -04:00
|
|
|
pass
|
|
|
|
|
|
|
|
#------------------------------------------------------ right_arrow
|
|
|
|
def right_arrow(event=NONE):
|
2007-06-22 16:32:58 -04:00
|
|
|
n=5*int(Audio.gcom2.mousedf/5)
|
2007-12-28 15:45:16 -05:00
|
|
|
if n!=0: n=n+5
|
2006-08-05 13:35:21 -04:00
|
|
|
if n==Audio.gcom2.mousedf: n=n+5
|
|
|
|
Audio.gcom2.mousedf=n
|
2007-06-22 16:32:58 -04:00
|
|
|
|
2006-08-05 13:35:21 -04:00
|
|
|
#------------------------------------------------------ left_arrow
|
|
|
|
def left_arrow(event=NONE):
|
|
|
|
n=5*int(Audio.gcom2.mousedf/5)
|
|
|
|
if n==Audio.gcom2.mousedf: n=n-5
|
|
|
|
Audio.gcom2.mousedf=n
|
2007-06-24 19:26:17 -04:00
|
|
|
|
|
|
|
#------------------------------------------------------ inc_fqso
|
|
|
|
def inc_fqso(event=NONE):
|
|
|
|
Audio.gcom2.mousefqso=Audio.gcom2.mousefqso + 1
|
|
|
|
|
|
|
|
#------------------------------------------------------ dec_fqso
|
|
|
|
def dec_fqso(event=NONE):
|
|
|
|
Audio.gcom2.mousefqso=Audio.gcom2.mousefqso - 1
|
2006-08-05 13:35:21 -04:00
|
|
|
|
2008-10-08 21:03:41 -04:00
|
|
|
#------------------------------------------------------ set_ftx
|
|
|
|
def set_ftx(event=NONE):
|
|
|
|
Audio.gcom2.nsetftx=1
|
|
|
|
|
2006-08-05 13:35:21 -04:00
|
|
|
#------------------------------------------------------ GenStdMsgs
|
|
|
|
def GenStdMsgs(event=NONE):
|
2006-09-08 10:21:08 -04:00
|
|
|
global altmsg
|
2006-08-05 13:35:21 -04:00
|
|
|
t=ToRadio.get().upper().strip()
|
|
|
|
ToRadio.delete(0,99)
|
|
|
|
ToRadio.insert(0,t)
|
|
|
|
if k2txb.get()!=0: ntx.set(1)
|
|
|
|
Audio.gcom2.hiscall=(ToRadio.get()+' ')[:12]
|
|
|
|
for m in (tx1, tx2, tx3, tx4, tx5, tx6):
|
|
|
|
m.delete(0,99)
|
2007-01-08 16:19:41 -05:00
|
|
|
if ToRadio.get().find("/") == -1 and \
|
|
|
|
options.MyCall.get().find("/") == -1:
|
|
|
|
t=ToRadio.get() + " "+options.MyCall.get() + " "+options.MyGrid.get()[:4]
|
|
|
|
tx1.insert(0,t.upper())
|
|
|
|
else:
|
2006-08-05 13:35:21 -04:00
|
|
|
tx1.insert(0,ToRadio.get() + " "+options.MyCall.get())
|
2007-01-08 16:19:41 -05:00
|
|
|
tx2.insert(0,tx1.get()+" OOO")
|
|
|
|
tx3.insert(0,"RO")
|
|
|
|
tx4.insert(0,"RRR")
|
|
|
|
tx5.insert(0,"73")
|
|
|
|
t="CQ " + options.MyCall.get()+ " "+options.MyGrid.get()[:4]
|
|
|
|
tx6.insert(0,t.upper())
|
|
|
|
altmsg=0
|
2006-08-05 13:35:21 -04:00
|
|
|
|
2006-09-08 10:21:08 -04:00
|
|
|
#------------------------------------------------------ GenAltMsgs
|
|
|
|
def GenAltMsgs(event=NONE):
|
|
|
|
global altmsg,tx6alt
|
|
|
|
t=ToRadio.get().upper().strip()
|
|
|
|
ToRadio.delete(0,99)
|
|
|
|
ToRadio.insert(0,t)
|
|
|
|
if k2txb.get()!=0: ntx.set(1)
|
|
|
|
Audio.gcom2.hiscall=(ToRadio.get()+' ')[:12]
|
2007-01-09 09:40:24 -05:00
|
|
|
if ToRadio.get().find("/") == -1 and options.MyCall.get().find("/") == -1:
|
2006-09-08 10:21:08 -04:00
|
|
|
for m in (tx1, tx2, tx3, tx4, tx5, tx6):
|
|
|
|
m.delete(0,99)
|
|
|
|
t=ToRadio.get() + " "+options.MyCall.get()
|
|
|
|
tx1.insert(0,t.upper())
|
|
|
|
tx2.insert(0,tx1.get()+" OOO")
|
|
|
|
tx3.insert(0,tx1.get()+" RO")
|
|
|
|
tx4.insert(0,tx1.get()+" RRR")
|
|
|
|
tx5.insert(0,"TNX 73 GL ")
|
|
|
|
tx6.insert(0,tx6alt.upper())
|
|
|
|
altmsg=1
|
|
|
|
|
2006-08-05 13:35:21 -04:00
|
|
|
#------------------------------------------------------ update
|
|
|
|
def update():
|
2007-07-09 20:15:11 -04:00
|
|
|
global root_geom,isec0,naz,nel,ndmiles,ndkm,nopen,kxp0, \
|
2007-01-09 09:40:24 -05:00
|
|
|
im,pim,cmap0,isync,isync_save,idsec,first,itol,txsnrdb,tx6alt,\
|
2008-09-19 13:25:58 -04:00
|
|
|
bm_geom,bm2_geom,hisgrid0,fqso0,isec00,worked
|
2006-08-05 13:35:21 -04:00
|
|
|
|
|
|
|
utc=time.gmtime(time.time()+0.1*idsec)
|
|
|
|
isec=utc[5]
|
2007-07-10 11:02:56 -04:00
|
|
|
txminute=0
|
2007-11-01 15:03:01 -04:00
|
|
|
if Audio.gcom2.lauto and utc[4]%2 != Audio.gcom1.txfirst: txminute=1
|
2006-08-05 13:35:21 -04:00
|
|
|
|
|
|
|
if isec != isec0: #Do once per second
|
|
|
|
isec0=isec
|
2008-09-18 10:58:59 -04:00
|
|
|
t=time.strftime('%y%m%d',utc)
|
|
|
|
Audio.gcom2.fnamedate=t[:6]
|
2006-08-05 13:35:21 -04:00
|
|
|
t=time.strftime('%Y %b %d\n%H:%M:%S',utc)
|
|
|
|
Audio.gcom2.utcdate=t[:12]
|
|
|
|
ldate.configure(text=t)
|
2008-09-16 13:20:42 -04:00
|
|
|
t="Rx: %.1f dB %.1f %%" % (Audio.gcom2.rxnoise,Audio.gcom2.pctblank)
|
2007-07-02 15:55:06 -04:00
|
|
|
msg4.configure(text=t)
|
2008-07-24 11:43:05 -04:00
|
|
|
t="Drop: %.2f %%" % Audio.gcom2.pctlost
|
|
|
|
msg5.configure(text=t)
|
2006-08-05 13:35:21 -04:00
|
|
|
root_geom=root.geometry()
|
2007-01-09 09:40:24 -05:00
|
|
|
try:
|
|
|
|
bm_geom=bm.geometry()
|
2007-01-17 09:36:54 -05:00
|
|
|
bm2_geom=bm2.geometry()
|
2007-01-09 09:40:24 -05:00
|
|
|
except:
|
2007-11-01 15:03:01 -04:00
|
|
|
pass
|
2006-08-05 13:35:21 -04:00
|
|
|
utchours=utc[3]+utc[4]/60.0 + utc[5]/3600.0
|
|
|
|
naz,nel,ndmiles,ndkm,nhotaz,nhotabetter=Audio.azdist0( \
|
|
|
|
options.MyGrid.get().upper(),HisGrid.get().upper(),utchours)
|
|
|
|
azdist()
|
|
|
|
g.nfreq=nfreq.get()
|
2007-07-09 20:15:11 -04:00
|
|
|
kxp=int(Audio.datcom.kxp)
|
2008-07-24 12:34:59 -04:00
|
|
|
if kxp-kxp0 >=0 and kxp-kxp0 < 50000 and \
|
2007-07-10 11:02:56 -04:00
|
|
|
((not Audio.gcom2.lauto) or (not Audio.gcom1.transmitting)):
|
|
|
|
msg5.configure(text='No Rx data',bg='red')
|
2007-07-09 20:15:11 -04:00
|
|
|
else:
|
|
|
|
msg5.configure(bg='gray85')
|
|
|
|
kxp0=kxp
|
2006-08-05 13:35:21 -04:00
|
|
|
|
|
|
|
if Audio.gcom2.ndecoding==0:
|
|
|
|
g.AzSun,g.ElSun,g.AzMoon,g.ElMoon,g.AzMoonB,g.ElMoonB,g.ntsky, \
|
|
|
|
g.ndop,g.ndop00,g.dbMoon,g.RAMoon,g.DecMoon,g.HA8,g.Dgrd, \
|
|
|
|
g.sd,g.poloffset,g.MaxNR,g.dfdt,g.dfdt0,g.RaAux,g.DecAux, \
|
|
|
|
g.AzAux,g.ElAux = Audio.astro0(utc[0],utc[1],utc[2], \
|
|
|
|
utchours,nfreq.get(),options.MyGrid.get().upper(), \
|
|
|
|
options.auxra.get()+' '[:9], \
|
|
|
|
options.auxdec.get()+' '[:9])
|
|
|
|
|
|
|
|
if len(HisGrid.get().strip())<4:
|
|
|
|
g.ndop=g.ndop00
|
|
|
|
g.dfdt=g.dfdt0
|
2007-10-25 15:44:42 -04:00
|
|
|
|
|
|
|
if (len(HisGrid.get().strip())<4) or (hisgrid != hisgrid0):
|
|
|
|
msg6.configure(text=" ",bg='gray85')
|
|
|
|
hisgrid0=hisgrid
|
|
|
|
Audio.gcom2.nhispol=-999
|
2007-07-11 15:47:36 -04:00
|
|
|
|
2007-07-02 15:17:07 -04:00
|
|
|
astrotext.delete(1.0,END)
|
|
|
|
astrotext.insert(END,' Moon\n')
|
|
|
|
astrotext.insert(END,"Az: %7.1f\n" % g.AzMoon)
|
|
|
|
astrotext.insert(END,"El: %7.1f\n" % g.ElMoon)
|
|
|
|
astrotext.insert(END,"DxAz: %5.1f\n" % g.AzMoonB)
|
|
|
|
astrotext.insert(END,"DxEl: %5.1f\n" % g.ElMoonB)
|
|
|
|
astrotext.insert(END,' Sun\n')
|
|
|
|
astrotext.insert(END,"Az: %7.1f\n" % g.AzSun)
|
|
|
|
astrotext.insert(END,"El: %7.1f\n\n" % g.ElSun)
|
|
|
|
astrotext.insert(END,"Dop:%7d\n" % g.ndop)
|
|
|
|
astrotext.insert(END,"Dgrd:%6.1f\n" % g.Dgrd)
|
2006-08-05 13:35:21 -04:00
|
|
|
|
2007-06-26 10:20:11 -04:00
|
|
|
if g.freeze_decode and mode.get()[:4]=='JT65':
|
2007-10-24 13:39:52 -04:00
|
|
|
if g.freeze_decode==1:
|
|
|
|
itol=5
|
|
|
|
ltol.configure(text='Tol '+str(500))
|
|
|
|
Audio.gcom2.dftolerance=500
|
2007-11-13 13:39:44 -05:00
|
|
|
Audio.gcom2.mousedf=0
|
2007-10-24 13:39:52 -04:00
|
|
|
else:
|
|
|
|
itol=3
|
|
|
|
ltol.configure(text='Tol '+str(100))
|
|
|
|
Audio.gcom2.dftolerance=100
|
2006-08-05 13:35:21 -04:00
|
|
|
nfreeze.set(1)
|
|
|
|
Audio.gcom2.nfreeze=1
|
|
|
|
if Audio.gcom2.monitoring:
|
|
|
|
Audio.gcom2.ndecoding=1
|
2007-06-28 16:36:17 -04:00
|
|
|
# Audio.gcom2.nagain=0
|
|
|
|
Audio.gcom2.nagain=1
|
2006-08-05 13:35:21 -04:00
|
|
|
else:
|
|
|
|
Audio.gcom2.ndecoding=4
|
|
|
|
Audio.gcom2.nagain=1
|
|
|
|
g.freeze_decode=0
|
|
|
|
|
|
|
|
t=g.ftnstr(Audio.gcom2.decodedfile)
|
|
|
|
i=g.rfnd(t,".")
|
|
|
|
t=t[:i]
|
|
|
|
if mode.get() != g.mode or first:
|
2007-07-06 12:28:58 -04:00
|
|
|
if mode.get()[:4]=='JT65':
|
|
|
|
msg1.configure(bg='#00FFFF')
|
|
|
|
elif mode.get()=='Measure':
|
|
|
|
msg1.configure(bg='yellow')
|
2006-08-05 13:35:21 -04:00
|
|
|
g.mode=mode.get()
|
|
|
|
first=0
|
|
|
|
|
|
|
|
samfac_out=Audio.gcom1.mfsample2/110250.0
|
2007-07-02 15:55:06 -04:00
|
|
|
t="%6.4f" % (samfac_out)
|
|
|
|
options.meas_rateout.setvalue(t)
|
|
|
|
msg1.configure(text=mode.get())
|
2007-06-22 16:32:58 -04:00
|
|
|
t="QSO Freq:%4d" % (int(Audio.gcom2.mousefqso),)
|
2007-07-02 15:55:06 -04:00
|
|
|
msg2.configure(text=t)
|
2007-06-22 16:32:58 -04:00
|
|
|
t="QSO DF:%4d" % (int(Audio.gcom2.mousedf),)
|
2007-07-02 15:55:06 -04:00
|
|
|
msg3.configure(text=t)
|
2007-10-25 15:44:42 -04:00
|
|
|
if int(Audio.gcom2.mousefqso) != fqso0:
|
|
|
|
itol=5
|
|
|
|
ltol.configure(text='Tol '+str(500))
|
|
|
|
Audio.gcom2.dftolerance=500
|
|
|
|
fqso0=int(Audio.gcom2.mousefqso)
|
2007-06-30 14:39:18 -04:00
|
|
|
|
2007-12-28 16:22:31 -05:00
|
|
|
## if mode.get()[:4]=='JT65' and (Audio.gcom2.ndecoding>0 or \
|
|
|
|
## (isec>=options.nt1.get() and txminute==0 and \
|
|
|
|
## Audio.gcom2.monitoring==1 and \
|
|
|
|
## Audio.datcom.kkdone!=-99 and Audio.gcom2.ndiskdat!=1)):
|
|
|
|
if mode.get()[:4]=='JT65' and Audio.gcom2.ndecoding>0:
|
2007-06-26 10:20:11 -04:00
|
|
|
#Set button bg while decoding
|
2007-01-13 19:44:34 -05:00
|
|
|
bc='#66FFFF'
|
2007-06-28 14:34:13 -04:00
|
|
|
bdecode.configure(bg=bc,activebackground=bc,state=DISABLED)
|
2007-01-13 19:44:34 -05:00
|
|
|
else:
|
2007-06-28 16:36:17 -04:00
|
|
|
bdecode.configure(bg='gray85',activebackground='gray85',state=ACTIVE)
|
2007-01-13 19:44:34 -05:00
|
|
|
g.ndecphase=0
|
2007-01-11 16:25:52 -05:00
|
|
|
|
2006-08-05 13:35:21 -04:00
|
|
|
tx1.configure(bg='white')
|
|
|
|
tx2.configure(bg='white')
|
|
|
|
tx3.configure(bg='white')
|
|
|
|
tx4.configure(bg='white')
|
|
|
|
tx5.configure(bg='white')
|
|
|
|
tx6.configure(bg='white')
|
2008-09-18 14:55:29 -04:00
|
|
|
if tx6.get()[:3] != 'CQ ' and len(tx6.get())>13:
|
|
|
|
tx6.configure(bg='pink')
|
|
|
|
|
2006-08-05 13:35:21 -04:00
|
|
|
if tx6.get()[:1]=='#':
|
|
|
|
try:
|
|
|
|
txsnrdb=float(tx6.get()[1:])
|
|
|
|
if txsnrdb>-99.0 and txsnrdb<40.0:
|
|
|
|
Audio.gcom1.txsnrdb=txsnrdb
|
|
|
|
tx6.configure(bg='orange')
|
|
|
|
except:
|
|
|
|
txsnrdb=99.0
|
|
|
|
else:
|
|
|
|
txsnrdb=99.0
|
|
|
|
Audio.gcom1.txsnrdb=txsnrdb
|
|
|
|
if Audio.gcom2.monitoring and not Audio.gcom1.transmitting:
|
|
|
|
bmonitor.configure(bg='green')
|
|
|
|
else:
|
|
|
|
bmonitor.configure(bg='gray85')
|
|
|
|
if Audio.gcom1.transmitting:
|
|
|
|
nmsg=int(Audio.gcom2.nmsg)
|
|
|
|
t=g.ftnstr(Audio.gcom2.sending)
|
|
|
|
t="Txing: "+t[:nmsg]
|
|
|
|
bgcolor='yellow'
|
|
|
|
if Audio.gcom2.sendingsh==1: bgcolor='#66FFFF' #Shorthand (lt blue)
|
|
|
|
if Audio.gcom2.sendingsh==-1: bgcolor='red' #Plain Text
|
|
|
|
if Audio.gcom2.sendingsh==2: bgcolor='pink' #Test file
|
|
|
|
if txsnrdb<90.0: bgcolor='orange' #Simulation mode
|
|
|
|
if Audio.gcom2.ntxnow==1: tx1.configure(bg=bgcolor)
|
|
|
|
elif Audio.gcom2.ntxnow==2: tx2.configure(bg=bgcolor)
|
|
|
|
elif Audio.gcom2.ntxnow==3: tx3.configure(bg=bgcolor)
|
|
|
|
elif Audio.gcom2.ntxnow==4: tx4.configure(bg=bgcolor)
|
|
|
|
elif Audio.gcom2.ntxnow==5: tx5.configure(bg=bgcolor)
|
|
|
|
else: tx6.configure(bg=bgcolor)
|
|
|
|
else:
|
|
|
|
bgcolor='green'
|
|
|
|
t='Receiving'
|
2008-07-12 14:11:36 -04:00
|
|
|
msg8.configure(text=t,bg=bgcolor)
|
2006-08-05 13:35:21 -04:00
|
|
|
|
2007-01-12 12:57:41 -05:00
|
|
|
if Audio.gcom2.ndecdone>0 or g.cmap != cmap0:
|
2006-08-05 13:35:21 -04:00
|
|
|
if Audio.gcom2.ndecdone==1:
|
|
|
|
if isync==-99 or isync==99:
|
|
|
|
isync=isync_save
|
|
|
|
Audio.gcom2.minsigdb=isync
|
|
|
|
try:
|
|
|
|
f=open(appdir+'/decoded.txt',mode='r')
|
|
|
|
lines=f.readlines()
|
|
|
|
f.close()
|
|
|
|
except:
|
|
|
|
lines=""
|
|
|
|
text.configure(state=NORMAL)
|
2007-06-28 14:34:13 -04:00
|
|
|
for i in range(len(lines)-1):
|
2006-08-05 13:35:21 -04:00
|
|
|
text.insert(END,lines[i])
|
|
|
|
text.see(END)
|
2007-01-13 19:44:34 -05:00
|
|
|
g.ndecphase=1
|
2007-10-25 15:44:42 -04:00
|
|
|
|
|
|
|
if Audio.gcom2.nhispol != -999:
|
2009-03-03 16:10:59 -05:00
|
|
|
npol=int(Audio.gcom2.nhispol)
|
|
|
|
npol=180-npol #Reverse sign of x
|
|
|
|
txpol=(npol - 2*g.poloffset + 360) % 180
|
2007-10-25 15:44:42 -04:00
|
|
|
t="Tx pol: %d " % txpol
|
|
|
|
if txpol < 45 or txpol > 135:
|
|
|
|
t=t + 'H'
|
|
|
|
color='pink'
|
|
|
|
else:
|
|
|
|
t=t + 'V'
|
|
|
|
color='yellow'
|
|
|
|
msg6.configure(text=t,bg=color)
|
|
|
|
|
2006-09-07 16:29:47 -04:00
|
|
|
# text.configure(state=DISABLED)
|
2006-08-05 13:35:21 -04:00
|
|
|
|
2007-01-09 09:40:24 -05:00
|
|
|
try:
|
|
|
|
f=open(appdir+'/decoded.ave',mode='r')
|
|
|
|
lines=f.readlines()
|
|
|
|
f.close()
|
|
|
|
except:
|
|
|
|
lines[0]=""
|
|
|
|
lines[1]=""
|
|
|
|
avetext.configure(state=NORMAL)
|
|
|
|
avetext.delete('1.0',END)
|
|
|
|
if len(lines)>1:
|
|
|
|
avetext.insert(END,lines[0])
|
|
|
|
avetext.insert(END,lines[1])
|
|
|
|
# avetext.configure(state=DISABLED)
|
2007-06-28 11:14:35 -04:00
|
|
|
cleartext()
|
2007-01-12 12:57:41 -05:00
|
|
|
Audio.gcom2.ndecdone=0
|
2007-01-11 16:25:52 -05:00
|
|
|
|
2007-01-12 12:57:41 -05:00
|
|
|
if Audio.gcom2.ndecdone==2:
|
2007-01-11 16:25:52 -05:00
|
|
|
try:
|
2007-07-02 15:17:07 -04:00
|
|
|
f=open(appdir+'/messages.txt',mode='r')
|
2007-01-11 16:25:52 -05:00
|
|
|
lines=f.readlines()
|
|
|
|
f.close()
|
|
|
|
except:
|
|
|
|
lines=""
|
2007-07-03 13:34:35 -04:00
|
|
|
msgtext.configure(state=NORMAL)
|
|
|
|
msgtext.delete('1.0',END)
|
2007-01-11 16:25:52 -05:00
|
|
|
for i in range(len(lines)):
|
2007-06-25 19:51:09 -04:00
|
|
|
try:
|
2007-07-10 11:02:56 -04:00
|
|
|
nage=int(lines[i][45:])
|
2007-06-25 19:51:09 -04:00
|
|
|
except:
|
|
|
|
nage=0
|
2007-07-10 11:02:56 -04:00
|
|
|
lines[i]=lines[i][:45]+'\n'
|
2007-06-25 12:57:31 -04:00
|
|
|
if nage==0: attr='age0'
|
|
|
|
if nage==1: attr='age1'
|
|
|
|
if nage==2: attr='age2'
|
|
|
|
if nage>=3: attr='age3'
|
2007-07-03 13:34:35 -04:00
|
|
|
msgtext.insert(END,lines[i],attr)
|
|
|
|
msgtext.see(END)
|
2007-01-17 09:36:54 -05:00
|
|
|
|
2008-09-19 13:25:58 -04:00
|
|
|
# Display Band Map information:
|
2007-01-17 09:36:54 -05:00
|
|
|
try:
|
2007-07-02 15:17:07 -04:00
|
|
|
f=open(appdir+'/bandmap.txt',mode='r')
|
2007-01-17 09:36:54 -05:00
|
|
|
lines=f.readlines()
|
|
|
|
f.close()
|
|
|
|
except:
|
|
|
|
lines=""
|
2007-07-03 15:47:14 -04:00
|
|
|
bmtext.configure(state=NORMAL)
|
|
|
|
bmtext.delete('1.0',END)
|
2007-10-25 12:31:19 -04:00
|
|
|
g.fc=["" for i in range(200)]
|
2007-01-17 09:36:54 -05:00
|
|
|
for i in range(len(lines)):
|
2007-06-25 12:57:31 -04:00
|
|
|
for j in range(3):
|
|
|
|
ka=14*j
|
|
|
|
kb=ka+12
|
|
|
|
t=lines[i][ka:kb]
|
|
|
|
try:
|
|
|
|
nage=int(t[10:])
|
|
|
|
except:
|
|
|
|
nage=0
|
|
|
|
t=t[:11]+' '
|
2008-09-19 13:25:58 -04:00
|
|
|
t2=""
|
|
|
|
if t[0]!=' ':
|
|
|
|
fqso=t[:3]
|
|
|
|
tcall=t[4:10]
|
|
|
|
cstar=' *'
|
|
|
|
if worked.has_key(tcall.strip()): cstar=' '
|
|
|
|
t2=fqso + cstar + tcall + ' '
|
|
|
|
if j==2:
|
|
|
|
t=t+'\n'
|
|
|
|
t2=t2+'\n'
|
2007-06-25 12:57:31 -04:00
|
|
|
if nage==0: attr='age0'
|
|
|
|
if nage==1: attr='age1'
|
|
|
|
if nage==2: attr='age2'
|
|
|
|
if nage>=3: attr='age3'
|
2008-09-19 13:25:58 -04:00
|
|
|
bmtext.insert(END,t2,attr)
|
2007-07-03 21:58:22 -04:00
|
|
|
t=t[:12]
|
|
|
|
if t!=" ":
|
|
|
|
try:
|
|
|
|
k=int(t[:3])
|
|
|
|
c=t[4:10]
|
|
|
|
if c!=NONE:
|
|
|
|
t=g.fc[k]
|
|
|
|
if t.find(c+" ") == -1:
|
|
|
|
g.fc[k]=g.fc[k] + c + " "
|
|
|
|
except:
|
|
|
|
pass
|
2007-07-03 15:47:14 -04:00
|
|
|
bmtext.see(END)
|
2007-01-17 09:36:54 -05:00
|
|
|
|
2007-01-13 15:21:32 -05:00
|
|
|
Audio.gcom2.ndecdone=0
|
2007-06-28 09:31:46 -04:00
|
|
|
if loopall: opennext()
|
2007-01-14 11:53:10 -05:00
|
|
|
nopen=0
|
2007-01-11 16:25:52 -05:00
|
|
|
|
2006-08-05 13:35:21 -04:00
|
|
|
if g.cmap != cmap0:
|
|
|
|
im.putpalette(g.palette)
|
|
|
|
cmap0=g.cmap
|
2007-01-14 21:28:58 -05:00
|
|
|
|
2006-08-05 13:35:21 -04:00
|
|
|
# Save some parameters
|
|
|
|
g.mode=mode.get()
|
|
|
|
Audio.gcom1.txfirst=TxFirst.get()
|
|
|
|
try:
|
|
|
|
Audio.gcom1.samfacin=options.samfacin.get()
|
|
|
|
except:
|
|
|
|
Audio.gcom1.samfacin=1.0
|
|
|
|
try:
|
|
|
|
Audio.gcom1.samfacout=options.samfacout.get()
|
|
|
|
except:
|
|
|
|
Audio.gcom1.samfacout=1.0
|
|
|
|
Audio.gcom2.mycall=(options.MyCall.get()+' ')[:12]
|
|
|
|
Audio.gcom2.hiscall=(ToRadio.get()+' ')[:12]
|
|
|
|
Audio.gcom2.hisgrid=(HisGrid.get()+' ')[:6]
|
|
|
|
Audio.gcom4.addpfx=(options.addpfx.get().lstrip()+' ')[:8]
|
|
|
|
Audio.gcom2.ntxreq=ntx.get()
|
|
|
|
tx=(tx1,tx2,tx3,tx4,tx5,tx6)
|
|
|
|
Audio.gcom2.txmsg=(tx[ntx.get()-1].get()+' ')[:28]
|
|
|
|
Audio.gcom2.mode=(mode.get()+' ')[:6]
|
|
|
|
Audio.gcom2.nsave=nsave.get()
|
|
|
|
Audio.gcom2.nzap=nzap.get()
|
2007-07-02 12:02:06 -04:00
|
|
|
n=ndebug.get()
|
|
|
|
if ndebug2.get(): n=2
|
|
|
|
Audio.gcom2.ndebug=n
|
2006-08-05 13:35:21 -04:00
|
|
|
Audio.gcom2.minsigdb=isync
|
|
|
|
Audio.gcom2.nclip=iclip
|
|
|
|
Audio.gcom2.nblank=nblank.get()
|
|
|
|
Audio.gcom2.nafc=nafc.get()
|
|
|
|
Audio.gcom2.nfreeze=nfreeze.get()
|
|
|
|
Audio.gcom2.dftolerance=ntol[itol]
|
|
|
|
Audio.gcom2.neme=neme.get()
|
|
|
|
Audio.gcom2.ndepth=ndepth.get()
|
2007-11-05 14:19:46 -05:00
|
|
|
Audio.gcom2.multicast=multicast.get()
|
2006-08-05 13:35:21 -04:00
|
|
|
try:
|
|
|
|
Audio.gcom2.idinterval=options.IDinterval.get()
|
|
|
|
except:
|
|
|
|
Audio.gcom2.idinterval=0
|
|
|
|
Audio.gcom2.ntx2=0
|
2007-07-09 12:14:00 -04:00
|
|
|
try:
|
|
|
|
Audio.gcom2.nkeep=options.nkeep.get()
|
|
|
|
except:
|
|
|
|
Audio.gcom2.nkeep=20
|
|
|
|
try:
|
|
|
|
Audio.gcom2.idphi=options.dphi.get()
|
|
|
|
except:
|
|
|
|
Audio.gcom2.idphi=0
|
|
|
|
try:
|
|
|
|
Audio.gcom2.nfa=options.fa.get()
|
|
|
|
except:
|
|
|
|
Audio.gcom2.nfa=100
|
|
|
|
try:
|
|
|
|
Audio.gcom2.nfb=options.fb.get()
|
|
|
|
except:
|
|
|
|
Audio.gcom2.nfa=160
|
|
|
|
try:
|
|
|
|
Audio.gcom2.nfcal=options.fcal.get()
|
|
|
|
except:
|
|
|
|
Audio.gcom2.nfcal=0
|
2007-07-12 16:45:14 -04:00
|
|
|
try:
|
|
|
|
Audio.gcom2.ncsmin=options.ncsmin.get()
|
|
|
|
except:
|
|
|
|
Audio.gcom2.ncsmin=20
|
|
|
|
try:
|
|
|
|
Audio.gcom2.nt1=options.nt1.get()
|
|
|
|
except:
|
|
|
|
Audio.gcom2.nt1=48
|
2007-07-09 12:14:00 -04:00
|
|
|
t=options.savedir.get() + \
|
|
|
|
' ' + \
|
|
|
|
' '
|
|
|
|
Audio.gcom2.savedir=t[:80]
|
|
|
|
|
2006-08-05 13:35:21 -04:00
|
|
|
# Audio.gcom1.rxdelay=float('0'+options.RxDelay.get())
|
|
|
|
# Audio.gcom1.txdelay=float('0'+options.TxDelay.get())
|
|
|
|
if ntx.get()==1 and noshjt65.get()==1: Audio.gcom2.ntx2=1
|
|
|
|
Audio.gcom2.nslim2=isync-4
|
|
|
|
try:
|
|
|
|
Audio.gcom2.nport=int(options.PttPort.get())
|
|
|
|
except:
|
|
|
|
Audio.gcom2.nport=0
|
|
|
|
Audio.gcom2.pttport=(options.PttPort.get() + ' ')[:12]
|
2006-09-08 10:21:08 -04:00
|
|
|
if altmsg: tx6alt=tx6.get()
|
2007-06-25 16:18:43 -04:00
|
|
|
ldate.after(100,update) # Queue up the next update
|
2006-08-05 13:35:21 -04:00
|
|
|
|
|
|
|
#------------------------------------------------------ Top level frame
|
|
|
|
frame = Frame(root)
|
|
|
|
|
|
|
|
#------------------------------------------------------ Menu Bar
|
|
|
|
mbar = Frame(frame)
|
|
|
|
mbar.pack(fill = X)
|
|
|
|
|
|
|
|
#------------------------------------------------------ File Menu
|
|
|
|
filebutton = Menubutton(mbar, text = 'File')
|
|
|
|
filebutton.pack(side = LEFT)
|
|
|
|
filemenu = Menu(filebutton, tearoff=0)
|
|
|
|
filebutton['menu'] = filemenu
|
2006-09-07 10:33:37 -04:00
|
|
|
filemenu.add('command', label = 'Open', command = openfile, \
|
|
|
|
accelerator='Ctrl+O')
|
|
|
|
filemenu.add('command', label = 'Open next in directory', command = opennext, \
|
|
|
|
accelerator='F6')
|
2006-08-05 13:35:21 -04:00
|
|
|
filemenu.add('command', label = 'Decode remaining files in directory', \
|
2006-09-07 10:33:37 -04:00
|
|
|
command = decodeall, accelerator='Shift+F6')
|
2006-08-05 13:35:21 -04:00
|
|
|
filemenu.add_separator()
|
2007-07-11 12:20:35 -04:00
|
|
|
filemenu.add('command', label = 'Delete all *.tf2 files in SaveDir', \
|
2006-08-05 13:35:21 -04:00
|
|
|
command = delwav)
|
2007-07-03 13:34:35 -04:00
|
|
|
filemenu.add('command', label = 'Erase Band Map and Messages', command = clr_all)
|
2007-06-24 19:26:17 -04:00
|
|
|
filemenu.add('command', label = 'Erase ALL65.TXT', command = del_all)
|
2006-08-05 13:35:21 -04:00
|
|
|
filemenu.add_separator()
|
|
|
|
filemenu.add('command', label = 'Exit', command = quit)
|
|
|
|
|
|
|
|
#------------------------------------------------------ Setup menu
|
2006-09-07 10:33:37 -04:00
|
|
|
setupbutton = Menubutton(mbar, text = 'Setup')
|
2006-08-05 13:35:21 -04:00
|
|
|
setupbutton.pack(side = LEFT)
|
|
|
|
setupmenu = Menu(setupbutton, tearoff=0)
|
|
|
|
setupbutton['menu'] = setupmenu
|
2006-09-07 10:33:37 -04:00
|
|
|
setupmenu.add('command', label = 'Options', command = options1, \
|
|
|
|
accelerator='F2')
|
2006-08-05 13:35:21 -04:00
|
|
|
setupmenu.add_separator()
|
|
|
|
setupmenu.add('command', label = 'Generate messages for test tones', command=testmsgs)
|
2007-07-03 15:47:14 -04:00
|
|
|
setupmenu.add('command', label = 'Find Delta Phi', command=delta_phi)
|
2006-08-05 13:35:21 -04:00
|
|
|
setupmenu.add_separator()
|
|
|
|
setupmenu.add_checkbutton(label = 'F4 sets Tx6',variable=kb8rq)
|
|
|
|
setupmenu.add_checkbutton(label = 'Double-click on callsign sets TxFirst',
|
|
|
|
variable=setseq)
|
|
|
|
setupmenu.add_checkbutton(label = 'GenStdMsgs sets Tx1',variable=k2txb)
|
2007-06-30 14:39:18 -04:00
|
|
|
setupmenu.add_separator()
|
2007-11-05 14:19:46 -05:00
|
|
|
setupmenu.add_radiobutton(label = 'Input data multicast', variable=multicast, \
|
|
|
|
value=1)
|
|
|
|
setupmenu.add_radiobutton(label = 'Input data unicast', variable=multicast, \
|
|
|
|
value=0)
|
|
|
|
setupmenu.add_separator()
|
2007-06-30 14:39:18 -04:00
|
|
|
setupmenu.add_checkbutton(label = 'Enable diagnostics',variable=ndebug)
|
2007-07-02 12:02:06 -04:00
|
|
|
setupmenu.add_checkbutton(label = 'Verbose diagnostics',variable=ndebug2)
|
2006-08-05 13:35:21 -04:00
|
|
|
|
|
|
|
#------------------------------------------------------ View menu
|
2006-09-07 10:33:37 -04:00
|
|
|
viewbutton=Menubutton(mbar,text='View')
|
2006-08-05 13:35:21 -04:00
|
|
|
viewbutton.pack(side=LEFT)
|
|
|
|
viewmenu=Menu(viewbutton,tearoff=0)
|
|
|
|
viewbutton['menu']=viewmenu
|
2006-09-07 10:33:37 -04:00
|
|
|
viewmenu.add('command', label = 'SpecJT', command = showspecjt, \
|
|
|
|
accelerator='F10')
|
2007-07-02 15:17:07 -04:00
|
|
|
viewmenu.add('command', label = 'Messages', command = messages)
|
|
|
|
viewmenu.add('command', label = 'Band Map', command = bandmap)
|
2006-09-07 10:33:37 -04:00
|
|
|
viewmenu.add('command', label = 'Astronomical data', command = astro1, \
|
|
|
|
accelerator='Shift+F10')
|
2006-08-05 13:35:21 -04:00
|
|
|
|
|
|
|
#------------------------------------------------------ Mode menu
|
2006-09-07 10:33:37 -04:00
|
|
|
modebutton = Menubutton(mbar, text = 'Mode')
|
2006-08-05 13:35:21 -04:00
|
|
|
modebutton.pack(side = LEFT)
|
|
|
|
modemenu = Menu(modebutton, tearoff=0)
|
|
|
|
modebutton['menu'] = modemenu
|
|
|
|
|
|
|
|
# To enable menu item 0:
|
|
|
|
# modemenu.entryconfig(0,state=NORMAL)
|
|
|
|
# Can use the following to retrieve the state:
|
|
|
|
# state=modemenu.entrycget(0,"state")
|
|
|
|
|
2007-07-12 10:47:41 -04:00
|
|
|
#modemenu.add_radiobutton(label = 'JT65A', variable=mode, command = ModeJT65A, \
|
|
|
|
# state=DISABLED, accelerator='F8')
|
2006-09-07 10:33:37 -04:00
|
|
|
modemenu.add_radiobutton(label = 'JT65B', variable=mode, command = ModeJT65B, \
|
|
|
|
accelerator='Shift+F8')
|
2007-07-12 10:47:41 -04:00
|
|
|
#modemenu.add_radiobutton(label = 'JT65C', variable=mode, command = ModeJT65C, \
|
|
|
|
# state=DISABLED, accelerator='Ctrl+F8')
|
2007-06-26 10:20:11 -04:00
|
|
|
modemenu.add_radiobutton(label = 'Measure', variable=mode)
|
|
|
|
modemenu.add_radiobutton(label = 'Pulsar', variable=mode,state=DISABLED)
|
2006-08-05 13:35:21 -04:00
|
|
|
|
|
|
|
#------------------------------------------------------ Decode menu
|
2006-09-07 10:33:37 -04:00
|
|
|
decodebutton = Menubutton(mbar, text = 'Decode')
|
2006-08-05 13:35:21 -04:00
|
|
|
decodebutton.pack(side = LEFT)
|
2007-01-09 12:08:45 -05:00
|
|
|
decodemenu = Menu(decodebutton, tearoff=0)
|
2006-08-05 13:35:21 -04:00
|
|
|
decodebutton['menu'] = decodemenu
|
2007-01-09 12:08:45 -05:00
|
|
|
decodemenu.add_checkbutton(label='Only EME calls',variable=neme)
|
|
|
|
decodemenu.add_checkbutton(label='No Shorthands if Tx 1',variable=noshjt65)
|
|
|
|
decodemenu.add_separator()
|
|
|
|
decodemenu.add_radiobutton(label = 'No Deep Search',
|
2006-08-05 13:35:21 -04:00
|
|
|
variable=ndepth, value=0)
|
2007-01-09 12:08:45 -05:00
|
|
|
decodemenu.add_radiobutton(label = 'Normal Deep Search',
|
2006-08-05 13:35:21 -04:00
|
|
|
variable=ndepth, value=1)
|
2007-01-09 12:08:45 -05:00
|
|
|
decodemenu.add_radiobutton(label = 'Aggressive Deep Search',
|
2006-08-05 13:35:21 -04:00
|
|
|
variable=ndepth, value=2)
|
2007-07-02 15:17:07 -04:00
|
|
|
#decodemenu.add_radiobutton(label ='Include Average in Aggressive Deep Search',
|
|
|
|
# variable=ndepth, value=3)
|
2006-08-05 13:35:21 -04:00
|
|
|
|
|
|
|
#------------------------------------------------------ Save menu
|
|
|
|
savebutton = Menubutton(mbar, text = 'Save')
|
|
|
|
savebutton.pack(side = LEFT)
|
|
|
|
savemenu = Menu(savebutton, tearoff=1)
|
|
|
|
savebutton['menu'] = savemenu
|
|
|
|
nsave=IntVar()
|
|
|
|
savemenu.add_radiobutton(label = 'None', variable=nsave,value=0)
|
2007-07-09 16:36:44 -04:00
|
|
|
savemenu.add_radiobutton(label = 'Save all', variable=nsave,value=1)
|
2006-08-05 13:35:21 -04:00
|
|
|
nsave.set(0)
|
|
|
|
|
|
|
|
#------------------------------------------------------ Band menu
|
|
|
|
bandbutton = Menubutton(mbar, text = 'Band')
|
|
|
|
bandbutton.pack(side = LEFT)
|
|
|
|
bandmenu = Menu(bandbutton, tearoff=1)
|
|
|
|
bandbutton['menu'] = bandmenu
|
|
|
|
nfreq=IntVar()
|
|
|
|
bandmenu.add_radiobutton(label = '50', variable=nfreq,value=50)
|
|
|
|
bandmenu.add_radiobutton(label = '144', variable=nfreq,value=144)
|
|
|
|
bandmenu.add_radiobutton(label = '222', variable=nfreq,value=222)
|
|
|
|
bandmenu.add_radiobutton(label = '432', variable=nfreq,value=432)
|
|
|
|
bandmenu.add_radiobutton(label = '1296', variable=nfreq,value=1296)
|
2007-01-09 12:08:45 -05:00
|
|
|
bandmenu.add_radiobutton(label = '2304', variable=nfreq,value=2304)
|
2006-08-05 13:35:21 -04:00
|
|
|
nfreq.set(144)
|
|
|
|
#------------------------------------------------------ Help menu
|
|
|
|
helpbutton = Menubutton(mbar, text = 'Help')
|
|
|
|
helpbutton.pack(side = LEFT)
|
|
|
|
helpmenu = Menu(helpbutton, tearoff=0)
|
|
|
|
helpbutton['menu'] = helpmenu
|
2006-09-07 10:33:37 -04:00
|
|
|
helpmenu.add('command', label = 'Keyboard shortcuts', command = shortcuts, \
|
|
|
|
accelerator='F1')
|
|
|
|
helpmenu.add('command', label = 'Special mouse commands', \
|
|
|
|
command = mouse_commands, accelerator='Shift+F1')
|
|
|
|
helpmenu.add('command', label = 'What message to send?', \
|
|
|
|
command = what2send, accelerator='F5')
|
2006-08-05 13:35:21 -04:00
|
|
|
helpmenu.add('command', label = 'Available suffixes and add-on prefixes', \
|
|
|
|
command = prefixes)
|
2007-01-08 15:54:34 -05:00
|
|
|
helpmenu.add('command', label = 'About MAP65', command = about, \
|
2006-09-07 10:33:37 -04:00
|
|
|
accelerator='Ctrl+F1')
|
2006-08-05 13:35:21 -04:00
|
|
|
|
2007-07-04 13:44:39 -04:00
|
|
|
#------------------------------------------------------ Label above text
|
2006-08-05 13:35:21 -04:00
|
|
|
iframe2 = Frame(frame, bd=1, relief=FLAT,height=15)
|
2007-07-03 12:53:28 -04:00
|
|
|
lab2=Label(iframe2, text='Freq DF Pol UTC DT dB')
|
2006-08-05 13:35:21 -04:00
|
|
|
lab2.place(x=3,y=6, anchor='w')
|
2007-07-02 15:17:07 -04:00
|
|
|
lab7=Label(iframe2,text='F3',fg='gray85')
|
2006-08-05 13:35:21 -04:00
|
|
|
lab7.place(x=495,y=6, anchor=CENTER)
|
2007-07-04 13:44:39 -04:00
|
|
|
iframe2.pack(expand=1, fill=BOTH, padx=4)
|
2006-08-05 13:35:21 -04:00
|
|
|
|
|
|
|
#-------------------------------------------------------- Decoded text
|
2007-07-02 15:17:07 -04:00
|
|
|
iframe4 = Frame(frame, bd=2, relief=SUNKEN)
|
|
|
|
text=Text(iframe4, height=16, width=65)
|
2006-08-05 13:35:21 -04:00
|
|
|
text.bind('<Double-Button-1>',dbl_click_text)
|
2007-10-25 12:31:19 -04:00
|
|
|
text.bind('<Double-Button-3>',dbl_click3_text)
|
2006-09-07 16:29:47 -04:00
|
|
|
text.bind('<Key>',textkey)
|
2006-08-05 13:35:21 -04:00
|
|
|
|
|
|
|
root.bind_all('<F1>', shortcuts)
|
|
|
|
root.bind_all('<Shift-F1>', mouse_commands)
|
|
|
|
root.bind_all('<Control-F1>', about)
|
|
|
|
root.bind_all('<F2>', options1)
|
|
|
|
root.bind_all('<F3>', txmute)
|
|
|
|
root.bind_all('<F4>', clrToRadio)
|
|
|
|
root.bind_all('<F5>', what2send)
|
|
|
|
root.bind_all('<F6>', opennext)
|
|
|
|
root.bind_all('<Shift-F6>', decodeall)
|
2007-07-12 10:47:41 -04:00
|
|
|
#root.bind_all('<F8>', ModeJT65A)
|
2006-08-05 13:35:21 -04:00
|
|
|
root.bind_all('<Shift-F8>', ModeJT65B)
|
2007-07-12 10:47:41 -04:00
|
|
|
#root.bind_all('<Control-F8>', ModeJT65C)
|
2006-08-05 13:35:21 -04:00
|
|
|
root.bind_all('<F10>', showspecjt)
|
2006-09-07 10:33:37 -04:00
|
|
|
root.bind_all('<Shift-F10>', astro1)
|
2007-06-22 16:32:58 -04:00
|
|
|
root.bind_all('<F11>',left_arrow)
|
2007-06-24 19:26:17 -04:00
|
|
|
root.bind_all('<Shift-F11>',dec_fqso)
|
2007-06-22 16:32:58 -04:00
|
|
|
root.bind_all('<F12>',right_arrow)
|
2007-06-24 19:26:17 -04:00
|
|
|
root.bind_all('<Shift-F12>',inc_fqso)
|
2006-08-05 13:35:21 -04:00
|
|
|
root.bind_all('<Alt-Key-1>',btx1)
|
|
|
|
root.bind_all('<Alt-Key-2>',btx2)
|
|
|
|
root.bind_all('<Alt-Key-3>',btx3)
|
|
|
|
root.bind_all('<Alt-Key-4>',btx4)
|
|
|
|
root.bind_all('<Alt-Key-5>',btx5)
|
|
|
|
root.bind_all('<Alt-Key-6>',btx6)
|
|
|
|
|
|
|
|
root.bind_all('<Alt-a>',toggleauto)
|
|
|
|
root.bind_all('<Alt-A>',toggleauto)
|
|
|
|
root.bind_all('<Alt-c>',clear_avg)
|
|
|
|
root.bind_all('<Alt-C>',clear_avg)
|
|
|
|
root.bind_all('<Alt-d>',decode)
|
|
|
|
root.bind_all('<Alt-D>',decode)
|
|
|
|
root.bind_all('<Alt-e>',erase)
|
|
|
|
root.bind_all('<Alt-E>',erase)
|
|
|
|
root.bind_all('<Alt-f>',toggle_freeze)
|
|
|
|
root.bind_all('<Alt-F>',toggle_freeze)
|
|
|
|
root.bind_all('<Alt-g>',GenStdMsgs)
|
|
|
|
root.bind_all('<Alt-G>',GenStdMsgs)
|
2006-09-08 10:21:08 -04:00
|
|
|
root.bind_all('<Control-g>', GenAltMsgs)
|
|
|
|
root.bind_all('<Control-G>', GenAltMsgs)
|
2006-08-05 13:35:21 -04:00
|
|
|
root.bind_all('<Alt-i>',decode_include)
|
|
|
|
root.bind_all('<Alt-I>',decode_include)
|
|
|
|
root.bind_all('<Alt-l>',lookup)
|
|
|
|
root.bind_all('<Alt-L>',lookup)
|
|
|
|
root.bind_all('<Alt-m>',monitor)
|
|
|
|
root.bind_all('<Alt-M>',monitor)
|
|
|
|
root.bind_all('<Alt-o>',txstop)
|
|
|
|
root.bind_all('<Alt-O>',txstop)
|
2006-09-07 10:33:37 -04:00
|
|
|
root.bind_all('<Control-o>',openfile)
|
|
|
|
root.bind_all('<Control-O>',openfile)
|
2006-08-05 13:35:21 -04:00
|
|
|
root.bind_all('<Alt-q>',logqso)
|
|
|
|
root.bind_all('<Alt-Q>',logqso)
|
2008-10-08 21:03:41 -04:00
|
|
|
root.bind_all('<Alt-s>',set_ftx)
|
|
|
|
root.bind_all('<Alt-S>',set_ftx)
|
2006-08-05 13:35:21 -04:00
|
|
|
root.bind_all('<Alt-x>',decode_exclude)
|
|
|
|
root.bind_all('<Alt-X>',decode_exclude)
|
|
|
|
root.bind_all('<Alt-z>',toggle_zap)
|
|
|
|
root.bind_all('<Alt-Z>',toggle_zap)
|
|
|
|
root.bind_all('<Control-l>',lookup_gen)
|
|
|
|
root.bind_all('<Control-L>',lookup_gen)
|
|
|
|
|
|
|
|
text.pack(side=LEFT, fill=X, padx=1)
|
|
|
|
sb = Scrollbar(iframe4, orient=VERTICAL, command=text.yview)
|
2007-07-02 15:17:07 -04:00
|
|
|
sb.pack(side=LEFT, fill=Y)
|
2006-08-05 13:35:21 -04:00
|
|
|
text.configure(yscrollcommand=sb.set)
|
2007-07-02 15:17:07 -04:00
|
|
|
|
|
|
|
astrotext_font='"Lucida Console" 16'
|
|
|
|
astrotext=Text(iframe4, bg="#66FFFF",height=10,width=11,font=astrotext_font)
|
|
|
|
astrotext.pack(side=LEFT, fill=BOTH, padx=4)
|
|
|
|
g2font=astrotext_font
|
|
|
|
if g2font!="": g.g2font=g2font
|
|
|
|
|
2006-08-05 13:35:21 -04:00
|
|
|
iframe4.pack(expand=1, fill=X, padx=4)
|
2007-07-02 15:17:07 -04:00
|
|
|
iframe4b = Frame(frame, bd=2, relief=SUNKEN)
|
|
|
|
avetext=Text(iframe4b, height=2, width=65)
|
2006-08-05 13:35:21 -04:00
|
|
|
avetext.bind('<Double-Button-1>',dbl_click_ave)
|
2006-09-07 16:29:47 -04:00
|
|
|
#avetext.bind('<Double-Button-3>',dbl_click_ave)
|
|
|
|
avetext.bind('<Key>',avetextkey)
|
2006-08-05 13:35:21 -04:00
|
|
|
avetext.pack(side=LEFT, fill=X, padx=1)
|
|
|
|
iframe4b.pack(expand=1, fill=X, padx=4)
|
|
|
|
|
|
|
|
#------------------------------------------------------- Button Bar
|
|
|
|
iframe4c = Frame(frame, bd=1, relief=SUNKEN)
|
|
|
|
blogqso=Button(iframe4c, text='Log QSO',underline=4,command=logqso,
|
|
|
|
padx=1,pady=1)
|
2008-10-08 21:03:41 -04:00
|
|
|
bstop=Button(iframe4c, text='Stop',command=stopmon,
|
2006-08-05 13:35:21 -04:00
|
|
|
padx=1,pady=1)
|
|
|
|
bmonitor=Button(iframe4c, text='Monitor',underline=0,command=monitor,
|
|
|
|
padx=1,pady=1)
|
|
|
|
bdecode=Button(iframe4c, text='Decode',underline=0,command=decode,
|
|
|
|
padx=1,pady=1)
|
|
|
|
berase=Button(iframe4c, text='Erase',underline=0,command=erase,
|
|
|
|
padx=1,pady=1)
|
|
|
|
bclravg=Button(iframe4c, text='Clear Avg',underline=0,command=clear_avg,
|
|
|
|
padx=1,pady=1)
|
|
|
|
binclude=Button(iframe4c, text='Include',underline=0,
|
|
|
|
command=decode_include,padx=1,pady=1)
|
|
|
|
bexclude=Button(iframe4c, text='Exclude',underline=1,
|
|
|
|
command=decode_exclude,padx=1,pady=1)
|
|
|
|
btxstop=Button(iframe4c,text='TxStop',underline=4,command=txstop,
|
|
|
|
padx=1,pady=1)
|
|
|
|
|
|
|
|
blogqso.pack(side=LEFT,expand=1,fill=X)
|
|
|
|
bstop.pack(side=LEFT,expand=1,fill=X)
|
|
|
|
bmonitor.pack(side=LEFT,expand=1,fill=X)
|
|
|
|
bdecode.pack(side=LEFT,expand=1,fill=X)
|
|
|
|
berase.pack(side=LEFT,expand=1,fill=X)
|
|
|
|
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)
|
|
|
|
iframe4c.pack(expand=1, fill=X, padx=4)
|
|
|
|
|
|
|
|
#-----------------------------------------------------General control area
|
|
|
|
iframe5 = Frame(frame, bd=1, relief=FLAT,height=180)
|
|
|
|
|
|
|
|
#------------------------------------------------------ "Other station" info
|
|
|
|
f5a=Frame(iframe5,height=170,bd=2,relief=GROOVE)
|
|
|
|
labToRadio=Label(f5a,text='To radio:', width=9, relief=FLAT)
|
|
|
|
labToRadio.grid(column=0,row=0)
|
|
|
|
ToRadio=Entry(f5a,width=9)
|
|
|
|
ToRadio.insert(0,'W8WN')
|
|
|
|
ToRadio.grid(column=1,row=0,pady=3)
|
|
|
|
bLookup=Button(f5a, text='Lookup',underline=0,command=lookup,padx=1,pady=1)
|
|
|
|
bLookup.grid(column=2,row=0,sticky='EW',padx=4)
|
|
|
|
labGrid=Label(f5a,text='Grid:', width=9, relief=FLAT)
|
|
|
|
labGrid.grid(column=0,row=1)
|
|
|
|
HisGrid=Entry(f5a,width=9)
|
|
|
|
HisGrid.grid(column=1,row=1,pady=1)
|
|
|
|
bAdd=Button(f5a, text='Add',command=addtodb,padx=1,pady=1)
|
|
|
|
bAdd.grid(column=2,row=1,sticky='EW',padx=4)
|
2006-09-04 22:25:39 -04:00
|
|
|
labAz=Label(f5a,text='Az 257 El 15',width=11)
|
2006-08-05 13:35:21 -04:00
|
|
|
labAz.grid(column=1,row=2)
|
2006-09-04 22:25:39 -04:00
|
|
|
labDist=Label(f5a,text='16753 km')
|
2006-08-05 13:35:21 -04:00
|
|
|
labDist.grid(column=2,row=2)
|
|
|
|
|
|
|
|
#------------------------------------------------------ Date and Time
|
|
|
|
ldate=Label(f5a, bg='black', fg='yellow', width=11, bd=4,
|
|
|
|
text='2005 Apr 22\n01:23:45', relief=RIDGE,
|
|
|
|
justify=CENTER, font=(font1,16))
|
|
|
|
ldate.grid(column=0,columnspan=3,row=3,rowspan=2,pady=2)
|
|
|
|
f5a.pack(side=LEFT,expand=1,fill=BOTH)
|
|
|
|
|
|
|
|
#------------------------------------------------------ Receiving parameters
|
|
|
|
f5b=Frame(iframe5,bd=2,relief=GROOVE)
|
|
|
|
nzap=IntVar()
|
2008-09-16 13:20:42 -04:00
|
|
|
bblank=Checkbutton(f5b,text='NB',justify=RIGHT,variable=nblank)
|
|
|
|
bblank.grid(column=0,row=0,padx=2,pady=20,sticky='EW')
|
2006-08-05 13:35:21 -04:00
|
|
|
ltol=Label(f5b, bg='white', fg='black', text='Tol 400', width=8, relief=RIDGE)
|
2008-09-16 13:20:42 -04:00
|
|
|
ltol.grid(column=0,row=1,padx=2,pady=1,sticky='EW')
|
2006-08-05 13:35:21 -04:00
|
|
|
Widget.bind(ltol,'<Button-1>',inctol)
|
|
|
|
Widget.bind(ltol,'<Button-3>',dectol)
|
|
|
|
ldsec=Label(f5b, bg='white', fg='black', text='Dsec 0.0', width=8, relief=RIDGE)
|
2008-09-16 13:20:42 -04:00
|
|
|
ldsec.grid(column=0,row=2,ipadx=3,padx=2,pady=5,sticky='EW')
|
2006-08-05 13:35:21 -04:00
|
|
|
Widget.bind(ldsec,'<Button-1>',incdsec)
|
|
|
|
Widget.bind(ldsec,'<Button-3>',decdsec)
|
|
|
|
|
2007-01-13 15:21:32 -05:00
|
|
|
f5b.pack(side=LEFT,expand=1,fill=BOTH)
|
2006-08-05 13:35:21 -04:00
|
|
|
|
|
|
|
#------------------------------------------------------ Tx params and msgs
|
|
|
|
f5c=Frame(iframe5,bd=2,relief=GROOVE)
|
|
|
|
txfirst=Checkbutton(f5c,text='Tx First',justify=RIGHT,variable=TxFirst)
|
|
|
|
f5c2=Frame(f5c,bd=0)
|
2008-10-27 15:20:07 -04:00
|
|
|
ftx=Button(f5c,text='Set Tx Freq',underline=0,command=set_ftx,
|
2008-10-08 21:03:41 -04:00
|
|
|
padx=1,pady=1)
|
2006-08-05 13:35:21 -04:00
|
|
|
genmsg=Button(f5c,text='GenStdMsgs',underline=0,command=GenStdMsgs,
|
|
|
|
padx=1,pady=1)
|
|
|
|
auto=Button(f5c,text='Auto is Off',underline=0,command=toggleauto,
|
|
|
|
padx=1,pady=1)
|
|
|
|
auto.focus_set()
|
|
|
|
|
|
|
|
txfirst.grid(column=0,row=0,sticky='W',padx=4)
|
|
|
|
f5c2.grid(column=0,row=1,sticky='W',padx=4)
|
2007-01-13 19:44:34 -05:00
|
|
|
#sked.grid(column=0,row=3,sticky='W',padx=4)
|
2008-10-08 21:03:41 -04:00
|
|
|
ftx.grid(column=0,row=2,sticky='EW',padx=4)
|
2006-08-05 13:35:21 -04:00
|
|
|
genmsg.grid(column=0,row=4,sticky='W',padx=4)
|
|
|
|
auto.grid(column=0,row=5,sticky='EW',padx=4)
|
|
|
|
|
|
|
|
ntx=IntVar()
|
|
|
|
tx1=Entry(f5c,width=24)
|
|
|
|
rb1=Radiobutton(f5c,value=1,variable=ntx)
|
|
|
|
b1=Button(f5c, text='Tx1',underline=2,command=btx1,padx=1,pady=1)
|
|
|
|
tx1.grid(column=1,row=0)
|
|
|
|
rb1.grid(column=2,row=0)
|
|
|
|
b1.grid(column=3,row=0)
|
|
|
|
|
|
|
|
tx2=Entry(f5c,width=24)
|
|
|
|
rb2=Radiobutton(f5c,value=2,variable=ntx)
|
|
|
|
b2=Button(f5c, text='Tx2',underline=2,command=btx2,padx=1,pady=1)
|
|
|
|
tx2.grid(column=1,row=1)
|
|
|
|
rb2.grid(column=2,row=1)
|
|
|
|
b2.grid(column=3,row=1)
|
|
|
|
|
|
|
|
tx3=Entry(f5c,width=24)
|
|
|
|
rb3=Radiobutton(f5c,value=3,variable=ntx)
|
|
|
|
b3=Button(f5c, text='Tx3',underline=2,command=btx3,padx=1,pady=1)
|
|
|
|
tx3.grid(column=1,row=2)
|
|
|
|
rb3.grid(column=2,row=2)
|
|
|
|
b3.grid(column=3,row=2)
|
|
|
|
|
|
|
|
tx4=Entry(f5c,width=24)
|
|
|
|
rb4=Radiobutton(f5c,value=4,variable=ntx)
|
|
|
|
b4=Button(f5c, text='Tx4',underline=2,command=btx4,padx=1,pady=1)
|
|
|
|
tx4.grid(column=1,row=3)
|
|
|
|
rb4.grid(column=2,row=3)
|
|
|
|
b4.grid(column=3,row=3)
|
|
|
|
|
|
|
|
tx5=Entry(f5c,width=24)
|
|
|
|
rb5=Radiobutton(f5c,value=5,variable=ntx)
|
|
|
|
b5=Button(f5c, text='Tx5',underline=2,command=btx5,padx=1,pady=1)
|
|
|
|
tx5.grid(column=1,row=4)
|
|
|
|
rb5.grid(column=2,row=4)
|
|
|
|
b5.grid(column=3,row=4)
|
|
|
|
|
|
|
|
tx6=Entry(f5c,width=24)
|
|
|
|
rb6=Radiobutton(f5c,value=6,variable=ntx)
|
|
|
|
b6=Button(f5c, text='Tx6',underline=2,command=btx6,padx=1,pady=1)
|
|
|
|
tx6.grid(column=1,row=5)
|
|
|
|
rb6.grid(column=2,row=5)
|
|
|
|
b6.grid(column=3,row=5)
|
|
|
|
|
2007-01-13 15:21:32 -05:00
|
|
|
f5c.pack(side=LEFT,expand=1,fill=BOTH)
|
2006-08-05 13:35:21 -04:00
|
|
|
iframe5.pack(expand=1, fill=X, padx=4)
|
|
|
|
|
|
|
|
#------------------------------------------------------------ Status Bar
|
|
|
|
iframe6 = Frame(frame, bd=1, relief=SUNKEN)
|
2007-07-02 15:55:06 -04:00
|
|
|
msg1=Message(iframe6, text="Message #2", width=300,relief=SUNKEN)
|
2006-08-05 13:35:21 -04:00
|
|
|
msg1.pack(side=LEFT, fill=X, padx=1)
|
2007-07-02 15:55:06 -04:00
|
|
|
msg2=Message(iframe6,width=300,relief=SUNKEN)
|
2006-08-05 13:35:21 -04:00
|
|
|
msg2.pack(side=LEFT, fill=X, padx=1)
|
2007-07-02 15:55:06 -04:00
|
|
|
msg3=Message(iframe6, text="", width=300,relief=SUNKEN)
|
2006-08-05 13:35:21 -04:00
|
|
|
msg3.pack(side=LEFT, fill=X, padx=1)
|
2007-06-22 16:32:58 -04:00
|
|
|
msg4=Message(iframe6, text="", width=300,relief=SUNKEN)
|
|
|
|
msg4.pack(side=LEFT, fill=X, padx=1)
|
2007-06-24 12:31:38 -04:00
|
|
|
msg5=Message(iframe6, text="", width=300,relief=SUNKEN)
|
|
|
|
msg5.pack(side=LEFT, fill=X, padx=1)
|
2007-07-11 15:47:36 -04:00
|
|
|
msg6=Message(iframe6, text="", width=300,relief=SUNKEN)
|
|
|
|
msg6.pack(side=LEFT, fill=X, padx=1)
|
2008-07-22 20:16:16 -04:00
|
|
|
##msg7=Message(iframe6, text="", width=300,relief=SUNKEN)
|
|
|
|
##msg7.pack(side=LEFT, fill=X, padx=1)
|
2008-07-12 14:11:36 -04:00
|
|
|
msg8=Message(iframe6, text=' ', width=300,relief=SUNKEN)
|
|
|
|
msg8.pack(side=RIGHT, fill=X, padx=1)
|
2006-08-05 13:35:21 -04:00
|
|
|
iframe6.pack(expand=1, fill=X, padx=4)
|
|
|
|
frame.pack()
|
2008-09-19 13:25:58 -04:00
|
|
|
|
|
|
|
# Create "worked", a dictionary of all calls in WSJT.LOG
|
|
|
|
try:
|
|
|
|
f=open(appdir+'/WSJT.LOG','r')
|
|
|
|
s=f.readlines()
|
|
|
|
except:
|
|
|
|
print 'Error opening WSJT.LOG'
|
|
|
|
s=""
|
|
|
|
f.close()
|
|
|
|
tcall=""
|
|
|
|
for i in range(len(s)):
|
|
|
|
tcall=s[i].split(',',3)[2]
|
|
|
|
worked[tcall]=1
|
|
|
|
|
2006-08-05 13:35:21 -04:00
|
|
|
ldate.after(100,update)
|
|
|
|
lauto=0
|
|
|
|
isync=1
|
|
|
|
ntx.set(1)
|
|
|
|
ndepth.set(1)
|
|
|
|
import options
|
2007-01-08 16:19:41 -05:00
|
|
|
ModeJT65B()
|
2006-08-05 13:35:21 -04:00
|
|
|
lookup()
|
|
|
|
balloon.unbind(ToRadio)
|
|
|
|
g.astro_geom0="+0+0"
|
|
|
|
Audio.gcom1.mute=0
|
|
|
|
|
|
|
|
#---------------------------------------------------------- Process INI file
|
|
|
|
try:
|
2007-01-08 15:54:34 -05:00
|
|
|
f=open(appdir+'/MAP65.INI',mode='r')
|
2006-08-05 13:35:21 -04:00
|
|
|
params=f.readlines()
|
|
|
|
except:
|
|
|
|
params=""
|
|
|
|
if g.Win32:
|
|
|
|
options.PttPort.set("0")
|
|
|
|
else:
|
2007-01-03 13:56:49 -05:00
|
|
|
options.PttPort.set("/dev/ttyS0")
|
2006-08-05 13:35:21 -04:00
|
|
|
Audio.gcom2.nport=0
|
|
|
|
|
|
|
|
try:
|
|
|
|
for i in range(len(params)):
|
|
|
|
key,value=params[i].split()
|
2007-01-08 15:54:34 -05:00
|
|
|
if key == 'MAP65Geometry': root.geometry(value)
|
|
|
|
elif key == 'BMGeometry': bm_geom=value
|
2007-01-17 09:36:54 -05:00
|
|
|
elif key == 'BM2Geometry': bm2_geom=value
|
2006-08-05 13:35:21 -04:00
|
|
|
elif key == 'Mode':
|
|
|
|
mode.set(value)
|
2007-01-08 16:19:41 -05:00
|
|
|
if value=='JT65A':
|
2006-08-05 13:35:21 -04:00
|
|
|
ModeJT65A()
|
|
|
|
elif value=='JT65B':
|
|
|
|
ModeJT65B()
|
|
|
|
elif value=='JT65C':
|
|
|
|
ModeJT65C()
|
|
|
|
elif key == 'MyCall': options.MyCall.set(value)
|
|
|
|
elif key == 'MyGrid': options.MyGrid.set(value)
|
|
|
|
elif key == 'HisCall':
|
|
|
|
hiscall=value
|
|
|
|
if hiscall=="______": hiscall=""
|
|
|
|
ToRadio.delete(0,END)
|
|
|
|
ToRadio.insert(0,hiscall)
|
|
|
|
elif key == 'HisGrid':
|
|
|
|
hisgrid=value
|
|
|
|
if hisgrid == "XX00xx":
|
|
|
|
lookup()
|
|
|
|
HisGrid.delete(0,END)
|
|
|
|
HisGrid.insert(0,hisgrid)
|
|
|
|
# elif key == 'RxDelay': options.RxDelay.set(value)
|
|
|
|
# elif key == 'TxDelay': options.TxDelay.set(value)
|
|
|
|
elif key == 'IDinterval': options.IDinterval.set(value)
|
|
|
|
elif key == 'PttPort':
|
|
|
|
try:
|
|
|
|
options.PttPort.set(value)
|
|
|
|
try:
|
|
|
|
Audio.gcom2.nport=int(options.PttPort.get())
|
|
|
|
except:
|
|
|
|
Audio.gcom2.nport=0
|
|
|
|
except:
|
|
|
|
if g.Win32:
|
|
|
|
options.PttPort.set("0")
|
|
|
|
else:
|
2007-01-03 13:56:49 -05:00
|
|
|
options.PttPort.set("/dev/ttyS0")
|
2006-08-05 13:35:21 -04:00
|
|
|
Audio.gcom2.nport=0
|
|
|
|
Audio.gcom2.pttport=(options.PttPort.get()+' ')[:12]
|
|
|
|
elif key == 'Mileskm': options.mileskm.set(value)
|
|
|
|
elif key == 'AudioOut':
|
|
|
|
try:
|
|
|
|
g.ndevout.set(value)
|
|
|
|
except:
|
|
|
|
g.ndevout.set(0)
|
|
|
|
g.DevoutName.set(value)
|
|
|
|
options.DevoutName.set(value)
|
|
|
|
Audio.gcom1.devout_name=(options.DevoutName.get()+' ')[:12]
|
|
|
|
elif key == 'SamFacOut': options.samfacout.set(value)
|
|
|
|
elif key == 'AddPrefix': options.addpfx.set(value.replace("_"," ").lstrip())
|
|
|
|
elif key == 'AuxRA': options.auxra.set(value)
|
|
|
|
elif key == 'AuxDEC': options.auxdec.set(value)
|
2007-07-09 12:14:00 -04:00
|
|
|
|
|
|
|
elif key == 'nkeep': options.nkeep.set(value)
|
|
|
|
elif key == 'fa': options.fa.set(value)
|
|
|
|
elif key == 'fb': options.fb.set(value)
|
|
|
|
elif key == 'fcal': options.fcal.set(value)
|
2007-07-11 12:38:56 -04:00
|
|
|
elif key == 'CSmin': options.ncsmin.set(value)
|
2007-07-12 16:45:14 -04:00
|
|
|
elif key == 'Nt1': options.nt1.set(value)
|
2007-07-09 12:14:00 -04:00
|
|
|
elif key == 'dphi': options.dphi.set(value)
|
2009-03-03 16:10:59 -05:00
|
|
|
elif key == 'SaveDir': options.savedir.set(value.replace("#"," "))
|
|
|
|
elif key == 'AzElDir': options.azeldir.set(value.replace("#"," "))
|
2006-08-05 13:35:21 -04:00
|
|
|
elif key == 'TxFirst': TxFirst.set(value)
|
|
|
|
elif key == 'KB8RQ': kb8rq.set(value)
|
|
|
|
elif key == 'K2TXB': k2txb.set(value)
|
|
|
|
elif key == 'SetSeq': setseq.set(value)
|
|
|
|
elif key == 'Nsave': nsave.set(value)
|
|
|
|
elif key == 'Band': nfreq.set(value)
|
2007-01-09 09:40:24 -05:00
|
|
|
elif key == 'Sync': isync=int(value)
|
2006-08-05 13:35:21 -04:00
|
|
|
elif key == 'Clip': iclip=int(value)
|
|
|
|
elif key == 'Zap': nzap.set(value)
|
|
|
|
elif key == 'NB': nblank.set(value)
|
|
|
|
elif key == 'NAFC': nafc.set(value)
|
2007-01-13 19:44:34 -05:00
|
|
|
# elif key == 'Sked': nsked.set(value)
|
2006-08-05 13:35:21 -04:00
|
|
|
elif key == 'NoSh441': nosh441.set(value)
|
|
|
|
elif key == 'NoShJT65': noshjt65.set(value)
|
|
|
|
elif key == 'NEME': neme.set(value)
|
|
|
|
elif key == 'NDepth': ndepth.set(value)
|
2007-11-05 14:19:46 -05:00
|
|
|
elif key == 'Multicast': multicast.set(value)
|
2006-08-05 13:35:21 -04:00
|
|
|
elif key == 'Debug': ndebug.set(value)
|
2007-07-02 12:02:06 -04:00
|
|
|
elif key == 'Debug2': ndebug2.set(value)
|
2006-08-05 13:35:21 -04:00
|
|
|
elif key == 'HisCall':
|
|
|
|
Audio.gcom2.hiscall=(value+' ')[:12]
|
|
|
|
ToRadio.delete(0,99)
|
|
|
|
ToRadio.insert(0,value)
|
|
|
|
lookup() #Maybe should save HisGrid, instead?
|
|
|
|
elif key == 'MRUDir': mrudir=value.replace("#"," ")
|
|
|
|
elif key == 'AstroGeometry': g.astro_geom0 =value
|
|
|
|
else: pass
|
|
|
|
except:
|
2007-01-08 15:54:34 -05:00
|
|
|
print 'Error reading MAP65.INI, continuing with defaults.'
|
2006-08-05 13:35:21 -04:00
|
|
|
print key,value
|
|
|
|
|
|
|
|
g.mode=mode.get()
|
|
|
|
Audio.gcom2.appdir=(appdir+' ')[:80]
|
2007-09-16 10:10:45 -04:00
|
|
|
Audio.gcom2.azeldir=(options.azeldir.get()+' ')[:80]
|
2006-08-05 13:35:21 -04:00
|
|
|
Audio.gcom2.ndepth=ndepth.get()
|
2007-11-05 14:19:46 -05:00
|
|
|
Audio.gcom2.multicast=multicast.get()
|
2007-06-23 14:12:39 -04:00
|
|
|
f=open(appdir+'/tmp26.txt','w')
|
|
|
|
f.truncate(0)
|
|
|
|
f.close
|
2006-08-05 13:35:21 -04:00
|
|
|
Audio.ftn_init()
|
|
|
|
GenStdMsgs()
|
|
|
|
Audio.gcom4.addpfx=(options.addpfx.get().lstrip()+' ')[:8]
|
2007-06-22 16:32:58 -04:00
|
|
|
Audio.gcom2.mousefqso=125
|
2007-07-11 15:47:36 -04:00
|
|
|
Audio.gcom2.nhispol=-999
|
2007-06-21 15:42:24 -04:00
|
|
|
monitor()
|
2006-08-05 13:35:21 -04:00
|
|
|
first=1
|
|
|
|
if g.Win32: root.iconbitmap("wsjt.ico")
|
2007-01-08 15:54:34 -05:00
|
|
|
root.title(' MAP65 by K1JT')
|
2007-07-02 15:17:07 -04:00
|
|
|
messages()
|
2007-01-08 15:54:34 -05:00
|
|
|
bandmap()
|
2006-08-05 13:35:21 -04:00
|
|
|
import astro
|
|
|
|
import specjt
|
|
|
|
|
2007-01-09 09:40:24 -05:00
|
|
|
# SpecJT has a "mainloop", so it does not return until terminated.
|
2006-08-05 13:35:21 -04:00
|
|
|
#root.mainloop() #Superseded by mainloop in SpecJT
|
|
|
|
|
|
|
|
# Clean up and save user options before terminating
|
2007-01-08 15:54:34 -05:00
|
|
|
f=open(appdir+'/MAP65.INI',mode='a')
|
2006-08-05 13:35:21 -04:00
|
|
|
root_geom=root_geom[root_geom.index("+"):]
|
2007-01-08 15:54:34 -05:00
|
|
|
f.write("MAP65Geometry " + root_geom + "\n")
|
|
|
|
bm_geom=bm_geom[bm_geom.index("+"):]
|
|
|
|
f.write("BMGeometry " + bm_geom + "\n")
|
2007-01-17 09:36:54 -05:00
|
|
|
bm2_geom=bm2_geom[bm2_geom.index("+"):]
|
|
|
|
f.write("BM2Geometry " + bm2_geom + "\n")
|
2006-08-05 13:35:21 -04:00
|
|
|
f.write("Mode " + g.mode + "\n")
|
|
|
|
f.write("MyCall " + options.MyCall.get() + "\n")
|
|
|
|
f.write("MyGrid " + options.MyGrid.get() + "\n")
|
|
|
|
t=g.ftnstr(Audio.gcom2.hiscall)
|
|
|
|
if t[:1]==" ": t="______"
|
|
|
|
f.write("HisCall " + t + "\n")
|
|
|
|
t=g.ftnstr(Audio.gcom2.hisgrid)
|
|
|
|
if t==" ": t="XX00xx"
|
|
|
|
f.write("HisGrid " + t + "\n")
|
|
|
|
#f.write("RxDelay " + str(options.RxDelay.get()) + "\n")
|
|
|
|
#f.write("TxDelay " + str(options.TxDelay.get()) + "\n")
|
|
|
|
f.write("IDinterval " + str(options.IDinterval.get()) + "\n")
|
|
|
|
f.write("PttPort " + str(options.PttPort.get()) + "\n")
|
|
|
|
f.write("Mileskm " + str(options.mileskm.get()) + "\n")
|
|
|
|
f.write("AudioOut " + options.DevoutName.get() + "\n")
|
|
|
|
f.write("SamFacOut " + str(options.samfacout.get()) + "\n")
|
|
|
|
if options.addpfx.get().lstrip()=="": options.addpfx.set("_")
|
|
|
|
f.write("AddPrefix " + options.addpfx.get().lstrip() + "\n")
|
|
|
|
if options.auxra.get()=="": options.auxra.set("0")
|
|
|
|
if options.auxdec.get()=="": options.auxdec.set("0")
|
|
|
|
f.write("AuxRA " + options.auxra.get() + "\n")
|
|
|
|
f.write("AuxDEC " + options.auxdec.get() + "\n")
|
2007-07-09 12:14:00 -04:00
|
|
|
f.write("nkeep " + str(options.nkeep.get()) + "\n")
|
|
|
|
f.write("dphi " + str(options.dphi.get()) + "\n")
|
|
|
|
f.write("fa " + str(options.fa.get()) + "\n")
|
|
|
|
f.write("fb " + str(options.fb.get()) + "\n")
|
|
|
|
f.write("fcal " + str(options.fcal.get()) + "\n")
|
2007-07-11 12:38:56 -04:00
|
|
|
f.write("CSmin " + str(options.ncsmin.get()) + "\n")
|
2007-07-12 16:45:14 -04:00
|
|
|
f.write("Nt1 " + str(options.nt1.get()) + "\n")
|
2009-03-03 16:10:59 -05:00
|
|
|
savedir2=options.savedir.get().replace(" ","#")
|
|
|
|
azeldir2=options.azeldir.get().replace(" ","#")
|
|
|
|
f.write("SaveDir " + str(savedir2) + "\n")
|
|
|
|
f.write("AzElDir " + str(azeldir2) + "\n")
|
2006-08-05 13:35:21 -04:00
|
|
|
f.write("TxFirst " + str(TxFirst.get()) + "\n")
|
|
|
|
f.write("KB8RQ " + str(kb8rq.get()) + "\n")
|
|
|
|
f.write("K2TXB " + str(k2txb.get()) + "\n")
|
|
|
|
f.write("SetSeq " + str(setseq.get()) + "\n")
|
|
|
|
f.write("Nsave " + str(nsave.get()) + "\n")
|
|
|
|
f.write("Band " + str(nfreq.get()) + "\n")
|
2007-01-09 09:40:24 -05:00
|
|
|
f.write("Sync " + str(isync) + "\n")
|
2006-08-05 13:35:21 -04:00
|
|
|
f.write("Clip " + str(iclip) + "\n")
|
|
|
|
f.write("Zap " + str(nzap.get()) + "\n")
|
|
|
|
f.write("NB " + str(nblank.get()) + "\n")
|
|
|
|
f.write("NAFC " + str(nafc.get()) + "\n")
|
|
|
|
f.write("NoSh441 " + str(nosh441.get()) + "\n")
|
|
|
|
f.write("NoShJT65 " + str(noshjt65.get()) + "\n")
|
|
|
|
f.write("NEME " + str(neme.get()) + "\n")
|
|
|
|
f.write("NDepth " + str(ndepth.get()) + "\n")
|
2007-11-05 14:19:46 -05:00
|
|
|
f.write("Multicast " + str(multicast.get()) + "\n")
|
2006-08-05 13:35:21 -04:00
|
|
|
f.write("Debug " + str(ndebug.get()) + "\n")
|
2007-07-02 12:02:06 -04:00
|
|
|
f.write("Debug2 " + str(ndebug2.get()) + "\n")
|
2006-08-05 13:35:21 -04:00
|
|
|
mrudir2=mrudir.replace(" ","#")
|
|
|
|
f.write("MRUDir " + mrudir2 + "\n")
|
2006-09-08 10:21:08 -04:00
|
|
|
if g.astro_geom[:7]=="200x200": g.astro_geom="316x373" + g.astro_geom[7:]
|
2006-08-05 13:35:21 -04:00
|
|
|
f.write("AstroGeometry " + g.astro_geom + "\n")
|
|
|
|
f.close()
|
|
|
|
|
|
|
|
Audio.ftn_quit()
|
|
|
|
Audio.gcom1.ngo=0 #Terminate audio streams
|
|
|
|
Audio.gcom2.lauto=0
|
|
|
|
Audio.gcom1.txok=0
|
|
|
|
time.sleep(0.5)
|