Skip to content
This repository has been archived by the owner on Apr 7, 2022. It is now read-only.

Support pogo's *mandatory property* feature in PyTango and PyTango pogo plugin #30

Closed
tiagocoutinho opened this issue Jul 29, 2016 · 7 comments
Labels
Milestone

Comments

@tiagocoutinho
Copy link
Contributor

Pogo has a new feature for each property called mandatory property.
If set, it generates code that puts the device is some state if the property is not set in the database.

PyTango and the pogo plugin for PyTango don't support this feature yet. It would be nice to have it.

Thanks to Jens Meyer for reporting this.

@tiagocoutinho
Copy link
Contributor Author

I propose to had a new keyword argument to device_property(mandatory=False) that will trigger the same behavior in PyTango.

For old style PyTango servers, I propose:
device_property_list = { '<prop_name>': [<type>, <desc>, <default>[, <mandatory>]]

Pogo plugins for PyTango (both old and new) need to be modified to support this as well

@NexeyaSGara
Copy link
Contributor

I can add this to the templates, once we are sure of the syntaxe.

@NexeyaSGara
Copy link
Contributor

NexeyaSGara commented Aug 12, 2016

Since there is no comment on the syntaxe, I will use what you proposed for PyTango HL.

For normal PyTango, are you sure for the syntaxe ?

I was thinking more
device_property_list = { '<prop_name>': [, , [], ]
instead of
device_property_list = { '<prop_name>': [, , [, ]]

@tiagocoutinho
Copy link
Contributor Author

I am not sure I understand what you mean. My apologies because I mixed BNF with python syntax in the example for old style PyTango servers. Here is a more clear explanation:

# last field represents mandatory. If omitted is False by default
device_property_list = { <prop_name>: [<type>, <desc>, <default>, <mandatory>] } 

Is this what you had in mind?

@NexeyaSGara
Copy link
Contributor

Exactly :)

I will imlement it for the next Pogo version

@NexeyaSGara
Copy link
Contributor

Here is an example :

'Test':
[PyTango.DevString,
"Desc Test",
mandatory=True,
[] ],

@tiagocoutinho tiagocoutinho modified the milestone: 9.2.1 Aug 18, 2016
@vxgmichel vxgmichel modified the milestones: 9.2.1, 9.2.2 Jan 17, 2017
vxgmichel pushed a commit that referenced this issue Jun 19, 2017
* initial implementation
* Add __init__ to device_property
* Changes after review
* mandatory property test case
* temporarily withdraw test
@vxgmichel
Copy link
Contributor

Done, thanks everyone!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants