This commit is contained in:
x07maop
2016-03-17 10:14:44 +01:00
parent 87f19f2623
commit 5cec2da7ea
3 changed files with 18 additions and 14 deletions

View File

@@ -8,18 +8,18 @@ energy.setBlockingWrite(True)
#The persistence strategy is overriden to adjust file names
import ch.psi.pshell.data.ScanPersistenceStrategyTable
class Strategy(ch.psi.pshell.data.ScanPersistenceStrategyTable):
import ch.psi.pshell.data.LayoutTable
class DataLayout( ch.psi.pshell.data.LayoutTable):
def getLogFileName(self):
return time.strftime('%Y%m%d%H%M%S') + '_' + controller.getExecutingContext() + '_logs'
return time.strftime('%Y%m%d%H%M%S') + '_' + get_context().name + '_logs'
def getDatasetName(self, scan):
global FILENAME, data_file
name = controller.getExecutingContext() if FILENAME is None else FILENAME
data_file = time.strftime('%Y%m%d_%H%M') + '_' + name + '_' + str(controller.dataManager.getScanIndex()).zfill(4)
name = get_context().name if FILENAME is None else FILENAME
data_file = time.strftime('%Y%m%d_%H%M') + '_' + name + '_' + str(get_context().index).zfill(4)
print "Opened data file: " + str(controller.dataManager.output) + "/" + data_file
return data_file
controller.dataManager.setScanStrategy(Strategy())
controller.dataManager.setLayout(DataLayout())
"""