jarjonam há 5 anos atrás
pai
commit
b573ca30dd
1 ficheiros alterados com 3 adições e 0 exclusões
  1. 3 0
      pi/server.py

+ 3 - 0
pi/server.py

@@ -28,6 +28,9 @@ def save_waveform():
 	print(wf_number, timestamp, last_wf_number, last_timestamp)
 	if(last_wf_number>0 and wf_number - last_wf_number>0):
 		state["board_freq"] = (timestamp - last_timestamp)/(wf_number - last_wf_number)
+	else:
+		state["board_freq"] = 0
+	print(state["board_freq"])
 	last_wf_number, last_timestamp = wf_number, timestamp
 	tosave = [wf_number, timestamp, state["start"], state["stop"], state["start_gnd"], state["stop_gnd"], state["input_gain"], state["offset"], signal, gnd, signal_std, gnd_std, state["wf_len"]] + list(data)
 	np.savetxt("data/waveforms/"+str(int(timestamp*100))+".csv", [tosave], delimiter=",", fmt='%10.5f')