Skip to content

Commit

Permalink
ENH: Added units and changing labels to nickname PVs
Browse files Browse the repository at this point in the history
  • Loading branch information
aksharsarvesh committed Aug 2, 2024
1 parent e8a8d9a commit 619790b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pydm/widgets/multi_axis_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,8 @@ def autoVisible(self, axisName):
label = axisName + ": "
for curve in axis._curves:
if curve.isVisible():
label += str(curve.name()) + ", "
if curve.name() != "":
label += str(curve.name()) + " (" + str(curve.units or "") + "), "
shouldShow = True
axis.setLabel(label[:-2])
if shouldShow:
Expand Down
3 changes: 3 additions & 0 deletions pydm/widgets/timeplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from .baseplot import BasePlot, BasePlotCurveItem
from .channel import PyDMChannel
from ..utilities import remove_protocol
from epics import caget

import logging

Expand Down Expand Up @@ -101,6 +102,7 @@ def __init__(self, channel_address=None, plot_by_timestamps=True, plot_style="Li
self.latest_value = None
self.channel = None
self.address = channel_address
self.units = caget(self.address+".EGU") if self.address else None
super(TimePlotCurveItem, self).__init__(**kws)

def to_dict(self):
Expand All @@ -117,6 +119,7 @@ def address(self):
@address.setter
def address(self, new_address: str):
"""Creates the channel for the input address for communicating with the address' plugin."""
self.units = caget(new_address+".EGU") if new_address else None
if not new_address:
self.channel = None
return
Expand Down

0 comments on commit 619790b

Please sign in to comment.