template: write random val to pv
This commit is contained in:
+5
-4
@@ -1,4 +1,4 @@
|
||||
from time import sleep
|
||||
import time
|
||||
|
||||
import typer
|
||||
from agebd.enums import LogLevel
|
||||
@@ -68,7 +68,7 @@ class Service(BaseService[PVs]):
|
||||
#######################################################################################
|
||||
# here goes all the code that your service
|
||||
# is supposed to be running when the callback is fired
|
||||
sleep(1)
|
||||
time.sleep(1)
|
||||
#######################################################################################
|
||||
#######################################################################################
|
||||
|
||||
@@ -81,7 +81,8 @@ class Service(BaseService[PVs]):
|
||||
# is supposed to be running in any case, e.g.,
|
||||
|
||||
# update some pvs/vals
|
||||
# self.pvs.my_pv1.put("MY_PV1 value")
|
||||
my_pv1_random_val = str(time.clock_gettime_ns(0))[-1]
|
||||
self.pvs.my_pv1.put(my_pv1_random_val)
|
||||
# self.pvs.my_pv2.put("MY_PV2 value")
|
||||
|
||||
# get some pvs/vals
|
||||
@@ -89,7 +90,7 @@ class Service(BaseService[PVs]):
|
||||
self.val2 = self.pvs.my_pv2.get()
|
||||
|
||||
# maybe sleep to limit the update loop execution rate
|
||||
sleep(1)
|
||||
time.sleep(1)
|
||||
#######################################################################################
|
||||
#######################################################################################
|
||||
|
||||
|
||||
Reference in New Issue
Block a user