41 #ifndef __OPENFLUID_BASE_RUNCONTEXTMANAGER_HPP__ 42 #define __OPENFLUID_BASE_RUNCONTEXTMANAGER_HPP__ 54 #include <openfluid/ware/TypeDefs.hpp> 69 std::string m_OutputDir;
71 std::string m_InputDir;
73 bool m_IsClearOutputDir;
77 unsigned int m_ValuesBufferSize;
79 unsigned int m_WaresMaxNumThreads;
85 QSettings* mp_ProjectFile;
87 std::string m_ProjectPath;
89 std::string m_ProjectName;
91 std::string m_ProjectDescription;
93 std::string m_ProjectAuthors;
95 std::string m_ProjectCreationDate;
97 std::string m_ProjectLastModDate;
99 bool m_ProjectIncOutputDir;
101 bool m_ProjectIsOpen;
103 static QString m_ProjectFileGroupName;
109 static std::string getNow();
111 void updateWaresEnvironment();
113 static std::string getFilePathFromProjectPath(
const std::string& ProjectPath);
115 static std::string getInputDirFromProjectPath(
const std::string& ProjectPath);
117 static std::string getOuputDirFromProjectPath(
const std::string& ProjectPath);
119 static bool checkProject(
const std::string& ProjectPath);
129 {
return m_InputDir; }
137 {
return m_InputDir +
"/" + Filename; }
143 void setInputDir(
const std::string& InputDir);
150 {
return m_OutputDir; }
158 {
return m_OutputDir +
"/" + Filename; }
164 void setOutputDir(
const std::string& OutputDir);
166 void setDateTimeOutputDir();
173 {
return m_IsClearOutputDir; }
180 { m_IsClearOutputDir = Enabled; }
187 {
return m_IsProfiling; }
194 { m_IsProfiling = Enabled; }
201 {
return m_ValuesBufferSize; }
208 { m_ValuesBufferSize = Size; }
215 { m_ValuesBufferSize = 0; }
222 {
return (m_ValuesBufferSize > 0); }
229 {
return m_WaresMaxNumThreads; }
236 { m_WaresMaxNumThreads = Num; }
242 void resetWaresMaxNumThreads();
245 {
return m_ExtraProperties; }
248 {
return m_WaresSharedEnvironment; }
253 {
return m_ProjectPath; }
256 {
return m_ProjectName; }
259 { m_ProjectName = Name; }
262 {
return m_ProjectDescription; }
265 { m_ProjectDescription = Description; }
268 {
return m_ProjectAuthors; }
271 { m_ProjectAuthors = Authors; }
274 {
return m_ProjectCreationDate; }
277 { m_ProjectCreationDate = CreationDate; }
280 { m_ProjectCreationDate = getNow(); }
283 {
return m_ProjectLastModDate; }
286 { m_ProjectLastModDate = LastModDate; }
289 {
return m_ProjectIncOutputDir; }
292 { m_ProjectIncOutputDir = Inc; }
294 bool openProject(
const std::string& Path);
296 bool createProject(
const std::string& Path,
const std::string& Name,
297 const std::string& Description,
const std::string& Authors,
301 {
return m_ProjectIsOpen; }
307 static bool isProject(
const std::string& Path);
309 static bool getProjectInfos(
const std::string& Path,
310 std::string& Name, std::string& Description, std::string& Authors,
311 std::string& CreationDate, std::string& LastModDate);
313 void updateProjectOutputDir();
315 QVariant getProjectConfigValue(
const QString& Group,
const QString& Key)
const;
317 void setProjectConfigValue(
const QString& Group,
const QString& Key,
const QVariant& Value);
std::map< WareParamKey_t, WareParamValue_t > WareParams_t
Definition: TypeDefs.hpp:130
std::string getInputFullPath(const std::string &Filename) const
Definition: RunContextManager.hpp:136
void setProjectCreationDate(const std::string &CreationDate)
Definition: RunContextManager.hpp:276
Definition: Environment.hpp:52
std::string getProjectCreationDate() const
Definition: RunContextManager.hpp:273
void setProjectName(const std::string &Name)
Definition: RunContextManager.hpp:258
bool isValuesBufferUserSize() const
Definition: RunContextManager.hpp:221
void setProjectDescription(const std::string &Description)
Definition: RunContextManager.hpp:264
Definition: RunContextManager.hpp:61
void setProjectCreationDateAsNow()
Definition: RunContextManager.hpp:279
#define OPENFLUID_SINGLETON_DEFINITION(T)
Definition: SingletonMacros.hpp:78
std::string getInputDir() const
Definition: RunContextManager.hpp:128
std::string getProjectAuthors() const
Definition: RunContextManager.hpp:267
Definition: MapValue.hpp:134
#define OPENFLUID_API
Definition: dllexport.hpp:87
std::string getProjectPath() const
Definition: RunContextManager.hpp:252
void setProjectLastModDate(const std::string &LastModDate)
Definition: RunContextManager.hpp:285
void setValuesBufferUserSize(unsigned int Size)
Definition: RunContextManager.hpp:207
const openfluid::core::MapValue & getWaresEnvironment() const
Definition: RunContextManager.hpp:247
void unsetValuesBufferUserSize()
Definition: RunContextManager.hpp:214
std::string getOutputDir() const
Definition: RunContextManager.hpp:149
void setProfiling(bool Enabled)
Definition: RunContextManager.hpp:193
void setProjectIncrementalOutputDir(const bool Inc)
Definition: RunContextManager.hpp:291
std::string getProjectName() const
Definition: RunContextManager.hpp:255
bool isProjectOpen() const
Definition: RunContextManager.hpp:300
void setClearOutputDir(bool Enabled)
Definition: RunContextManager.hpp:179
openfluid::core::MapValue & extraProperties()
Definition: RunContextManager.hpp:244
unsigned int getWaresMaxNumThreads() const
Definition: RunContextManager.hpp:228
bool isClearOutputDir() const
Definition: RunContextManager.hpp:172
bool isProjectIncrementalOutputDir() const
Definition: RunContextManager.hpp:288
unsigned int getValuesBufferUserSize() const
Definition: RunContextManager.hpp:200
std::string getOutputFullPath(const std::string &Filename) const
Definition: RunContextManager.hpp:157
bool isProfiling() const
Definition: RunContextManager.hpp:186
void setWaresMaxNumThreads(unsigned int Num)
Definition: RunContextManager.hpp:235
void setProjectAuthors(const std::string &Authors)
Definition: RunContextManager.hpp:270
std::string getProjectDescription() const
Definition: RunContextManager.hpp:261
std::string getProjectLastModDate() const
Definition: RunContextManager.hpp:282
Definition: ApplicationException.hpp:47