Mon, 10 Dec 2007 21:40:39 +0100
completed missing constants
read_trace.py | file | annotate | diff | comparison | revisions |
--- a/read_trace.py Mon Dec 10 21:28:14 2007 +0100 +++ b/read_trace.py Mon Dec 10 21:40:39 2007 +0100 @@ -16,26 +16,18 @@ for i in range(len(s)-1): #M += m[i]<<(i*8) M += float(m[i])/2**((i+1)*8) - + # XXX how do we deal negative numbers? #if m[0] & 0x80: # M = M - 2^(len(s)) - return M * 2**(e+1) - mm = str(M) - - mm = '0.'+mm + 'e' + str(e) - if len(s) == 8: - print "mm = ", mm - return eval(mm) def decode_string(s): nb = ord(s[0]) s = s[1:nb+2] r = "" + # XXX why do we need to do this? It's not described in the manual... for c in s: - if ord(c)>128: - c = chr(ord(c)-128) - r += c + r += chr(ord(c) & 0x7F) return r EDSP = {0: "No data", @@ -145,7 +137,15 @@ 24: "Octave", 25: "Seconds/Decade", 26: "Seconds/Octave", - #... + 27: "Hz/Point", + 28: "Points/Sweep", + 29: "Points/Decade", + 30: "Points/Octave", + 31: "V/Vrms", + 32: "V²", + 33: "EU referenced to chan 1", + 34: "EU referenced to chan 2", + 35: "EU value", } EMEAS = {0: "Linear resolution", @@ -171,7 +171,12 @@ EWIN = {0: "N/A", 1: "Hann", 2: "Flat top", - #... + 3: "Uniforme", + 4: "Exponential", + 5: "Force", + 6: "Force chan 1/expon chan 2", + 7: "Expon chan 1/force chan 2", + 8: "User", } HEADER = [ ("Display function", EDSP, 'h', 2),