Skip to content

Commit

Permalink
ENH: Archiver curves prepare new addresses with pydm utility function
Browse files Browse the repository at this point in the history
  • Loading branch information
zdomke committed Feb 20, 2024
1 parent 3f23f0f commit 98b57d3
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions pydm/widgets/archiver_time_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from collections import OrderedDict
from typing import List, Optional
from pyqtgraph import DateAxisItem, ErrorBarItem
from pydm.utilities import remove_protocol
from pydm.widgets.channel import PyDMChannel
from pydm.widgets.timeplot import TimePlotCurveItem
from pydm.widgets import PyDMTimePlot
Expand Down Expand Up @@ -73,14 +74,8 @@ def address(self, new_address: str) -> None:
elif self.archive_channel and new_address == self.archive_channel.address:
return

archiver_prefix = "archiver://pv="
if new_address.startswith("ca://"):
archive_address = new_address.replace("ca://", archiver_prefix, 1)
elif new_address.startswith("pva://"):
archive_address = new_address.replace("pva://", archiver_prefix, 1)
else:
archive_address = archiver_prefix + new_address

# Prepare new address to use the archiver plugin and create the new channel
archive_address = "archiver://pv=" + remove_protocol(new_address)
self.archive_channel = PyDMChannel(
address=archive_address, value_slot=self.receiveArchiveData, value_signal=self.archive_data_request_signal
)
Expand Down

0 comments on commit 98b57d3

Please sign in to comment.