This commit is contained in:
sfop
2016-12-16 08:33:18 +01:00
parent bab567fbfd
commit 4f1850787c
7 changed files with 40 additions and 29 deletions

View File

@@ -131,7 +131,7 @@ def elog(title, message, attachments = [], author = None, category = "Info", dom
Add entry to ELOG.
"""
if author is None:
author = "pshell" #controller.getUser().name
author = "pshell" #context.getUser().name
typ = "pshell"
entry = ""
@@ -156,7 +156,7 @@ def elog(title, message, attachments = [], author = None, category = "Info", dom
raise Exception(err)
print out
def get_plot_snapshots(title = None, file_type = "png", temp_path = controller.setup.getContextPath()):
def get_plot_snapshots(title = None, file_type = "png", temp_path = context.setup.getContextPath()):
"""
Returns list with file names of plots snapshots from a plotting context.
"""
@@ -184,7 +184,7 @@ center_x.setPolling(100)
center_y.setPolling(100)
if not controller.isLocalMode():
if not context.isLocalMode():
try:
run("camtool")
add_device(CamTool("image_stats", prefix = "SINEG01-DSCR190:", latch = True, camera = "SINEG01-DSCR190", gauss = False), True)
@@ -255,13 +255,13 @@ avy = create_averager(comy, 5, 0.001)
#CAS
if controller.isServerEnabled():
if context.isServerEnabled():
import ch.psi.pshell.epics.CAS as CAS
#CAS.setServerPort(5062)
class ServerUrl(ReadonlyRegisterBase):
def doRead(self):
return controller.server.baseURL
return context.server.baseURL
d = ServerUrl()
d.initialize()

View File

@@ -10,14 +10,25 @@ st1 = Stream("st1", dispatcher)
st1.addScalar("scpu", "SINDI01-RLLE-STA:SLAVE1-CPUTIMER", 10, 0)
st1.addScalar("mcpu", "SINDI01-RLLE-STA:MASTER-CPUTIMER", 10, 0)
st1.addWaveform("amp", "SINDI01-RCIR-PUP10:SIG-AMPLT", 10, 0, 2048)
st1.addWaveform("amp", "SINDI01-RCIR-PUP10:SIG-AMPLT", 10, 0)
st1.initialize()
st1.start(True)
#st1.start(True)
class PseudoPositioner(Writable):
def write(self,pos):
print "Step = " + str(pos)
pseudo_motor = PseudoPositioner()
try:
#Dumps to file all pulse IDs
bscan (st1, 10, title="bscan")
tscan (st1.getReadables(), 10,0.1, title="tscan")
#When sampling the stream waits for next value in normal scans/
#tscan (st1.getReadables(), 10,0.1)
#lscan (pseudo_motor, [gsx,] + st1.getReadables(), 0, 10, 10, latency=0.1)
finally:
st1.close()