system.kanoa.tooling.getRequiredTooling(paramsDict)
The tools items need on machines that use tooling (mes.itemAssetTooling): a specific tool, or any tool of a tooling type, for an item on one machine or on any machine. Given an assetId, the machine's own requirements and the ones for any machine. Set them up on the Required Tooling tab of Configuration > Ops > Materials; see Required Tooling.
Parameters
paramsDict Dictionary: Keys, all optional
| - itemId | Integer | |
| - assetId | Integer | The machine: its own requirements and the ones for any machine |
| - toolingAssetId | Integer | |
| - enabled | Boolean |
Returns
requiredTooling Dataset: itemAssetToolingId, itemId, itemName, assetId, assetName, assetPath, toolingAssetId, toolingName, toolingPath, toolingAssetTypeId, toolingTypeName, required, sortOrder, enabled, makesItem
makesItem says whether a required tool can make the item: True when one of the tool's output positions (not retired) is set to the item or to no item, False when they are all set to other items, None for a tooling type or a tool with no output positions.
Example
paramsDict = {'itemId': 1, 'assetId': 1, 'enabled': True}
requiredTooling = system.kanoa.tooling.getRequiredTooling(paramsDict)
for row in system.kanoa.utilities.convertDatasetToJSON(requiredTooling):
if row['makesItem'] is False:
print "%s can't make %s" % (row['toolingName'], row['itemName'])