Skip to content

Commit

Permalink
Add python-based state parser alternative (see team-vigir/flexbe_beha…
Browse files Browse the repository at this point in the history
  • Loading branch information
pschillinger committed Jan 11, 2020
1 parent a4093a5 commit 4f20227
Show file tree
Hide file tree
Showing 5 changed files with 264 additions and 139 deletions.
2 changes: 2 additions & 0 deletions src/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ document.addEventListener('DOMContentLoaded', function() {

document.getElementById('button_ros_connect').addEventListener('click', UI.Settings.rosConnectClicked);

document.getElementById('select_state_parser').addEventListener('change', UI.Settings.stateParserChanged);
document.getElementById('button_force_discover').addEventListener('click', UI.Settings.forceDiscoverClicked);

document.getElementById('cb_synthesis_enabled').addEventListener('change', UI.Settings.synthesisEnabledClicked);
Expand Down Expand Up @@ -176,6 +177,7 @@ document.addEventListener('DOMContentLoaded', function() {
RC.PubSub.shutdown();
ROS.shutdown();
IO.PackageParser.stopWatching();
IO.StateParser.close();
});

nw.App.on('open', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/io/io_packageparser.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ IO.PackageParser = new (function() {
processEntry(idx + 1);
});
} else if (import_path != undefined) {
if (path.extname(entry) == ".py") {
if (path.extname(entry) == ".py" && path.basename(entry) != "__init__.py") {
IO.Filesystem.readFile(entry, (content) => {
var imports = entry.replace(import_path+"/", "").replace(/.py$/i, "").replace(/[\/]/g, ".");
IO.StateParser.parseState(content, imports, state_def => {
Expand Down
Loading

0 comments on commit 4f20227

Please sign in to comment.