system.mes.analysis.createCustomValueSource()
Sepasoft MES Module Suite
Description
Create a new custom value-source object. This is an advanced feature not recommended for most users. Most use-cases can be accommodated without custom analysis features.
Syntax
system.mes.spc.analysis.createCustomValueSource()
None
CustomValueSource valueSource - A new custom value-source object of the CustomValueSource class including:
Last Value
Interpolated Value
Time Stamp Match
Gateway
Code Examples
Code Snippet
|
from java.lang import Exception
from org.apache.log4j import Logger
log = Logger.getLogger("CustomAnalysis")
# It creates and registers a custom value-source object.
class CustomValueSource(system.mes.analysis.createCustomValueSource().__class__):
def __init__(self, dataConnectionName):
import system.mes.analysis
system.mes.analysis.createCustomValueSource().__class__.__init__(self, dataConnectionName)
self.setData("interval", 1)
def getGroupName(self):
return "Custom"
def getName(self):
return "Custom Value Source"
def getDescription(self):
return "Custom value source"
def getDataType(self):
from java.lang import Integer
return Integer
def isDataColumn(self):
return True
def isFilter(self):
return True
def isGroupBy(self):
return True
def isOrderBy(self):
return True
def isEquipmentInfoRequired(self):
return False
def setGroupValue(self, finalValueItem, finalRow, finalResults, isNewFinalRow, isFinalRow, lastValuesMode, equipmentValueItem, equipmentRow):
return self.defaultSetGroupValue(finalValueItem, finalRow, finalResults, isNewFinalRow, isFinalRow, lastValuesMode, equipmentValueItem, equipmentRow, self.getName())
def getRequiresGrouping(self):
return True
def getValueMode(self):
import system.mes.spc.analysis
return system.mes.spc.analysis.getValueModeType("LAST_VALUE")
def getDefaultValue(self):
return 0
def isCacheEnabeled(self):
return False
try:
log.info("Register a custom value-source object.")
system.mes.analysis.registerCustomValueSource(CustomValueSource("Custom Data Source"))
except Exception, e:
log.warn(e.getMessage())
|
Sepasoft MES Module Suite