PostInitAttributes
The callback PostInitAttributes (CENPyOlpEvent_AttribInitOperator) is called when the kernel initializes the event attributes.
Il peut être utilisé pour :
-
initialiser attributs
-
obtenir des valeurs d’attribut
-
Définir les valeurs des attributs
-
accéder à OlpController
-
sortie au journal
The callback is defined in the %EVENT_NAME%.py file that is located in the scripts folder of the plugin.
def PostInitAttributes(EventAttribInitOperator):
attribCreator = EventAttribInitOperator.GetAttribCreator()
# Laser type
attribCreator.AddEnum(LASER_TYPE, LASER_TYPE_LIST, LASER_TYPE_LIST[0], USER_ATTRIBUTE | PROCESS_ATTRIBUTE, LASER_TYPE)
# Laser offset
attribCreator.AddDouble(LASER_OFFSET, 0.0,0.0,1000.0,1.0, USER_ATTRIBUTE | PROCESS_ATTRIBUTE, ATTRIB_LENGTH, LASER_OFFSET)Was this page helpful?