Commit 87088471478f0b79ee8a3e3e8adffd084f4084c7

Authored by Benjamin Renard
1 parent 87c20ffe

Use file prefix for compressed archive + Add TTName in output files names

src/ParamOutputImpl/Plot/PlotNode.cc
... ... @@ -51,6 +51,7 @@ void PlotNode::proceed(xmlNodePtr pNode,
51 51  
52 52 lContext.push<PlotOutput*>(plotOutput);
53 53 lContext.push<AMDA::Parameters::ParameterManager*>(lParameterManager);
  54 + lContext.push<std::string*>(&plotOutput->getFilePrefix());
54 55 AMDA::Parameters::ParamOutputSPtr lParamOutput(plotOutput);
55 56 AMDA::XMLConfigurator::NodeGrpCfg::proceed(pNode, lContext);
56 57 lParameterManager->getParamOutputList().push_back(lParamOutput);
... ...
src/ParamOutputImpl/Plot/PlotOutput.cc
... ... @@ -145,8 +145,9 @@ void PlotOutput::apply() {
145 145  
146 146 /**
147 147 * @brief Init new page - Create also the new file if necessary
  148 + *
148 149 */
149   -void PlotOutput::initNewPage(int intervalIndex)
  150 +bool PlotOutput::initNewPage(int intervalIndex, std::string& ttName)
150 151 {
151 152 LOG4CXX_DEBUG(gLogger,"PlotOutput::initNewPage");
152 153 std::stringstream plotFilePrefix;
... ... @@ -163,12 +164,14 @@ void PlotOutput::initNewPage(int intervalIndex)
163 164 if ((_timeIntervalList->size() > 1) &&
164 165 (_outputStructure == OutputStructure::ONE_FILE_PER_INTERVAL) &&
165 166 !_page->_superposeMode)
166   - plotFilePrefix << _filePrefix << "_" << intervalIndex << "_";
  167 + plotFilePrefix << _filePrefix << "_" << ttName << "_" << intervalIndex << "_";
167 168 else
168 169 plotFilePrefix << _filePrefix << "_";
169 170  
170 171 //draw page
171 172 _page->draw(_pls, newFile, plotFilePrefix.str().c_str());
  173 +
  174 + return newFile;
172 175 }
173 176  
174 177 /*
... ... @@ -183,7 +186,7 @@ void PlotOutput::drawOneIntervalByPage()
183 186 getDataFromServer();
184 187  
185 188 //init the page
186   - initNewPage(_currentTimeInterval->_index);
  189 + bool newFile = initNewPage(_currentTimeInterval->_index, _currentTimeInterval->_ttName);
187 190  
188 191 // Compute panel position depending on the page layout
189 192 computePanelBounds();
... ... @@ -246,7 +249,8 @@ void PlotOutput::drawOneIntervalByPage()
246 249 _parameterValues[paramId].reset();
247 250  
248 251 //add file to file list for post processing
249   - _files.push_back(_page->_fileName);
  252 + if (newFile)
  253 + _files.push_back(_page->_fileName);
250 254  
251 255 //go to next interval
252 256 ++_currentTimeInterval;
... ... @@ -274,7 +278,7 @@ void PlotOutput::drawAllIntervalsInOnePage()
274 278 }
275 279  
276 280 //init the page
277   - initNewPage(0);
  281 + initNewPage(0,_timeIntervalList->begin()->_ttName);
278 282  
279 283 //Compute panel position depending on the page layout
280 284 computePanelBounds();
... ...
src/ParamOutputImpl/Plot/PlotOutput.hh
... ... @@ -87,6 +87,13 @@ public:
87 87 _filePrefix = filePrefix;
88 88 }
89 89  
  90 + /**
  91 + * @brief sets the file prefix to use.
  92 + */
  93 + std::string& getFilePrefix()
  94 + {
  95 + return _filePrefix;
  96 + }
90 97 AMDA::Parameters::ParameterManager& getParameterManager(){
91 98 return _parameterManager;
92 99 }
... ... @@ -218,7 +225,7 @@ private:
218 225 /**
219 226 * @brief Init new page - Create also the new file if necessary
220 227 */
221   - void initNewPage(int intervalIndex);
  228 + bool initNewPage(int intervalIndex, std::string& ttName);
222 229  
223 230 /*
224 231 * @brief Sequence to draw one interval by page
... ...
src/ParamOutputImpl/Plot/TickPlot/TickMarkDecorator.cc
... ... @@ -445,6 +445,7 @@ void TickMarkDecorator::installLabelGenerator(PanelPlotOutput* /*pplot_*/, TimeA
445 445 //_decoratorPlot->getDataFromServer();
446 446  
447 447 // build all series names :
  448 + _seriesInfoList.clear();
448 449 for (auto p : _decoratorPlot->_parameterAxesList) {
449 450 const std::string name = p._originalParamId;
450 451 LOG4CXX_DEBUG(_logger, " inspecting parameter : " << name);
... ...
src/PostProcessing/PostProcessingNode.hh
... ... @@ -51,6 +51,9 @@ public:
51 51 // Push post processing able in the context
52 52 lContext.push<PostProcessingAble*>(lOutput);
53 53  
  54 + std::string* filePrefix = pContext.get<std::string*>();
  55 + lContext.push<std::string*>(filePrefix);
  56 +
54 57 // proceed child nodes
55 58 NodeGrpCfg::proceed(pNode, lContext);
56 59 }
... ...
src/PostProcessing/TarNode.cc
... ... @@ -20,7 +20,13 @@ void TarNode::proceed(xmlNodePtr pNode,
20 20  
21 21 // Set value in output param
22 22 std::stringstream outputNodeName;
23   - outputNodeName << pNode->parent->parent->name;
  23 +
  24 + std::string* filePrefix = pContext.get<std::string*>();
  25 +
  26 + if (filePrefix == NULL)
  27 + outputNodeName << pNode->parent->parent->name;
  28 + else
  29 + outputNodeName << (*filePrefix);
24 30 output->addPostProcessing(new TarPostProcessing(outputNodeName.str()));
25 31 }
26 32  
... ...
src/PostProcessing/ZipNode.cc
... ... @@ -20,7 +20,14 @@ void ZipNode::proceed(xmlNodePtr pNode,
20 20  
21 21 // Set value in output param
22 22 std::stringstream outputNodeName;
23   - outputNodeName << pNode->parent->parent->name;
  23 +
  24 + std::string* filePrefix = pContext.get<std::string*>();
  25 +
  26 + if (filePrefix == NULL)
  27 + outputNodeName << pNode->parent->parent->name;
  28 + else
  29 + outputNodeName << (*filePrefix);
  30 +
24 31 output->addPostProcessing(new ZipPostProcessing(outputNodeName.str()));
25 32 }
26 33 }
... ...