File tree Expand file tree Collapse file tree 3 files changed +14
-3
lines changed Expand file tree Collapse file tree 3 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -245,7 +245,7 @@ class Omniscan450(PingDevice):
245245 save_name = dt .strftime ("%Y-%m-%d-%H-%M" )
246246
247247 if log_directory is None :
248- project_root = Path .cwd (). parent
248+ project_root = Path .cwd ()
249249 self .log_directory = project_root / "logs/omniscan"
250250 else :
251251 self .log_directory = Path (log_directory )
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ from brping import pingmessage
1414import time
1515import struct
1616import socket
17+ import math
1718from datetime import datetime , timezone
1819from pathlib import Path
1920
@@ -158,6 +159,11 @@ class S500(PingDevice):
158159 except ConnectionResetError as e :
159160 raise ConnectionError ("Socket connection was reset: %s" % str (e ))
160161
162+ # Calculate the milliseconds per ping from a ping rate
163+ @staticmethod
164+ def calc_msec_per_ping (ping_rate ):
165+ return math .floor (1000.0 / ping_rate )
166+
161167 # Converts power results to correct format
162168 @staticmethod
163169 def scale_power (msg ):
@@ -276,7 +282,7 @@ class S500(PingDevice):
276282 save_name = dt .strftime ("%Y-%m-%d-%H-%M" )
277283
278284 if log_directory is None :
279- project_root = Path .cwd (). parent
285+ project_root = Path .cwd ()
280286 self .log_directory = project_root / "logs/s500"
281287 else :
282288 self .log_directory = Path (log_directory )
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ from brping import pingmessage
1414import time
1515import struct
1616import socket
17+ import math
1718from datetime import datetime , timezone
1819from pathlib import Path
1920
@@ -232,7 +233,7 @@ class Surveyor240(PingDevice):
232233 save_name = dt .strftime ("%Y-%m-%d-%H-%M" )
233234
234235 if log_directory is None :
235- project_root = Path .cwd (). parent
236+ project_root = Path .cwd ()
236237 self .log_directory = project_root / "logs/surveyor"
237238 else :
238239 self .log_directory = Path (log_directory )
@@ -395,6 +396,10 @@ class Surveyor240(PingDevice):
395396 yz_list = struct .unpack ('<' + 'f' * int (msg .num_points ) * 2 , raw_array )
396397 return yz_list
397398
399+ # Calculate the milliseconds per ping from a ping rate
400+ @staticmethod
401+ def calc_msec_per_ping (ping_rate ):
402+ return math .floor (1000.0 / ping_rate )
398403
399404if __name__ == "__main__" :
400405 import argparse
You can’t perform that action at this time.
0 commit comments