10 Commits

4 changed files with 923 additions and 62 deletions

Binary file not shown.

942
main.c

File diff suppressed because it is too large Load Diff

View File

@ -45,6 +45,6 @@ endif
all: all:
$(CC) main.c $(FLAGS) -ll502api -le502api -lx502api -o BF_companion $(CC) main.c $(FLAGS) -ll502api -le502api -lx502api -g -o BF_companion
clean: clean:
-rm BF_companion -rm BF_companion

View File

@ -15,21 +15,42 @@ if __name__ == "__main__":
main() main()
else: else:
f = open(argv[1], "rt") f = open(argv[1], "rt")
f.readline() data = {}
X = [] values_N = 0
Y = []
for line in f: for line in f:
#print(line)
#print(line, len(line))
len_line = len(line)
try: try:
i, x, y = line.split() if (len_line >= 11):
x = float(x) if (line[:2] == "0x"):
y = float(y) values_N += 1
X.append(x) header = line[2:4]
Y.append(y) 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: except ValueError:
pass pass
except IndexError:
pass
if (values_N > 10000):
# break
pass
f.close() f.close()
print("data samples:",len(X)) print("data samples:", values_N)
chart = go.Figure() 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() chart.show()