diff --git a/haemmodel/trajplotworkflow.cc b/haemmodel/trajplotworkflow.cc index ea5f7de92fd99cedff5af2128df098f87822f6d5..8de00f9f8e90bafde5b1777bad4600c865059857 100644 --- a/haemmodel/trajplotworkflow.cc +++ b/haemmodel/trajplotworkflow.cc @@ -87,17 +87,8 @@ void TrajPlotWorkflow::setOriginSymbol(bool origin_symbol) TrajPlotWorkflow::TrajPlotWorkflow() {} -void TrajPlotWorkflow::run() const +std::string TrajPlotWorkflow::buildCommand() const { - // check if this is a file listing separated by '+' - if (m_input_path.find("+") == std::string::npos) - { - if (radix::file_exists(m_input_path) == false) - { - throw std::logic_error( - "***Error: Required input file file does not exist."); - } - } // // Find the trajplot executable std::string executable = @@ -128,11 +119,6 @@ void TrajPlotWorkflow::run() const // all Postscript file plotting options if (!m_map_background.empty()) { - if (radix::file_exists(m_map_background) == false) - { - throw std::logic_error( - "***Error: Provided map background does not exist."); - } command << " -j" << m_map_background; } if (m_projection != TrajPlotMapProjection::Auto) @@ -155,9 +141,13 @@ void TrajPlotWorkflow::run() const { command << " -s0"; } - - std::cout << command.str() << std::endl; - int return_code = system(command.str().c_str()); + return command.str(); +} +void TrajPlotWorkflow::run() const +{ + std::string command = buildCommand(); + std::cout << command << std::endl; + int return_code = system(command.c_str()); int exit_code = return_code; #ifndef _WIN32 exit_code = exit_code >> 8; diff --git a/haemmodel/trajplotworkflow.hh b/haemmodel/trajplotworkflow.hh index 12375b6fb8ce2264b473ec37d2593e3215f60abe..0592e15af9b47624105776bcd3da43532c4df41a 100644 --- a/haemmodel/trajplotworkflow.hh +++ b/haemmodel/trajplotworkflow.hh @@ -62,10 +62,11 @@ class RADIX_PUBLIC TrajPlotWorkflow public: TrajPlotWorkflow(); + std::string buildCommand() const; /** * @brief run Executes the HYSPLIT trajectory plot capability */ - void run() const; + virtual void run() const; std::string hysplitDirectory() const; void setHysplitDirectory(const std::string &hysplit_directory);