-
Notifications
You must be signed in to change notification settings - Fork 5
Tweaks #28
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
Tweaks #28
Conversation
1 similar comment
The data may come from the model and not a pv.
ControlSystem objects still use the name put_value.
Add test to check that the correct behaviour is happening.
1 similar comment
| field = 'b2'; | ||
| elseif strcmp(type, 'VSTR') | ||
| field = 'a0'; | ||
| else |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be more robust to check the type here as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. This was a shortcut because everything left was either a bending magnet or a horizontal steerer.
| # each one has both a0 (VSTR) and b0 (HSTR) as fields | ||
| assert set(('a0', 'b0')).issubset(element.get_fields()) | ||
|
|
||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think in some transfer lines or the injectors there are steerers in a single plane.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This module is designed to check specifically the loading of the VMX lattice, as opposed to something more generic. It's pretty useful for testing that everything is as it should be for Diamond, but it's generally OK because I think bundling the data for a machine is useful for anyone else using this. We could make this a bit clearer in the module name and comments.
|
|
||
| def get_pv_value(self, field, handle, unit=pytac.ENG, sim=False): | ||
| def get_value(self, field, handle, unit=pytac.ENG, sim=False): | ||
| """Get the value of a pv. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should pv be removed from the comment as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point.
| try: | ||
| return self._devices[field].get_pv_name(handle) | ||
| except KeyError: | ||
| raise PvException('Element has no device for field {}'.format(field)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this exception be renamed to something more generic, CsException perhaps?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea.
@mfurseman we should get you reviewing pytac code.
It should also be moved to dls-controls as well, I suppose.
Any comments?