Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename AMC frequency feedback PVs #655

Merged
merged 3 commits into from
Sep 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 16 additions & 40 deletions pyqt-apps/siriushla/as_ti_control/low_level_devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,17 +413,9 @@ def _setup_info_wid(self):
lay.addWidget(gb, 1, 2, alignment=Qt.AlignHCenter)

lb = QLabel("<b>Fw.Version</b>")
pvname = self.get_pvname(propty='FrmVersionA-Cte')
frma = SiriusLabel(self, init_channel=pvname)
frma.displayFormat = frma.DisplayFormat.TIFwVersion
pvname = self.get_pvname(propty='FrmVersionB-Cte')
frmb = SiriusLabel(self, init_channel=pvname)
frmb.displayFormat = frmb.DisplayFormat.TIFwVersion
pvname = self.get_pvname(propty='FrmVersionC-Cte')
frmc = SiriusLabel(self, init_channel=pvname)
frmc.displayFormat = frmc.DisplayFormat.TIFwVersion
gb = self._create_small_group(
'', info_wid, (lb, frma, frmb, frmc))
pvname = self.get_pvname(propty='FwVersion-Cte.SVAL')
frmv = SiriusLabel(self, init_channel=pvname)
gb = self._create_small_group('', info_wid, (lb, frmv))
gb.layout().setSpacing(3)
lay.addWidget(gb, 1, 3, alignment=Qt.AlignHCenter)

Expand Down Expand Up @@ -1246,17 +1238,9 @@ def _setup_info_wid(self):
info_lay.addWidget(gb, 1, 1, alignment=Qt.AlignTop)

lb = QLabel("<b>Fw.Version</b>")
pvname = self.get_pvname(propty='FrmVersionA-Cte')
frma = SiriusLabel(self, init_channel=pvname)
frma.displayFormat = frma.DisplayFormat.TIFwVersion
pvname = self.get_pvname(propty='FrmVersionB-Cte')
frmb = SiriusLabel(self, init_channel=pvname)
frmb.displayFormat = frmb.DisplayFormat.TIFwVersion
pvname = self.get_pvname(propty='FrmVersionC-Cte')
frmc = SiriusLabel(self, init_channel=pvname)
frmc.displayFormat = frmc.DisplayFormat.TIFwVersion
gb = self._create_small_group(
'', info_wid, (lb, frma, frmb, frmc))
pvname = self.get_pvname(propty='FwVersion-Cte.SVAL')
frmv = SiriusLabel(self, init_channel=pvname)
gb = self._create_small_group('', info_wid, (lb, frmv))
gb.layout().setSpacing(3)
info_lay.addWidget(gb, 1, 2, alignment=Qt.AlignTop)

Expand Down Expand Up @@ -1526,26 +1510,26 @@ def _setup_freqfb_wid(self, subdev):
lb_phdiv = SiriusLabel(
self, self.get_pvname(propty=subdev+'PhaseDiv-RB'))

ld_rfrlo = QLabel('<b>RFReqLo</b>', self, alignment=Qt.AlignCenter)
ld_rfrlo = QLabel('<b>RFreqLo</b>', self, alignment=Qt.AlignCenter)
lb_rfrlo = SiriusLabel(
self, self.get_pvname(propty=subdev+'RFReqLo-RB'))
self, self.get_pvname(propty=subdev+'RFreqLo-Mon'))
lb_rfrlo.displayFormat = SiriusLabel.DisplayFormat.Hex

ld_rfrhi = QLabel('<b>RFReqHi</b>', self, alignment=Qt.AlignCenter)
ld_rfrhi = QLabel('<b>RFreqHi</b>', self, alignment=Qt.AlignCenter)
lb_rfrhi = SiriusLabel(
self, self.get_pvname(propty=subdev+'RFReqHi-RB'))
self, self.get_pvname(propty=subdev+'RFreqHi-Mon'))
lb_rfrhi.displayFormat = SiriusLabel.DisplayFormat.Hex

ld_n1 = QLabel('<b>N1</b>', self, alignment=Qt.AlignCenter)
ld_n1.setObjectName('n1')
lb_n1 = SiriusLabel(
self, self.get_pvname(propty=subdev+'n1-RB'))
self, self.get_pvname(propty=subdev+'N1-Mon'))
lb_n1.setObjectName('n1')
lb_n1.displayFormat = SiriusLabel.DisplayFormat.Hex

ld_hsdiv = QLabel('<b>HS_DIV</b>', self, alignment=Qt.AlignCenter)
ld_hsdiv = QLabel('<b>HSDiv</b>', self, alignment=Qt.AlignCenter)
lb_hsdiv = SiriusLabel(
self, self.get_pvname(propty=subdev+'hs_div-RB'))
self, self.get_pvname(propty=subdev+'HSDiv-Mon'))

# Equation
ld_fpgaclk = QLabel('(FPGA Clk) x ', self, alignment=Qt.AlignRight)
Expand Down Expand Up @@ -1864,17 +1848,9 @@ def _setup_info_wid(self):
info_lay.addWidget(gb, 0, 6, alignment=Qt.AlignTop)

lb = QLabel("<b>Fw.Version</b>")
pvname = self.get_pvname(propty='FrmVersionA-Cte')
frma = SiriusLabel(self, init_channel=pvname)
frma.displayFormat = frma.DisplayFormat.TIFwVersion
pvname = self.get_pvname(propty='FrmVersionB-Cte')
frmb = SiriusLabel(self, init_channel=pvname)
frmb.displayFormat = frmb.DisplayFormat.TIFwVersion
pvname = self.get_pvname(propty='FrmVersionC-Cte')
frmc = SiriusLabel(self, init_channel=pvname)
frmc.displayFormat = frmc.DisplayFormat.TIFwVersion
gb = self._create_small_group(
'', info_wid, (lb, frma, frmb, frmc))
pvname = self.get_pvname(propty='FwVersion-Cte.SVAL')
frmv = SiriusLabel(self, init_channel=pvname)
gb = self._create_small_group('', info_wid, (lb, frmv))
gb.layout().setSpacing(3)
info_lay.addWidget(gb, 0, 7, alignment=Qt.AlignTop)

Expand Down
14 changes: 0 additions & 14 deletions pyqt-apps/siriushla/widgets/label.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Sirius Label."""

import ctypes
from pyqtgraph import functions as func
from qtpy.QtWidgets import QLabel, QApplication
from qtpy.QtCore import Qt, Property, Q_ENUMS
Expand Down Expand Up @@ -31,7 +30,6 @@ class SiriusLabel(QLabel, TextFormatter, PyDMWidget, DisplayFormat):
DisplayFormat = DisplayFormat
DisplayFormat.Time = 6
DisplayFormat.BSMPUDCVersion = 7
DisplayFormat.TIFwVersion = 8

def __init__(self, parent=None, init_channel=None, keep_unit=False, **kws):
"""Init."""
Expand Down Expand Up @@ -117,18 +115,6 @@ def value_changed(self, new_value):
self.setText(version)
return

# If it is a timing firmware version string, convert to unsigned int
# and represent in hex
if self._display_format_type == self.DisplayFormat.TIFwVersion:
new_value = ctypes.c_uint32(new_value).value \
if new_value is not None else ''
version = parse_value_for_display(
value=new_value, precision=self.precision,
display_format_type=self.DisplayFormat.Hex,
string_encoding=self._string_encoding, widget=self)
self.setText(version)
return

new_value = parse_value_for_display(
value=new_value, precision=self.precision,
display_format_type=self._display_format_type,
Expand Down