Compare commits
10 Commits
c1f3d3262b
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 26841ba30e | |||
| dc6e7be012 | |||
| cf8bdd5b5c | |||
| a1dec94f1f | |||
| 068b026473 | |||
| 16c92aa730 | |||
| 2bf0e01f20 | |||
| ebad5bbfc6 | |||
| 675d952752 | |||
| 587ba5245c |
BIN
BF_companion
BIN
BF_companion
Binary file not shown.
2
makefile
2
makefile
@ -45,6 +45,6 @@ endif
|
||||
|
||||
|
||||
all:
|
||||
$(CC) main.c $(FLAGS) -ll502api -le502api -lx502api -o BF_companion
|
||||
$(CC) main.c $(FLAGS) -ll502api -le502api -lx502api -g -o BF_companion
|
||||
clean:
|
||||
-rm BF_companion
|
||||
|
||||
41
plotter.py
41
plotter.py
@ -15,21 +15,42 @@ if __name__ == "__main__":
|
||||
main()
|
||||
else:
|
||||
f = open(argv[1], "rt")
|
||||
f.readline()
|
||||
X = []
|
||||
Y = []
|
||||
data = {}
|
||||
values_N = 0
|
||||
for line in f:
|
||||
#print(line)
|
||||
#print(line, len(line))
|
||||
len_line = len(line)
|
||||
try:
|
||||
i, x, y = line.split()
|
||||
x = float(x)
|
||||
y = float(y)
|
||||
X.append(x)
|
||||
Y.append(y)
|
||||
if (len_line >= 11):
|
||||
if (line[:2] == "0x"):
|
||||
values_N += 1
|
||||
header = line[2:4]
|
||||
value = line[4:10]
|
||||
if not(header in data):
|
||||
print("New msg type!")
|
||||
print(line)
|
||||
data[header] = []
|
||||
data[header + "_N"] = []
|
||||
data[header + "_hex"] = []
|
||||
data[header].append(int(value,16))
|
||||
data[header + "_hex"].append(value)
|
||||
data[header + "_N"].append(values_N)
|
||||
except ValueError:
|
||||
pass
|
||||
except IndexError:
|
||||
pass
|
||||
if (values_N > 10000):
|
||||
# break
|
||||
pass
|
||||
f.close()
|
||||
print("data samples:",len(X))
|
||||
print("data samples:", values_N)
|
||||
chart = go.Figure()
|
||||
chart.add_trace(go.Scatter(x=X, y=Y))
|
||||
for key, val in data.items():
|
||||
if (key.count("_N") + key.count("_hex")) == 0:
|
||||
#print(key+"_hex :", data[key+"_hex"])
|
||||
chart.add_trace(go.Scattergl(x=data[key+"_N"], y=data[key], name=key, mode="lines", text=data[key+"_hex"]))
|
||||
# chart.add_trace(go.Scattergl(x=data[key+"_N"], y=data[key], name=key, mode="lines+markers", text=data[key+"_hex"]))
|
||||
chart.update_layout(title=argv[1])
|
||||
chart.show()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user