-
Notifications
You must be signed in to change notification settings - Fork 13
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
Change display.format #24
Conversation
Yes, much better than the current 'display.format' string. Format type choices are good, mapping well to https://github.com/shroffk/phoebus/blob/master/core/ui/src/main/java/org/phoebus/ui/vtype/FormatOption.java. I thought the interpretation of 'precision' was clear. Since you mentioned negative values for the precision, don't know how that would be used. |
@mdavidsaver, I agree with @kasemir. It is much better this way! 👍 I am also not sure how to deal with the negative values for precision and where it would be used. Can you give us an example? |
|
I think this should be about displaying a value, not about entering it. When entering a numerical value in a text input, I would always expect reasonable conversions to be applied, so that entering in hex, octal, binary (for integers), or exponential (for floats) just works without additional configuration. |
Ralph, that's OK when you require people to enter "0x12" for hex. |
Fine. |
@kasemir that is exactly what I meant for the Binary... we have the Byte widget but we also allow users to display a value as binary at Textboxes as well as labels. |
Precisely. I don't expect (or really want) this list to be exhaustive. And I expect that there will always be a way for individual displays to override So that leaves me with the following ordered list:
|
The Astronomy community may ask about Sexagesimal (for celestial coordinates) once they start to look at PVA, but given their recent progress that could be quite a few years off. Assuming it won't be too hard to add formats in the future I'm okay with the current list, although I note that it is missing Compact (%g) from Kay's Phoebus list. What will "Default" actually mean?
|
I see the purpose of this exercise as providing a hint in a form specified by the consumers of this hint. I'm not going to try to tell them how to use it. The decision I'm willing to make is to delay adding choices in the interest of preventing a premature proliferation. eg. I'm not saying "no" to |
I forgot to repeat myself from #19 (comment)
What should it be? Time to put on your name czar hat! |
Show me an OPI client which currently uses the |
Well the "VTypes" do, but that was a consequence of the V4 API only providing a format string. Would be much happier with just the numeric precision, plus a hint how to use that: decimal, engineering, hex, ... |
The enum provides an answer to the question "how should the value of this channel be displayed" so I suggest naming it Any objections to or problems with this? One more question: Do/did the pvtools programs support |
I strongly object against using interrogative words and particles as names for structure elements. |
In my mind, this is a done deal at this point. We're just haggling over the details.
From my test with cs-studio (NSLS2) 4.3.3, and Timo's original report using 4.6.1, I concluded that recent versions of cs-studio/BOY effectively ignored Am I wrong in this? I know that the format string was used at some point (circa 2016). Early on I set |
No, and never have. Thinking about how to do this safely is part of what led me to conclude that the |
Since we have to use the VType, which has a format and no precision, the precision received from Channel Access it turned into a format, and the format received from PVAccess is copied as such. The format is then used in a few places like the PV Tree, but we also have a lot of code like this that tries to recover the precision from the format: |
@kasemir I think we're having two different conversations. I'm trying to find out if simply removing A) Use QSRV It sounds like your answer to C for cs-studio is a conditional yes. That some parts do. I admit I don't often use PV Tree. I don't believe that SNS uses QSRV, so I'm guessing you wouldn't be effected? As for the fact that the format string idea has been baked into the VType interfaces. All I can do is apologize and sympathize. |
ESS depends on QSRV. |
From the SNS perspective, I suggest to simply remove the display.format. Has ESS written custom clients that depend on the display.format string? As far as I can tell the current CSS vtype.PV and phoebus.pv code that decodes the pvdata checks for a subfield "format". So right now removing the format wouldn't result in a crash. You'd simply get some default number format. |
I am not aware of any ESS custom clients that use the format string. Even if we had, we would fix them to work with this proposal. I would also vote for removing the display.format, leaving it in would just invite confusion. |
This sounds like a good idea to me, but what is rationale behind making it an enum rather than a string? I can't imagine a time that a client would need to know what all the different possible values of the enum... |
A client like CS-Studio would like to offer a 'default' option that uses the formatting hint from the PV. |
Final decision: This term could be confused with a fill-out-form (e.g. a tax form), but that is a different sense of the word than the one I'm using. |
Replace printf-style format string with enum + integer. ScalarBuilder explode scalar()/scalarArray()
Updated structure
@thomascobb says:
It also allows QSRV to report typos. eg. |
This reverts commit 4ffddfa.
Replace printf-style format string with enum + integer. See #19. I'd like to hear from some developers of OPI clients prior to merging.
With this change, a record
would result in
@shroffk @kasemir @georgweiss @hhslepicka