Commit f405ea25 authored by Carlos Ortiz's avatar Carlos Ortiz

Add detailed circleplots localisatio changing

parent 3e62accf
Pipeline #1518 canceled with stages
......@@ -240,6 +240,17 @@ class NativeUI(HEVClient, QMainWindow):
self.widgets.localisation_button.SetLocalisation.connect(
self.widgets.ventilator_start_stop_buttons_widget.localise_text
)
self.widgets.localisation_button.SetLocalisation.connect(
self.widgets.detailed_plots.localise_text
)
self.widgets.localisation_button.SetLocalisation.connect(
self.widgets.circle_plots.localise_text
)
self.widgets.localisation_button.SetLocalisation.connect(
self.widgets.charts_widget.localise_text
)
return 0
......
......@@ -265,7 +265,42 @@ class CirclePlotsWidget(QtWidgets.QWidget):
plot.setXRange(self.time_range * (-1), 0, padding=0)
plot.enableAutoRange("y", True)
return 0
@QtCore.Slot(dict)
def localise_text(self, text: dict) -> int:
"""
Update the text displayed on the axis' and legend of time plots.
"""
self.pressure_plot.setLabel("left", text["plot_axis_label_pressure"])
self.pressure_plot.legend.clear()
self.pressure_plot.legend.addItem(self.pressure_line, text["plot_line_label_pressure"])
self.flow_plot.setLabel("left", text["plot_axis_label_flow"])
self.flow_plot.legend.clear()
self.flow_plot.legend.addItem(self.flow_line, name=text["plot_line_label_flow"])
self.volume_plot.setLabel("left", text["plot_axis_label_volume"])
self.volume_plot.setLabel("bottom", text["plot_axis_label_time"])
self.volume_plot.legend.clear()
self.volume_plot.legend.addItem(self.volume_line, name=text["plot_line_label_volume"])
self.pressure_flow_plot.setLabel("left", text["plot_axis_label_pressure"])
self.pressure_flow_plot.setLabel("bottom", text["plot_axis_label_flow"])
self.pressure_flow_plot.legend.clear()
self.pressure_flow_plot.legend.additem(self.pressure_flow_line, name=text["plot_line_label_pressure_flow"])
self.flow_volume_plot.setLabel("left", text["plot_axis_label_flow"])
self.flow_volume_plot.setLabel("bottom", text["plot_axis_label_volume"])
self.flow_volume_plot.legend.clear()
self.flow_volume_plot.legend.additem(self.volume_flow_line, name=text["plot_line_label_flow_volume"])
self.volume_pressure_plot.setLabel("left", text["plot_axis_label_volume"])
self.volume_pressure_plot.setLabel("bottom", text["plot_axis_label_pressure"])
self.volume_pressure_plot.legend.clear()
self.volume_pressure_plot.legend.additem(self.volume_pressure_line, name=text["plot_line_label_volume_pressure"])
return 0
class ChartsPlotWidget(QtWidgets.QWidget):
def __init__(self, port=54322, *args, colors: dict = {}, **kwargs):
......@@ -346,3 +381,14 @@ class ChartsPlotWidget(QtWidgets.QWidget):
"""
self.lines[key].setPen(pg.mkPen(color=(0, 0, 0, 0), width=0))
return 0
@QtCore.Slot(dict)
def localise_text(self, text: dict) -> int:
"""
Update the text displayed on the axis' and legend of time plots.
"""
self.pressure_plot.setLabel("left", text["plot_axis_label_pressure"])
self.pressure_plot.legend.clear()
self.pressure_plot.legend.addItem(self.pressure_line, text["plot_line_label_pressure"])
return 0
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment