Handle nonstandard tf2 filenames correctly.

For contesting: flag "needed calls" with "*" in band map, and do 
"dupe checking" when double-clicking on a callsign or entering
a QSO in WSJT.LOG.


git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/map65@1030 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Joe Taylor 2008-09-19 17:25:58 +00:00
parent cc13ce0f8f
commit 45a284acfb
2 changed files with 77 additions and 36 deletions

View File

@ -48,8 +48,11 @@ subroutine getfile2(fname,len)
enddo enddo
sqave=174*sq/(kb-ka+1) sqave=174*sq/(kb-ka+1)
rxnoise=10.0*log10(sqave) - 48.0 rxnoise=10.0*log10(sqave) - 48.0
read(filename(8:11),*) nutc read(filename(8:11),*,err=20,end=20) nutc
ndiskdat=1 go to 30
20 nutc=0
30 ndiskdat=1
mousebutton=0 mousebutton=0
999 return 999 return

View File

@ -95,6 +95,7 @@ setseq=IntVar()
tx6alt="" tx6alt=""
txsnrdb=99. txsnrdb=99.
TxFirst=IntVar() TxFirst=IntVar()
worked={}
green=zeros(500,'f') green=zeros(500,'f')
im=Image.new('P',(500,120)) im=Image.new('P',(500,120))
im.putpalette(Colormap2Palette(colormapLinrad),"RGB") im.putpalette(Colormap2Palette(colormapLinrad),"RGB")
@ -218,7 +219,7 @@ def bandmap(event=NONE):
bm2.geometry(bm2_geom) bm2.geometry(bm2_geom)
if g.Win32: bm2.iconbitmap("wsjt.ico") if g.Win32: bm2.iconbitmap("wsjt.ico")
iframe_bm2 = Frame(bm2, bd=1, relief=SUNKEN) iframe_bm2 = Frame(bm2, bd=1, relief=SUNKEN)
bmtext=Text(iframe_bm2, height=24, width=36, bg="Navy", fg="yellow") bmtext=Text(iframe_bm2, height=24, width=39, bg="Navy", fg="yellow")
bmtext.bind('<Double-Button-1>',dbl_click_bmtext) bmtext.bind('<Double-Button-1>',dbl_click_bmtext)
bmtext.pack(side=LEFT, fill=X, padx=1, pady=3) bmtext.pack(side=LEFT, fill=X, padx=1, pady=3)
bmtext.tag_configure('age0',foreground='red') bmtext.tag_configure('age0',foreground='red')
@ -233,6 +234,8 @@ def logqso(event=NONE):
# t=t+","+hiscall+","+hisgrid+","+str(g.nfreq)+","+g.mode+"\n" # t=t+","+hiscall+","+hisgrid+","+str(g.nfreq)+","+g.mode+"\n"
t=t+","+ToRadio.get()+","+HisGrid.get()+","+str(g.nfreq)+","+g.mode+"\n" t=t+","+ToRadio.get()+","+HisGrid.get()+","+str(g.nfreq)+","+g.mode+"\n"
t2="Please confirm making the following entry in MAP65.LOG:\n\n" + t t2="Please confirm making the following entry in MAP65.LOG:\n\n" + t
if worked.has_key(hiscall.strip()):
t2=t2 + "\n\n*** Dupe: " + hiscall + "is already in LOG ***"
msg=Pmw.MessageDialog(root,buttons=('Yes','No'),message_text=t2) msg=Pmw.MessageDialog(root,buttons=('Yes','No'),message_text=t2)
msg.geometry(msgpos()) msg.geometry(msgpos())
if g.Win32: msg.iconbitmap("wsjt.ico") if g.Win32: msg.iconbitmap("wsjt.ico")
@ -242,6 +245,7 @@ def logqso(event=NONE):
f=open(appdir+'/WSJT.LOG','a') f=open(appdir+'/WSJT.LOG','a')
f.write(t) f.write(t)
f.close() f.close()
worked[hiscall.strip()]=1
#------------------------------------------------------ monitor #------------------------------------------------------ monitor
def monitor(event=NONE): def monitor(event=NONE):
@ -290,6 +294,16 @@ def dbl_click_call(t,t1,rpt,nbox,event):
i1=t1.rfind(' ')+1 #index of preceding space i1=t1.rfind(' ')+1 #index of preceding space
i2=i1+t[i1:].find(' ') #index of next space i2=i1+t[i1:].find(' ') #index of next space
hiscall=t[i1:i2] #selected word, assumed as callsign hiscall=t[i1:i2] #selected word, assumed as callsign
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()
if result == 'OK':
ToRadio.delete(0,END) ToRadio.delete(0,END)
ToRadio.insert(0,hiscall) ToRadio.insert(0,hiscall)
i3=t1.rfind('\n')+1 #start of selected line i3=t1.rfind('\n')+1 #start of selected line
@ -958,7 +972,7 @@ def GenAltMsgs(event=NONE):
def update(): def update():
global root_geom,isec0,naz,nel,ndmiles,ndkm,nopen,kxp0, \ global root_geom,isec0,naz,nel,ndmiles,ndkm,nopen,kxp0, \
im,pim,cmap0,isync,isync_save,idsec,first,itol,txsnrdb,tx6alt,\ im,pim,cmap0,isync,isync_save,idsec,first,itol,txsnrdb,tx6alt,\
bm_geom,bm2_geom,hisgrid0,fqso0,isec00 bm_geom,bm2_geom,hisgrid0,fqso0,isec00,worked
utc=time.gmtime(time.time()+0.1*idsec) utc=time.gmtime(time.time()+0.1*idsec)
isec=utc[5] isec=utc[5]
@ -1195,6 +1209,7 @@ def update():
msgtext.insert(END,lines[i],attr) msgtext.insert(END,lines[i],attr)
msgtext.see(END) msgtext.see(END)
# Display Band Map information:
try: try:
f=open(appdir+'/bandmap.txt',mode='r') f=open(appdir+'/bandmap.txt',mode='r')
lines=f.readlines() lines=f.readlines()
@ -1214,12 +1229,21 @@ def update():
except: except:
nage=0 nage=0
t=t[:11]+' ' t=t[:11]+' '
if j==2: t=t+'\n' 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'
if nage==0: attr='age0' if nage==0: attr='age0'
if nage==1: attr='age1' if nage==1: attr='age1'
if nage==2: attr='age2' if nage==2: attr='age2'
if nage>=3: attr='age3' if nage>=3: attr='age3'
bmtext.insert(END,t,attr) bmtext.insert(END,t2,attr)
t=t[:12] t=t[:12]
if t!=" ": if t!=" ":
try: try:
@ -1717,6 +1741,20 @@ msg8=Message(iframe6, text=' ', width=300,relief=SUNKEN)
msg8.pack(side=RIGHT, fill=X, padx=1) msg8.pack(side=RIGHT, fill=X, padx=1)
iframe6.pack(expand=1, fill=X, padx=4) iframe6.pack(expand=1, fill=X, padx=4)
frame.pack() frame.pack()
# 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
ldate.after(100,update) ldate.after(100,update)
lauto=0 lauto=0
isync=1 isync=1