Skip to content
Snippets Groups Projects
Commit 6cca2a4e authored by Rainer Kartmann's avatar Rainer Kartmann
Browse files

Fix snapshot loading

parent 3b1f2d4d
No related branches found
No related tags found
No related merge requests found
...@@ -81,12 +81,14 @@ namespace armarx::armem::server::obj::instance ...@@ -81,12 +81,14 @@ namespace armarx::armem::server::obj::instance
"If true, no new snapshots are stored while an object is attached to a robot node.\n" "If true, no new snapshots are stored while an object is attached to a robot node.\n"
"If false, new snapshots are stored, but the attachment is kept in the new snapshots."); "If false, new snapshots are stored, but the attachment is kept in the new snapshots.");
defs->optional(p.sceneSnapshotsPackage, prefix + "scene.Package", defs->optional(p.sceneSnapshotsPackage, prefix + "scene.10_Package",
"ArmarX package containing the scene snapshots.\n" "ArmarX package containing the scene snapshots.\n"
"Scene snapshots are expected to be located in Package/data/Package/Scenes/*.json."); "Scene snapshots are expected to be located in Package/data/Package/Scenes/*.json.");
defs->optional(p.sceneSnapshotToLoad, prefix + "scene.SnapshotToLoad", defs->optional(p.sceneSnapshotsDirectory, prefix + "scene.11_Directory",
"Directory in Package/data/Package/ containing the scene snapshots.");
defs->optional(p.sceneSnapshotToLoad, prefix + "scene.12_SnapshotToLoad",
"Scene snapshot to load on startup (e.g. 'Scene_2021-06-24_20-20-03').\n" "Scene snapshot to load on startup (e.g. 'Scene_2021-06-24_20-20-03').\n"
"You can also specify paths relative to 'Package/Scenes/'."); "You can also specify paths relative to 'Package/scenes/'.");
decay.defineProperties(defs, prefix + "decay."); decay.defineProperties(defs, prefix + "decay.");
} }
...@@ -791,7 +793,7 @@ namespace armarx::armem::server::obj::instance ...@@ -791,7 +793,7 @@ namespace armarx::armem::server::obj::instance
if (finder->packageFound()) if (finder->packageFound())
{ {
std::filesystem::path dataDir = finder->getDataDir(); std::filesystem::path dataDir = finder->getDataDir();
std::filesystem::path path = dataDir / p.sceneSnapshotsPackage / "Scenes" / filename; std::filesystem::path path = dataDir / p.sceneSnapshotsPackage / p.sceneSnapshotsDirectory / filename;
return path; return path;
} }
else else
...@@ -906,7 +908,12 @@ namespace armarx::armem::server::obj::instance ...@@ -906,7 +908,12 @@ namespace armarx::armem::server::obj::instance
loadButton.setLabel("Load Scene"); loadButton.setLabel("Load Scene");
storeButton.setLabel("Store Scene"); storeButton.setLabel("Store Scene");
HBoxLayout storeLoadLineLayout({Label(data.p.sceneSnapshotsPackage + "/Scenes/"), storeLoadLine, Label(".json")}); HBoxLayout storeLoadLineLayout(
{
Label(data.p.sceneSnapshotsPackage + "/" + data.p.sceneSnapshotsDirectory + "/"),
storeLoadLine,
Label(".json")
});
HBoxLayout storeLoadButtonsLayout({loadButton, storeButton}); HBoxLayout storeLoadButtonsLayout({loadButton, storeButton});
GridLayout grid; GridLayout grid;
......
...@@ -182,7 +182,8 @@ namespace armarx::armem::server::obj::instance ...@@ -182,7 +182,8 @@ namespace armarx::armem::server::obj::instance
bool discardSnapshotsWhileAttached = true; bool discardSnapshotsWhileAttached = true;
/// Package containing the scene snapshots /// Package containing the scene snapshots
std::string sceneSnapshotsPackage = "ArmarXObjects"; std::string sceneSnapshotsPackage = armarx::ObjectFinder::DefaultObjectsPackageName;
std::string sceneSnapshotsDirectory = "scenes";
std::string sceneSnapshotToLoad = ""; std::string sceneSnapshotToLoad = "";
}; };
Properties p; Properties p;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment