diff options
author | Miodrag Milanovic <mmicko@gmail.com> | 2020-09-04 17:14:30 +0200 |
---|---|---|
committer | Miodrag Milanovic <mmicko@gmail.com> | 2020-09-04 17:14:30 +0200 |
commit | 717bcfa19eb6d6351c471b657312097ad1261da5 (patch) | |
tree | 10c99d2475700e3e98010c8bb50009cfa69a5e2e /common | |
parent | 4512a9de19751916c466ed12a2ba4dce958d77bc (diff) | |
download | nextpnr-717bcfa19eb6d6351c471b657312097ad1261da5.tar.gz nextpnr-717bcfa19eb6d6351c471b657312097ad1261da5.tar.bz2 nextpnr-717bcfa19eb6d6351c471b657312097ad1261da5.zip |
Preserve cmd parameters when loading json from GUI
Diffstat (limited to 'common')
-rw-r--r-- | common/command.cc | 6 | ||||
-rw-r--r-- | common/command.h | 1 |
2 files changed, 6 insertions, 1 deletions
diff --git a/common/command.cc b/common/command.cc index f0d028ce..cad89c02 100644 --- a/common/command.cc +++ b/common/command.cc @@ -430,7 +430,6 @@ int CommandHandler::exec() std::unique_ptr<Context> CommandHandler::load_json(std::string filename) { - vm.clear(); std::unordered_map<std::string, Property> values; std::unique_ptr<Context> ctx = createContext(values); setupContext(ctx.get()); @@ -444,6 +443,11 @@ std::unique_ptr<Context> CommandHandler::load_json(std::string filename) return ctx; } +void CommandHandler::clear() +{ + vm.clear(); +} + void CommandHandler::run_script_hook(const std::string &name) { #ifndef NO_PYTHON diff --git a/common/command.h b/common/command.h index e52b5a48..36b6d8ab 100644 --- a/common/command.h +++ b/common/command.h @@ -38,6 +38,7 @@ class CommandHandler int exec(); std::unique_ptr<Context> load_json(std::string filename); + void clear(); protected: virtual void setupArchContext(Context *ctx) = 0; |