Compare commits

10 Commits

4 changed files with 923 additions and 62 deletions

Binary file not shown.

940
main.c

File diff suppressed because it is too large Load Diff

View File

@ -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

View File

@ -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()