How to read a multiline device property?
|
|
---|---|
In a device server, I'm using device properties as described in the docs: The problem is that if the property is a multiline string (i.e. there are multiple strings separated by newlines), the above code only retrieves the first line. Is there a way to read the entire value content of a property, not just the first line?Thanks! |
|
|
---|---|
Hi Dušan, It's usually done this way:
Cheers, |
|
|
---|---|
Vincent, thank you! Your solution works. Note, however, that for some reason, using dtype=(str,) or [str] results in the following error message at device server startup:PyDS: DeviceServer: An error occured in the constructor:The device server then proceeds to work and run normally, but the array dtype is still causing this error message - I'm not sure why, but it happens even with an empty device server code as soon as you use a (str,) property … |
|
|
---|---|
|
Hi Dušan, I guess you edited the property value with Jive, right? The problem is that Jive is not able to distinguish a string of multiple lines from a list of strings . Picking up from your first example:
… and if you use PyTango to write the property value like this:
You should see on the server output that the string is correct. |
|
|
---|---|
Tiago, thank you for your proposal and for pointing this out. You are right in that I was using Jive to edit the property. I don't think that I'll be able to rely on DeviceProxy for value setting, though, because the end user may use Jive as well. Anyway, I figured out how to get rid of the "'NoneType' object is not iterable" error mentioned above. You must assign a default value to your property: After this, multiline properties work normally with no erroneous output.
|