pydm icon indicating copy to clipboard operation
pydm copied to clipboard

Add DataKeys.TIMESTAMP in pydm 2.0

Open klauer opened this issue 5 years ago • 7 comments

It should be possible to propagate timestamp information to widgets.

Consideration for timestamp metadata (like pulse ID) may be advisable as well.

klauer avatar Jul 18 '19 22:07 klauer

I have heard repeated requests in the past to somehow display the timestamp related to the data shown on a widget (via hover tooltip or right click or something like that). The demand is out there!

mattgibbs avatar Jul 18 '19 23:07 mattgibbs

Reopening as we still plan to implement that.

hhslepicka avatar Nov 03 '20 23:11 hhslepicka

I would like to see this, and was wondering if it could simply be a special type of PYDMLabel widget (PYDMTimeLabel?)

slactasha avatar Oct 13 '21 22:10 slactasha

@slactasha as an alternative you can use a PyDMDateTimeLabel along with the PV but selecting the .TIME field. That should technically work.

hhslepicka avatar Oct 13 '21 23:10 hhslepicka

Thanks @hhslepicka! I'll try that today, I admit I've never used that widget before and its purpose is kind of obvious from the name :)

slactasha avatar Oct 14 '21 15:10 slactasha

I'm not entirely sure how EPICS records output the timestamp, nor how the timestamp gets updated in PyDM. For context, I'm working on a ui that dynamically changes channels based on the text field of a QLineEdit. Some channels write to my PyDMDateTimeLabel just fine, and it shows the timestamp as expected. Others crash my page and spit out the following error:

File "/afs/slac/g/lcls/package/python/python2.7.13/linux-x86_64/lib/python2.7/site-packages/pydm/widgets/base.py", line 793, in channelValueChanged self.value_changed(new_val) File "/afs/slac/g/lcls/package/python/python2.7.13/linux-x86_64/lib/python2.7/site-packages/pydm/widgets/datetime.py", line 175, in value_changed val = val.addMSecs(new_val) TypeError: addMSecs(self, int): argument 1 has unexpected type 'unicode'

kabanaty avatar Oct 14 '21 19:10 kabanaty

I'm not sure that .TIME is universally available, I think only certain well-behaved IOCs support it. However, all monitor events in EPICS come with a timestamp (if you use the right monitor flags). We could (should?) implement the capability for handling timestamps (and passing them along to widgets) at the data plugin level. My only reservation is that we need to be a bit careful to make this stuff optional, because non-EPICS data sources might handle timestamps in a very different way.

mattgibbs avatar Oct 15 '21 20:10 mattgibbs

This feature was included in PR #911

YektaY avatar Aug 10 '23 21:08 YektaY