system.mes.spc.definition.addAttribute(sampleDefinition, attributeName, [dataType], [format], [measurementCount], [defaultChart], [defaultValue], [min], [max], [units])

Sepasoft MES Module Suite

system.mes.spc.definition.addAttribute(sampleDefinition, attributeName, [dataType], [format], [measurementCount], [defaultChart], [defaultValue], [min], [max], [units])

Adds an attribute to a sample definition object. This function accepts keyword arguments.

Syntax

system.mes.spc.definition.addAttribute(sampleDefinition, attributeName, [dataType], [format], [measurementCount], [defaultChart], [defaultValue], [min], [max], [units])

  • Parameters

MESSampleDefinition sampleDefinition - The sample definition object that is being modified.

String attributeName - The name of the new attribute.

String dataType - Optional Argument. Defaults to 'REAL'. Options are ['REAL', 'INTEGER', 'BOOLEAN', 'INSPECTED_COUNT', 'NONCONFORMING_COUNT', 'NONCONFORMITY_COUNT']

String format - Optional Argument. The format string for how to display this attribute.

Integer measurementCount - Optional Argument. Defaults to 1. The number of measurements for this attribute.

String defaultChart - Optional Argument. The default chart of this attribute.

Object defaultValue - Optional Argument. The default value when a new sample is created.

Double min - Optional Argument. The minimum value that can be entered.

Double max - Optional Argument. The maximum value that can be entered.

String units - Optional Argument. The type of units.

  • Returns

MESSampleAttributeProperty - The new MESSampleAttributeProperty object.

  • Scope

All

Python
attributeName = 'viscosity'
sampleDefinition = system.mes.spc.definition.getSampleDefinition('Test')

attObj = system.mes.spc.definition.addAttribute(sampleDefinition, attributeName, dataType='REAL', format='#.##',measurementCount=2, defaultValue=2.0, min=0.5, max=15.0)
print attObj

#need to save the sample definition to apply
sampleDefinition.save()
>>> 
{AttributeDataType=REAL, Format=#.##, Description=, Order=0, Required=false, SampleDefaultChart=NONE, SampleDefaultValue=null, SampleDefaultWeight=1.0, SampleMaxValue=15.0, SampleMinValue=0.5, SampleSize=2, SampleSource=MANUAL, SampleUnits=, TagPath=}
>>> 




Sepasoft MES Module Suite