pschillinger / flexbe_chrome_app

Contains the source code of the FlexBE Chrome App.
BSD 3-Clause "New" or "Revised" License
2 stars 6 forks source link

[Bug] State changes not immediately taken into account #4

Closed achim-k closed 8 years ago

achim-k commented 8 years ago

I usually need to remove the state's .pyc file and restart FlexBE before my changes are taken into account. Is there an easier/nicer way to achieve this?

pschillinger commented 8 years ago

.pyc files are ignored by the state parser of the GUI, so it shouldn't be required to remove them.

The state parser does not run continously, the overhead would be much too large if files get parsed repeatedly and I am not aware of a feature in Chrome which lets you get notified if a certain file changes.

Anyways, the "Apply" button in the State Library panel of the Settings page triggers the state parser and states should get updated. Let me know if this doesn't work for you.

Ideas of how to automatically react to files changes are of course welcome. :) I think I could add something like a "refresh states" button to the Add State panel, though. Would this make sense?

achim-k commented 8 years ago

I think it's not really related to the GUI, more like a FlexBE behavior engine issue. It is not possible to fix a bug in a state while a behavior is running. I assume that all behaviors/states are instantiated at behavior launch and not destroyed after behavior exit, which would explain why I need to restart the whole FlexBE engine before seeing my state changes having effect.

pschillinger commented 8 years ago

Oh, I see what you are talking about. Sorry, I got confused by the fact that this issue is opened in the GUI repo.

In order to update the implementation of a state for execution, you need to restart the onboard engine, yes. If Python has imported a class and it is imported again later (even if its implementation changed in the meantime), the old version will still be used by the same program.

Maybe the flexbe_testing framework will be useful for you in this case.

achim-k commented 8 years ago

Thanks for the clarification. Will close this issue then.