system.mes.oee.updateMaterialOperationSegments
Sepasoft MES Module Suite
Description
Update the operations MES objects for the specified material and equipment.
|
If the material-equipment combination doesn't exist, an exception is thrown.
|
Syntax
system.mes.oee.updateMaterialOperationSegments(materialLink, equipmentPath, operationSegmentList)
MESObjectLink materialLink - The MES object link to the material definition that the operations MES objects are based on.
String equipmentPath - The equipment path that the operations MES objects are based on.
MESObjectList operationSegmentList - A MESObjectList that contain an Operations Definition, an Operations Segment for the changeover and an Operations Segment for the production.
Nothing
All
Code Examples
Code Snippet
|
path = "DPSG\Northlake\Packaging\Line 5"
matRoot = system.mes.getMESObjectLinkByName('MaterialClass', 'Test Material')
print matRoot
matLink = system.mes.oee.getMaterialItems(matRoot, 'PC_0001').get(0)
print matLink
##Get Operations Def
obj1 = system.mes.loadMESObject('PC_0001-DPSG:Northlake:Packaging:Line 5', 'OperationsDefinition')
##Get Operations Segment for Changeover
obj2 = system.mes.loadMESObject('PC_0001-DPSG:Northlake:Packaging:Line 5_CO', 'OperationsSegment')
##Get Operations Segment for Production
obj3 = system.mes.loadMESObject('PC_0001-DPSG:Northlake:Packaging:Line 5', 'OperationsSegment')
productionSettings = obj3.getComplexProperty('ProductionSettings', 0)
##Response Segment Production Settings Complex Property Set Functions:
# productionSettings.setEquipmentRefUUID(String equipmentRefUUID)
# productionSettings.setEquipmentRefType(String equipmentRefType)
# productionSettings.setEquipmentRef(MESObjectLink mesObjectLink)
# productionSettings.setModeRefUUID(String modeRefUUID)
# productionSettings.setModeRefType(String modeRefType)
# productionSettings.setModeRef(MESObjectLink mesObjectLink)
##Use the OEE rate for the line as an example property to set:
productionSettings.setOEERate(25.0)
obj3.setPropertyValue('ProductionSettings', productionSettings)
system.mes.saveMESObject(obj3)
##Create, populate, and save the list
objList = system.mes.object.list.createList()
objList.add(obj1)
objList.add(obj2)
objList.add(obj3)
system.mes.saveMESObjects(objList)
##Update the Operations Segments
system.mes.oee.updateMaterialOperationSegments(matLink, path, objList)
|
Output
|
Test Material
Size 3
True
True
True
True
|
Sepasoft MES Module Suite