Finished testing new save-settings-to-profile feature

This commit is contained in:
GPayne
2020-05-14 13:20:05 -06:00
parent fe24b0c446
commit dfb61097b2
10 changed files with 236 additions and 110 deletions
@@ -114,6 +114,7 @@ private:
void runGlobalCustomizationScripts();
void configureLogging();
std::string generateFilePath(std::string openspaceRelativePath);
void resetPropertyChangeFlagsOfSubowners(openspace::properties::PropertyOwner* po);
std::unique_ptr<Scene> _scene;
std::unique_ptr<AssetManager> _assetManager;
+15 -3
View File
@@ -45,6 +45,8 @@ namespace openspace {
namespace documentation { struct Documentation; }
namespace scripting { struct LuaLibrary; }
const std::string profileFormatVersion = "1.0";
class Profile {
public:
enum class AssetEventType {
@@ -68,6 +70,10 @@ public:
virtual ~Profile() {};
const std::string formatVersion() {
return profileFormatVersion;
}
/**
* Saves all current settings, starting from the profile that was loaded at startup,
* and all of the property & asset changes that were made since startup.
@@ -106,14 +112,17 @@ public:
*/
static scripting::LuaLibrary luaLibrary();
protected:
std::string _profileBaseDirectory = "${ASSETS}";
private:
struct AllAssetDetails {
std::vector<AssetEvent> base;
std::vector<AssetEvent> changed;
};
virtual bool usingProfile();
virtual std::string initialProfile();
virtual std::string profileBaseDirectory();
virtual std::vector<AssetEvent> listOfAllAssetEvents();
ProfileFile collateBaseWithChanges();
std::string convertToScene_assets(ProfileFile& pf);
@@ -124,15 +133,18 @@ private:
std::string convertToScene_time(ProfileFile& pf);
std::string convertToScene_camera(ProfileFile& pf);
void updateToCurrentFormatVersion(ProfileFile& pf);
std::vector<AssetEvent> modifyAssetsToReflectChanges(ProfileFile& pf);
void parseAssetFileLines(std::vector<AssetEvent>& results, ProfileFile& pf);
void handleChangedAdd(std::vector<AssetEvent>& base, unsigned int changedIdx,
std::vector<AssetEvent>& changed, std::string asset);
void handleChangedRemove(std::vector<AssetEvent>& base, unsigned int changedIdx,
std::vector<AssetEvent>& changed, std::string asset);
void handleChangedRemove(std::vector<AssetEvent>& base, std::string asset);
void addAssetsToProfileFile(std::vector<AssetEvent>& allAssets, ProfileFile& pf);
void modifyPropertiesToReflectChanges(ProfileFile& pf);
virtual std::vector<openspace::properties::Property*> getChangedProperties();
void checkForChangedProps(std::vector<openspace::properties::Property*>& changedList,
openspace::properties::PropertyOwner* po);
std::string getFullPropertyPath(openspace::properties::Property* prop);
virtual std::vector<std::string> getChangedPropertiesFormatted();
virtual std::string getCurrentTimeUTC();
virtual interaction::NavigationHandler::NavigationState getCurrentCameraState();
+7 -1
View File
@@ -211,11 +211,17 @@ public:
void addMarkNodesLine(const std::string line);
/**
* Returns the version number (profiles syntax version) string
* Returns the format version number (profiles syntax version) string
* \return The version string
*/
const std::string getVersion() const;
/**
* Sets the format version number (profiles syntax version) string
* \param The version string to set
*/
void setVersion(std::string);
/**
* Returns the profile's time string. See updateTime comment header for notes on
* syntax of this time string