File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99comms = pymoos .comms ()
1010
1111def c ():
12+ print ("\t |-Time Warp @ {0:.1f} \n " .format (pymoos .get_moos_timewarp ()))
13+ print ("\t |-Time Warp delay @ {0:.1f} ms \n " .format ( \
14+ comms .get_comms_control_timewarp_scale_factor ()* pymoos .get_moos_timewarp ()))
1215 return comms .register ('simple_var' ,0 )
1316
1417def m ():
@@ -17,13 +20,15 @@ def m():
1720
1821def main ():
1922
20- comms .set_on_connect_callback (c );
21- comms .set_on_mail_callback (m );
23+ comms .set_on_connect_callback (c )
24+ comms .set_on_mail_callback (m )
25+ pymoos .set_moos_timewarp (10 )
26+ comms .set_comms_control_timewarp_scale_factor (0.4 )
2227 comms .run ('localhost' ,9000 ,'pymoos' )
2328
2429 while True :
2530 time .sleep (1 )
26- comms .notify ('simple_var' ,'a string' ,pymoos .time ());
31+ comms .notify ('simple_var' ,'a string' ,pymoos .time ())
2732
2833if __name__ == "__main__" :
2934 main ()
Original file line number Diff line number Diff line change @@ -398,6 +398,8 @@ BOOST_PYTHON_MODULE(pymoos)
398398 bp::def (" time" , &MOOSTime, time_overloads ());
399399 bp::def (" local_time" , &MOOSLocalTime, time_overloads ());
400400 bp::def (" is_little_end_in" , &IsLittleEndian);
401+ bp::def (" set_moos_timewarp" , &SetMOOSTimeWarp);
402+ bp::def (" get_moos_timewarp" , &GetMOOSTimeWarp);
401403
402404 bp::register_exception_translator<pyMOOSException>(&MOOSExceptionTranslator);
403405
You can’t perform that action at this time.
0 commit comments