hku-ect / libsphactor

"Extended nodal actor framework based on zactor"
Other
3 stars 4 forks source link

initial command line utility for running a stage of actors #68

Closed sphaero closed 3 years ago

sphaero commented 3 years ago

includes new utility class sph_stage for managing a stage and sph_stock containing stock actors (Log, Pulse, Count)

CLI utility is called sph:

$ ./sph
sph [options] <config file>
  --verbose / -v         verbose output
  --help / -h            this information
  <config file>          stage config file to load

Example run:

$ ./sph test.gzs
W: 21-08-31 14:20:42 INIT CALLED
W: 21-08-31 14:20:42 No python dir found in '/home/arnaud/src/build-libsphactor-Desktop-Debug' so hoping for a system installed
Python 3.9.2 (default, Feb 28 2021, 17:03:44) 
[GCC 10.2.1 20210110] initialized. Paths: ['/usr/lib/python39.zip', '/usr/lib/python3.9', '/usr/lib/python3.9/lib-dynload', '/home/arnaud/.local/lib/python3.9/site-packages', '/usr/local/lib/python3.9/dist-packages', '/usr/lib/python3/dist-packages', '/home/arnaud/src/build-libsphactor-Desktop-Debug']
I: 21-08-31 14:20:42 Successfully loaded /home/arnaud/src/build-gazebosc-Desktop-Debug/bin/tester.py
Python test actor: Message received: /pulse
/testpython hhhdFsi 0 2 3 4.140000 False blaa 32
Python test actor: Message received: /pulse
/testpython hhhdFsi 0 2 3 4.140000 False blaa 32
Python test actor: Message received: /pulse
/testpython hhhdFsi 0 2 3 4.140000 False blaa 32
Python test actor: Message received: /pulse
/testpython hhhdFsi 0 2 3 4.140000 False blaa 32
Python test actor: Message received: /pulse
/testpython hhhdFsi 0 2 3 4.140000 False blaa 32
Python test actor: Message received: /pulse
/testpython hhhdFsi 0 2 3 4.140000 False blaa 32
Python test actor: Message received: /pulse
/testpython hhhdFsi 0 2 3 4.140000 False blaa 32
Python test actor: Message received: /pulse
/testpython hhhdFsi 0 2 3 4.140000 False blaa 32
^CStopping actor
I: 21-08-31 14:20:51 EXIT
aaronvark commented 3 years ago

stage_save still has to return an int (no idea why unix allows this (probably a default return?), but won't compile on windows like this)

sphaero commented 3 years ago

Yes, missed that one.It's actually the compiler (gcc) that allows it. Clang probably does the same as OSX compiles fine as well.

sphaero commented 3 years ago

It's passing now