Haptic Controller
Loading...
Searching...
No Matches
profiler Namespace Reference

Functions

 disconnect ()
 

Variables

str COM_PORT = "COM11"
 
int MESSAGES_TO_SAMPLE = 1000
 
str LOCAL_FILENAME = "debug_log.txt"
 
 ser
 
 f = open(LOCAL_FILENAME, "w")
 
int messages_counted = 0
 
 line = ser.readline().decode("utf-8").strip()
 
 section_current = defaultdict(int)
 
 section_times = defaultdict(list)
 
 lines = f.readlines()[1:]
 
 segments = line.split()
 
 name
 
 action
 
 time
 

Detailed Description

Reads data from a serial port and saves it to a local file, then analyzes the data.
Make sure to set COM_PORT to the correct value before running.

Function Documentation

◆ disconnect()

profiler.disconnect ( )

Definition at line 27 of file profiler.py.

Variable Documentation

◆ action

profiler.action

Definition at line 57 of file profiler.py.

◆ COM_PORT

str profiler.COM_PORT = "COM11"

Definition at line 11 of file profiler.py.

◆ f

profiler.f = open(LOCAL_FILENAME, "w")

Definition at line 32 of file profiler.py.

◆ line

profiler.line = ser.readline().decode("utf-8").strip()

Definition at line 38 of file profiler.py.

◆ lines

profiler.lines = f.readlines()[1:]

Definition at line 52 of file profiler.py.

◆ LOCAL_FILENAME

str profiler.LOCAL_FILENAME = "debug_log.txt"

Definition at line 13 of file profiler.py.

◆ messages_counted

int profiler.messages_counted = 0

Definition at line 35 of file profiler.py.

◆ MESSAGES_TO_SAMPLE

int profiler.MESSAGES_TO_SAMPLE = 1000

Definition at line 12 of file profiler.py.

◆ name

profiler.name

Definition at line 57 of file profiler.py.

◆ section_current

profiler.section_current = defaultdict(int)

Definition at line 49 of file profiler.py.

◆ section_times

profiler.section_times = defaultdict(list)

Definition at line 50 of file profiler.py.

◆ segments

profiler.segments = line.split()

Definition at line 54 of file profiler.py.

◆ ser

profiler.ser
Initial value:
1= serial.Serial(
2 port=COM_PORT,
3 baudrate=115200,
4 parity=serial.PARITY_NONE,
5 stopbits=serial.STOPBITS_ONE,
6 bytesize=serial.EIGHTBITS,
7 timeout=0,
8)

Definition at line 15 of file profiler.py.

◆ time

profiler.time

Definition at line 57 of file profiler.py.