diff --git a/README.md b/README.md index 1622bf3..9dc06d8 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ A manager/runner of scripts: A trivially easy to use softIOC: -- Uses `pcaspy` (in a slightly unintended way). +- Uses [`pcaspy`](https://github.com/paulscherrerinstitute/pcaspy/) (in a slightly unintended way). - `serve` (output) PVs and `host` (input) PVs: ```python @@ -40,4 +40,24 @@ with MorIOC("mtest") as mor: ``` - PV's data type is inferred from the value. -- Currently supports Python scalars (int, float, str), sequences (lists, tuples, etc.) as well as numpy arrays and scalars. \ No newline at end of file +- Currently supports Python scalars (int, float, str), sequences (lists, tuples, etc.) as well as numpy arrays and scalars. + +- Alternatively, an object-oriented interface exists: + +```python +with MorIOC("mtest") as mor: + pvo = mor.PV("chan-PV-out") # creates MTEST:CHAN-PV-OUT + pvi = mor.PV("chan-PV-in") # creates MTEST:CHAN-PV-IN + img = mor.Image("chan-Image") + # creates MTEST:CHAN-IMAGE:FPICTURE, :WIDTH, :HEIGHT + + while True: + val = random() + pvo.put(val) + + val = pvi.get() + print(val) + + val = np.random.random(200).reshape(10, 20) + img.put(val) +``` \ No newline at end of file