create PV/Image from IOC object

This commit is contained in:
2021-04-06 17:48:43 +02:00
parent 4a87aa3d4d
commit 3add9b35f0
2 changed files with 10 additions and 3 deletions

View File

@ -3,6 +3,7 @@ from datetime import datetime
from threading import Thread
from pcaspy import SimpleServer, Driver
from channels import PV, Image
from context import Context
from pvinfoset import PVInfoSet
from managed import delete_managed
@ -103,4 +104,11 @@ class MorIOC(Context):
return self.driver.getParam(name)
def PV(self, *args, **kwargs):
return PV(self, *args, **kwargs)
def Image(self, *args, **kwargs):
return Image(self, *args, **kwargs)

View File

@ -6,14 +6,13 @@ from numpy.random import normal
import numpy as np
from morioc import MorIOC
from channels import PV, Image
if __name__ == "__main__":
with MorIOC("mtest") as mor:
ch_pv = PV(mor, "chan-PV")
ch_img = Image(mor, "chan-Image")
ch_pv = mor.PV("chan-PV")
ch_img = mor.Image("chan-Image")
for i in range(1000):