Commit c518ae79 authored by Benjamin Mummery's avatar Benjamin Mummery 💻

Merge branch 'feature/UI_Plots' into ui_brain_and_brawn

parents a2df9cf4 743c80c2
......@@ -34,44 +34,31 @@ class TimePlotsWidget(QtWidgets.QWidget):
self.graph_widget = pg.GraphicsLayoutWidget()
layout.addWidget(self.graph_widget)
labelStyle = {"color": "#FFF", "font-size": "15pt"}
labelStyle = {"color": NativeUI.colors["page_foreground"], "font-size": "15pt"}
# Set up pressure - time plot
self.pressure_plot = self.graph_widget.addPlot()
self.pressure_plot.setLabel(
"left", NativeUI.text["plot_axis_label_pressure"], **labelStyle
)
self.pressure_plot.getAxis("left").setTextPen("w")
self.pressure_plot.getAxis("bottom").setTextPen("w")
self.pressure_plot.getAxis("bottom").setStyle(showValues=False)
self.graph_widget.nextRow()
# Set up flow - time plot
self.flow_plot = self.graph_widget.addPlot()
self.flow_plot.setLabel(
"left", NativeUI.text["plot_axis_label_flow"], **labelStyle
#labels={"left": NativeUI.text["plot_axis_label_flow"]}
)
self.flow_plot.getAxis("left").setTextPen("w")
self.flow_plot.getAxis("bottom").setTextPen("w")
self.flow_plot.getAxis("bottom").setStyle(showValues=False)
self.flow_plot.setXLink(self.pressure_plot)
self.graph_widget.nextRow()
# Set up volume -time plot
self.volume_plot = self.graph_widget.addPlot()
self.volume_plot.setLabel(
"left", NativeUI.text["plot_axis_label_volume"],**labelStyle)
"left", NativeUI.text["plot_axis_label_volume"], **labelStyle
)
self.volume_plot.setLabel(
"bottom", NativeUI.text["plot_axis_label_time"],**labelStyle
# labels={
# "left": NativeUI.text["plot_axis_label_volume"],
# "bottom": NativeUI.text["plot_axis_label_time"],
# }
"bottom", NativeUI.text["plot_axis_label_time"], **labelStyle
)
self.volume_plot.getAxis("left").setTextPen("w")
self.volume_plot.getAxis("bottom").setTextPen("w")
self.volume_plot.setXLink(self.pressure_plot)
self.graph_widget.nextRow()
......@@ -83,7 +70,7 @@ class TimePlotsWidget(QtWidgets.QWidget):
# Add grid, hide the autoscale button, and add the legend
font = QtGui.QFont() # TODO: change to an imported font from NativeuI
font.setPixelSize(24)
for plot in self.plots:
plot.showGrid(x=True, y=True)
plot.hideButtons()
......@@ -92,6 +79,8 @@ class TimePlotsWidget(QtWidgets.QWidget):
plot.setMouseEnabled(x=False, y=False)
plot.getAxis("bottom").setStyle(tickFont=font)
plot.getAxis("left").setStyle(tickFont=font)
plot.getAxis("left").setTextPen(NativeUI.colors["page_foreground"])
plot.getAxis("bottom").setTextPen(NativeUI.colors["page_foreground"])
# Set Range
self.update_plot_time_range(61)
......@@ -158,59 +147,33 @@ class CirclePlotsWidget(QtWidgets.QWidget):
self.graph_widget = pg.GraphicsLayoutWidget()
layout.addWidget(self.graph_widget)
labelStyle = {"color": "#FFF", "font-size": "15pt"}
labelStyle = {"color": NativeUI.colors["page_foreground"], "font-size": "15pt"}
self.pressure_flow_plot = self.graph_widget.addPlot()
self.pressure_flow_plot.setLabel(
"left", NativeUI.text["plot_axis_label_pressure"], **labelStyle)
"left", NativeUI.text["plot_axis_label_pressure"], **labelStyle
)
self.pressure_flow_plot.setLabel(
"bottom", NativeUI.text["plot_axis_label_flow"], **labelStyle
# labels={
# "bottom": NativeUI.text["plot_axis_label_flow"],
# "left": NativeUI.text["plot_axis_label_pressure"],
# }
)
self.pressure_flow_plot.getAxis("left").setTextPen("w")
self.pressure_flow_plot.getAxis("bottom").setTextPen("w")
self.graph_widget.nextRow()
self.flow_volume_plot = self.graph_widget.addPlot()
self.flow_volume_plot.setLabel(
"left", NativeUI.text["plot_axis_label_volume"], **labelStyle)
"left", NativeUI.text["plot_axis_label_volume"], **labelStyle
)
self.flow_volume_plot.setLabel(
"bottom", NativeUI.text["plot_axis_label_flow"], **labelStyle
# labels={
# "bottom": NativeUI.text["plot_axis_label_volume"],
# "left": NativeUI.text["plot_axis_label_flow"],
# }
"bottom", NativeUI.text["plot_axis_label_flow"], **labelStyle
)
self.flow_volume_plot.getAxis("left").setTextPen("w")
self.flow_volume_plot.getAxis("bottom").setTextPen("w")
self.graph_widget.nextRow()
self.volume_pressure_plot = self.graph_widget.addPlot()
self.volume_pressure_plot.setLabel(
"left", NativeUI.text["plot_axis_label_pressure"], **labelStyle)
"left", NativeUI.text["plot_axis_label_pressure"], **labelStyle
)
self.volume_pressure_plot.setLabel(
"bottom", NativeUI.text["plot_axis_label_flow"], **labelStyle
# labels={
# "bottom": NativeUI.text["plot_axis_label_pressure"],
# "left": NativeUI.text["plot_axis_label_volume"],
# }
"bottom", NativeUI.text["plot_axis_label_flow"], **labelStyle
)
self.volume_pressure_plot.getAxis("left").setTextPen("w")
self.volume_pressure_plot.getAxis("bottom").setTextPen("w")
self.graph_widget.nextRow()
self.graph_widget.nextRow()
......@@ -228,7 +191,7 @@ class CirclePlotsWidget(QtWidgets.QWidget):
# Add grid, hide the autoscale button, and add the legend
font = QtGui.QFont() # TODO: change to an imported font from NativeuI
font.setPixelSize(25)
for plot in self.plots:
plot.showGrid(x=True, y=True)
plot.hideButtons()
......@@ -237,7 +200,8 @@ class CirclePlotsWidget(QtWidgets.QWidget):
plot.setMouseEnabled(x=False, y=False)
plot.getAxis("bottom").setStyle(tickFont=font)
plot.getAxis("left").setStyle(tickFont=font)
plot.getAxis("left").setTextPen(NativeUI.colors["page_foreground"])
plot.getAxis("bottom").setTextPen(NativeUI.colors["page_foreground"])
# Plot styles
self.pressure_flow_line = self.plot(
......@@ -294,29 +258,26 @@ class ChartsPlotWidget(QtWidgets.QWidget):
self.port = port
layout = QtWidgets.QHBoxLayout()
# Set up the graph widget
self.graph_widget = pg.GraphicsLayoutWidget()
layout.addWidget(self.graph_widget)
labelStyle = {"color": "#FFF", "font-size": "15pt"}
# Add the plot axes to the graph widget
self.display_plot = self.graph_widget.addPlot()
self.display_plot.setLabel("left", "????", **labelStyle)
self.display_plot.setLabel(
"left", "????", **labelStyle
)
self.display_plot.setLabel(
"bottom", "????", **labelStyle
# labels={"left": "????", "bottom": "????"}
"bottom",
"????",
**labelStyle
# labels={"left": "????", "bottom": "????"}
)
self.display_plot.getAxis("left").setTextPen("w")
self.display_plot.getAxis("bottom").setTextPen("w")
self.graph_widget.nextRow()
# Store plots in a list in case we need to add additional axes in the future.
......@@ -342,10 +303,10 @@ class ChartsPlotWidget(QtWidgets.QWidget):
self.graph_widget.setContentsMargins(0.0, 0.0, 0.0, 0.0)
self.graph_widget.setBackground(colors["page_background"])
self.legends = []
font = QtGui.QFont() # TODO: change to an imported font from NativeuI
font.setPixelSize(25)
for plot in plots:
plot.showGrid(x=True, y=True)
plot.hideButtons()
......@@ -353,7 +314,6 @@ class ChartsPlotWidget(QtWidgets.QWidget):
self.legends.append(plot.addLegend(offset=(-1, 1)))
plot.getAxis("bottom").setStyle(tickFont=font)
plot.getAxis("left").setStyle(tickFont=font)
self.setLayout(layout)
......
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