@@ -41,7 +41,7 @@ def __init__(self):
4141 self .algorithm = None
4242 self .old_dict = {}
4343 self .teleplot_socket = None
44- self .teleplot_prefix = qt_ui .settings .focstim_teleplot_prefix .get (). encode ( 'ascii' )
44+ self .teleplot_prefix = qt_ui .settings .focstim_teleplot_prefix .get ()
4545 self .notification_log = None
4646 self .dump_notifications = False
4747
@@ -277,7 +277,7 @@ def generic_timeout(self, id):
277277
278278 def transmit_dirty_params (self , interval = 30 ):
279279 msg = f"""
280- event_loop_latency:{ (time .time () - self .last_update ) * 1000 }
280+ { self . teleplot_prefix } event_loop_latency:{ (time .time () - self .last_update ) * 1000 }
281281 """
282282 self .teleplot_socket .write (msg .encode ('utf-8' ))
283283 self .last_update = time .time ()
@@ -341,68 +341,68 @@ def handle_notification_currents(self, notif: NotificationCurrents):
341341 # print(notif)
342342 if self .teleplot_socket :
343343 msg = f"""
344- rms_a:{ notif .rms_a }
345- rms_b:{ notif .rms_b }
346- rms_c:{ notif .rms_c }
347- rms_d:{ notif .rms_d }
348- max_a:{ notif .peak_a }
349- max_b:{ notif .peak_b }
350- max_c:{ notif .peak_c }
351- max_d:{ notif .peak_d }
352- max_cmd:{ notif .peak_cmd }
353- power_total:{ notif .output_power }
354- power_skin:{ notif .output_power_skin }
344+ { self . teleplot_prefix } rms_a:{ notif .rms_a }
345+ { self . teleplot_prefix } rms_b:{ notif .rms_b }
346+ { self . teleplot_prefix } rms_c:{ notif .rms_c }
347+ { self . teleplot_prefix } rms_d:{ notif .rms_d }
348+ { self . teleplot_prefix } max_a:{ notif .peak_a }
349+ { self . teleplot_prefix } max_b:{ notif .peak_b }
350+ { self . teleplot_prefix } max_c:{ notif .peak_c }
351+ { self . teleplot_prefix } max_d:{ notif .peak_d }
352+ { self . teleplot_prefix } max_cmd:{ notif .peak_cmd }
353+ { self . teleplot_prefix } power_total:{ notif .output_power }
354+ { self . teleplot_prefix } power_skin:{ notif .output_power_skin }
355355 """
356356 self .teleplot_socket .write (msg .encode ('utf-8' ))
357357
358358 def handle_notification_model_estimation (self , notif : NotificationModelEstimation ):
359359 if self .teleplot_socket :
360360 msg = f"""
361- R_a:{ notif .resistance_a }
362- R_b:{ notif .resistance_b }
363- R_c:{ notif .resistance_c }
364- R_d:{ notif .resistance_d }
365- Z_a:{ notif .resistance_a } :{ notif .reluctance_a } |xy
366- Z_b:{ notif .resistance_b } :{ notif .reluctance_b } |xy
367- Z_c:{ notif .resistance_c } :{ notif .reluctance_c } |xy
368- Z_d:{ notif .resistance_d } :{ notif .reluctance_d } |xy
361+ { self . teleplot_prefix } R_a:{ notif .resistance_a }
362+ { self . teleplot_prefix } R_b:{ notif .resistance_b }
363+ { self . teleplot_prefix } R_c:{ notif .resistance_c }
364+ { self . teleplot_prefix } R_d:{ notif .resistance_d }
365+ { self . teleplot_prefix } Z_a:{ notif .resistance_a } :{ notif .reluctance_a } |xy
366+ { self . teleplot_prefix } Z_b:{ notif .resistance_b } :{ notif .reluctance_b } |xy
367+ { self . teleplot_prefix } Z_c:{ notif .resistance_c } :{ notif .reluctance_c } |xy
368+ { self . teleplot_prefix } Z_d:{ notif .resistance_d } :{ notif .reluctance_d } |xy
369369 """
370370 self .teleplot_socket .write (msg .encode ('utf-8' ))
371371
372372 def handle_notification_system_stats (self , notif : NotificationSystemStats ):
373373 if notif .HasField ('esc1' ):
374374 if self .teleplot_socket :
375375 msg = f"""
376- temp_stm32:{ notif .esc1 .temp_stm32 }
377- temp_board:{ notif .esc1 .temp_board }
378- v_bus:{ notif .esc1 .v_bus }
376+ { self . teleplot_prefix } temp_stm32:{ notif .esc1 .temp_stm32 }
377+ { self . teleplot_prefix } temp_board:{ notif .esc1 .temp_board }
378+ { self . teleplot_prefix } v_bus:{ notif .esc1 .v_bus }
379379 """
380380 self .teleplot_socket .write (msg .encode ('utf-8' ))
381381 elif notif .HasField ('focstimv3' ):
382382 if self .teleplot_socket :
383383 msg = f"""
384- temp_stm32:{ notif .focstimv3 .temp_stm32 }
385- v_sys:{ notif .focstimv3 .v_sys }
386- v_boost:{ notif .focstimv3 .v_boost }
387- boost_duty_cycle:{ notif .focstimv3 .boost_duty_cycle }
384+ { self . teleplot_prefix } temp_stm32:{ notif .focstimv3 .temp_stm32 }
385+ { self . teleplot_prefix } v_sys:{ notif .focstimv3 .v_sys }
386+ { self . teleplot_prefix } v_boost:{ notif .focstimv3 .v_boost }
387+ { self . teleplot_prefix } boost_duty_cycle:{ notif .focstimv3 .boost_duty_cycle }
388388 """
389389 self .teleplot_socket .write (msg .encode ('utf-8' ))
390390
391391 def handle_notification_signal_stats (self , notif : NotificationSignalStats ):
392392 if self .teleplot_socket :
393393 msg = f"""
394- pulse_frequency:{ notif .actual_pulse_frequency }
395- v_drive:{ notif .v_drive }
394+ { self . teleplot_prefix } pulse_frequency:{ notif .actual_pulse_frequency }
395+ { self . teleplot_prefix } v_drive:{ notif .v_drive }
396396 """
397397 self .teleplot_socket .write (msg .encode ('utf-8' ))
398398
399399 def handle_notification_battery (self , notif : NotificationBattery ):
400400 if self .teleplot_socket :
401401 msg = f"""
402- battery_voltage:{ notif .battery_voltage }
403- battery_charge_rate:{ notif .battery_charge_rate_watt }
404- battery_soc:{ notif .battery_soc }
405- temp_bq27411:{ notif .chip_temperature }
402+ { self . teleplot_prefix } battery_voltage:{ notif .battery_voltage }
403+ { self . teleplot_prefix } battery_charge_rate:{ notif .battery_charge_rate_watt }
404+ { self . teleplot_prefix } battery_soc:{ notif .battery_soc }
405+ { self . teleplot_prefix } temp_bq27411:{ notif .chip_temperature }
406406 """
407407 self .teleplot_socket .write (msg .encode ('utf-8' ))
408408
@@ -412,9 +412,9 @@ def handle_notification_debug_string(self, notif: NotificationDebugString):
412412 def handle_notification_debug_as5311 (self , notif : NotificationDebugAS5311 ):
413413 if self .teleplot_socket :
414414 msg = f"""
415- as5311_raw:{ notif .raw }
416- as5311_um:{ notif .tracked * (2000.0 / 4096 ) }
417- as5311_flags:{ notif .flags }
415+ { self . teleplot_prefix } as5311_raw:{ notif .raw }
416+ { self . teleplot_prefix } as5311_um:{ notif .tracked * (2000.0 / 4096 ) }
417+ { self . teleplot_prefix } as5311_flags:{ notif .flags }
418418 """
419419 self .teleplot_socket .write (msg .encode ('utf-8' ))
420420
0 commit comments