Skip to content

Commit 568f9fc

Browse files
committed
Update data plotter to print output of recent sigrok PDs
Sigrok now prepends the parser ID to the annotation, so strip out everything prior to the first colon
1 parent 12db317 commit 568f9fc

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

Diff for: emount_plotdata.py

+18-5
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ def valtoaperture(val):
8080
max_pos = 0
8181

8282
for line in infile:
83-
[pktts,data] = line.split(',',1)
83+
[sigrok_parser, data] = line.split(':',1)
84+
[pktts,data] = data.split(',',1)
8485
pktts = float(pktts)
8586
[lenstr,data] = data.split(',',1)
8687
pktlen = int(lenstr.split(':',1)[1],16)
@@ -96,12 +97,17 @@ def valtoaperture(val):
9697
cmdid = pktdata[bytesproc]
9798
if(cmdid == 0x6):
9899
timespos.append(pktts)
100+
string6 = str(pktts) + ": Group 6:"
99101
sum6 = 1
100-
print str(pktts) + ": Group 6"
102+
# print str(pktts) + ": Group 6"
101103
for j in range(len(group6_lens)):
102-
print "\tSubgroup " + str(j) + ": " + binascii.hexlify(pktdata[bytesproc+sum6:bytesproc+sum6+group6_lens[j]])
104+
#print "\tSubgroup " + str(j) + ": " + binascii.hexlify(pktdata[bytesproc+sum6:bytesproc+sum6+group6_lens[j]])
105+
if((j == 12) | (j == 13)):
106+
string6 += " Sg " + str(j) + ": " + binascii.hexlify(pktdata[bytesproc+sum6:bytesproc+sum6+group6_lens[j]])
103107
sum6 += group6_lens[j]
104108
motorpos1 = struct.unpack('<H', pktdata[bytesproc+3:bytesproc+5])[0]
109+
string6 += " Pos: " + str(motorpos1)
110+
print string6
105111
if(motorpos1 == 0):
106112
motorpos1 = None
107113
#This looks like a Metabones IV bug
@@ -147,11 +153,15 @@ def valtoaperture(val):
147153
#but I should look for potential patterns when motorpos2 is 0
148154
bytesproc += 40
149155
elif(cmdid == 0x05):
156+
string5 = str(pktts) + ": Group 5:"
150157
sum5 = 1
151-
print str(pktts) + ": Group 5"
158+
#print str(pktts) + ": Group 5"
152159
for j in range(len(group5_lens)):
153-
print "\tSubgroup " + str(j) + ": " + binascii.hexlify(pktdata[bytesproc+sum5:bytesproc+sum5+group5_lens[j]])
160+
#print "\tSubgroup " + str(j) + ": " + binascii.hexlify(pktdata[bytesproc+sum5:bytesproc+sum5+group5_lens[j]])
161+
if((j == 12) | (j == 13)):
162+
string5 += " Sg " + str(j) + ": " + binascii.hexlify(pktdata[bytesproc+sum5:bytesproc+sum5+group5_lens[j]])
154163
sum5 += group5_lens[j]
164+
print string5
155165
#TODO: Use the info leegong provided to decode this packet in more detail
156166
bytesproc += 97
157167
aperturestattimes.append(pktts)
@@ -176,6 +186,9 @@ def valtoaperture(val):
176186
#does it ACK the start of hunt, or the end - if end should be rare as
177187
#0x1F is usually interrupted by a subsequent 0x1D or 0x3C
178188
bytesproc += 2
189+
elif(cmdid == 0x20):
190+
#Only seen in the same status slot as group 5, and only seen reported by the Techart EOS-NEX III in Fn mode
191+
bytesproc += 12
179192
elif(cmdid == 0x22):
180193
bytesproc += 3
181194
elif(cmdid == 0x3C):

0 commit comments

Comments
 (0)