FlexBE / flexbe_app

The classic user interface (editor + runtime control) for the FlexBE behavior engine. See the flexbe_webui for latest
BSD 3-Clause "New" or "Revised" License
48 stars 49 forks source link

Can we load a particular configuration file via command line / roslaunch? #1

Open dcconner opened 7 years ago

dcconner commented 7 years ago

We have option to save and load configuration files, but can we load a particular one (mainly to set default package path)

Also, can we write/read config with new lines after each argument?

pschillinger commented 7 years ago

This is not possible right now, but I also don't see any problems with adding this functionality.

Are you referring to new lines in the generated config file? This is done by the Javascript JSON package, not sure if new lines are supported out of the box.

dcconner commented 7 years ago

If you want to give me a pointer to the correct spot to change, I can take a look.

Yes. The current generated config is all on one line when I view in my editor. I added new lines when I was making a change, and it seemed to read in OK.

pschillinger commented 7 years ago

Right now there is only one arg, it is processed by the main function. But it should be ok to add the new one there as well, I will refactor it when it becomes more.

A config is imported here, but the interface includes that the file dialog opens and the resulting entry (not a path) is processed. I would suggest you extract the loading part from there and let the class offer another public function to import settings by accepting a file path. readFile gives you the file content.

dcconner commented 7 years ago

For later reference: ui_settings.js#L335 var content = JSON.stringify(config, null, '\n');