Live Analysis | Copy Live Analysis Settings

Copy Live-Analysis Settings between Equipment

You want to copy Live Analysis Settings between Equipment w/o using the UI Copy/Paste option

This Script will help you achieve this in the Script Console:

Python
srcPath = 'Enterprise\Recipe Site\Mixing Area\Mixing Line'
dstPaths = ['Enterprise\Recipe Site\Mixing Area\Mixing Line 2']
srcLAs = ['New Analysis']
srcObj = system.mes.loadMESObjectByEquipmentPath(srcPath)
for dstPath in dstPaths:
	dstObj = system.mes.loadMESObjectByEquipmentPath(dstPath)
	for srcLA in srcLAs:
		srcProp = srcObj.getComplexProperty('LiveAnalysis', srcLA)
		dstProp = dstObj.getComplexProperty('LiveAnalysis', srcLA)
		if dstProp is None:
			dstProp = dstObj.createComplexProperty('LiveAnalysis', srcLA)
		dstProp.setLiveAnalysisPeriod(srcProp.getLiveAnalysisPeriod())
		dstProp.setLiveAnalysisCustomPeriodTag(srcProp.getLiveAnalysisCustomPeriodTag())
		dstProp.setLiveAnalysisUpdateRate(srcProp.getLiveAnalysisUpdateRate())
		dstProp.setDataPoints(srcProp.getDataPoints())
		dstProp.setFilterExpression(srcProp.getFilterExpression())
		dstProp.setAnalysisSettings(srcProp.getAnalysisSettings())
		dstProp.setActive(srcProp.isActive())
		print dstProp
	dstObj.save()