DiamondLightSource / cs-web-proto

Prototype Operator Interface and Display Manager on the Web for EPICS
Apache License 2.0
7 stars 1 forks source link

PV State #53

Closed willrogers closed 5 years ago

willrogers commented 5 years ago

A PV may have a particular value (represented by a VType), but that doesn't include whether the PV is connected or whether it is readonly. These are additional information associated with each PV.

At the moment in the store we have

export interface PvState {
  value: VType;
  connected: boolean;
}

We could add readonly: boolean to this. Looking at the PV.java class in Phoebus, the only other state associated with the PV is the list of subscribers. We currently have this as a separate object in the store.

Another important point is that the vtype may be null (this happens for example when a local PV has not been initialised). That suggests that the pv state should be:

export interface PvState {
  value?: VType;
  connected: boolean;
  readonly: boolean;
}

with a value that may be undefined.

willrogers commented 5 years ago

In CS-Studio, widgets may display null, disconnected and invalid in different ways.

TimGuiteDiamond commented 5 years ago

How does Phoebus tackle this problem then? Or are you saying this IS a state stored with the PV state information in Phoebus?

willrogers commented 5 years ago

Phoebus has a PV object, which has:

TimGuiteDiamond commented 5 years ago

Main work here would be adding it in connectionWrapper.tsx and giving a sensible name? Are there any places where this would be expected to cause big problems?

Happy to take this on as I haven't looked at this part of the program too much.

willrogers commented 5 years ago

I think this would be quite simple. I'm not sure what you mean by 'giving a sensible name' though.

TimGuiteDiamond commented 5 years ago

Will this need to be optional? Can a PV which is not connected know whether it is readonly or not? Should this default to True if there is no connection or other information from the PV?

willrogers commented 5 years ago

I added a non-existent PV to Phoebus and it showed up as readonly. It's not clear to me whether that's best but I don't have a good reason to give it different behaviour.

willrogers commented 5 years ago

Same in CS-Studio.

TimGuiteDiamond commented 5 years ago

Yea I'm happy with that. Are we envisioning that this information will eventually be sent from the EPICS interface (ie coniql) ?

willrogers commented 5 years ago

Yes, it comes through coniql. It will be false for local PVs, but we could have sim pv for which it is true.


From: TimGuiteDiamond notifications@github.com Sent: 10 October 2019 16:07 To: dls-controls/cs-web-proto cs-web-proto@noreply.github.com Cc: Rogers, Will (DLSLtd,RAL,LSCI) will.rogers@diamond.ac.uk; Assign assign@noreply.github.com Subject: Re: [dls-controls/cs-web-proto] PV State (#53)

Yea I'm happy with that. Are we envisioning that this information will eventually be sent from the EPICS interface (ie coniql) ?

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHubhttps://github.com/dls-controls/cs-web-proto/issues/53?email_source=notifications&email_token=AASTW523CRFB53VQRW7NZUTQN5AMJA5CNFSM4I7LSKKKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEA4WHXA#issuecomment-540632028, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AASTW56QEXPDFTYW4MNV453QN5AMJANCNFSM4I7LSKKA.

-- This e-mail and any attachments may contain confidential, copyright and or privileged material, and are for the use of the intended addressee only. If you are not the intended addressee or an authorised recipient of the addressee please notify us of receipt by returning the e-mail and do not use, copy, retain, distribute or disclose the information in or attached to the e-mail. Any opinions expressed within this e-mail are those of the individual and not necessarily of Diamond Light Source Ltd. Diamond Light Source Ltd. cannot guarantee that this e-mail or any attachments are free from viruses and we cannot accept liability for any damage which you may sustain as a result of software viruses which may be transmitted in or with the message. Diamond Light Source Limited (company no. 4375679). Registered in England and Wales with its registered office at Diamond House, Harwell Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom

TimGuiteDiamond commented 5 years ago

Cool.