@@ -265,7 +265,7 @@ def load_sensors(self):
265
265
self .sensors_menu .addSection (sensor .location )
266
266
if sensor .id_sensor not in self .sensors :
267
267
self .sensors [sensor .id_sensor ] = sensor
268
- sensor_item = QAction (sensor .name + ' [' + str (sensor .sampling_rate ) + ' Hz]' )
268
+ sensor_item = QAction (sensor .name + ' [' + "{:.1f}" . format (sensor .sampling_rate ) + ' Hz]' )
269
269
sensor_item .setCheckable (True )
270
270
sensor_item .setProperty ("sensor_id" , sensor .id_sensor )
271
271
self .sensors_items [sensor .id_sensor ] = sensor_item
@@ -449,7 +449,8 @@ def draw_sensors_names(self):
449
449
for sensor_id in sensors :
450
450
sensor = self .sensors [sensor_id ]
451
451
# Sensor names
452
- label = self .timeSensorsScene .addText (sensor .name + ' [' + str (sensor .sampling_rate ) + ' Hz]' )
452
+ label = self .timeSensorsScene .addText (sensor .name + ' [' + "{:.1f}" .format (sensor .sampling_rate )
453
+ + ' Hz]' )
453
454
label .setPos (0 , pos )
454
455
label .setDefaultTextColor (Qt .black )
455
456
# label.setFont(QFont("Times", 10, QFont.Bold))
@@ -622,7 +623,8 @@ def query_sensor_data(self, sensor: Sensor, start_time: datetime, end_time: date
622
623
def sensor_graph_selected (self , sensor_item ):
623
624
sensor_id = sensor_item .property ("sensor_id" )
624
625
sensor = self .sensors [sensor_id ]
625
- sensor_label = sensor .name + " (" + sensor .location + ")" + ' [' + str (sensor .sampling_rate ) + ' Hz]'
626
+ sensor_label = (sensor .name + " (" + sensor .location + ")" + ' [' + "{:.1f}" .format (sensor .sampling_rate ) +
627
+ ' Hz]' )
626
628
627
629
if sensor_item .isChecked ():
628
630
# Choose the correct display for each sensor
@@ -707,7 +709,7 @@ def sensor_graph_selected(self, sensor_item):
707
709
# self.UI.displayContents.layout().insertWidget(0,graph)
708
710
709
711
graph_window .show ()
710
- QApplication .instance ().processEvents ()
712
+ # QApplication.instance().processEvents()
711
713
712
714
graph_window .aboutToClose .connect (self .graph_was_closed )
713
715
graph_window .requestData .connect (self .query_sensor_data )
0 commit comments