From 9f17564989071ba61c4f386edccbf9f190b63c9a Mon Sep 17 00:00:00 2001 From: Benjamin Labrecque Date: Thu, 9 Jul 2026 16:47:17 +0200 Subject: [PATCH] template: write random val to pv --- .../src/AGEBD-SERVICE-{{service_name_upper}}.py.jinja | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/templates/service/{{service_name_lower}}/current/app/src/AGEBD-SERVICE-{{service_name_upper}}.py.jinja b/templates/service/{{service_name_lower}}/current/app/src/AGEBD-SERVICE-{{service_name_upper}}.py.jinja index 1fb17ea..9dc4c24 100644 --- a/templates/service/{{service_name_lower}}/current/app/src/AGEBD-SERVICE-{{service_name_upper}}.py.jinja +++ b/templates/service/{{service_name_lower}}/current/app/src/AGEBD-SERVICE-{{service_name_upper}}.py.jinja @@ -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) ####################################################################################### #######################################################################################