Skip to content
This repository has been archived by the owner on Feb 11, 2023. It is now read-only.

Commit

Permalink
FIX: add temperature monitor, fixes #11
Browse files Browse the repository at this point in the history
  • Loading branch information
leloup314 committed Oct 10, 2019
1 parent 42f6021 commit 641dd5a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
8 changes: 7 additions & 1 deletion irrad_control/gui/tabs/monitor_tab.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from PyQt5 import QtCore, QtWidgets
from collections import OrderedDict
from irrad_control.gui.widgets import RawDataPlot, BeamPositionPlot, PlotWrapperWidget, BeamCurrentPlot, FluenceHist
from irrad_control.gui.widgets import RawDataPlot, BeamPositionPlot, PlotWrapperWidget, BeamCurrentPlot, FluenceHist, TemperatureDataPlot


class IrradMonitorTab(QtWidgets.QWidget):
Expand Down Expand Up @@ -59,6 +59,12 @@ def _init_tabs(self):
monitor_widget.addWidget(beam_current_wrapper)
monitor_widget.addWidget(beam_pos_wrapper)

if 'temp' in self.setup[server]['devices']:

if monitor == 'temp':
self.plots[server]['temp_plot'] = TemperatureDataPlot(self.setup[server], daq_device=self.setup[server]['devices']['daq']['sem'])
monitor_widget = PlotWrapperWidget(self.plots[server]['temp_plot'])

if monitor_widget is not None:
self.monitor_tabs[server].addTab(monitor_widget, monitor.capitalize())

Expand Down
16 changes: 16 additions & 0 deletions irrad_control/gui/widgets/plot_widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,22 @@ def __init__(self, beam_current_setup=None, daq_device=None, parent=None):
self.plt.setLabel('right', text='Beam current', units='A')


class TemperatureDataPlot(ScrollingIrradDataPlot):

def __init__(self, temp_setup, daq_device=None, parent=None):

self.temp_setup = temp_setup

super(TemperatureDataPlot, self).__init__(channels=temp_setup['devices']['temp'].values(), units={'right': 'C', 'left': 'C'},
name=type(self).__name__ + ('' if daq_device is None else ' ' + daq_device),
parent=parent)

self.plt.setLabel('left', text='Temperature', units='C')
self.plt.hideAxis('left')
self.plt.showAxis('right')
self.plt.setLabel('right', text='Temperature', units='C')


class BeamPositionItem:
"""This class implements three pyqtgraph items in order to display a reticle with a circle in its intersection."""

Expand Down

0 comments on commit 641dd5a

Please sign in to comment.