Open mdavidsaver opened 6 years ago
On 08/28/2018 08:09 PM, Kasemir, Kay wrote:
Hi Andrew:
.. "field(value)" seems to have always been the default... What does your older pvget show for its help text?
Same as the new one:
-r
: Request, specifies what fields to return and options, default is 'field(value)' this change in behavior looks like a regression now that you point it out.
Yes, it is a change. In the old code, I find this in EPICS-CPP-4.6.0/pvAccessCPP/pvtoolsSrc/pvget.cpp:
// probe for value field
... if (structure.get() == 0 || structure->getField("value").get() == 0) { // fallback to structure mode = StructureMode; pvRequest = CreateRequest::create()->createRequest("field()"); }
That must be what made it tolerant to a missing "value" field, falling back to getting everything.
The new pvget code doesn't update the pvRequest. In the printout section, it's prepared to say "no value field" if there is none, but then it's already too late, because it forced the "field(value)" request and failed, instead of falling back to "field()".
If this was a democracy, I'd vote for putting the more tolerant code back in.
Thanks, -Kay
-r : Request, specifies what fields to return and options, default is 'field(value)' ... if (structure.get() == 0 || structure->getField("value").get() == 0) { // fallback to structure mode = StructureMode; pvRequest = CreateRequest::create()->createRequest("field()");
So the issue is that the default pvRequest wasn't always the default, and now is. My inclination is to change the default to field()
(get everything). This along with removing a "no 'value' field" warning should restore the previous behavior for Kay. Given that this is likely to be seen as contentious by some, I won't take any action until the face to face meeting next week.
Yes, should be discussed.
If I remember correctly, pvget/pvput were designed to be drop-in replacements for caget/caput. For that, a plain pvget
would have to print the value of the 'value' field, not the whole structure, in the same way a plain caget
only prints the value, not the union of all DBR_ structures.
Too bad that we're so horrible at proper development procedures, else one could just look up the specification...
I think this issue would be resolved by #129 which changes the default pvRequest to "field()" (among a great many other changes).
@kasemir
On 08/28/2018 04:06 PM, Kasemir, Kay wrote: