I2PC / scipion

Scipion is an image processing framework to obtain 3D models of macromolecular complexes using Electron Microscopy (3DEM)
http://scipion.i2pc.es
Other
76 stars 47 forks source link

Add events #2075

Open DStrelak opened 4 years ago

DStrelak commented 4 years ago

Is your feature request related to a problem? Please describe. When I set e.g. input movie set, I would like to automatically preset some default values in the protocol, based on the e.g. size of the movie.

Describe the solution you'd like I would like to be able to register specific callback for input change event

Describe alternatives you've considered Similar functionality can be achieved by inheritance / overriding

pconesa commented 4 years ago

Thank you @DStrelak .

delarosatrevin commented 4 years ago

Please check the protocol base class...I think this is already implemented, although not used in many protocols. It is called trigger or something like that.

pconesa commented 4 years ago

Hi, @delarosatrevin. I wasn't aware of this. I've looked up for trigger in the code and nothing related pops up.

I've reviewed parms.py, and haven't seen any similar....please, please, please, enlighten us!

delarosatrevin commented 4 years ago

Input variables have a 'trace' where callback can be registered. The following example change the pointer class when another input changes:

https://github.com/scipion-em/scipion-em-emxlib/blob/devel/emxlib/protocols/protocol_export.py#L60