-
Notifications
You must be signed in to change notification settings - Fork 6
Add table support in pva and fix gui pv naming #167
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
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
4643567
Apply snake to pascal to attr path
shihab-dls aad9206
Add Table support for pva
shihab-dls 8820b6e
Use PvaEpicsGui for pva epics adapter gui
shihab-dls 4225e27
Simplify PvaEpicsGui
shihab-dls 6f8a37e
Add tests for pva tables and prefix
shihab-dls a100fc3
Get widgets from Table column datatypes
shihab-dls e3be5e1
Amend EpicGui tests to pass datatype
shihab-dls 2f75e39
Add test for np to fastcs dtype conversion
shihab-dls abae72d
Add docstring to util function
shihab-dls 839c39d
Amend get_pv variable name from attr to node
shihab-dls 074eb5d
Replace row ToggleButton with Checkbox widget
shihab-dls 0509505
Fix typo and test for table row widgets
shihab-dls a37abf2
Implement review changes
shihab-dls File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| import numpy as np | ||
| from pvi.device import ( | ||
| LED, | ||
| CheckBox, | ||
| SignalR, | ||
| SignalW, | ||
| TableRead, | ||
| TableWrite, | ||
| TextFormat, | ||
| TextRead, | ||
| TextWrite, | ||
| ) | ||
|
|
||
| from fastcs.attributes import AttrR, AttrW | ||
| from fastcs.datatypes import Table | ||
| from fastcs.transport.epics.gui import PvaEpicsGUI | ||
|
|
||
|
|
||
| def test_get_pv_in_pva(controller_api): | ||
| gui = PvaEpicsGUI(controller_api, "DEVICE") | ||
|
|
||
| assert gui._get_pv([], "A") == "pva://DEVICE:A" | ||
| assert gui._get_pv(["B"], "C") == "pva://DEVICE:B:C" | ||
| assert gui._get_pv(["D", "E"], "F") == "pva://DEVICE:D:E:F" | ||
|
|
||
|
|
||
| def test_get_attribute_component_table_write(controller_api): | ||
| gui = PvaEpicsGUI(controller_api, "DEVICE") | ||
|
|
||
| attribute_component = gui._get_attribute_component( | ||
| [], | ||
| "Table", | ||
| AttrW( | ||
| Table( | ||
| structured_dtype=[ | ||
| ("FIELD1", np.uint32), | ||
| ("FIELD2", np.bool), | ||
| ("FIELD3", np.dtype("S1000")), | ||
| ] | ||
| ) | ||
| ), | ||
| ) | ||
|
|
||
| assert isinstance(attribute_component, SignalW) | ||
| assert isinstance(attribute_component.write_widget, TableWrite) | ||
| assert attribute_component.write_widget.widgets == [ | ||
| TextWrite(), | ||
| CheckBox(), | ||
| TextWrite(format=TextFormat.string), | ||
| ] | ||
|
|
||
|
|
||
| def test_get_attribute_component_table_read(controller_api): | ||
| gui = PvaEpicsGUI(controller_api, "DEVICE") | ||
|
|
||
| attribute_component = gui._get_attribute_component( | ||
| [], | ||
| "Table", | ||
| AttrR( | ||
| Table( | ||
| structured_dtype=[ | ||
| ("FIELD1", np.uint32), | ||
| ("FIELD2", np.bool), | ||
| ("FIELD3", np.dtype("S1000")), | ||
| ] | ||
| ) | ||
| ), | ||
| ) | ||
|
|
||
| assert isinstance(attribute_component, SignalR) | ||
| assert isinstance(attribute_component.read_widget, TableRead) | ||
| assert attribute_component.read_widget.widgets == [ | ||
| TextRead(), | ||
| LED(), | ||
| TextRead(format=TextFormat.string), | ||
| ] |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.