1313def on_startup ():
1414 print ("App starting up..." )
1515
16- # Read configuration from the mission file
17- # The mission file should have a ProcessConfig block for this app
18- success , freq = app .get_configuration_double ('app_freq' )
19- if success :
20- print (f"Setting app frequency from config: { freq } Hz" )
21- app .set_app_freq (freq )
22- else :
23- print ("Using default app frequency: 1.0 Hz" )
24- app .set_app_freq (1.0 )
16+ # Note: AppTick and CommsTick from the mission file are automatically
17+ # handled by CMOOSApp - you don't need to read or set them manually.
2518
26- success , comms_freq = app .get_configuration_double ('comms_freq' )
19+ # Read custom configuration parameters from the mission file
20+ # The mission file should have a ProcessConfig block for this app
21+ success , var_name = app .get_configuration_string ('variable_name' )
2722 if success :
28- print (f"Setting comms frequency from config: { comms_freq } Hz" )
29- app .set_comms_freq (comms_freq )
23+ print (f"Will publish to variable: { var_name } " )
3024 else :
31- print ("Using default comms frequency: 5.0 Hz" )
32- app .set_comms_freq (5.0 )
25+ print ("Using default variable name: simple_app_var" )
3326
34- # Read other configuration parameters
35- success , var_name = app .get_configuration_string ('variable_name' )
27+ success , max_iter = app .get_configuration_int ('max_iterations' )
3628 if success :
37- print (f"Will publish to variable: { var_name } " )
29+ print (f"Will run for { max_iter } iterations " )
3830
3931 return True
4032
@@ -50,7 +42,7 @@ def on_new_mail(mail):
5042 msg .trace ()
5143 return True
5244
53- # Iterate is the main work loop, called at the frequency set by set_app_freq
45+ # Iterate is the main work loop, called at the frequency set by AppTick in the mission file
5446iteration_count = 0
5547def iterate ():
5648 global iteration_count
0 commit comments