41 #ifndef __OPENFLUID_BASE_RUNCONTEXTMANAGER_HPP__
42 #define __OPENFLUID_BASE_RUNCONTEXTMANAGER_HPP__
54 #include <openfluid/ware/TypeDefs.hpp>
58 namespace openfluid {
namespace base {
68 std::string m_OutputDir;
70 std::string m_InputDir;
72 bool m_IsClearOutputDir;
76 unsigned int m_ValuesBufferSize;
78 unsigned int m_WaresMaxNumThreads;
84 QSettings* mp_ProjectFile;
86 std::string m_ProjectPath;
88 std::string m_ProjectName;
90 std::string m_ProjectDescription;
92 std::string m_ProjectAuthors;
94 std::string m_ProjectCreationDate;
96 std::string m_ProjectLastModDate;
98 bool m_ProjectIncOutputDir;
100 bool m_ProjectIsOpen;
102 static QString m_ProjectFileGroupName;
108 static std::string getNow();
110 void updateWaresEnvironment();
112 static std::string getFilePathFromProjectPath(
const std::string& ProjectPath);
114 static std::string getInputDirFromProjectPath(
const std::string& ProjectPath);
116 static std::string getOuputDirFromProjectPath(
const std::string& ProjectPath);
118 static bool checkProject(
const std::string& ProjectPath);
124 {
return m_InputDir; }
127 {
return m_InputDir +
"/" + Filename; }
129 void setInputDir(
const std::string& InputDir);
132 {
return m_OutputDir; }
135 {
return m_OutputDir +
"/" + Filename; }
137 void setOutputDir(
const std::string& OutputDir);
139 void setDateTimeOutputDir();
142 {
return m_IsClearOutputDir; }
145 { m_IsClearOutputDir = Enabled; }
148 {
return m_IsProfiling; }
151 { m_IsProfiling = Enabled; }
154 {
return m_ValuesBufferSize; }
157 { m_ValuesBufferSize = Size; }
160 { m_ValuesBufferSize = 0; }
163 {
return (m_ValuesBufferSize > 0); }
166 {
return m_WaresMaxNumThreads; }
169 { m_WaresMaxNumThreads = Num; }
171 void resetWaresMaxNumThreads();
174 {
return m_ExtraProperties; }
177 {
return m_WaresSharedEnvironment; }
182 {
return m_ProjectPath; }
185 {
return m_ProjectName; }
188 { m_ProjectName = Name; }
191 {
return m_ProjectDescription; }
194 { m_ProjectDescription = Description; }
197 {
return m_ProjectAuthors; }
200 { m_ProjectAuthors = Authors; }
203 {
return m_ProjectCreationDate; }
206 { m_ProjectCreationDate = CreationDate; }
209 { m_ProjectCreationDate = getNow(); }
212 {
return m_ProjectLastModDate; }
215 { m_ProjectLastModDate = LastModDate; }
218 {
return m_ProjectIncOutputDir; }
221 { m_ProjectIncOutputDir = Inc; }
223 bool openProject(
const std::string& Path);
225 bool createProject(
const std::string& Path,
const std::string& Name,
226 const std::string& Description,
const std::string& Authors,
230 {
return m_ProjectIsOpen; }
236 static bool isProject(
const std::string& Path);
238 static bool getProjectInfos(
const std::string& Path,
239 std::string& Name, std::string& Description, std::string& Authors,
240 std::string& CreationDate, std::string& LastModDate);
242 void updateProjectOutputDir();
244 QVariant getProjectConfigValue(
const QString& Group,
const QString& Key)
const;
246 void setProjectConfigValue(
const QString& Group,
const QString& Key,
const QVariant& Value);
void setClearOutputDir(bool Enabled)
Definition: RunContextManager.hpp:144
void setProjectAuthors(const std::string &Authors)
Definition: RunContextManager.hpp:199
void unsetValuesBufferUserSize()
Definition: RunContextManager.hpp:159
bool isProjectOpen() const
Definition: RunContextManager.hpp:229
std::string getProjectAuthors() const
Definition: RunContextManager.hpp:196
std::map< WareParamKey_t, WareParamValue_t > WareParams_t
Definition: TypeDefs.hpp:130
bool isClearOutputDir() const
Definition: RunContextManager.hpp:141
void setProjectName(const std::string &Name)
Definition: RunContextManager.hpp:187
bool isValuesBufferUserSize() const
Definition: RunContextManager.hpp:162
std::string getProjectCreationDate() const
Definition: RunContextManager.hpp:202
void setValuesBufferUserSize(unsigned int Size)
Definition: RunContextManager.hpp:156
std::string getOutputDir() const
Definition: RunContextManager.hpp:131
std::string getProjectDescription() const
Definition: RunContextManager.hpp:190
void setProjectCreationDateAsNow()
Definition: RunContextManager.hpp:208
std::string getProjectLastModDate() const
Definition: RunContextManager.hpp:211
Definition: Environment.hpp:52
void setWaresMaxNumThreads(unsigned int Num)
Definition: RunContextManager.hpp:168
Definition: RunContextManager.hpp:61
unsigned int getValuesBufferUserSize() const
Definition: RunContextManager.hpp:153
void setProjectIncrementalOutputDir(const bool Inc)
Definition: RunContextManager.hpp:220
std::string getProjectPath() const
Definition: RunContextManager.hpp:181
#define OPENFLUID_API
Definition: dllexport.hpp:87
Definition: MapValue.hpp:134
const openfluid::core::MapValue & getWaresEnvironment() const
Definition: RunContextManager.hpp:176
void setProjectLastModDate(const std::string &LastModDate)
Definition: RunContextManager.hpp:214
std::string getInputDir() const
Definition: RunContextManager.hpp:123
bool isProjectIncrementalOutputDir() const
Definition: RunContextManager.hpp:217
void setProjectCreationDate(const std::string &CreationDate)
Definition: RunContextManager.hpp:205
std::string getInputFullPath(const std::string &Filename) const
Definition: RunContextManager.hpp:126
void setProjectDescription(const std::string &Description)
Definition: RunContextManager.hpp:193
void setProfiling(bool Enabled)
Definition: RunContextManager.hpp:150
openfluid::core::MapValue & extraProperties()
Definition: RunContextManager.hpp:173
unsigned int getWaresMaxNumThreads() const
Definition: RunContextManager.hpp:165
bool isProfiling() const
Definition: RunContextManager.hpp:147
std::string getProjectName() const
Definition: RunContextManager.hpp:184
#define OPENFLUID_SINGLETON_DEFINITION(T)
Definition: SingletonMacros.hpp:78
std::string getOutputFullPath(const std::string &Filename) const
Definition: RunContextManager.hpp:134