-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #84 from jacquelinegarrahan/structure-pvs
Introduce structured pvs and summary variable
- Loading branch information
Showing
12 changed files
with
556 additions
and
94 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
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
input_variables: | ||
input1: | ||
pvname: test:input1 | ||
protocol: ca | ||
|
||
input2: | ||
pvname: test:input2 | ||
protocol: pva | ||
|
||
output_variables: | ||
output_summary: | ||
pvname: test:output_summary | ||
protocol: pva | ||
fields: | ||
- output1 | ||
- output2 | ||
- output3 |
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
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,16 +1,15 @@ | ||
|
||
from lume_epics.epics_server import Server | ||
from lume_model.utils import model_from_yaml | ||
from lume_epics.utils import config_from_yaml | ||
|
||
if __name__ == "__main__": | ||
with open("examples/files/iris_config.yml", "r") as f: | ||
model_class, model_kwargs = model_from_yaml(f, load_model=False) | ||
|
||
with open("examples/files/iris_config.yml", "r") as f: | ||
model_class, model_kwargs = model_from_yaml(f, load_model=False) | ||
with open("examples/files/iris_epics_config.yml", "r") as f: | ||
epics_config = config_from_yaml(f) | ||
|
||
prefix = "test" | ||
server = Server( | ||
model_class, | ||
prefix, | ||
model_kwargs=model_kwargs | ||
) | ||
server = Server(model_class, epics_config, model_kwargs=model_kwargs) | ||
|
||
# monitor = False does not loop in main thread | ||
server.start(monitor=True) | ||
# monitor = False does not loop in main thread | ||
server.start(monitor=True) |
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from lume_epics.epics_server import Server | ||
from lume_model.utils import variables_from_yaml | ||
from lume_epics.utils import config_from_yaml | ||
import os | ||
from examples.model import DemoModel | ||
|
||
import logging | ||
|
||
|
||
if __name__ == "__main__": | ||
with open("examples/files/demo_config.yml", "r") as f: | ||
input_variables, output_variables = variables_from_yaml(f) | ||
|
||
with open("examples/files/epics_config_struct.yml", "r") as f: | ||
epics_config_struct = config_from_yaml(f) | ||
|
||
server = Server( | ||
DemoModel, | ||
epics_config_struct, | ||
model_kwargs={ | ||
"input_variables": input_variables, | ||
"output_variables": output_variables, | ||
}, | ||
) | ||
# monitor = False does not loop in main thread | ||
server.start(monitor=True) |
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
Oops, something went wrong.