Commit 99825391 authored by Manuela Kuhn's avatar Manuela Kuhn
Browse files

Added check for necessary variables in TangoServer

parent 9d592c4d
......@@ -198,67 +198,67 @@ class ZmqDT():
# see, if all required params are there.
#
# if (self.detectorDevice
# and self.filewriterDevice
# # TODO replace TangoDevices with the following
# #and self.eigerIp
# and self.historySize
# and self.localTarget
# and self.storeData
# and self.removeData
# and self.whitelist ):
#
# execute the start action ...
#
# write configfile
# /etc/zeromq-data-transfer/P01.conf
configFile = "/space/projects/zeromq-data-transfer/conf/" + self.beamline + ".conf"
with open(configFile, 'w') as f:
f.write("logfilePath = /space/projects/zeromq-data-transfer/logs" + "\n")
f.write("logfileName = dataManager.log" + "\n")
f.write("logfileSize = 10485760" + "\n")
f.write("procname = zeromq-data-transfer" + "\n")
f.write("comPort = 50000" + "\n")
f.write("requestPort = 50001" + "\n")
# f.write("eventDetectorType = HttpDetector" + "\n")
f.write("eventDetectorType = InotifyxDetector" + "\n")
f.write("fixSubdirs = ['commissioning', 'current', 'local']" + "\n")
f.write("monitoredDir = /space/projects/zeromq-data-transfer/data/source" + "\n")
f.write("monitoredEventType = IN_CLOSE_WRITE" + "\n")
f.write("monitoredFormats = ['.tif', '.cbf']" + "\n")
f.write("useCleanUp = False" + "\n")
f.write("actionTime = 150" + "\n")
f.write("timeTillClosed = 2" + "\n")
# f.write("dataFetcherType = getFromHttp" + "\n")
f.write("dataFetcherType = getFromFile" + "\n")
f.write("chunkSize = 10485760" + "\n")
f.write("detectorDevice = " + str(self.detectorDevice) + "\n")
f.write("filewriterDevice = " + str(self.filewriterDevice) + "\n")
if (self.detectorDevice
and self.filewriterDevice
# TODO replace TangoDevices with the following
#f.write("eigerIp = " + str(self.eigerIp) + "\n")
f.write("historySize = " + str(self.historySize) + "\n")
f.write("localTarget = " + str(self.localTarget) + "\n")
f.write("storeData = " + str(self.storeData) + "\n")
f.write("removeData = " + str(self.removeData) + "\n")
f.write("whitelist = " + str(self.whitelist) + "\n")
# start service
#systemctl start zeromq-data-transfer@P01.service
#and self.eigerIp
and self.historySize
and self.localTarget
and self.storeData
and self.removeData
and self.whitelist ):
#
# execute the start action ...
#
# write configfile
# /etc/zeromq-data-transfer/P01.conf
configFile = "/space/projects/zeromq-data-transfer/conf/" + self.beamline + ".conf"
with open(configFile, 'w') as f:
f.write("logfilePath = /space/projects/zeromq-data-transfer/logs" + "\n")
f.write("logfileName = dataManager.log" + "\n")
f.write("logfileSize = 10485760" + "\n")
f.write("procname = zeromq-data-transfer" + "\n")
f.write("comPort = 50000" + "\n")
f.write("requestPort = 50001" + "\n")
# f.write("eventDetectorType = HttpDetector" + "\n")
f.write("eventDetectorType = InotifyxDetector" + "\n")
f.write("fixSubdirs = ['commissioning', 'current', 'local']" + "\n")
f.write("monitoredDir = /space/projects/zeromq-data-transfer/data/source" + "\n")
f.write("monitoredEventType = IN_CLOSE_WRITE" + "\n")
f.write("monitoredFormats = ['.tif', '.cbf']" + "\n")
f.write("useCleanUp = False" + "\n")
f.write("actionTime = 150" + "\n")
f.write("timeTillClosed = 2" + "\n")
# f.write("dataFetcherType = getFromHttp" + "\n")
f.write("dataFetcherType = getFromFile" + "\n")
f.write("chunkSize = 10485760" + "\n")
f.write("detectorDevice = " + str(self.detectorDevice) + "\n")
f.write("filewriterDevice = " + str(self.filewriterDevice) + "\n")
# TODO replace TangoDevices with the following
#f.write("eigerIp = " + str(self.eigerIp) + "\n")
f.write("historySize = " + str(self.historySize) + "\n")
f.write("localTarget = " + str(self.localTarget) + "\n")
f.write("storeData = " + str(self.storeData) + "\n")
f.write("removeData = " + str(self.removeData) + "\n")
f.write("whitelist = " + str(self.whitelist) + "\n")
# start service
#systemctl start zeromq-data-transfer@P01.service
# python src/sender/DataManager.py --verbose --procname self.procname --detectorDevice self.detectorDevice --filewriterDevice self.filewriterDevice --historySize self.historySize --localTarget self.localTarget --storeData self.storeData --removeData self.removeData --whitelist self.whitelist
return "DONE"
return "DONE"
# else:
# print "if failed"
# return "ERROR"
else:
print "if failed"
return "ERROR"
def stop (self):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment