From 8e99b602c876594a46b7828859b2bc0233fa4ef4 Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Thu, 27 Aug 2015 09:08:33 +0200 Subject: [PATCH] Function to parse an ISO time accept now a time without mls defined Fix epochPlot to enable the draw without any parameters Add plot context file write in superposed mode --- src/DD_Client_r_Lib/TimeUtil.cc | 13 +++++++++---- src/ParamOutputImpl/Plot/Epoch/EpochPlot.cc | 3 +-- src/ParamOutputImpl/Plot/PlotOutput.cc | 15 +++++++++++++++ 3 files changed, 25 insertions(+), 6 deletions(-) diff --git a/src/DD_Client_r_Lib/TimeUtil.cc b/src/DD_Client_r_Lib/TimeUtil.cc index 66cffb8..344b82b 100644 --- a/src/DD_Client_r_Lib/TimeUtil.cc +++ b/src/DD_Client_r_Lib/TimeUtil.cc @@ -84,10 +84,15 @@ double TimeUtil::readTimeInIso(char *Stime) { ss.width(2); ss >> tabTime[5]; //sec; - ss.width(1); - ss >> c; //. - ss.width(3); - ss >> tabTime[6]; //ms; + if (ss.eof()) + tabTime[6] = 0; + else + { + ss.width(1); + ss >> c; //. + ss.width(3); + ss >> tabTime[6]; //ms; + } UT = UT2double(tabTime); diff --git a/src/ParamOutputImpl/Plot/Epoch/EpochPlot.cc b/src/ParamOutputImpl/Plot/Epoch/EpochPlot.cc index b0db79b..b234cb0 100644 --- a/src/ParamOutputImpl/Plot/Epoch/EpochPlot.cc +++ b/src/ParamOutputImpl/Plot/Epoch/EpochPlot.cc @@ -372,8 +372,7 @@ const std::string EpochPlot::getXAxisId() const { return param.getYSeriePropertiesMap().begin()->second.getXAxisId(); } - //not found, TODO see if we should raise an exception... - return ""; + return "epochAxis"; } void EpochPlot::setCenterTimeId(std::string centerTimeId) diff --git a/src/ParamOutputImpl/Plot/PlotOutput.cc b/src/ParamOutputImpl/Plot/PlotOutput.cc index 5c7d5f4..6e3d432 100644 --- a/src/ParamOutputImpl/Plot/PlotOutput.cc +++ b/src/ParamOutputImpl/Plot/PlotOutput.cc @@ -289,6 +289,15 @@ void PlotOutput::drawAllIntervalsInOnePage() // Compute and set left axis tickmark width depending on the panel constraints computePanelLegendPosition(); + //write page context + if (_writeContextFile) + { + _contextWriter.startElement("page"); + _contextWriter.addAttribute("startTime",std::to_string(_currentTimeInterval->_startTime).c_str()); + _contextWriter.addAttribute("stopTime",std::to_string(_currentTimeInterval->_stopTime).c_str()); + _page->writeContext(_contextWriter); + } + /* * Second step : Draw plot for each intervals */ @@ -308,12 +317,18 @@ void PlotOutput::drawAllIntervalsInOnePage() _currentTimeInterval == _timeIntervalList->begin(), //is second interval? _currentTimeInterval == std::prev(_timeIntervalList->end())); + if (_writeContextFile && (_currentTimeInterval == _timeIntervalList->begin())) + //write plot context + plot->writeContext(_contextWriter); } //go to next interval ++_currentTimeInterval; } + if (_writeContextFile) + _contextWriter.endElement(); /* page */ + /* * Third step : reset plots and data and prepare for post processing */ -- libgit2 0.21.2