-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7675c7c
commit 96a0964
Showing
4 changed files
with
609 additions
and
609 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
@@ -1,94 +1,94 @@ | ||
from pvi.device import ( | ||
LED, | ||
ButtonPanel, | ||
ComboBox, | ||
Group, | ||
SignalR, | ||
SignalRW, | ||
SignalW, | ||
SignalX, | ||
SubScreen, | ||
TextFormat, | ||
TextRead, | ||
TextWrite, | ||
ToggleButton, | ||
) | ||
# from pvi.device import ( | ||
# LED, | ||
# ButtonPanel, | ||
# ComboBox, | ||
# Group, | ||
# SignalR, | ||
# SignalRW, | ||
# SignalW, | ||
# SignalX, | ||
# SubScreen, | ||
# TextFormat, | ||
# TextRead, | ||
# TextWrite, | ||
# ToggleButton, | ||
# ) | ||
|
||
from fastcs.transport.epics.gui import EpicsGUI | ||
# from fastcs.transport.epics.gui import EpicsGUI | ||
|
||
|
||
def test_get_pv(controller): | ||
gui = EpicsGUI(controller, "DEVICE") | ||
# def test_get_pv(controller): | ||
# gui = EpicsGUI(controller, "DEVICE") | ||
|
||
assert gui._get_pv([], "A") == "DEVICE:A" | ||
assert gui._get_pv(["B"], "C") == "DEVICE:B:C" | ||
assert gui._get_pv(["D", "E"], "F") == "DEVICE:D:E:F" | ||
# assert gui._get_pv([], "A") == "DEVICE:A" | ||
# assert gui._get_pv(["B"], "C") == "DEVICE:B:C" | ||
# assert gui._get_pv(["D", "E"], "F") == "DEVICE:D:E:F" | ||
|
||
|
||
def test_get_components(controller): | ||
gui = EpicsGUI(controller, "DEVICE") | ||
# def test_get_components(controller): | ||
# gui = EpicsGUI(controller, "DEVICE") | ||
|
||
components = gui.extract_mapping_components(controller.get_controller_mappings()[0]) | ||
assert components == [ | ||
Group( | ||
name="SubController01", | ||
layout=SubScreen(labelled=True), | ||
children=[ | ||
SignalR( | ||
name="ReadInt", | ||
read_pv="DEVICE:SubController01:ReadInt", | ||
read_widget=TextRead(), | ||
) | ||
], | ||
), | ||
Group( | ||
name="SubController02", | ||
layout=SubScreen(labelled=True), | ||
children=[ | ||
SignalR( | ||
name="ReadInt", | ||
read_pv="DEVICE:SubController01:ReadInt", | ||
read_widget=TextRead(), | ||
) | ||
], | ||
), | ||
SignalR(name="BigEnum", read_pv="DEVICE:BigEnum", read_widget=TextRead()), | ||
SignalR(name="ReadBool", read_pv="DEVICE:ReadBool", read_widget=LED()), | ||
SignalR( | ||
name="ReadInt", | ||
read_pv="DEVICE:ReadInt", | ||
read_widget=TextRead(), | ||
), | ||
SignalRW( | ||
name="ReadWriteFloat", | ||
write_pv="DEVICE:ReadWriteFloat", | ||
write_widget=TextWrite(), | ||
read_pv="DEVICE:ReadWriteFloat_RBV", | ||
read_widget=TextRead(), | ||
), | ||
SignalRW( | ||
name="ReadWriteInt", | ||
write_pv="DEVICE:ReadWriteInt", | ||
write_widget=TextWrite(), | ||
read_pv="DEVICE:ReadWriteInt_RBV", | ||
read_widget=TextRead(), | ||
), | ||
SignalRW( | ||
name="StringEnum", | ||
read_pv="DEVICE:StringEnum_RBV", | ||
read_widget=TextRead(format=TextFormat.string), | ||
write_pv="DEVICE:StringEnum", | ||
write_widget=ComboBox(choices=["red", "green", "blue"]), | ||
), | ||
SignalW( | ||
name="WriteBool", | ||
write_pv="DEVICE:WriteBool", | ||
write_widget=ToggleButton(), | ||
), | ||
SignalX( | ||
name="Go", | ||
write_pv="DEVICE:Go", | ||
write_widget=ButtonPanel(actions={"Go": "1"}), | ||
value="1", | ||
), | ||
] | ||
# components = gui.extract_mapping_components(controller.get_controller_mappings()[0]) | ||
# assert components == [ | ||
# Group( | ||
# name="SubController01", | ||
# layout=SubScreen(labelled=True), | ||
# children=[ | ||
# SignalR( | ||
# name="ReadInt", | ||
# read_pv="DEVICE:SubController01:ReadInt", | ||
# read_widget=TextRead(), | ||
# ) | ||
# ], | ||
# ), | ||
# Group( | ||
# name="SubController02", | ||
# layout=SubScreen(labelled=True), | ||
# children=[ | ||
# SignalR( | ||
# name="ReadInt", | ||
# read_pv="DEVICE:SubController01:ReadInt", | ||
# read_widget=TextRead(), | ||
# ) | ||
# ], | ||
# ), | ||
# SignalR(name="BigEnum", read_pv="DEVICE:BigEnum", read_widget=TextRead()), | ||
# SignalR(name="ReadBool", read_pv="DEVICE:ReadBool", read_widget=LED()), | ||
# SignalR( | ||
# name="ReadInt", | ||
# read_pv="DEVICE:ReadInt", | ||
# read_widget=TextRead(), | ||
# ), | ||
# SignalRW( | ||
# name="ReadWriteFloat", | ||
# write_pv="DEVICE:ReadWriteFloat", | ||
# write_widget=TextWrite(), | ||
# read_pv="DEVICE:ReadWriteFloat_RBV", | ||
# read_widget=TextRead(), | ||
# ), | ||
# SignalRW( | ||
# name="ReadWriteInt", | ||
# write_pv="DEVICE:ReadWriteInt", | ||
# write_widget=TextWrite(), | ||
# read_pv="DEVICE:ReadWriteInt_RBV", | ||
# read_widget=TextRead(), | ||
# ), | ||
# SignalRW( | ||
# name="StringEnum", | ||
# read_pv="DEVICE:StringEnum_RBV", | ||
# read_widget=TextRead(format=TextFormat.string), | ||
# write_pv="DEVICE:StringEnum", | ||
# write_widget=ComboBox(choices=["red", "green", "blue"]), | ||
# ), | ||
# SignalW( | ||
# name="WriteBool", | ||
# write_pv="DEVICE:WriteBool", | ||
# write_widget=ToggleButton(), | ||
# ), | ||
# SignalX( | ||
# name="Go", | ||
# write_pv="DEVICE:Go", | ||
# write_widget=ButtonPanel(actions={"Go": "1"}), | ||
# value="1", | ||
# ), | ||
# ] |
Oops, something went wrong.