system.recipe.getDefaultValues
Sepasoft MES Module Suite
Description
Return values for a sub recipe based on a product code or default values for a production item.
Syntax
system.recipe.getDefaultValues(itemPath, category, subProductCode)
String itemPath - The item path to a production line, cell, cell group or location.
String category - Category of recipe values to return. Where 1 is recipe values created by the recipe module, 2 is recipe values created by the OEE module and 3 is recipe values created by the SPC module. Use blank to include all categories.
String subProductCode - Sub product code to return values for, or else leave blank to read the default values for the production item.
A list of Item Recipe Value objects.
All
Code Examples
Code Snippet
|
#-- getDefaultValues
#-- function system.recipe.getDefaultValues(itemPath, category, subProductCode)
# (str) (str) (str)
#-- SCRIPT CONSOLE CODE ---------------------------------------------------------------------------------------
#itemPath = 'Enterprise\Site 2\Packaging\packagingLine1\Filler' #change this to your path
#category = str('1')
#subProductCode = ''
#dv = system.recipe.getDefaultValues(itemPath, category, subProductCode)
#if dv.size() > 0:
# for value in dv:
# print '%s = %s' %(value.getName(), value)
#else:
# print 'No values created by the OEE module were Found'
#--------------------------------------------------------------------------------------------------------------
#-- WINDOW CODE -----------------------------------------------------------------------------------------------
#Put the following script in getDefaultValues button's actionPerformed event handler
linePath = event.source.parent.getComponent('mesosLine').equipmentItemPath
cell = event.source.parent.getComponent('mesosCell').selectedName
itemPath = linePath + '\\' + cell
# the category selects from items created in various modules: 1=Recipe, 2=OEE, 3=SPC and ''=All
if event.source.parent.getComponent('cntSelections').getComponent('rbAll').selected:
category = str('')
cat = 'All'
elif event.source.parent.getComponent('cntSelections').getComponent('rbRecipe').selected:
category = str('1')
cat = 'Recipe'
elif event.source.parent.getComponent('cntSelections').getComponent('rbSPC').selected:
category = str('2')
cat = 'SPC'
elif event.source.parent.getComponent('cntSelections').getComponent('rbOEE').selected:
category = str('3')
cat = 'OEE'
# subProductCode # leave blank to get values for the default production item
if event.source.parent.getComponent('cntUseProductCode').getComponent('rbUseProdCodeYes').selected:
subProductCode = event.source.parent.getComponent('Product Code Selector').selectedStringValue
else:
subProductCode = ''
event.source.parent.getComponent('taData').text = ''
event.source.parent.getComponent('taData').text += '
' + 'Choices:'
event.source.parent.getComponent('taData').text += '
' + 'Item Path = %s' %(itemPath)
event.source.parent.getComponent('taData').text += '
' + 'Cell = %s' %(cell)
event.source.parent.getComponent('taData').text += '
' + 'Category = %s' %(cat)
event.source.parent.getComponent('taData').text += '
' + 'Values:'
dv = system.recipe.getDefaultValues(itemPath, category, subProductCode)
# dv returns an ArrayList - this list contains Item Recipe Value objects
if dv.size() > 0:
for value in dv:
event.source.parent.getComponent('taData').text += '
' + ' %s = %s' %(value.getName(), value)
print '%s = %s' %(value.getName(), value)
else:
event.source.parent.getComponent('taData').text += '
' + 'No values created by the ' + cat + ' module were Found'
#--------------------------------------------------------------------------------------------------------------
|
Output
|
Line Speed(1) = 120
IBC Vanilla Percentage = 2.8
Max Temperature = 92
Min Temperature = 85.3
IBC Sugar Percentage = 17.5
Line Speed = 110
|
Sepasoft MES Module Suite