Commit 366230e0 authored by Lefebvre, Jordan's avatar Lefebvre, Jordan

Merge branch 'virtual-run' into 'master'

Virtual run

See merge request nsm/haem!3
parents 55fa2d1c ebdcd42c
Pipeline #74081 failed with stages
in 0 seconds
......@@ -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;
......
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment