The object of the CENPyOlpTech_UpdateOperator class is passed to the PostTechUpdate callback as a parameter.
It can be used to obtain the required operators within the scope of the PostTechUpdate callback in the %TechnologyName%.py script file, located in the folder of the plugin.
[Example]
def PostTechOnAttribChanged(techAttribChangedOperator):
pass
This operator gives the possibility to find attribute of given program component and get their values.
[Example]
program = techUpdateOperator.GetOlpProgram()
componentsList = program.GetChildComponents()
for component in componentsList:
componentType = component.GetType()
parentComponent = component.GetParentComponent()
componentCreatorName = component.GetCreatorName()
if componentType is OLPPROGRAMCOMPONENTTYPE_OPERATIONGROUP:
attribGetter = techUpdateOperator.GetAttribGetter(component)
attribValue = attribGetter.GetInteger('MyIntAttribute')
This operator gives the possibility to change attribute values of given program component.
[Example]
program = techUpdateOperator.GetOlpProgram()
componentsList = program.GetChildComponents()
for component in componentsList:
componentType = component.GetType()
parentComponent = component.GetParentComponent()
componentCreatorName = component.GetCreatorName()
if componentType is OLPPROGRAMCOMPONENTTYPE_OPERATIONGROUP:
attribSetter = techUpdateOperator.GetAttribSetter(component)
attribSetter.SetString('MyStringAttribute', 'This is new string')
This operator gives the possibility to create an attribute for given program component.
[Example]
program = techUpdateOperator.GetOlpProgram()
componentsList = program.GetChildComponents()
for component in componentsList:
componentType = component.GetType()
parentComponent = component.GetParentComponent()
componentCreatorName = component.GetCreatorName()
if componentType is OLPPROGRAMCOMPONENTTYPE_OPERATIONGROUP:
attribCreator = techUpdateOperator.GetAttribCreator(component)
attribCreator.AddBool('MyBoolAttribute', True, USER_ATTRIBUTE | PROCESS_ATTRIBUTE | GLOBAL_ATTRIBUTE, 'MyBoolAttribute')
|
|
Object of CENPyOlpProgramComponent class
|
|
|
Name of attribute to remove
|
|
|
true - if the attribute was found in the program component and removed, false - otherwise
|
Removes an attribute from given program component.
[Example]
program = techUpdateOperator.GetOlpProgram()
componentsList = program.GetChildComponents()
for component in componentsList:
componentType = component.GetType()
parentComponent = component.GetParentComponent()
componentCreatorName = component.GetCreatorName()
if componentType is OLPPROGRAMCOMPONENTTYPE_OPERATIONGROUP:
attribCreator = techUpdateOperator.GetAttribCreator(component)
attribCreator.AddInteger('MyIntAttribute', 0, -100, 100, USER_ATTRIBUTE | PROCESS_ATTRIBUTE | GLOBAL_ATTRIBUTE, 'MyIntAttribute')
techUpdateOperator.RemoveAttribute(component, 'MyIntAttribute')
This operator gives the possibility to log issues resulting by user input.
[Example]
logOperator = techUpdateOperator.GetLoggerOperator()
controller = techUpdateOperator.GetController()
toolIndex = controller.GetActiveToolFrameIndex()
baseIndex = controller.GetActiveBaseFrameIndex()
logging.LogInfo("Controller active tool index: " + str(toolIndex) + "; base index: " + str(baseIndex))
This method returns the assigned controller.
[Example]
controller = techUpdateOperator.GetController()
This method returns the OLP program.
[Example]
program = techUpdateOperator.GetOlpProgram()
This method sets owner of attribute.
[Example]
techUpdateOperator.SetAttribOwner(attribute, ownerName)
The method returns event rule update operator of technology.
[Example]
ruleUpdateOperator = techUpdateOperator.GetTechEventRuleUpdateOperator(eventRule)
The method returns event rule update operator of work method.
[Example]
ruleUpdateOperator = techUpdateOperator.GetWmEventRuleUpdateOperator(eventRule)
The method returns cycle explode status and can be called for the program components of type OLPPROGRAMCOMPONENTTYPE_EVENT only.
[Example]
program = techUpdateOperator.GetOlpProgram()
componentsList = program.GetChildComponents()
for component in componentsList:
componentType = component.GetType()
if componentType is OLPPROGRAMCOMPONENTTYPE_EVENT:
logging.LogInfo("Component type: EVENT")
status = techUpdateOperator.GetCycleExplodeStatus(component)
logging.LogInfo("Cycle explode status: " + str(status))
•
|
GetLastSavedPythonTechnologyVersion(): int
|
|
|
Integer version value of the saved technology python script
|
The method returns the last saved version value of the technology python script.
[Example]
version = techUpdateOperator.GetLastSavedPythonTechnologyVersion()
|