9 #include <QtCore/QString>
10 #include <QtCore/QFile>
11 #include <QtCore/QFileInfo>
37 , mRunScheduled(false)
38 , mSetSolutionStatistic(false)
39 , mDisableStatistic(false)
40 , mDisablePlots(false)
41 , mDisableRandomizeStartValues(false)
43 , mQuitAfterTaskExecution(false)
44 , mClearTargets(false)
57 for (
size_t i = 0; i < taskList.
size(); ++i)
72 for (
size_t i = 0; i < taskList.
size(); ++i)
158 for (
int i = 1; i < argc; ++i)
160 QString current(argv[i]);
161 QString lower = current.toLower();
163 if (lower ==
"-r" || lower ==
"--run-scheduled")
167 else if (lower ==
"-q" || lower ==
"--quit-after-task-execution")
171 else if (i + 1 < argc && (lower ==
"--switch-to-task"))
176 else if (i + 1 < argc && (lower ==
"--task"))
181 else if (lower ==
"--set-solution-statistic")
185 else if (lower ==
"--disable-calculate-statistic")
189 else if (lower ==
"--disable-other-plots")
193 else if (lower ==
"--hide")
197 else if (lower ==
"--clear-targets")
201 else if (lower ==
"--disable-randomize-startvalues")
205 else if (lower ==
"--save-layout")
209 else if (i + 1 < argc && (lower ==
"-g" || lower ==
"--generate-output"))
214 else if (i + 1 < argc && (lower ==
"-f" || lower ==
"--set-report-file"))
219 else if (i + 1 < argc && (lower ==
"-o" || lower ==
"--set-output-dir"))
224 else if (i + 1 < argc && (lower ==
"-t" || lower ==
"--set-file-type"))
229 else if (QFile(current).exists() &&
mFilename.empty())
249 char ** result = (
char**)malloc(
sizeof(
char*) * 2);
250 result[0] = strdup(
mArgv[0]);
251 result[1] = strdup((
mFilename +
".view.cps").c_str());
277 return !
mTask.empty();
319 if (!QFile(
mFilename.c_str()).exists())
return false;
343 (*model->
getTaskList())[index]->getReport().setTarget(
"");
bool isSolutionStatistic() const
bool haveOutputDir() const
void saveToFile(const std::string &fileName, const std::string &fileType="pdf")
bool isDisablePlots() const
CCopasiTask * getTask() const
CCopasiProblem * getProblem()
void parseArgs(int arc, char *argv[])
bool isHideWindow() const
const std::string & getObjectName() const
virtual size_t size() const
bool isGenerateOutput() const
const CCopasiMessage & getMessage() const
static std::string getAllMessageText(const bool &chronological=true)
bool isSaveLayout() const
bool isDisableStatistic() const
bool importSBML(const std::string &fileName, CProcessReport *pImportHandler=NULL, const bool &deleteOldData=true)
const bool & isScheduled() const
static CCopasiObject * createDefaultOutput(C_INT32 id, CCopasiTask *task, CCopasiDataModel *pDataModel, bool activate=true)
static CCopasiTask * getFirstScheduledTask()
bool handleCommandLine() const
char ** getInitArgs() const
bool mDisableRandomizeStartValues
static std::vector< C_INT32 > getListOfDefaultOutputDescriptions(const CCopasiTask *task=NULL)
bool haveReportFile() const
bool mSetSolutionStatistic
const std::string & getFilename() const
bool mQuitAfterTaskExecution
CCopasiVectorN< CCopasiTask > * getTaskList()
bool isQuitAfterTaskExecution() const
bool isSwitchToTask() const
const std::string & getOutputDir() const
static CCopasiVector< CCopasiDataModel > * getDatamodelList()
bool loadModel(std::istream &in, const std::string &pwd, CProcessReport *pProcessReport, const bool &deleteOldData=true)
int getTaskToSwitchTo() const
CListOfLayouts * getListOfLayouts()
bool saveModel(const std::string &fileName, CProcessReport *pProcessReport, bool overwriteFile=false, const bool &autoSave=false)
Arguments(int argc, char *argv[])
virtual bool setMethodType(const int &type)
void setTarget(const std::string &target)
static CCopasiDataModel * addDatamodel()
void setRandomizeStartValues(const bool &randomize)
CCopasiTask * getTaskForName(const std::string &name) const
const COutputDefinitionVector * getPlotDefinitionList() const
const std::string & getReportFile() const
static void init(int argc, char *argv[], const bool &withGui=false)
bool isDisableRandomizeStartValues() const
std::string prepareModel() const
const std::string & getFileType() const
bool haveTaskName() const
bool isRunScheduled() const
void setCalculateStatistics(const bool &calculate)
int getOutputToGenerate() const
const std::string & getTaskName() const