Commit 4c184d91bd0d4624eb7f8e48f41232568ecf6f51
1 parent
f43341e7
Exists in
master
and in
24 other branches
Delete data file for plot preview before apply function
Showing
1 changed file
with
9 additions
and
0 deletions
Show diff stats
src/ParamOutputImpl/Plot/PanelPlotOutput.cc
@@ -25,6 +25,7 @@ | @@ -25,6 +25,7 @@ | ||
25 | #include <boost/algorithm/string/replace.hpp> | 25 | #include <boost/algorithm/string/replace.hpp> |
26 | #include <string> | 26 | #include <string> |
27 | #include <ctime> | 27 | #include <ctime> |
28 | +#include<stdio.h> | ||
28 | 29 | ||
29 | using namespace AMDA::Parameters; | 30 | using namespace AMDA::Parameters; |
30 | using namespace AMDA::Info; | 31 | using namespace AMDA::Info; |
@@ -4174,6 +4175,14 @@ namespace plot | @@ -4174,6 +4175,14 @@ namespace plot | ||
4174 | return; | 4175 | return; |
4175 | 4176 | ||
4176 | std::string fileName = _panel->_page->fileDataName; | 4177 | std::string fileName = _panel->_page->fileDataName; |
4178 | + | ||
4179 | + if (remove(fileName.c_str()) == 0){ | ||
4180 | + LOG4CXX_DEBUG(gLogger, "Deleted successfully: " << fileName); | ||
4181 | + } | ||
4182 | + else{ | ||
4183 | + LOG4CXX_DEBUG(gLogger, "Unable to delete the file: " << fileName); | ||
4184 | + } | ||
4185 | + | ||
4177 | LOG4CXX_DEBUG(gLogger, "Name of the data file is " << fileName); | 4186 | LOG4CXX_DEBUG(gLogger, "Name of the data file is " << fileName); |
4178 | 4187 | ||
4179 | fileData.open(fileName); | 4188 | fileData.open(fileName); |