0.2.0
Loading...
Searching...
No Matches
FlowManager.hpp
Go to the documentation of this file.
1// This file is part of INSTINCT, the INS Toolkit for Integrated
2// Navigation Concepts and Training by the Institute of Navigation of
3// the University of Stuttgart, Germany.
4//
5// This Source Code Form is subject to the terms of the Mozilla Public
6// License, v. 2.0. If a copy of the MPL was not distributed with this
7// file, You can obtain one at https://mozilla.org/MPL/2.0/.
8
13
14#pragma once
15
16#include <string>
17#include <filesystem>
19
20#include <nlohmann/json.hpp>
21using json = nlohmann::json;
22
23namespace NAV::flow
24{
27void SaveFlow(GlobalActions& globalAction);
28
31void SaveFlowAs(const std::string& filepath);
32
36bool LoadFlow(const std::string& filepath);
37
42bool LoadJson(const json& j, bool requestNewIds = false);
43
47
50
53
56std::string GetCurrentFilename();
57
60void SetCurrentFilename(const std::string& newFilename);
61
64std::filesystem::path GetProgramRootPath();
65
68void SetProgramRootPath(const std::filesystem::path& newRootPath);
69
71std::filesystem::path GetOutputPath();
72
75
77std::filesystem::path GetInputPath();
78
80std::filesystem::path GetFlowPath();
81
83std::filesystem::path GetConfigPath();
84
86extern bool saveLastActions;
87
89extern int loadingFrameCount;
90
91} // namespace NAV::flow
bool saveLastActions
Whether actions should be saved to the last actions list.
void SetProgramRootPath(const std::filesystem::path &newRootPath)
Set the program root path.
bool LoadJson(const json &j, bool requestNewIds=false)
Loads the nodes and links from the specified json object.
void SetCurrentFilename(const std::string &newFilename)
Set the current filename of the open flow.
bool LoadFlow(const std::string &filepath)
Loads the flow from the specified file.
int loadingFrameCount
Frame Count when changes were loaded to prevent nodes moving from triggering unsaved changes.
std::filesystem::path GetConfigPath()
Get the path where config files are searched.
std::filesystem::path GetOutputPath()
Get the path where logs and outputs are stored.
void SaveFlowAs(const std::string &filepath)
Saves the current flow into the specified file.
std::filesystem::path GetInputPath()
Get the path where data files are searched.
void DiscardChanges()
Discards the unsaved changes flag. Does not really discard the changes.
std::string GetCurrentFilename()
Get the current filename of the open flow.
void ApplyChanges()
Signals that there have been changes to the flow.
std::filesystem::path GetFlowPath()
Get the path where flow files are searched.
nlohmann::json json
json namespace
Definition FlowManager.hpp:21
std::filesystem::path GetProgramRootPath()
Get the program root path.
bool HasUnsavedChanges()
Checks if the currently open flow has unsaved changes.
void SaveFlow(GlobalActions &globalAction)
Saves the current flow into a file.
void SetOutputPath()
Set the path where logs and outputs are stored.
Global Gui Actions.
GlobalActions
Possible Global Actions to perform in the GUI.
Definition GlobalActions.hpp:18