Modifications

Sauter à la navigation Sauter à la recherche
891 octets ajoutés ,  27 avril 2025 à 21:20
Ligne 174 : Ligne 174 :  
| textstyle  = color: red; font-weight: bold; font-style: italic;
 
| textstyle  = color: red; font-weight: bold; font-style: italic;
 
| text      = Do not confuse the override operation used by subclasses to create their tasks with the {{fname|on_task_create}} event allowing the user code to create their own tasks. }}
 
| text      = Do not confuse the override operation used by subclasses to create their tasks with the {{fname|on_task_create}} event allowing the user code to create their own tasks. }}
 +
 +
==== before_run() ====
 +
{{dbox-orange| Overridable method}}
 +
 +
This method is called before starting the ''userloop''. The execution is aborted when the {{fname|before_run()}} returns False.
 +
 +
Overriding it allows the descendant class to checks specific condition before allowing the user code to run (EG: Pico3Mod checks the internal temperature before allowing the ''userloop'' to starts).
 +
 +
<syntaxhighlight lang="python">
 +
def before_run( self ):
 +
</syntaxhighlight>
 +
 +
==== after_run() ====
 +
{{dbox-orange| Overridable method}}
 +
 +
This method is called when the ''userloop'' ends for any reason (RUN_APP or ''userloop'' exception).
 +
 +
No return value is expected from this method.
 +
 +
<syntaxhighlight lang="python">
 +
def after_run( self ):
 +
</syntaxhighlight>
 +
 +
==== run() ====
 +
xxxxxxxxxxxNo return value is expected from this method.
 +
 +
<syntaxhighlight lang="python">
 +
def run( self ):
 +
</syntaxhighlight>
32 908

modifications

Menu de navigation